소스 검색

Fixed bugs with `Goal` `overlap` method.

Lucas Willems 7 년 전
부모
커밋
92922b13f7
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      gym_minigrid/minigrid.py

+ 2 - 2
gym_minigrid/minigrid.py

@@ -475,7 +475,7 @@ class Grid:
 
         return array
 
-    def decode(self, array):
+    def decode(array):
         """
         Decode an array grid encoding back into a grid
         """
@@ -762,7 +762,7 @@ class MiniGridEnv(gym.Env):
             targetCell = self.grid.get(newPos[0], newPos[1])
             if targetCell == None or targetCell.canOverlap():
                 self.agentPos = newPos
-            elif targetCell.type == 'goal':
+            if targetCell != None and targetCell.type == 'goal':
                 done = True
                 reward = 1000 - self.stepCount