Fundamentals
We model a population of agents on a two-dimensional grid of cells that can move randomly or away from infected agents. Each cell can be in one of the following states:
empty
: there is no agent on the cell.susceptible
: the agent on the cell is healthy but susceptible to the disease and can be exposed if in contact with the disease.exposed
: the agent on the cell is exposed to the disease, meaning that it can already infect other agents in contact with the disease; however, there are no symptoms yet, thus, the agent gets noticed as infected only after the incubation period.infected
: the agent on the cell is infected and can infect neighboring agents.recovered
: the agent on the cell is recovered, thus, it is immune to the disease. However, it can lose its immunity after a while and become susceptible again.deceased
: the agent on the cell is deceased. The cell will again be empty in the next time step.
Special Cell States
Additionally, cells can also have the following “special” states:
source
: the cells are infection sources, thus, they can transition neighboring agents from the susceptible to the exposed state.inert
: inert cells are cells that do not partake in any of the model dynamics. They can be used to model spatial heterogeneities like compartmentalization, much likestones
in the ForestFire model.
Cells that are initialized in one of these states should not be regarded as representing agents: there is no movement for these cells, nor can these cells change their state.
Implementation
The implementation allows for a range of different storylines by changing the parameters. Keep in mind that individual processes can often be disabled by setting probabilities to zero.
Update Rules
In each time step the cells update their respective states asynchronously, but randomly shuffled to reduce artefacts, according to the following rules:
- A living (susceptible, exposed, infected, or recovered) cell becomes empty with probability
p_empty
. - An
empty
cell turns into asusceptible
one with probabilityp_susceptible
. With probabilityp_immune
the cell isimmune
to being infected. - A
susceptible
cell either becomes randomly exposed with probabilityp_exposed
or becomes exposed with probabilityp_transmit * (1 - p_random_immunity)
if a neighboring cell isexposed
orinfected
, withp_transmit
being the neighboring cell’s probability of transmitting the disease. Disease transmission happens only if the cell is notimmune
. - An
exposed
cell becomesinfected
with probabilityp_infected
. - An
infected
cell recovers with probabilityp_recovered
and becomesimmune
, becomesdeceased
with probabilityp_deceased
, or else stays infected. - A
recovered
cell can lose its immunity withp_lose_immunity
and becomessusceptible
again. - A
deceased
cell turns into anempty
cell.
Movement
In each time step, the agents on the cells can move to empty
neighboring cells according to the following rules:
- A living (susceptible, exposed, infected, or recovered) cell moves with probability
p_move_randomly
to a randomly chosenempty
neighboring cell, if there is any. - A living cell moves away from an
infected
neighboring cell to a randomly selected neighboringempty
cell if there is any.
Heterogeneities
As in the Forest Fire model, there is the possibility to introduce heterogeneities into the grid that are implemented as two additional possible cell states:
source
: these are constant exposure sources. They spread the infection like normal infected or exposed cells, but don not revert to the empty state. If activated, they are per default at the lower boundary of the grid, though this can be changed in the configuration.inert
: inert cells are cells that do not partake in the dynamics of the model, and hence can be used to represent barriers. If enabled, the default mode isclustered_simple
, which leads to randomly distributed inert cells whose neighbors have a certain probability to also be inert.
Both make use of the entity selection interface.
Immunity Control
Via the immunity_control
parameter in the model configuration, additional immunities can be introduced at desired times, thereby manipulating a cell’s immune
state.
This feature can be used e.g. to investigate the effect of vaccination. The immunities are introduced before the update rule above is carried out.
Exposure Control
Via the exposure_control
parameter in the model configuration, additional exposures can be introduced at desired times. The exposures are introduced before the update rule above is carried out.
Transmission Control
Via the transmission_control
parameter in the model configuration, the cell-specific state p_transmit
can be manipulated. The cell state manipulation happens before the update rule above is carried out.
Data Output
The following data is stored alongside the simulation:
-
kind
: the state of each cell:0
:empty
1
:susceptible
2
:exposed
3
:infected
4
:recovered
5
:deceased
6
:source
, is constantly infectious7
:inert
, does not take part in any interaction
-
age
: the age of each cell, reset after a cell turns empty. -
cluster_id
: a number identifying to which cluster a cell belongs; is0
for non-living cells. Recovered cells do not count towards it. -
exposed_time
: the time steps a living cell has already been exposed to the disease, for each cell. -
immunity
: whether or not a cell is immune, for each cell. -
densities
: the densities of each of the kind of cells over time; this is a labeled 2D array with the dimensionstime
andkind
. -
counts
: cumulative counters for a number of events, e.g. state transitions. This is a 2D array with the dimensionstime
andlabel
, where the latter describes the name of the counted event:empty_to_susceptible
, i.e. “birth”living_to_empty
, i.e. “random death”susceptible_to_exposed_contact
, via local contact with a neighborsusceptible_to_exposed_random
, via a random point exposure, controlled byp_exposed
susceptible_to_exposed_controlled
, via exposure control.exposed_to_infected
, as controlled byp_infected
infected_to_recovered
, as controlled byp_recovered
infected_to_deceased
, as controlled byp_deceased
recovered_to_susceptible
, which happens when losing immunity, as controlled byp_lose_immunity
move_randomly
, as controlled byp_move_randomly
move_away_from_infected
, as enabled bymove_away_from_infected