State path

text
NEW → prepare → READY → start → RUNNING
                         │          │
                         │        pause
                         │          ▼
                         └─────── PAUSED
                                    │
                         single_step / resume

READY / RUNNING / PAUSED → reset
READY / RUNNING / PAUSED → stop → STOPPED
any non-closed state → close → CLOSED

Prepare creates and checks dependencies; start advances the world; pause takes effect at a complete boundary; single-step advances one permitted step; stop ends active execution; close releases every resource.

Generation

Reset starts a new generation and returns tick to zero. Queued writes, control sessions, and subscriptions from the old generation cannot leak into the new world. Read results carry generation so callers can reject stale values.

Asynchronous and synchronous facades

FastSimApplication is the recommended async facade for embedded applications, servers, and plugins. FastSimRun provides a blocking context for scripts and simple CLI integrations. They do not create separate runtimes.

Finalization

Stopping is more than closing a backend. Control producers stop submitting, Operations reach terminal state, data plugins flush, outputs validate and publish atomically, and services are revoked. Only then is a Run complete.

Pause never leaves half a control/physics tick, close is idempotent, and failures retain structured results. See Application API and the Python SDK.