Skip to content
Snippets Groups Projects
Commit 55563c43 authored by Vicki Pfau's avatar Vicki Pfau
Browse files

retro: Raise exception if env.step is called before env.reset

parent f4c26a12
No related branches found
No related tags found
No related merge requests found
...@@ -143,6 +143,9 @@ class RetroEnv(gym.Env): ...@@ -143,6 +143,9 @@ class RetroEnv(gym.Env):
self._close = self.close self._close = self.close
def step(self, a): def step(self, a):
if self.img is None:
raise RuntimeError('Please call env.reset() before env.step()')
action = 0 action = 0
if self.use_restricted_actions == retro.ACTIONS_DISCRETE: if self.use_restricted_actions == retro.ACTIONS_DISCRETE:
for combo in self.BUTTON_COMBOS: for combo in self.BUTTON_COMBOS:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment