Skip to content

ActiveTrajectorySession ​

python
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) -> None

Per-environment trajectory state tracked while an episode is in flight.

Source

Properties ​

is_policy_trainable ​

python
is_policy_trainable: bool

Return whether PPO should learn directly from this episode's actions.

Returns:

  • bool – True when the current step should be learned on-policy.

Source

is_random_controlled ​

python
is_random_controlled: bool

Return whether the episode is under whole-episode random control.

Returns:

  • bool – True when actions should be sampled randomly.

Source

step_plan ​

python
step_plan: StepPlan

Return the current per-step action/learning plan for this session.

Returns:

  • StepPlan – The shared step-plan flyweight for the next step.

Source

Methods ​

normal ​

python
normal(*, behaviour_kind: TrajectoryBehaviourKind = 'policy', action_budget: int | None = None, over_budget_penalty: float = -1.01) -> ActiveTrajectorySession

Create 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.

Source

start ​

python
start(recording: TrajectoryRecording, *, source_reference: TrajectorySliceReference | None = None, behaviour_kind: TrajectoryBehaviourKind = 'policy', action_budget: int | None = None, over_budget_penalty: float = -1.01) -> ActiveTrajectorySession

Create 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.

Source

Values ​

action_budget ​

python
action_budget: int | None = None

Actions this episode may take before it is abandoned as a loss; None leaves it uncapped.

Source

behaviour_kind ​

python
behaviour_kind: TrajectoryBehaviourKind = 'policy'

Source

over_budget_penalty ​

python
over_budget_penalty: float = -1.01

The 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.

Source

recording ​

python
recording: TrajectoryRecording | None = None

Source

source_kind ​

python
source_kind: TrajectorySourceKind = 'normal'

Source

source_reference ​

python
source_reference: TrajectorySliceReference | None = None

Source