diff --git a/neuralplayground/arenas/discritized_objects.py b/neuralplayground/arenas/discritized_objects.py index 41986f0..7759aab 100644 --- a/neuralplayground/arenas/discritized_objects.py +++ b/neuralplayground/arenas/discritized_objects.py @@ -97,8 +97,8 @@ def __init__( self.arena_limits = np.array( [[self.arena_x_limits[0], self.arena_x_limits[1]], [self.arena_y_limits[0], self.arena_y_limits[1]]] ) - self.room_width = np.diff(self.arena_x_limits)[0] - self.room_depth = np.diff(self.arena_y_limits)[0] + self.room_width = np.diff(self.arena_x_limits)[0].item() + self.room_depth = np.diff(self.arena_y_limits)[0].item() self.agent_step_size = env_kwargs["agent_step_size"] self._create_default_walls() self._create_custom_walls() diff --git a/neuralplayground/arenas/simple2d.py b/neuralplayground/arenas/simple2d.py index 47c2be2..2e1e9f9 100644 --- a/neuralplayground/arenas/simple2d.py +++ b/neuralplayground/arenas/simple2d.py @@ -107,8 +107,8 @@ def __init__( [self.arena_y_limits[0], self.arena_y_limits[1]], ] ) - self.room_width = np.diff(self.arena_x_limits)[0] - self.room_depth = np.diff(self.arena_y_limits)[0] + self.room_width = np.diff(self.arena_x_limits)[0].item() + self.room_depth = np.diff(self.arena_y_limits)[0].item() self.observation_space = Box( low=np.array([self.arena_x_limits[0], self.arena_y_limits[0]]), high=np.array([self.arena_x_limits[1], self.arena_y_limits[1]]),