SIS_FixedRecovery
: SIS with a fixed recovery interval¶
-
class
epydemic.
SIS_FixedRecovery
¶ The Susceptible-Infected-Susceptible compartmented model of disease, in the variation where the time spent infected is fixed rather than happening with some probability.
Models of this kind have slightly more predictable behaviour (since they use a fixed rather than randomly-distributed recovery time), and so can be useful for some kinds of analysis.
Additional parameters and node attributes¶
Instead of taking a recovery probability (as defined by
SIS.P_REMOVE
), SIS_FixedRecovery
accepts a fixed
time interval over which an infected node will remain infected
before being removed.
-
SIS_FixedRecovery.
T_INFECTED
= ‘tInfected’¶ Parameter for the time spent infected before becoming susceptible again.
We also record the infection time of a node explicitly:
-
SIS_FixedRecovery.
INFECTION_TIME
= ‘infection_time’¶ Attribute recording when a node became infected
Building the model¶
-
SIS_FixedRecovery.
build
(params)¶ Build the variant SIS model. The difference between this and the reference
SIS
model is that only infection events happen probabilistically, with recovery events happening on a fixed schedule depending on theT_INFECTED
parameter.Parameters: params – the model parameters
Setup and events¶
In setting up the model, we need an additional step to make sure that any nodes initially infected are set to recover at the appropriate simulation time.
-
SIS_FixedRecovery.
setUp
(dyn, g, params)¶ After setting up as normal, post recovery events for any nodes that are initially infected.
Parameters: - dyn – the dynamics
- g – the network
- params – the simulation parameters
Only a single event method is needed, with SIS.recover()
being
inherited.
-
SIS_FixedRecovery.
infect
(dyn, t, g, (n, m))¶ Perform the normal infection event, and then post an event to recover the infected node back to susceptible at the appropriate time.
Parameters: - dyn – the dynamics
- t – the simulation time
- g – the network
- e – the edge transmitting the infection, susceptible-infected