|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Phase 8 example: SIR epidemic on a 2-D toroidal lattice. More...
#include <algorithm>#include <array>#include <cstddef>#include <cstdint>#include <iomanip>#include <iostream>#include <string>#include <ca-rng.H>#include <ca-traits.H>#include <tpl_ca_engine.H>#include <tpl_ca_lattice.H>#include <tpl_ca_neighborhood.H>#include <tpl_ca_storage.H>#include <tpl_ca_stochastic_rules.H>Go to the source code of this file.
Functions | |
| int | main () |
Phase 8 example: SIR epidemic on a 2-D toroidal lattice.
Runs the discrete-time SIR rule
S -> I with probability 1 - (1 - beta)^k (k infected nbrs) I -> R with probability gamma R -> R (immune)
for a 64x64 toroidal grid seeded with a single infected cell at the centre. The example contrasts two regimes:
After every snapshot the example prints the lattice in ASCII plus the (S, I, R) tally and a tiny prevalence bar so the output reads like a printed epidemic curve.
Glyphs: '.' susceptible '*' infected '#' recovered
Definition in file ca_sir_epidemic_example.cc.
| int main | ( | void | ) |
Definition at line 180 of file ca_sir_epidemic_example.cc.
References Aleph::blossom_maximum_cardinality_matching().