TrajectoryData
TrajectoryData(blocks: tuple[_Block, ...]) -> NoneOne episode trajectory parsed from OakEmu's pointer-based interop buffer.
Mirrors the TrajectoryFile wrapper API but is parsed entirely from raw bytes, without any pythonnet object access. The wire format is exactly the bytes of the trajectory's .oet file: an 18-byte file header (identifier plus version) followed by self-framing blocks of {byte Type, fixed-size header starting with a uint size field, body bytes}.
Initialize the trajectory from parsed blocks.
Parameters:
blocks(tuple[_Block, ...]) – The parsed blocks in episode order.
Properties
action_map
action_map: tuple[str, ...]The action names stored in the trajectory map.
actions
actions: bytesThe action indices up to the last interesting marker.
captured_expression_labels
captured_expression_labels: tuple[str, ...]The captured value labels, in marker value order.
emulator_type
emulator_type: intThe OakEmu emulator type.
end_state
end_state: bytes | NoneThe snapshot at the last interesting marker, if present.
end_values
end_values: dict[str, int]The values captured at the last interesting marker.
episode
episode: TrajectoryEpisodeThe episode block.
episode_actions
episode_actions: bytesThe full episode action indices.
episode_end_state
episode_end_state: bytesThe snapshot at the end marker.
episode_end_values
episode_end_values: dict[str, int]The values captured at the end marker.
frame_skip
frame_skip: intThe frame-skip value stored in the trajectory.
has_end_state
has_end_state: boolWhether the episode contains at least one interesting marker.
initial_state
initial_state: bytesThe serialised emulator state at the start of the episode.
interesting_markers
interesting_markers: tuple[TrajectoryMarker, ...]Only the interesting-point markers.
markers
markers: tuple[TrajectoryMarker, ...]The ordered markers emitted for the episode.
screen_type
screen_type: intThe OakEmu screen type.
start_values
start_values: dict[str, int]The values captured at the start marker.
trigger_definitions
trigger_definitions: tuple[TrajectoryTriggerDefinition, ...]The trigger definitions stored in the episode block.
Methods
from_buffer
from_buffer(buffer: bytes, offset: int = 0) -> TrajectoryDataParse a trajectory from its interop wire format (the bytes of its .oet file).
Parameters:
buffer(bytes) – The buffer containing the trajectory, which extends to the end of the buffer.offset(int) – The offset of the trajectory within the buffer.
Returns:
TrajectoryData– The parsed trajectory.
interesting_segments
interesting_segments() -> tuple[TrajectorySegment, ...]Split the full episode into boundary-to-boundary segments ending at interesting or final markers.
Adjacent interesting markers with no intervening action block are treated as the same boundary and do not create zero-length segments.
Returns:
tuple[TrajectorySegment, ...]– The derived interesting segments in episode order.