Infection#

class Infection(pars=None, *args, **kwargs)[source]#

Bases: Disease

Base class for infectious diseases used in Starsim

This class contains specializations for infectious transmission (i.e., implements network-based transmission with directional beta values) and defines attributes that connectors operate on to capture co-infection

Attributes

infectious

Generally defined as an alias for infected, although these may differ in some diseases.

now

Shortcut to self.t.now()

states

Return a flat list of all states

statesdict

Return a flat dictionary (objdict) of all states

ti

Get the current module timestep

timevec

Shortcut to self.t.timevec

Methods

property infectious#

Generally defined as an alias for infected, although these may differ in some diseases. Transmission comes from infectious people; prevalence estimates may include infected people who don’t transmit

init_post()[source]#

Set initial values for states. This could involve passing in a full set of initial conditions, or using init_prev, or other. Note that this is different to initialization of the Arr objects i.e., creating their dynamic array, linking them to a People instance. That should have already taken place by the time this method is called.

init_results()[source]#

Initialize results

validate_beta(run_checks=False)[source]#

Validate beta and return as a map to match the networks

step()[source]#

Perform key infection updates, including infection and setting prognoses

static compute_transmission(src, trg, rel_trans, rel_sus, beta_per_dt, randvals)[source]#

Compute the probability of a->b transmission

infect()[source]#

Determine who gets infected on this timestep via transmission on the network