Bläddra i källkod

add env.close method (#100)

as mentioned here: https://github.com/openai/gym/issues/1056#issuecomment-471136134 

close=True was removed a while ago, so this change just adds an 'env.close' method exactly the same as the way you were doing it, without removing the old way, so it's hopefully backwards compatible (let's test it!)
bion howard 4 år sedan
förälder
incheckning
d3b1ea8df4
1 ändrade filer med 5 tillägg och 0 borttagningar
  1. 5 0
      gym_minigrid/minigrid.py

+ 5 - 0
gym_minigrid/minigrid.py

@@ -1293,3 +1293,8 @@ class MiniGridEnv(gym.Env):
             self.window.set_caption(self.mission)
 
         return img
+
+    def close(self):
+        if self.window:
+            self.window.close()
+        return