Skip to main content

drive

Function drive 

Source
pub fn drive(
    plan: RunPlan,
    ledger: &mut dyn Ledger,
    model: &mut dyn Model,
    hooks: &mut RunHooks<'_>,
    handoff: &Handoff,
) -> Result<Run<Frozen>, AxError>
Expand description

Dispatch, turn until an ending, freeze. The loop is here rather than in each caller because the ending rules — an empty wave concludes, a cancellation is an ending too — are the part that must not drift between the city and the simulator.

The loop counts no turns. There is no ceiling to reach, because nobody can price a piece of work before it runs. What ends a run is what it did: a turn that concluded, a failure with a carrier event, or an interruption a safe point delivered — and what stops one from outside is Halt, which shuts the scope and kills the backlog members inside it.

§Errors

Propagates ledger and provider failures.