|
Hermes
Simulation Orchestration Platform for Aerospace
|

Public Member Functions | |
| None | __init__ (self, ProcessManager process_mgr, ExecutionConfig config) |
| int | frame (self) |
| float | time (self) |
| int | time_ns (self) |
| float | dt (self) |
| int | dt_ns (self) |
| bool | running (self) |
| bool | paused (self) |
| ExecutionMode | mode (self) |
| None | stage (self) |
| None | step (self, int count=1) |
| None | reset (self) |
| None | run (self, Callable[[int, float], Awaitable[None]]|None callback=None) |
| None | pause (self) |
| None | resume (self) |
| None | stop (self) |
Public Attributes | |
| time | |
Static Public Attributes | |
| int | NANOSECONDS_PER_SECOND = 1_000_000_000 |
Protected Attributes | |
| _pm = process_mgr | |
| _config = config | |
| int | _frame = 0 |
| int | _time_ns = 0 |
| int | _dt_ns = config.get_dt_ns() |
| bool | _running = False |
| bool | _paused = False |
| bool | _needs_wall_rebase = False |
| WireRouter|None | _router = None |
| dict | _module_substeps = {} |
Runtime simulation scheduler.
Controls simulation execution with support for realtime, AFAP,
and single-frame modes. Coordinates with ProcessManager for
module stepping and provides pause/resume/stop control.
Example:
>>> scheduler = Scheduler(process_mgr, config.execution)
>>> scheduler.stage()
>>> await scheduler.run(callback=my_telemetry_fn)
| None hermes.core.scheduler.Scheduler.__init__ | ( | self, | |
| ProcessManager | process_mgr, | ||
| ExecutionConfig | config ) |
Initialize the scheduler.
Args:
process_mgr: ProcessManager for controlling modules
config: Execution configuration (mode, rate, end_time)
| float hermes.core.scheduler.Scheduler.dt | ( | self | ) |
Timestep in seconds. Derived from `dt_ns` for API convenience.
| int hermes.core.scheduler.Scheduler.dt_ns | ( | self | ) |
Timestep in nanoseconds. This is the authoritative timestep value for deterministic simulations.
| int hermes.core.scheduler.Scheduler.frame | ( | self | ) |
Current simulation frame number.
| ExecutionMode hermes.core.scheduler.Scheduler.mode | ( | self | ) |
Current execution mode.
| None hermes.core.scheduler.Scheduler.pause | ( | self | ) |
Pause the run loop. The simulation will stop advancing but remain in the run loop. Use resume() to continue.
| bool hermes.core.scheduler.Scheduler.paused | ( | self | ) |
Whether the simulation is paused.
| None hermes.core.scheduler.Scheduler.reset | ( | self | ) |
Reset simulation to initial state. Resets frame/time counters, flags wall_start for rebasing so realtime pacing resumes correctly, and resets all modules to their initial conditions (restoring signal values).
| None hermes.core.scheduler.Scheduler.resume | ( | self | ) |
Resume the run loop after pause.
| None hermes.core.scheduler.Scheduler.run | ( | self, | |
| Callable[[int, float], Awaitable[None]] | None | callback = None ) |
Run simulation loop until stopped or end_time reached.
In realtime mode, paces execution to wall-clock time.
In AFAP mode, runs as fast as possible.
In single_frame mode, waits for explicit step() calls.
Args:
callback: Optional async callback invoked after each frame
with (frame_number, simulation_time_seconds)
| bool hermes.core.scheduler.Scheduler.running | ( | self | ) |
Whether the simulation run loop is active.
| None hermes.core.scheduler.Scheduler.stage | ( | self | ) |
Stage simulation for execution. Calls stage() on all modules via ProcessManager, configures wire routing, and resets frame/time counters to zero.
| None hermes.core.scheduler.Scheduler.step | ( | self, | |
| int | count = 1 ) |
Execute N major frames.
Each major frame routes wires, then steps each module according to
its configured rate (faster modules sub-step multiple times).
Args:
count: Number of major frames to execute (default: 1)
Raises:
ValueError: If count is not positive
| None hermes.core.scheduler.Scheduler.stop | ( | self | ) |
Stop the run loop. The simulation will exit the run() method cleanly.
| float hermes.core.scheduler.Scheduler.time | ( | self | ) |
Current simulation time in seconds. This is derived from `time_ns` for API convenience. For deterministic comparisons, use `time_ns` instead.
| int hermes.core.scheduler.Scheduler.time_ns | ( | self | ) |
Current simulation time in nanoseconds. This is the authoritative time value for deterministic simulations. Use this for exact comparisons and reproducibility.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
| hermes.core.scheduler.Scheduler.time |