Created
January 23, 2021 22:05
-
-
Save davidADSP/f6baaf61025a9d93ae455b5e073531fa to your computer and use it in GitHub Desktop.
the continue_game method of the SelfPlayEnv class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SelfPlayEnv(env): | |
# ... | |
def continue_game(self): | |
while self.current_player_num != self.agent_player_num: | |
self.render() | |
action = self.current_agent.choose_action(self, choose_best_action = False, mask_invalid_actions = False) | |
observation, reward, done, _ = super(SelfPlayEnv, self).step(action) | |
logger.debug(f'Rewards: {reward}') | |
logger.debug(f'Done: {done}') | |
if done: | |
break | |
return observation, reward, done, None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment