Now we need to implement the code that will describe the agent's behavior and the ML-Agent's Academy. The agent's behavior script describes the way the agents performs actions in the simulation, the reward it receives, and the way we reset it to start a new simulation:
- Click on the Academy and add to it a new script called SphereAcademy with the following code:
using MLAgents;public class SphereAcademy : Academy { }
This will create a default training academy for our agent.
- Select the Brain object and add the Brain script to it.
- Select the Sphere. Let's add to it a new script, called SphereAgent, with the following contents:
using System.Collections.Generic; using UnityEngine; using MLAgents; public class SphereAgent ...