Advance to the next turn. Runs between-turn progression.
OptionalprogressionHook: (ctx: ProgressionHookContext) => voidApply updates to living people: the featured colonist updates of the department reports, and the memory the reaction step writes. A report's psych score moves the person at most 0.15 toward the value it writes (PSYCH_STEP); its conditions are set as written. A memory write is held by writeMemory; it moves no number the dice read.
Add each delta to wherever the run holds its key, metrics first, then politics; a key the run holds in neither is dropped. Returns the change each key made.
Apply personality drift to all promoted colonists.
Apply a policy effect from the commander's decision: its patches set values outright, then its deltas add to them. Returns the change each delta made, and logs it.
Apply additive deltas to world politics; one for a field the run does not carry is dropped. Returns the change each field made, within the range its scenario declares.
Apply additive deltas to world systems (not absolute values). A delta
for a metric the run does not carry is dropped. A population delta
moves whole people on and off the roster; see movePeople.
A morale gain adds in full up to 0.9 and eases above it, so no gain
stops at 1 (moraleAfterGain). Returns the change each metric made,
which is what the run reports: the delta itself, or less where a floor
or ceiling stopped it (power at 0, a hull a scenario keeps at or under
100) or a morale gain eased.
Find an agent by an id a model wrote. An exact id wins; otherwise the id is compared with punctuation dropped on both sides, then also without a leading title (see agentIdKeys). A loose match counts only when it names exactly one agent.
Get top N candidates for a department role, scored by trait fit. The living adults with no department to head: a fork's roster holds the people born since the start, and the score does not read age.
Promote a colonist to a department head role. Returns the roster id
the promotion resolved to, which can differ from agentId in
punctuation or a dropped title.
Capture a KernelSnapshot bundle. The returned object is
plain JSON-safe data: JSON.stringify(snap) + JSON.parse +
SimulationKernel.fromSnapshot(parsed, scenarioId) round-trips
to a new kernel in the same state. Used by
WorldModel.snapshot() + fork() for mid-run counterfactuals.
Scenario id the snapshot is being taken
against. Stamped into the snapshot so fromSnapshot can
verify the target WorldModel's scenario matches.
StaticfromReverse of SimulationKernel.toSnapshot. Constructs a
fresh kernel positioned at the snapshot's turn, with simulation
state + PRNG state + metadata fully restored. The returned
kernel is indistinguishable from the one that produced the
snapshot as far as subsequent advanceTurn calls are concerned.
The captured snapshot.
Scenario id the caller expects the snapshot to match. Throws when they differ; this is the gate against accidental cross-scenario forks.
Optionalscenario: ScenarioPackage
The scenario the kernel goes on running, for its declared floors and ceilings, which a snapshot does not hold. Without it the restored kernel keeps only its built-in ones.
Years in one unit of the run's time. A state saved before units had lengths carries none, and its ages were written as if a unit were a year, so it reads 1.