Skip to content

Class UPipelinedStepper

Class UPipelinedStepper

  • Defined in File PipelinedStepper.h

Nested Relationships

Nested Types

Inheritance Relationships

Base Types

class UPipelinedStepper : public UObject, public IStepper

Source: Source/Schola/InferenceUtils/Public/Steppers/PipelinedStepper.h

Dependencies: IAgent, IPolicy

Pipelined stepper implementation for asynchronous inference.

A sophisticated stepper that pipelines agent observations and policy inference across multiple frames to hide inference latency. Uses a two-stage pipeline:

Frame N: Collect observations -> Dispatch async inference Frame N+1: Apply actions from N -> Collect observations -> Dispatch async inference

This allows the policy to perform inference on a background thread while the game continues running, significantly reducing effective latency for expensive inference operations. The stepper manages synchronization between the game thread and inference threads.


Public Functions

SymbolDetails
InitInitialize the pipelined stepper with agents and policy.
StepExecute one step of the pipelined agent-policy loop.
BeginDestroyOverride for object destruction.

Init

inline virtual bool Init(const TArray<TScriptInterface<IAgent>> &InAgents,
const TScriptInterface<IPolicy> &InPolicy) override

Initialize the pipelined stepper with agents and policy.

Sets up the pipeline frames and prepares for asynchronous operation.

Parameters

  • InAgents – [in] The array of agents to manage

  • InPolicy – [in] The policy to use for inference (must support batched operations)

Returns:

true if initialization succeeded (agents and policy are valid), false otherwise

#DirectionNameTypeDescription
1InAgentsconst TArray< TScriptInterface< IAgent > > &The array of agents to manage
2InPolicyconst TScriptInterface< IPolicy > &The policy to use for inference (must support batched operations)

Attributes: inline, virtual

Source: Source/Schola/InferenceUtils/Public/Steppers/PipelinedStepper.h

Step

void Step()

Execute one step of the pipelined agent-policy loop.

Must be called every tick on the Game Thread. Performs:

  • Applies actions from the previous frame (if ready)

  • Collects observations from all agents

  • Dispatches asynchronous inference if policy is not busy

The inference runs on a background thread and results are applied in a subsequent frame once ready.

Source: Source/Schola/InferenceUtils/Public/Steppers/PipelinedStepper.h

Implementation: Source/Schola/InferenceUtils/Private/Steppers/PipelinedStepper.cpp

BeginDestroy

inline virtual void BeginDestroy() override

Override for object destruction.

Sets the shutdown flag to prevent background threads from accessing the object after it has been destroyed.

Attributes: inline, virtual

Source: Source/Schola/InferenceUtils/Public/Steppers/PipelinedStepper.h