SpacesRecordingWrapper

class maze.core.wrappers.spaces_recording_wrapper.SpacesRecordingWrapper(env: MazeEnv, output_dir: str = 'space_records')

Records actions, observations, rewards and dones in structured spaces records.

Dumps one trajectory record file per episode.

Parameters:

output_dir – Where to dump the serialized trajectory data. Files for individual episodes will be named after the episode ID, with “.pkl” suffix.

get_observation_and_action_dicts(maze_state: Any | None, maze_action: Any | None, first_step_in_episode: bool) Tuple[Dict[int | str, Any] | None, Dict[int | str, Any] | None]

(overrides Wrapper)

Keep both actions and observation the same - no change takes place in this wrapper.

reset() Any

(overrides BaseEnv)

Write the episode record and initialize a new one.

step(action: Dict[str, int | numpy.ndarray]) Tuple[Dict[str, numpy.ndarray], Any, bool, Dict[Any, Any]]

(overrides BaseEnv)

Record available step-level data.

write_episode_record() None

Serializes the episode record, if available.