Testing the learning environment
Before we start learning, we want to test the environment by controlling the Agents with manual input. It is very useful to debug the learning environment without wasting hours of the training process.
Fortunately, the ML-Agents Toolkit makes it very handy to control an agent with live input. We only need two steps:
- We add the
Heuristicmethod to theSphereAgentcomponent. This function allows us to manually specify the values of theActionBufferobjects. In our case, we want to add the two continuous actions to the input axes of the controller:Â Â Â Â public override void Heuristic( Â Â Â Â Â Â in ActionBuffers actionsOut) { Â Â Â Â Â Â Â Â var continuousActionsOut = Â Â Â Â Â Â Â Â Â Â actionsOut.ContinuousActions; Â Â Â Â Â Â Â Â continuousActionsOut[0] = Â Â Â Â Â Â ...