SpacesRecordingWrapper

class maze.core.wrappers.spaces_recording_wrapper.SpacesRecordingWrapper(*args, **kwds)

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: Optional[Any], maze_action: Optional[Any], first_step_in_episode: bool) → Tuple[Optional[Dict[Union[int, str], Any]], Optional[Dict[Union[int, str], Any]]]

(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, Union[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.