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

Can Agent.OnEnable() and Academy.FixedUpdate() be made virtual?

Open kumarict opened this issue 7 years ago • 3 comments

I'm currently changing Agent.OnEnable() and Academy.FixedUpdate() to protected virtual functions. For Agent.OnEnable(), it's just to check if a variable is null and if not, to add it from the parent.

For Academy.FixedUpdate(), I have had good results by only calling base.FixedUpdate() (which calls EnvironmentStep()) when the parallel environments in my scene are all done with their respective steps.

So, if I'm doing this a wrong/bass-ackward way, please let me know the best practice. If this is acceptable, please consider making Agent.OnEnable() and Academy.FixedUpdate() protected virtual functions.

Thank you.

kumarict avatar Nov 26 '19 00:11 kumarict

Your approach sounds reasonable to me. We've documented your suggestion and will prioritize when appropriate.

dylansc avatar Nov 26 '19 17:11 dylansc

Sorry that this has sat open for so long. Agent.OnEnable() and OnDisable() has been virtual since https://github.com/Unity-Technologies/ml-agents/pull/3590.

Academy was changed to a singleton, so it no longer has a specific FixedUpdate method and can't be inherited from.

chriselion avatar Jan 09 '21 01:01 chriselion

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 Feb 08 '21 04:02 github-actions[bot]