-
Notifications
You must be signed in to change notification settings - Fork 4.4k
encapsulate the agent mapping operations #3481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encapsulate the agent mapping operations #3481
Conversation
| mock_env.return_value.get_step_result.return_value = mock_result | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("mapper_cls", [AgentIdIndexMapper, AgentIdIndexMapperSlow]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's pretty cool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean pytest.mark.parametrize, or passing class types as parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both
| # Make sure it's actually a permutation - needs to contain 0..N-1 with no repeats. | ||
| assert set(permutation) == set(range(0, 4)) | ||
|
|
||
| # For initial agents that were in the initial group, they need to be in the same slot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vincentpierre Is my claim here correct about the new agents? Order shouldn't matter as long as it's consistent, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, although anywhere might be confusing. They must replace previously done agents
* Fixing #3460 * Addressing comments * Added 2 tests * encapsulate the agent mapping operations (#3481) * encapsulate the agent mapping operations * rename, linear time impl * cleanup * dict.popitem * udpate comments * Update gym-unity/gym_unity/tests/test_gym.py Co-authored-by: Chris Elion <celion@gmail.com>
* Fixing #3460 * Addressing comments * Added 2 tests * encapsulate the agent mapping operations (#3481) * encapsulate the agent mapping operations * rename, linear time impl * cleanup * dict.popitem * udpate comments * Update gym-unity/gym_unity/tests/test_gym.py Co-authored-by: Chris Elion <celion@gmail.com>
Trying to clean up and encapsulate these operations. If the initial approach sounds good, I think I can make all the operations O(1).