فهرست منبع

In response to #96

Maxime Chevalier-Boisvert 4 سال پیش
والد
کامیت
b84d99a2fb
2فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 3 1
      gym_minigrid/minigrid.py
  2. 3 0
      gym_minigrid/wrappers.py

+ 3 - 1
gym_minigrid/minigrid.py

@@ -174,7 +174,7 @@ class Floor(WorldObj):
 
     def render(self, img):
         # Give the floor a pale color
-        color = COLORS[self.color] / 2        
+        color = COLORS[self.color] / 2
         fill_coords(img, point_in_rect(0.031, 1, 0.031, 1), color)
 
 
@@ -665,6 +665,8 @@ class MiniGridEnv(gym.Env):
         self.action_space = spaces.Discrete(len(self.actions))
 
         # Number of cells (width and height) in the agent view
+        assert agent_view_size % 2 == 1
+        assert agent_view_size >= 3
         self.agent_view_size = agent_view_size
 
         # Observations are dictionaries containing an

+ 3 - 0
gym_minigrid/wrappers.py

@@ -307,6 +307,9 @@ class ViewSizeWrapper(gym.core.Wrapper):
     def __init__(self, env, agent_view_size=7):
         super().__init__(env)
 
+        assert agent_view_size % 2 == 1
+        assert agent_view_size >= 3
+
         # Override default view size
         env.unwrapped.agent_view_size = agent_view_size