Skip to content

Instantly share code, notes, and snippets.

@davidADSP
Created January 23, 2021 22:05
Show Gist options
  • Save davidADSP/f6baaf61025a9d93ae455b5e073531fa to your computer and use it in GitHub Desktop.
Save davidADSP/f6baaf61025a9d93ae455b5e073531fa to your computer and use it in GitHub Desktop.
the continue_game method of the SelfPlayEnv class
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