popgym.core.wrapper

Module Contents

Classes

POPGymWrapper

Wraps a gymnasium.Env to allow a modular transformation of the step() and reset() methods.

class popgym.core.wrapper.POPGymWrapper(env: popgym.core.env.POPGymEnv)

Bases: gymnasium.Wrapper, popgym.core.env.POPGymEnv

Wraps a gymnasium.Env to allow a modular transformation of the step() and reset() methods.

This class is the base class of all wrappers to change the behavior of the underlying environment. Wrappers that inherit from this class can modify the action_space, observation_space, reward_range and metadata attributes, without changing the underlying environment’s attributes. Moreover, the behavior of the step() and reset() methods can be changed by these wrappers.

Some attributes (spec, render_mode, np_random) will point back to the wrapper’s environment (i.e. to the corresponding attributes of env).

Note:

If you inherit from Wrapper, don’t forget to call super().__init__(env)

property state_space: gymnasium.spaces.Space

Returns the observation space of the environment.

get_state() gymnasium.core.ObsType

Returns the underlying hidden Markov state