Environment Reset for Multi-Agent Set Up

We have a multi-environment set-up with policy sharing.

We are looking for a way to end the episode and reset the environment from any agent. In the Awake() function of the environment, we achieve this by calling Academy.Instance.OnEnvironmentReset += EnvironmentReset;

During training, once a termination criterion is met (ex. maxStep), the listener OnEnvironmentReset is not called anymore. Also Academy.Instance.Done() does not exist anymore.

We would like to start a new episode and reset the environment in the same way as done in Awake().

Hello,

The typical way to handle multi-agent settings is to have a script keeping track of the state of the episode a group of agents are involved in, and then having that script reset all agents individually by calling EndEpisode() on them. See here for an example: https://github.com/Unity-Technologies/ml-agents/blob/master/Project/Assets/ML-Agents/Examples/Soccer/Scripts/SoccerFieldArea.cs

Thank you, that solved the problem.