TimeLimitWrapper

class maze.core.wrappers.time_limit_wrapper.TimeLimitWrapper(*args, **kwds)

Wrapper to limit the environment step count, equivalent to gym.wrappers.time_limit.

Additionally to the gym wrapper, this one supports adjusting the limit after construction.

close()None

forward call to the inner env

get_observation_and_action_dicts(maze_state: Optional[Any], maze_action: Optional[Any], first_step_in_episode: bool) → Tuple[Optional[Dict[Union[int, str], Any]], Optional[Dict[Union[int, str], Any]]]

This wrapper does not modify observations and actions.

reset() → Any

Override BaseEnv.reset to reset the step count.

seed(seed: int)None

forward call to the inner env

set_max_episode_steps(max_episode_steps: int)None

Set the step limit.

Parameters

max_episode_steps – The environment step() function sets the done flag if this step limit is reached. If 0, the step limit is disabled.

step(action: Any) → Tuple[Any, Any, bool, Dict[Any, Any]]

Override BaseEnv.step and set done if the step limit is reached.