Skip to content

PopActionWrapper

Full path: schola.gym.utils.PopActionWrapper

A wrapper that pops the action from the environment’s action space. This is useful for environments where the action space is a dictionary and we want to use only one of the actions.

PopActionWrapper(env)

Parameters

  • env (gymnasium.Env) - Wrapped environment whose action_space is a gymnasium.spaces.Dict. The first key in spaces becomes the sole exposed action space and is injected back as a dict on step.

Methods

init

__init__(env)

Parameters

  • env (Env)

step

step(action)

Step the wrapped environment, wrapping action under the selected dict key.

Parameters

  • action - Action for the popped (single) branch of the original dict action space.