浏览代码

Renamed wait action to done

Maxime Chevalier-Boisvert 7 年之前
父节点
当前提交
636226f90e
共有 5 个文件被更改,包括 10 次插入10 次删除
  1. 1 1
      README.md
  2. 2 2
      gym_minigrid/envs/gotodoor.py
  3. 2 2
      gym_minigrid/envs/gotoobject.py
  4. 4 4
      gym_minigrid/minigrid.py
  5. 1 1
      standalone.py

+ 1 - 1
README.md

@@ -113,7 +113,7 @@ Actions in the basic environment:
 - Pick up an object
 - Drop the object being carried
 - Toggle (interact with objects)
-- Wait (noop, do nothing)
+- Done (task completed, optional)
 
 By default, sparse rewards are given for reaching a green goal tile. A
 reward of 1 is given for success, and zero for failure. There is also an

+ 2 - 2
gym_minigrid/envs/gotodoor.py

@@ -72,8 +72,8 @@ class GoToDoorEnv(MiniGridEnv):
         if action == self.actions.toggle:
             done = True
 
-        # Reward waiting in front of the target door
-        if action == self.actions.wait:
+        # Reward performing done action in front of the target door
+        if action == self.actions.done:
             if (ax == tx and abs(ay - ty) == 1) or (ay == ty and abs(ax - tx) == 1):
                 reward = 1
             done = True

+ 2 - 2
gym_minigrid/envs/gotoobject.py

@@ -75,8 +75,8 @@ class GoToObjectEnv(MiniGridEnv):
         if action == self.actions.toggle:
             done = True
 
-        # Reward performing the wait action next to the target object
-        if action == self.actions.wait:
+        # Reward performing the done action next to the target object
+        if action == self.actions.done:
             if abs(ax - tx) <= 1 and abs(ay - ty) <= 1:
                 reward = 1
             done = True

+ 4 - 4
gym_minigrid/minigrid.py

@@ -606,8 +606,8 @@ class MiniGridEnv(gym.Env):
         # Toggle/activate an object
         toggle = 5
 
-        # Wait/stay put/do nothing
-        wait = 6
+        # Done completing task
+        done = 6
 
     def __init__(
         self,
@@ -1034,8 +1034,8 @@ class MiniGridEnv(gym.Env):
             if fwd_cell:
                 fwd_cell.toggle(self, fwd_pos)
 
-        # Wait/do nothing
-        elif action == self.actions.wait:
+        # Done action (not used by default)
+        elif action == self.actions.done:
             pass
 
         else:

+ 1 - 1
standalone.py

@@ -59,7 +59,7 @@ def main():
             action = env.actions.drop
 
         elif keyName == 'CTRL':
-            action = env.actions.wait
+            action = env.actions.done
 
         else:
             print("unknown key %s" % keyName)