gxm.wrappers.IgnoreTruncation#

class IgnoreTruncation(wrapped)#

Bases: EnvironmentWrapper[Any]

A wrapper that treats truncation as termination.

Truncation is folded into the terminated flag and true_next_obs is set equal to next_obs, so downstream code sees a plain termination with no distinction between the two episode-ending conditions.

__init__(wrapped)#

Methods

__init__(wrapped)

get_wrapper(wrapper_type)

Retrieve the first wrapper of a specific type from the dynamics.

has_wrapper(wrapper_type)

Check if the dynamics or any of its wrappers is of a specific type.

init(key)

Initialize the dynamics and return the initial state.

reset(key, state)

Reset the dynamics to an initial state.

step(key, state, action)

Advance the dynamics by one step given an action.

Attributes

unwrap

unwrapped

Retrieve the base dynamics by unwrapping all wrappers.

wrapped

id

The unique identifier of the dynamics.

action_space

The action space of the dynamics.

observation_space

The observation space of the dynamics.

init(key)#

Initialize the dynamics and return the initial state.

Parameters:

key (Array) – A JAX random key for any stochastic initialization.

Return type:

tuple[DynamicsState, Timestep]

Returns:

A tuple of the initial state and the initial step output.

reset(key, state)#

Reset the dynamics to an initial state.

Parameters:
  • key (Array) – A JAX random key for any stochasticity.

  • state (DynamicsState) – The current state.

Return type:

tuple[DynamicsState, Timestep]

Returns:

A tuple of the reset state and the initial step output.

step(key, state, action)#

Advance the dynamics by one step given an action.

Parameters:
  • key (Array) – A JAX random key for any stochasticity.

  • state (DynamicsState) – The current state.

  • action (Any) – The action to apply.

Return type:

tuple[DynamicsState, Timestep]

Returns:

A tuple of the new state and the resulting step output.