From 3b45bb7b4727512b1003cf7f8183752e4484245a Mon Sep 17 00:00:00 2001 From: Mario Jerez Date: Sat, 9 Nov 2024 22:53:53 -0600 Subject: [PATCH] Changed the data type of grid so that strings could be added to the numpy array without throwing an error. Increased the dimensions of grid since pieces could be moved one step beyond its previous boundaries. --- tutorials/CustomEnvironment/tutorial3_action_masking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/CustomEnvironment/tutorial3_action_masking.py b/tutorials/CustomEnvironment/tutorial3_action_masking.py index 24676373f..c0dfe2170 100644 --- a/tutorials/CustomEnvironment/tutorial3_action_masking.py +++ b/tutorials/CustomEnvironment/tutorial3_action_masking.py @@ -193,7 +193,7 @@ def step(self, actions): def render(self): """Renders the environment.""" - grid = np.zeros((7, 7)) + grid = np.zeros((8, 8), dtype=object) grid[self.prisoner_y, self.prisoner_x] = "P" grid[self.guard_y, self.guard_x] = "G" grid[self.escape_y, self.escape_x] = "E"