Skip to content

Conversation

@chriselion
Copy link
Contributor

Trying to clean up and encapsulate these operations. If the initial approach sounds good, I think I can make all the operations O(1).

mock_env.return_value.get_step_result.return_value = mock_result


@pytest.mark.parametrize("mapper_cls", [AgentIdIndexMapper, AgentIdIndexMapperSlow])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty cool.

Copy link
Contributor Author

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?

Copy link
Contributor

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.
Copy link
Contributor Author

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?

Copy link
Contributor

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

@vincentpierre vincentpierre merged commit 4885920 into develop-fix-gym-last-reward Feb 24, 2020
@delete-merged-branch delete-merged-branch bot deleted the develop-fix-gym-last-reward-cleanup branch February 24, 2020 20:07
vincentpierre added a commit that referenced this pull request Feb 24, 2020
* 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>
anupam-142857 pushed a commit that referenced this pull request Feb 26, 2020
* 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>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants