浏览代码

Updated child classes constructors

zeio 2 年之前
父节点
当前提交
68c9108091
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      gym_minigrid/envs/doorkey.py

+ 6 - 6
gym_minigrid/envs/doorkey.py

@@ -44,16 +44,16 @@ class DoorKeyEnv(MiniGridEnv):
         self.mission = "use the key to open the door and then get to the goal"
         self.mission = "use the key to open the door and then get to the goal"
 
 
 class DoorKeyEnv5x5(DoorKeyEnv):
 class DoorKeyEnv5x5(DoorKeyEnv):
-    def __init__(self):
-        super().__init__(size=5)
+    def __init__(self, max_steps=None):
+        super().__init__(size=5, max_steps=max_steps)
 
 
 class DoorKeyEnv6x6(DoorKeyEnv):
 class DoorKeyEnv6x6(DoorKeyEnv):
-    def __init__(self):
-        super().__init__(size=6)
+    def __init__(self, max_steps=None):
+        super().__init__(size=6, max_steps=max_steps)
 
 
 class DoorKeyEnv16x16(DoorKeyEnv):
 class DoorKeyEnv16x16(DoorKeyEnv):
-    def __init__(self):
-        super().__init__(size=16)
+    def __init__(self, max_steps=None):
+        super().__init__(size=16, max_steps=max_steps)
 
 
 register(
 register(
     id='MiniGrid-DoorKey-5x5-v0',
     id='MiniGrid-DoorKey-5x5-v0',