示例#1
0
    /// <summary>
    /// Collect the rigidbodies of the reacher in order to resue them for
    /// observations and actions.
    /// </summary>
    public override void InitializeAgent()
    {
        m_RbA       = pendulumA.GetComponent <Rigidbody>();
        m_RbB       = pendulumB.GetComponent <Rigidbody>();
        m_MyAcademy = GameObject.Find("Academy").GetComponent <ReacherAcademy>();

        SetResetParameters();
    }
    public override void AgentReset()
    {
        pendulumA.transform.position = new Vector3(0f, -4f, 0f) + transform.position;
        pendulumA.transform.rotation = Quaternion.Euler(180f, 0f, 0f);
        rbA.velocity        = new Vector3(0f, 0f, 0f);
        rbA.angularVelocity = new Vector3(0f, 0f, 0f);

        pendulumB.transform.position = new Vector3(0f, -10f, 0f) + transform.position;
        pendulumB.transform.rotation = Quaternion.Euler(180f, 0f, 0f);
        rbB.velocity        = new Vector3(0f, 0f, 0f);
        rbB.angularVelocity = new Vector3(0f, 0f, 0f);


        goalDegree = Random.Range(0, 360);
        UpdateGoalPosition();

        ReacherAcademy academy  = GameObject.Find("Academy").GetComponent <ReacherAcademy>();
        float          goalSize = academy.goalSize;

        goalSpeed = academy.goalSpeed;

        goal.transform.localScale = new Vector3(goalSize, goalSize, goalSize);
    }
示例#3
0
 /// <summary>
 /// Collect the rigidbodies of the reacher in order to resue them for
 /// observations and actions.
 /// </summary>
 public override void InitializeAgent()
 {
     rbA       = pendulumA.GetComponent <Rigidbody>();
     rbB       = pendulumB.GetComponent <Rigidbody>();
     myAcademy = GameObject.Find("Academy").GetComponent <ReacherAcademy>();
 }