ActiveTrajectorySession
ActiveTrajectorySession(source_kind: TrajectorySourceKind = 'normal', behaviour_kind: TrajectoryBehaviourKind = 'policy', recording: TrajectoryRecording | None = None, source_reference: TrajectorySliceReference | None = None, action_budget: int | None = None, over_budget_penalty: float = -1.01) -> NonePer-environment trajectory state tracked while an episode is in flight.
Properties
is_policy_trainable
is_policy_trainable: boolReturn whether PPO should learn directly from this episode's actions.
Returns:
bool–Truewhen the current step should be learned on-policy.
is_random_controlled
is_random_controlled: boolReturn whether the episode is under whole-episode random control.
Returns:
bool–Truewhen actions should be sampled randomly.
step_plan
step_plan: StepPlanReturn the current per-step action/learning plan for this session.
Returns:
StepPlan– The shared step-plan flyweight for the next step.
Methods
normal
normal(*, behaviour_kind: TrajectoryBehaviourKind = 'policy', action_budget: int | None = None, over_budget_penalty: float = -1.01) -> ActiveTrajectorySessionCreate a normal session with no trajectory source.
Parameters:
behaviour_kind(TrajectoryBehaviourKind) – The episode behaviour mode.action_budget(int | None) – Optional cap on the episode's actions before it is abandoned.over_budget_penalty(float) – The reward for an episode that runs out of budget.
Returns:
ActiveTrajectorySession– The normal session.
start
start(recording: TrajectoryRecording, *, source_reference: TrajectorySliceReference | None = None, behaviour_kind: TrajectoryBehaviourKind = 'policy', action_budget: int | None = None, over_budget_penalty: float = -1.01) -> ActiveTrajectorySessionCreate a trajectory-start session.
Parameters:
recording(TrajectoryRecording) – The source recording.source_reference(TrajectorySliceReference | None) – Optional store reference for path stitching.behaviour_kind(TrajectoryBehaviourKind) – The episode behaviour mode after the reset.action_budget(int | None) – Optional cap on the episode's actions before it is abandoned.over_budget_penalty(float) – The reward for an episode that runs out of budget.
Returns:
ActiveTrajectorySession– The start session.
Values
action_budget
action_budget: int | None = NoneActions this episode may take before it is abandoned as a loss; None leaves it uncapped.
behaviour_kind
behaviour_kind: TrajectoryBehaviourKind = 'policy'over_budget_penalty
over_budget_penalty: float = -1.01The reward an episode is given when its budget runs out, replacing that step's reward.
Defaults to just worse than a death (-1 after normalization) so that forgetting to set it fails SAFE. An abandoned episode is marked done and reaches GAE with no bootstrap, so an unpriced cut-off is valued at zero -- better than dying, which makes running out the clock the best escape from any losing position. That is the freeze-in-place attractor, and at 0.0 the game's unterminable states stop being traps and become escape hatches. Setting 0.0 is a deliberate choice, never a default.
recording
recording: TrajectoryRecording | None = Nonesource_kind
source_kind: TrajectorySourceKind = 'normal'source_reference
source_reference: TrajectorySliceReference | None = None