popgym.wrappers.discrete_action

Attributes

PREV_ACTION

Classes

DiscreteAction

Wrapper that converts a MultiDiscrete into a single Discrete action.

Module Contents

popgym.wrappers.discrete_action.PREV_ACTION = 'prev_action'
class popgym.wrappers.discrete_action.DiscreteAction(env: popgym.core.env.POPGymEnv)

Bases: popgym.core.wrapper.POPGymWrapper

Wrapper that converts a MultiDiscrete into a single Discrete action.

Args:

env: The environment

Returns:

A gym environment

action_space: gymnasium.spaces.Space

Return the Env action_space unless overwritten then the wrapper action_space is used.

step(action: gymnasium.core.ActType) Tuple[gymnasium.core.ObsType, float, bool, bool, dict]

Uses the step() of the env that can be overwritten to change the returned data.