CascadeStats
The rule this module exists to enforce: **no number is hidden behind another.** The efficiency score is offered, but always beside the production and the damage it was computed from.
CascadeStats — everything measured, and every way of getting it out
The rule this module exists to enforce: no number is hidden behind another. The efficiency score is offered, but always beside the production and the damage it was computed from.
local Stats = require("CascadeStats")
Stats.snapshot(sim) -- one flat table of every live number
Stats.strategyComparison(sim) -- Phase 13, both strategies side by side
Stats.dashboard(sim) -- Phase 26, the whole run
Stats.csvCascades(sim) -- Phase 27
Stats.csvSamples(sim)
Stats.jsonRun(sim)
Export
Stats.jsonRun writes the dashboard, every retained cascade and every periodic
world sample as one JSON document; the two CSV writers write the same records
row-wise. Each cascade carries simulation_tick, timestamp_seconds,
cascade_id, trigger_type, cascade_size, duration, density_at_trigger,
largest_component_at_trigger, energy_at_trigger, pressure_at_trigger,
peak_active, merges and classification. Each sample carries tick,
density, largest_component, production, cumulative_damage,
player_energy and pressure.
That is the artefact for analysing the mechanics outside the engine.
Percentiles
Computed over the retained cascade window (the last history_capacity events,
1000 by default), not over all time — so the readout answers "what does this
world look like now", and the lifetime counters beside it answer "what has it
ever done". Both are on screen; neither replaces the other.
Scoped to this part · feeds back into the world's score.