ActionRecord

class maze.core.trajectory_recording.records.action_record.ActionRecord(seed: int)

Action record holding either maze_action objects of agent actions for later deterministic (seeded) replays.

Parameters:

seed – The seed identifying the respective deterministic episode for the action record.

clip(max_items: int) → None

Clip action record to maximum length.

Parameters:

max_items – Maximum number of items in action record.

dump(dump_file: str) → None

Dump action record to file.

Parameters:

dump_file – absolute file path to pickle dump file.

get_agent_action(step: int, actor_id: ActorID) → Dict[str, int | numpy.ndarray]

Request agent action item for specific step.

Parameters:
  • step – The requested time step.

  • actor_id – ID of the actor to query the action for.

Returns:

The action item.

get_maze_action(step: int) → Any

Request maze action item for specific step.

Parameters:

step – The requested time step.

Returns:

The maze action item.

classmethod load(dump_file: str) → ActionRecord

Load existing action record from file.

Parameters:

dump_file – Path to dumped action record.

Returns:

Loaded action record.

set_agent_action(step: int, actor_id: ActorID, action: Dict[str, int | numpy.ndarray]) → None

Add action item for specified step.

Parameters:
  • step – The respective time step.

  • actor_id – ID of the actor to record the action for.

  • action – The respective agent action.

set_maze_action(step: int, maze_action: Any) → None

Add action item for specified step.

Parameters:
  • step – The respective time step.

  • maze_action – The maze action.