Simulation
This page covers running a single simulation from Edit mode. For repeatable, named simulation configurations see Scenarios; for many-run Monte Carlo batches see Experiments.
Initial stateCopy link to this section
Before running a simulation, set the initial marking -- the starting tokens in each place.
Open Simulation Settings in the bottom panel to configure the initial state. Select a saved scenario, or choose No scenario and define an ad-hoc initial state in the Initial state column.
Select a place and open its State sub-view to inspect the resulting tokens. This view is always read-only, including when no saved scenario is selected:
- Untyped places show the token count.
- Typed places show each token's attribute values in a read-only grid.
During simulation, the State sub-view shows the tokens at the current playback frame. Make initial-state changes in Simulation Settings.
Simulation settingsCopy link to this section
Open the Simulation Settings tab in the bottom panel to configure:
ScenarioCopy link to this section
The Scenario dropdown lists "No scenario" plus every saved scenario. Selecting a scenario overrides parameters and the per-place initial marking with the scenario's values for this run. The picker is locked while a simulation is running; reset to change scenario.
Quick-action buttons next to the picker let you edit the selected scenario, create a new scenario, or jump to the Scenarios management view in Simulate mode. With "No scenario" selected, the panel becomes an ad-hoc scenario for the next run, without saving anything: Variables and Parameters share the left column and an Initial state column fills the right; a Clear button next to the Initial state title resets it.
ParametersCopy link to this section
Override values for this run:
- With No scenario selected: the form's Parameters table -- an expression per net-level parameter, the default shown with a
defaulttag until you override it; expressions may read the Variables above asscenario.<name>. - With a scenario selected: the scenario parameters are shown instead, pre-filled with that scenario's defaults. Net-level parameter values are fixed by the scenario's parameter overrides and are not editable here. Every selected scenario shows through the ad-hoc form: its scenario parameters take value edits in the left column, and its parameter overrides and initial state sit read-only in the right one -- browsable with the same keyboard navigation, but only a scenario edit (the pencil next to the picker) changes them. Every scenario shows computed parameter values and the exact tokens the run will start with, recomputed as you change scenario parameters. Select a read-only value to see its source expression in a floating cell over the selected value. The expression disappears when focus moves away. Very large places preview their first 100 rows.
Changes here do not modify the parameter definition or the scenario -- they only apply to the simulation. Parameter values are locked while a simulation is running. Reset the simulation to change them.
Time step (dt)Copy link to this section
Set the time step in seconds per frame using the Time Step input beside the scenario picker in Simulation Settings. It controls the resolution of ODE integration and how frequently transitions are evaluated. Hover the info icon beside its label for a short explanation.
- Smaller dt -- finer approximation, but slower computation.
- Larger dt -- faster, but less accurate for continuous dynamics.
Default: 0.01 seconds.
Running a simulationCopy link to this section
Press Play in the bottom toolbar. The simulation:
- Initializes with a fixed random seed, the current dt, and parameter values, so pressing Play twice with the same configuration reproduces the same trajectory. Many runs at once, and a search over parameters, are an experiment.
- Computes frames in a background Web Worker.
- Streams frames to the UI for playback.
If you need multiple runs of the same configuration -- e.g. to compare a stochastic model under different conditions -- use a Monte Carlo experiment.
If there are unresolved error-severity diagnostics (code errors), pressing Play opens the Diagnostics tab instead of starting the simulation. Fix all errors first -- warnings and hints don't block simulation.
Navigating Simulation SettingsCopy link to this section
Use arrow keys to move between the scenario picker, its action buttons, the time-step field, and the tables below. Enter opens a picker or edits a selected table value. Text fields keep Left and Right for moving the caret until it reaches an edge. Tab follows the usual browser order.
The uppercase section headers stack at the top as you scroll each column. Earlier headers fade slightly; click one to return to that section. Upcoming section headers stay at the bottom; click one to jump ahead. A soft fade marks the edge where content scrolls beneath the headers and clears when you return to the section's start. Informational tooltips are skipped by Tab and arrow-key navigation. Scrollbars overlay the content when you hover over a scrollable area, without shifting the columns. Initial state starts with the places marked Default starting place in their properties. Turn on the compact Show all places switch beside the Initial state title and info icon to inspect the rest. The switch appears only when the model contains other places. Left collapses an expanded place; Left again moves to the neighbouring focus group.
How a frame is computedCopy link to this section
Each simulation step proceeds in two phases:
Continuous dynamics -- for every place with dynamics enabled, the differential equation is integrated one step (Euler method, step size = dt). This updates all token dimension values.
Discrete transitions -- transitions are evaluated in definition order (deterministic, not random). For each transition:
- Checks structural enablement (enough tokens for standard/read input arcs, inhibitor conditions met, and enough room in any output place with a token capacity).
- Evaluates the lambda when one is active for the transition. If no lambda is active, the transition is treated as enabled once its structural arc conditions are met.
- If the transition fires, removes standard input tokens immediately (subsequent transitions see the updated state). Read and inhibitor arcs do not consume tokens.
All produced output tokens are added at the end of the step. If no transition kernel is active, uncoloured output tokens are generated from the output arc weights. Because output is applied at the end of the step, capacity accounts for tokens that transitions earlier in the same step have already produced -- several transitions feeding one capped place cannot collectively overflow it.
Simulation time advances by dt each frame.
What a firing looks likeCopy link to this section
A transition that fires flashes yellow, shows a lightning bolt, and thickens the arcs it moved tokens along, by an amount that grows with how many fired at once.
Firings you cannot see are not animated: a node off the side of the canvas, or a net zoomed out far enough that a node is only a few pixels across. Token counts, arcs and the timeline are unaffected -- only the flash is skipped, which is what keeps a large net moving at speed. Zoom in and the firings you are looking at animate as usual.
DeadlockCopy link to this section
If no transition fires in a step and no transition is structurally enabled (regardless of lambda values), the simulation reports deadlock and stops (a "Simulation Complete" message is shown).
This only stops computation: the simulation will continue to playback computed frames until no more are available.
If transitions are structurally enabled but their lambdas prevent firing, the simulation continues stepping.
A transition blocked only because its output place is at capacity is not structurally enabled, so a net whose remaining transitions are all blocked by full places reports deadlock rather than stepping on with nothing happening.
Playback controlsCopy link to this section
The bottom toolbar provides playback controls:
| Control | Description |
|---|---|
| Play | Start or resume playback. |
| Pause | Pause at the current point in the run. |
| Stop / Reset | Stop playback and reset to the run start. |
The time readout shows the elapsed simulation time and the run's total simulated time, at the precision the run's time step carries. Both values include s for seconds: the current time is prominent, with of and the total below it. The toolbar expands with a quick start and gentle settle to reveal the time readout and scrubber when a run starts.
Playback widens the toolbar, so in a narrow window it keeps Play and folds the scrubber, the time readout and the playback settings away until you point at it.
SpeedCopy link to this section
Choose a playback speed multiplier via playback settings: 1x, 2x, 5x, 10x, 30x, 60x, 120x, or Max (as fast as possible).
Play modeCopy link to this section
Controls how computation and playback interact:
| Mode | Behavior |
|---|---|
| Play computed steps only | Replay already-computed frames without further computation. |
| Play + compute buffer | Compute only a small buffer ahead of the playhead. |
| Play + compute max | Compute frames as fast as possible while playing. |
Stopping conditionCopy link to this section
- Run indefinitely -- simulation continues until manually paused or deadlock.
- End at fixed time -- simulation stops after a set number of seconds (simulation time).
Stopping conditions are locked after the simulation starts. Reset the simulation to change them.
TimelineCopy link to this section
The Timeline tab appears in the bottom panel during and after simulation. It shows token counts per place over time as a chart.
- Chart type -- toggle between Run (line chart) and Stacked (area chart) using the control in the tab header.
- Scrub -- click or drag on the chart to jump to any frame. A playhead indicator shows the current position.
- Closing the panel -- a closed timeline stops reading frames and stops drawing, so a run costs nothing on its account while it is out of sight. Reopen it and it catches up on everything it missed.
- Series selector -- the strip below the chart lists the traces currently shown. Hover a trace and click the eye icon that replaces its colour swatch to hide it; the trace stays in place, struck through, until the pointer leaves the selector, so you can hide several traces in a row or click again to undo a change. Hidden traces are managed from the dropdown: click the N/M shown badge (or anywhere else in the selector) to open the full list for searching, which is also where traces that don't fit in the strip live. The badge shows how many traces are currently shown, and your selection is kept while you switch tabs. Use Select All or Unselect All for bulk changes, or choose Only on a trace row to focus the chart on that one series. Y axis is automatically scaled to the maximum value.
Viewing state during simulationCopy link to this section
Select a place during simulation to see its current token values in the properties panel. For typed places, individual token dimension values are displayed.
If the place has a visualizer defined, it renders live in the properties panel, updating as the simulation progresses.
The same visualizer is reachable on the canvas: point at the place, click the button that appears above it, and its pin holds it open while you scrub the timeline or change the initial state.
Locked editingCopy link to this section
The editor is read-only during simulation and after a simulation completes. You cannot add, remove, or modify nodes, arcs, types, or code while a simulation exists.
Press Stop / Reset to return to editing mode.
At the last frame of a completed simulation, Play is disabled -- reset to replay from the beginning.