예제 #1
0
    public override void AgentAction(float[] vectorAction)
    {
        //Debug.Log(vectorAction[0]);
        if ((int)vectorAction[0] == 0)
        {
            //do nothing
        }
        else
        {
            qB_Controller.ChooseReceiver((int)vectorAction[0]);
        }

        if (gameManager.ballCaught || gameManager.qbSacked || gameManager.ballIntercepted)
        {
            if (gameManager.ballCaught)
            {
                SetReward(1.0f);
            }
            if (gameManager.qbSacked)
            {
                SetReward(-1.0f);
            }
            if (gameManager.ballIntercepted)
            {
                SetReward(-1.0f);
            }

            Done();
        }
    }
예제 #2
0
    public override void AgentAction(float[] vectorAction)
    {
        //Debug.Log("Agent Action" + vectorAction[0]);
        if ((int)vectorAction[0] == 0)
        {
            //do nothing
        }
        else
        {
            qB_Controller.ChooseReceiver((int)vectorAction[0]);
        }


        //check if the episode reset code can be moved to the update func

        /*if(episodeDone == false)
         * {
         *  if (gameManager.ballCaught || gameManager.qbSacked || gameManager.ballIntercepted)
         *  {
         *      if (gameManager.ballCaught)
         *      {
         *          //calculate reward
         *          SetReward(CalculateReward());
         *      }
         *      if (gameManager.qbSacked)
         *      {
         *          SetReward(-1.0f);
         *      }
         *      if (gameManager.ballIntercepted)
         *      {
         *          SetReward(-1.0f);
         *      }
         *      Done();
         *      episodeDone = true;
         *  }
         *
         *  //learning reset bug
         *  if(targetTime <= 0.0f)
         *  {
         *      Debug.LogError("Learning reset Error occured");
         *      Done();
         *      episodeDone = true;
         *  }
         * }*/
    }