Skip to content

lit_sb3.wrappers.delayed_reward

source module lit_sb3.wrappers.delayed_reward

Classes

source class DelayedRewardWrapper(env: gym.Env, delay: int = 10)

Bases : gym.Wrapper

Delay the reward by delay steps (accumulated until released).

Makes the task harder but more realistic.

:param env: Gym environment. :param delay: Number of steps to delay the reward.

Attributes

  • metadata : dict[str, Any] — attr:Env :attr:metadata.

  • render_mode : str | None — attr:Env :attr:render_mode.

  • spec : EnvSpec | None — attr:Env :attr:spec attribute with the WrapperSpec if the wrapper inherits from EzPickle.

  • action_space : spaces.Space[ActType] | spaces.Space[WrapperActType] — attr:Env :attr:action_space unless overwritten then the wrapper :attr:action_space is used.

  • observation_space : spaces.Space[ObsType] | spaces.Space[WrapperObsType] — attr:Env :attr:observation_space unless overwritten then the wrapper :attr:observation_space is used.

  • unwrapped : Env[ObsType, ActType] — Returns the base environment of the wrapper.

  • np_random_seed : int | None — attr:np_random_seed.

  • np_random : np.random.Generator — attr:Env :attr:np_random attribute.

Methods

source method DelayedRewardWrapper.reset(seed: int | None = None, options: dict | None = None) → GymResetReturn

source method DelayedRewardWrapper.step(action: Any) → GymStepReturn