From e46204bd09a4a40b67fa0715cecfc5a00e7532c0 Mon Sep 17 00:00:00 2001 From: Lucas Alegre Date: Sat, 7 Sep 2024 12:15:39 +0200 Subject: [PATCH] Fix state type to int32 --- mo_gymnasium/envs/fishwood/fishwood.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mo_gymnasium/envs/fishwood/fishwood.py b/mo_gymnasium/envs/fishwood/fishwood.py index 658908c..7aa1242 100644 --- a/mo_gymnasium/envs/fishwood/fishwood.py +++ b/mo_gymnasium/envs/fishwood/fishwood.py @@ -42,8 +42,8 @@ class FishWood(gym.Env, EzPickle): """ metadata = {"render_modes": ["human"]} - FISH = np.array([0]) - WOOD = np.array([1]) + FISH = np.array([0], dtype=np.int32) + WOOD = np.array([1], dtype=np.int32) MAX_TS = 200 def __init__(self, render_mode: Optional[str] = None, fishproba=0.1, woodproba=0.9): @@ -89,7 +89,7 @@ def step(self, action): rewards[self.FISH] = 1.0 # Execute the action - self._state = np.array([action]) + self._state = np.array([action], dtype=np.int32) self._timestep += 1 if self.render_mode == "human":