Skip to content

Commit

Permalink
Env creation tutorial 3: Change action mask type to int8 (#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandDecoster authored Jul 24, 2023
1 parent 8e16523 commit e9127d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tutorials/EnvironmentCreation/tutorial3_action_masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def step(self, actions):
self.guard_y += 1

# Generate action masks
prisoner_action_mask = np.ones(4)
prisoner_action_mask = np.ones(4, dtype=np.int8)
if self.prisoner_x == 0:
prisoner_action_mask[0] = 0 # Block left movement
elif self.prisoner_x == 6:
Expand All @@ -81,7 +81,7 @@ def step(self, actions):
elif self.prisoner_y == 6:
prisoner_action_mask[3] = 0 # Block up movement

guard_action_mask = np.ones(4)
guard_action_mask = np.ones(4, dtype=np.int8)
if self.guard_x == 0:
guard_action_mask[0] = 0
elif self.guard_x == 6:
Expand Down

0 comments on commit e9127d3

Please sign in to comment.