-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
MO Connect 4, Breakthrough and Samegame #21
Conversation
rradules
commented
Dec 7, 2023
- MO Connect 4, Breakthrough and Samegame environments
- Also adds the "is_parallelizable" key to the metadata dict of the environments, when missing, to allow selective testing of the parallel environments
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.
Did a very quick check because I don't have much connection :-)
@override | ||
def reset(self, seed=None, options=None): | ||
if seed is not None: | ||
np.random.seed(seed) |
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.
I think the PZ convention is to store self.seed
and self.np_random
from that call now. And use the self.np_random
for rng stuff
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.
np.random generators seem to not actually have all their state defined by the seed alone, which is why I store/restore their entire state in samegame.py. What do you think about that solution?
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.
So the only stochastic environment is samegame, 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.
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.
Looks good! I just had some small questions or suggestions, but I think this is ready to be included into main.
I also very much liked the introduction of the check_[ENV].py
files and think it might be useful to add one of those for every supported environment. The benefit is that you can just run the file to see if the output of the game still makes a little bit of sense. We could even put such sanity checks into an automated test for every environment. What do others think? @rradules @ffelten
@@ -0,0 +1,49 @@ | |||
"""MO Connect4 check.""" |
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.
I actually very much like these "check" files you have implemented. I think it would be good to have one of these sanity checks for each environment, maybe in a dedicated test runner? This should be discussed also with @rradules
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.
I agree. CrazyRL environments have these as well in the main environment files 👍
I'm not sure what's the addition here exactly but we can if needed define a |
@ffelten Having thought about it a little bit more, I realised that having such a check env file is only useful during development, and after that has concluded its role is taken over by the |
Connect 4 Visualization for Dynamic Board Sizes