lit_sb3.wrappers.truncated_on_success
source module lit_sb3.wrappers.truncated_on_success
Classes
-
TruncatedOnSuccessWrapper — Reset on success and offset the reward.
source class TruncatedOnSuccessWrapper(env: gym.Env, reward_offset: float = 0.0, n_successes: int = 1)
Bases : gym.Wrapper
Reset on success and offset the reward.
Useful for GoalEnv environments where success should end the episode.
:param env: Gym environment. :param reward_offset: Reward added on top of the env reward at each step. :param n_successes: Number of consecutive successes required to truncate.
Attributes
-
metadata : dict[str, Any] — attr:
Env:attr:metadata. -
render_mode : str | None — attr:
Env:attr:render_mode. -
spec : EnvSpec | None — attr:
Env:attr:specattribute with theWrapperSpecif the wrapper inherits fromEzPickle. -
action_space : spaces.Space[ActType] | spaces.Space[WrapperActType] — attr:
Env:attr:action_spaceunless overwritten then the wrapper :attr:action_spaceis used. -
observation_space : spaces.Space[ObsType] | spaces.Space[WrapperObsType] — attr:
Env:attr:observation_spaceunless overwritten then the wrapper :attr:observation_spaceis 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_randomattribute.
Methods
source method TruncatedOnSuccessWrapper.reset(seed: int | None = None, options: dict | None = None) → GymResetReturn
source method TruncatedOnSuccessWrapper.step(action: Any) → GymStepReturn
source method TruncatedOnSuccessWrapper.compute_reward(achieved_goal: Any, desired_goal: Any, info: dict[str, Any]) → SupportsFloat