Skip to content

Commit

Permalink
add env.close method
Browse files Browse the repository at this point in the history
this helps clean up the render windows as mentioned here openai/gym#1056 (comment)
  • Loading branch information
bionicles committed Jun 29, 2020
1 parent 453787a commit d45fc93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions slimevolleygym/slimevolley.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,10 @@ def render(self, mode='human', close=False):
self.game.display(self.viewer)
return self.viewer.render(return_rgb_array = mode=='rgb_array')

def close(self):
if self.viewer():
self.viewer.close()

def get_action_meanings(self):
return [self.atari_action_meaning[i] for i in self.atari_action_set]

Expand Down

0 comments on commit d45fc93

Please sign in to comment.