Beispiel #1
0
 public override void AgentReset()
 {
     if (currentBandit)
     {
         currentBandit.ResetMaterial();
     }
     currentBandit = null;
     nextBandit    = connectedAcademy.GetNewBandit();
     nextBandit.SetMaterial(agentMaterial);
 }
Beispiel #2
0
    public override void AgentAction(float[] vectorAction, string textAction)
    {
        Thread.Sleep(500);
        int action = (int)vectorAction[0];

        if (currentBandit)
        {
            nextBandit = currentBandit.ChoosePath(action);
            nextBandit.SetMaterial(agentMaterial);
            currentBandit.ResetMaterial();
            AddReward(currentBandit.reward);
            if (currentBandit.reward == 1.0f)
            {
                Done();
            }
        }
    }