stable_learning_control.utils.gym_utils

Contains utilities that can be used with the gymnasium package.

Attributes

DISCRETE_SPACES

CONTINUOUS_SPACES

Functions

is_gym_env(env)

Checks whether object is a gymnasium environment.

is_continuous_space(space)

Checks whether a given space is continuous.

is_discrete_space(space)

Checks whether a given space is discrete.

validate_gym_env(arg_dict)

Make sure that env_name is a real, registered gymnasium environment.

Module Contents

stable_learning_control.utils.gym_utils.DISCRETE_SPACES[source]
stable_learning_control.utils.gym_utils.CONTINUOUS_SPACES[source]
stable_learning_control.utils.gym_utils.is_gym_env(env)[source]

Checks whether object is a gymnasium environment.

Parameters:

env (object) – A python object.

Returns:

Boolean specifying whether object is gymnasium environment.

Return type:

bool

stable_learning_control.utils.gym_utils.is_continuous_space(space)[source]

Checks whether a given space is continuous.

Parameters:

space (gym.spaces) – The gymnasium space object.

Returns:

Boolean specifying whether the space is discrete.

Return type:

bool

stable_learning_control.utils.gym_utils.is_discrete_space(space)[source]

Checks whether a given space is discrete.

Parameters:

space (gym.spaces) – The gymnasium space object.

Returns:

Boolean specifying whether the space is discrete.

Return type:

bool

stable_learning_control.utils.gym_utils.validate_gym_env(arg_dict)[source]

Make sure that env_name is a real, registered gymnasium environment.

Parameters:

cmd (dict) – The cmd dictionary.

Raises:

AssertError – Raised when a environment is supplied that is not a valid gymnasium environment.