Class RealtimeDriver
- Namespace
- DotFly
- Assembly
- DotFly.Engine.dll
Runs a Simulation on its own thread, keeping neural time in step with the wall clock (times Ratio). The game or UI thread writes input ports and reads output snapshots; it never touches the simulation directly. BehindBy tells the host how far the network lags, so it can degrade honestly (e.g. switch to a smaller checkpoint) instead of pretending.
public sealed class RealtimeDriver : IDisposable
- Inheritance
-
RealtimeDriver
- Implements
- Inherited Members
Constructors
RealtimeDriver(Simulation, RealtimeOptions?)
Creates a driver; call Start() to begin.
public RealtimeDriver(Simulation sim, RealtimeOptions? options = null)
Parameters
simSimulationoptionsRealtimeOptions
Properties
BehindBy
How far neural time (÷ ratio) lags the wall clock right now; zero or negative when caught up.
public TimeSpan BehindBy { get; }
Property Value
Error
The exception that stopped the driver, if any.
public Exception? Error { get; }
Property Value
Running
Whether the driver thread is currently advancing (not paused/stopped).
public bool Running { get; }
Property Value
Simulation
The simulation being driven.
public Simulation Simulation { get; }
Property Value
StepsLastTick
Steps advanced in the most recent tick.
public long StepsLastTick { get; }
Property Value
Methods
Dispose()
Stops the driver thread and waits for it. The simulation is left as is.
public void Dispose()
Pause()
Pauses; neural time stops, wall time keeps going (the deficit is forgiven up to MaxLag).
public void Pause()
Start()
Starts (or resumes) advancing.
public void Start()