Skip to content
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

[RLlib] Add coin game env. Matrix social dilemma env. With tests and examples. #14208

Merged
merged 3 commits into from
Mar 9, 2021

Conversation

Manuscrit
Copy link
Contributor

@Manuscrit Manuscrit commented Feb 19, 2021

@sven1977

Why are these changes needed?

Add coin game env. Matrix social dilemma env. With tests and examples.

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR. => Some stuff are much less readable now ;)
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • [X](only for the new tests in this PR) I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

Thank you for this massive contribution! This looks really great!
Just a few changes required:

  • Could you run the LINTer on your repo (some lines are too long)?
    • $ cd ray
    • $ ci/travis/format.sh
  • Could you move the test cases into a new examples/env/tests dir?
  • Could you rename ipd_env.py into iterated_prisoners_dilemma_env.py?
  • Could you move the reward-uncertainty class in examples/utils/wrappers.py into rllib/env/wrappers/.?
  • Could you rename examples/vectorized_coin_game.py into examples/coin_game.py?
  • Could you rename test_coin_game.py into test_non_vectorized_coin_game.py?

@sven1977 sven1977 changed the title Add coin game env. Matrix social dilemma env. With tests and examples. [RLlib] Add coin game env. Matrix social dilemma env. With tests and examples. Feb 22, 2021
@Manuscrit
Copy link
Contributor Author

About these 2 changes:

  • Could you rename examples/vectorized_coin_game.py into examples/coin_game.py?
  • Could you rename test_coin_game.py into test_non_vectorized_coin_game.py?

Currently the existing files are:

  • coin_game_env.py
  • vectorized_coin_game_env.py
  • test_coin_game_env.py
  • test_vectorized_coin_game_env.py

The two changes mentioned should produce the following:

  • coin_game_env.py
  • coin_game_env.py
  • test_non_vectorized_coin_game_env.py
  • test_vectorized_coin_game_env.py

Is that what you had in mind? Then do you mean to merge vectorized_coin_game_env.py and coin_game_env.py in a single file?
Like that:

  • coin_game_env.py
  • test_non_vectorized_coin_game_env.py
  • test_vectorized_coin_game_env.py

If not, then the following seems like a better refactoring to me:

  • coin_game_non_vectorized_env.py
  • coin_game_vectorized_env.py
  • test_coin_game_non_vectorized_env.py
  • test_coin_game_vectorized_env.py

What do you think?

@sven1977
Copy link
Contributor

sven1977 commented Mar 1, 2021

Sounds great, let's rename these according to your suggestion.
Thanks!

@Manuscrit
Copy link
Contributor Author

I committed the changes @sven1977

Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

Thanks @Manuscrit for this great contribution!
One more thing before we can merge: Could you check the LINT output again? There seems to be 3 list comprehensions that need to be fixed.

@sven1977
Copy link
Contributor

sven1977 commented Mar 9, 2021

@Manuscrit no worries, I already fixed the LINT. Just waiting for all tests to pass now. ...

@sven1977 sven1977 merged commit 9a7fbd3 into ray-project:master Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants