_tacoma.SI¶
-
class
_tacoma.
SI
¶ Base class for the simulation of an SI compartmental infection model on a temporal network. Pass this to
tacoma.api.gillespie_SI()
to simulate and retrieve the simulation results. Simulation stops whent_simulation
is reached or if no infected is left.-
__init__
(self: _tacoma.SI, N: int, t_simulation: float, infection_rate: float, number_of_initially_infected: int = 1, number_of_initially_vaccinated: int = 0, sampling_dt: float = 0.0, seed: int = 0, save_infection_events: bool = False, verbose: bool = False) → None¶ Parameters: - N (int) – Number of nodes in the temporal network.
- t_simulation (float) – Maximum time for the simulation to run. Can possibly be greater than the maximum time of the temporal network in which case the temporal network is looped.
- infection_rate (float) – Infection rate per \(SI\)-link (expected number of reaction events \(SI\rightarrow II\) for a single \(SI\)-link per dimension of time).
- number_of_initially_infected (int, default = 1) – Number of nodes which will be in the infected compartment at \(t = t_0\).
- number_of_initially_vaccinated (int, default = 0) – Number of nodes which will be in the recovered compartment at \(t = t_0\).
- sampling_dt (float, default = 0.0) – If this is
>0.0
, save observables roughly every sampling_dt instead of on every change. - seed (int, default = 0) – Seed for RNG initialization. If this is 0, the seed will be initialized randomly.
- save_infection_events (bool, default = False) – If true, the edge along which each infection event occurs is saved in the variable infection_events.
- verbose (bool, default = False) – Be talkative.
Methods
__init__
Attributes
I
A list containing the number of infected at time \(t\). SI
A list containing the number of \(SI\)-links at time \(t\). infection_events
A list containing the edges along which each infection event took place, in the form (infection_source, susceptible). t_simulation
Absolute run time of the simulation. time
A list containing the time points at which one or more of the observables changed. -