From bb8fe678575b14289dd3b2e5ea25abd5abf0e334 Mon Sep 17 00:00:00 2001 From: Kautenja Date: Mon, 20 Aug 2018 22:57:00 -0500 Subject: [PATCH] update _did_step() with done parameter --- nes_py/nes_env.py | 18 +++++++++++++++--- setup.py | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/nes_py/nes_env.py b/nes_py/nes_env.py index 189117e..3421641 100644 --- a/nes_py/nes_env.py +++ b/nes_py/nes_env.py @@ -279,8 +279,11 @@ def step(self, action): done = done or self._get_done() # get the info for this step info = self._get_info() + # if done terminate the collection early + if done: + break # call the after step callback - self._did_step() + self._did_step(done) # copy the screen from the emulator self._copy_screen() # increment the steps counter @@ -308,8 +311,17 @@ def _get_info(self): """Return the info after a step occurs.""" return {} - def _did_step(self): - """Handle any RAM hacking after a step occurs.""" + def _did_step(self, done): + """ + Handle any RAM hacking after a step occurs. + + Args: + done: whether the done flag is set to true + + Returns: + None + + """ pass def close(self): diff --git a/setup.py b/setup.py index 4ee98d7..9d292c4 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def README(): setup( name='nes_py', - version='0.11.1', + version='1.0.0', description='An NES Emulator and OpenAI Gym interface', long_description=README(), long_description_content_type='text/markdown',