ml-agents icon indicating copy to clipboard operation
ml-agents copied to clipboard

Replacement of PlayerBrain for imitation and testing

Open AdhamAlHarazi opened this issue 7 years ago • 5 comments

  • Prior to 0.11, I enjoyed the capability of the "player brain" to test the implementation (by mapping keys to action) and also to record demonstrations for imitation. Now there is no player brain anymore only the "Behavior Parameters" component, which acts as a learning brain. Therefore, my question is: what is the replacement of the player brain for imitation and testing purposes?

  • Also, the decision class, with its decide function, is removed, and I was using it for heuristics so I can record demonstrations. So, what is the replacement for that also?

AdhamAlHarazi avatar Nov 26 '19 08:11 AdhamAlHarazi

Regarding your first question, to control the agent yourself, just set the Model field under behavior parameters to none.

dylansc avatar Nov 26 '19 17:11 dylansc

@dylansc Thank you for your reply. The model field is already set to None. However, I cannot control the agent. it gives the following error:-

UnityAgentsException: The Heuristic method was not implemented for the Agent

Also, where to map actions to keys?

AdhamAlHarazi avatar Nov 26 '19 17:11 AdhamAlHarazi

Have you defined the Heuristic() method in your agent class? Ctrl-f heuristic() in this doc for more details.

And here's the Unity input manager documentation that should help with mapping actions to keys

dylansc avatar Nov 26 '19 17:11 dylansc

@dylansc Thank you. I have defined the Heuristic() method and mapped keys to actions, and everything is working as expected. Also, this method answers my second question as well. Thank you again.

Unity should add such changes in the migrating guide.

AdhamAlHarazi avatar Nov 26 '19 18:11 AdhamAlHarazi

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Jan 28 '21 17:01 github-actions[bot]