diff --git a/src/bbrl/agents/gymnasium.py b/src/bbrl/agents/gymnasium.py index 6fdf77e..d5d4614 100644 --- a/src/bbrl/agents/gymnasium.py +++ b/src/bbrl/agents/gymnasium.py @@ -200,6 +200,18 @@ def get_obs_and_actions_sizes(self): state_dim = 1 # self.observation_space.n return state_dim, action_dim + def is_continuous_action(self): + return isinstance(self.action_space, gym.spaces.Box) + + def is_discrete_action(self): + return isinstance(self.action_space, gym.spaces.Discrete) + + def is_continuous_state(self): + return isinstance(self.observation_space, gym.spaces.Box) + + def is_discrete_state(self): + return isinstance(self.observation_space, gym.spaces.Discrete) + class ParallelGymAgent(GymAgent): """Create an Agent from a gymnasium environment