Skip to content

PPOActorStepProcessor ​

python
PPOActorStepProcessor(env_states: Sequence[PPOActorEnvironmentRuntime], step_buffers: PPOActorStepBuffers, trajectory_runtime: PPOActorTrajectoryRuntime, *, potential_shaping: PotentialRewardShapingConfiguration | None = None, restart_pool: RestartPool | None = None, max_episode_actions: int = 0) -> None

Processes PPO environment step results into rollout state.

Initialize the step processor.

Parameters:

  • env_states (Sequence[PPOActorEnvironmentRuntime]) – Per-environment actor state objects.
  • step_buffers (PPOActorStepBuffers) – Mutable per-step rollout buffers.
  • trajectory_runtime (PPOActorTrajectoryRuntime) – Shared trajectory coordinator.
  • potential_shaping (PotentialRewardShapingConfiguration | None) – Optional potential-based reward shaping configuration.
  • restart_pool (RestartPool | None) – Optional pool harvesting restart points from completed episodes.
  • max_episode_actions (int) – Actor-wide cap on any episode's actions; 0 leaves them uncapped.

Source

Methods ​

handle_reset_result ​

python
handle_reset_result(result: MultiEnvResult) -> None

Apply one environment reset result after a completed episode.

Parameters:

  • result (MultiEnvResult) – The reset result returned by OakEmu.

Source

process_step_results ​

python
process_step_results(results: list[MultiEnvResult], *, starting_step: int) -> PPOProcessedStepBatch

Process one synchronous PPO environment step.

Parameters:

  • results (list[MultiEnvResult]) – One environment result per stepped environment.
  • starting_step (int) – The actor step count before processing this batch.

Returns:

  • PPOProcessedStepBatch – The processed batch summary.

Source

refresh_potential_snapshot ​

python
refresh_potential_snapshot() -> None

Rebuild the lock-free potential snapshot from the store. Call once per rollout; per-step shaping then reads the snapshot without locking. A no-op when shaping is disabled.

Source