Skip to content

Commit

Permalink
In response to Farama-Foundation#96
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb committed Jun 2, 2020
1 parent 1a29011 commit b84d99a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gym_minigrid/minigrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def can_overlap(self):

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)


Expand Down Expand Up @@ -665,6 +665,8 @@ def __init__(
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
Expand Down
3 changes: 3 additions & 0 deletions gym_minigrid/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b84d99a

Please sign in to comment.