#Epidemic Analysis
#Preset Dynamics
The SIRSD Epidemic preset has cell states: Dead, Susceptible, Infectious, and Recovered. Its ordered rules are:
| Current state and condition | Next state | Rule probability |
|---|---|---|
Susceptible with at least Infectious neighbor |
Infectious |
|
Infectious |
Recovered |
|
Infectious, if the recovery roll did not apply |
Dead |
|
Recovered |
Susceptible |
Infection probability saturates at Infectious neighbor: having through Infectious neighbors does not increase the roll. Because rules are evaluated in order, the death roll is attempted only after the recovery roll fails. Given that rolls are independent, that makes the unconditional -generation death probability approximately for an Infectious cell.
Recovered cells can become Susceptible again, so reinfection and multiple waves are possible. Dead cells remain Dead. There are no births, movement, or incubation state.
#Derived Metrics
Initial population, written as , is the first recorded Susceptible + Infectious + Recovered count. Empty grid cells are not included.
- Prevalence: current
Infectiouscells divided by fixed . - Peak prevalence: maximum unsmoothed prevalence during the run.
- Mortality fraction: deaths occurring during the run divided by .
- Final healthy grid density: final . This uses the whole grid as its denominator.
- Infectious duration: final
Infectiousgeneration minus first recorded generation. - Time to peak: peak-
Infectiousgeneration minus first recorded generation.
Using fixed for prevalence prevents deaths from shrinking the denominator and artificially inflating late prevalence.
#Infection Episodes
An infection episode is reconstructed Susceptible → Infectious transition. The initial seeded Infectious cells are not counted.
With the preset's only possible transitions, the population deltas and changed_cells identify the aggregate flows exactly for consecutive generations.
If is changed_cells, the reconstruction is:
Episodes per initial population are cumulative . Values can exceed because the same population can pass through repeatedly. This is an event rate over the initial population, not the fraction of unique people ever infected and not a distribution of infections per individual.
#Density Outcomes
| Density | Median peak prevalence | Median mortality | Median final healthy grid density | Median duration | |
|---|---|---|---|---|---|
The clearest observed change is between and : median episodes per initial population increase from to , peak prevalence from to , mortality from to , and duration from to generations.
Run-to-run variation in infectious duration is greatest at : its IQR is generations, compared with at and at .


Resurgence count is explained below.
#Mortality And Surviving Population
Above the transition, increased initial density supports many cycles of infection and substantially higher mortality. Median mortality reaches of the initial population at density.
Median final healthy grid density nevertheless stays in a narrow band from at to at . This convergence is consistent with the regime transition observed between and : at initial densities of or below, infection usually becomes extinct before spreading through enough of the population to cause substantial mortality, so final healthy density remains close to initial density. Above the transition, infection reaches a much larger part of the population and deaths progressively reduce occupancy. The epidemic therefore appears to prune densely populated grids toward a density at which continued transmission becomes difficult.

#Timing And Trajectories
Median duration increases throughout the sustained-epidemic regime, reaching generations at . Time to peak behaves differently: it is largest at with a median of generations, then falls to at , at , at , and at . Once dense local connectivity supports sustained spread, higher density produces an earlier, larger peak but a longer period of repeated circulation.
The spaghetti plots show all prevalence trajectories per density. Color denotes final mortality and the black curve is the per-generation median.

#Resurgence Count
Resurgence is a retrospective event definition applied to prevalence, not a native engine metric.
- Smooth prevalence with an -generation centered mean. The window suppresses short cell-level fluctuations while keeping generations of context on either side.
- Start a candidate wave when smoothed prevalence reaches .
- End it after smoothed prevalence remains at or below for consecutive generations.
- Treat the first candidate as the initial outbreak.
- Count a later candidate as a resurgence only if its smoothed peak is at least times the preceding smoothed trough, it spends at least generations at or above , and the trough is above .
The event's reported peak prevalence is the unsmoothed maximum inside its interval. Because the smoother is centered, this is an offline detector that uses future and past values; it is not suitable for real-time alerts.
Across all runs:
- runs have no resurgence.
- have .
- have .
- has .
- runs, or , have at least , for qualifying resurgence events in total.
- No qualifying resurgence occurs at or .
Counts are sparse and non-monotonic, so they support occasional post-outbreak resurgence but not a density-dependent resurgence law.

#Three-Resurgence Example
At density, run contains qualifying resurgences after its initial outbreak. In the recording, rendered at , the first occurs at generation (), the second at generation (), and the third at generation (). They subsequently peak at generations (), (), and (), with unsmoothed peak prevalences of approximately , , and , respectively.
The recording provides a concrete example of the retrospective event definition above.
#Representative Runs
The transition figure uses , where the infection-episode IQR is largest, and selects actual runs nearest the , , and episode percentiles:
| Representative role | Run | Peak prevalence | Mortality | Duration | |
|---|---|---|---|---|---|
| Nearest | |||||
| Nearest | |||||
| Nearest |

#Transition Runs In Motion
These recordings use the same initial density and correspond to the low-, median-, and high-outcome representatives above. They expose the run-to-run variation hidden by a density-level median.
| Low outcome – Run | Median outcome – Run | High outcome – Run |
|---|---|---|
| peak prevalence generations |
peak prevalence generations |
peak prevalence generations |
#Typical Runs Across Regimes
The following median-like runs contrast rapid extinction at with sustained circulation and extensive mortality at . To keep the long recording practical to view, it is rendered at , or the used for the other videos. Its accelerated playback is a presentation choice made to reduce size and length and should not be used to compare visual propagation speed directly with other recordings.
| Typical – Run | Typical – Run |
|---|---|
| peak prevalence mortality generations |
peak prevalence mortality generations |