Skip to main content

Module session

Module session 

Source
Expand description

Live incremental edit API.

evaluate() runs the whole model once. Engine instead builds the differential-dataflow graph once and keeps it alive on a dedicated worker thread, so subsequent input-cell edits propagate as deltas — only affected coordinates (and their downstream measures) recompute. This is the “edits → deltas → recompute without full rebuild” API the engine steering calls for (see AGENT_ENGINE_STEERING §6.2).

Scope: the measure structure (which measures exist, their formulas and dimensions) is fixed at Engine::new time. Editing input cell values is incremental. Adding/removing measures or changing a formula requires a new Engine (a structural rebuild) — callers rebuild on structural change, which is cheap relative to a data-edit-heavy session.

Threading: differential dataflow’s worker and InputSessions are not Send-friendly to hold across calls, so the worker lives on its own thread and communicates over channels. Engine is the Send handle.

Structs§

Edit
A single input-cell edit: set measure[coord] to value (or remove it when value is None).
Engine
A live, incremental evaluation handle over a fixed model structure.

Functions§

input_cell
The engine cell an input of type ty holding val contributes: None for a value of another type (text in a number measure, an error), which is no cell. One rule for the seed and for callers’ edits, so an edit and a rebuild always agree.

Type Aliases§

MeasureValues
A snapshot of a computed derived measure after an edit round.
Snapshot
Every tracked derived measure’s values after an edit round.