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
Heuristic
method to theSphereAgent
component. This function allows us to manually specify the values of theActionBuffer
objects. 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] = ...