covid-sim
/home/abuild/rpmbuild/BUILD/covid-sim-0.14.0/docs/intervention-description.md
1 # CovidSim: how interventions and policies are implemented
2 
3 See [model overview](./model-overview.md) for further information.
4 
5 CovidSim models infections through time in a spatially explicit representation
6 of individuals in a population. Infected people are assumed to infect
7 susceptible people at household, spatial and place level. Here,
8 [place](./model-glossary.md#Places) is a generalisation of either primary
9 schools, secondary schools, universities or workplaces (e.g. offices). The model
10 includes disease progression for symptomatic individuals, and is parameterised
11 to reflect current knowledge of Covid-19 disease progression and death.
12 
13 Interventions are implemented in the code through the parameter and
14 pre-parameter files (see [input and outputs](./inputs-and-outputs.md)). These
15 parameters are read in function `ReadParams` in `CovidSim.cpp` and collected in
16 single structure `PARAMS`, of which there is a single, global instance `P`.
17 
18 ## Intervention overview
19 
20 The model considers various interventions that alter either the infectiousness
21 of infected people or the susceptibility of susceptible people (or both).
22 Fundamentally, interventions are implemented by changing the person-specific
23 period during which a person is subject to a particular intervention (given in
24 `#define` functions in `ModelMacros.h`). These values in turn toggle parameters
25 in functions governing infectiousness and susceptibility in `CalcInfSusc.cpp`,
26 and in function `InfectSweep` in `Update.cpp`. The interventions broadly fall
27 into the following categories:
28 
29 - Case Isolation (CI),
30 - Household Quarantine (HQ),
31 - Place Closure (PC),
32 - Social Distancing (SD).
33 
34 Example parameter files have been provided for the following scenarios:
35 
36 1. no interventions (`p_NoInt.txt`)
37 2. case isolation; household quarantine; social
38 distancing and place closure (`p_PC7_CI_HQ_SD.txt`).
39 
40 Units of time `t` are in days, and day 1 is taken to be January 1st 2020 (e.g.
41 day 76 is March 16th 2020) in output files. The model is calibrated at the start
42 of runtime to match the user-specified inputs. It will approximately (through an
43 iterative calibration process) match a user-specified threshold cumulative
44 epidemic size (either [Number of deaths accumulated before alert] for deaths or
45 [Number of detected cases needed before outbreak alert triggered] for detected
46 cases, depending on value of `P.PreControlClusterIdUseDeaths` [Trigger alert on
47 deaths]) occurring up to the day specified by [Day of year trigger is reached]
48 (`P.PreControlClusterIdCalTime`). If [Alert trigger starts after interventions]
49 is set to 1 in the input pre-parameter file, this threshold can occur after the
50 start of interventions, in which case the start day of interventions,
51 [Day of year interventions start] (`P.PreIntervIdCalTime`) should be also
52 specified.
53 
54 Intervention times in the intervention parameter files are relative to
55 `P.PreIntervIdCalTime`.
56 (e.g. if `P.HQuarantineTimeStartBase` / [Household quarantine start time] is set
57 to 10, then in the start date of household quarantine policy will be ten days
58 after `P.PreIntervIdCalTime`).
59 
60 Importantly, the model distinguishes between the period during which a policy is
61 implemented, and the period during which the actual intervention is implemented.
62 If a policy is implemented from time `t`, the intervention will not be
63 implemented until a user-specified threshold has been met by a particular
64 “trigger” or count (see below). Further, CI and HQ policies have durations at
65 the level of a person, which denote the length of time that a person would
66 either self-isolate or be under home quarantine. These person-level durations
67 are distinct from the duration of policy at the population level. For example,
68 a policy could be implemented for a year, during which time people would home
69 quarantine for 14 days if a member of their household becomes sick.
70 
71 ### Intervention triggers
72 
73 A trigger is defined flexibly, with reference to either the numbers (cumulative
74 incidence) of confirmed cases, numbers of critical cases that require Intensive
75 Care Units (ICU beds), or numbers of deaths. Numbers can be either absolute or
76 per-capita, and the model may be refined so that the number is defined in
77 relation to ICU bed capacity. The window over which cumulative incidence is
78 calculated is specified by `P.TriggersSamplingInterval` [Number of sampling
79 intervals over which cumulative incidence measured for global trigger] days.
80 Further, triggers may be specified at either admin unit (regional) or at country
81 (global) level. So too can the start times for when each intervention is
82 considered. Finally, each intervention has its own threshold value.
83 
84 Currently, all interventions must use the same epidemiological variable for
85 their trigger (e.g. all using confirmed cases or all using ICU beds), and
86 interventions do not differ in whether they consider absolute or per-capita
87 triggers. Note that triggers can be set to zero, indicating that interventions
88 are implemented throughout the time window specified by the start time and
89 duration of that intervention.
90 
91 The steps below summarise the above process:
92 
93 - Simulation starts
94 - Policy implemented
95 - Trigger (count) surpasses threshold for that intervention
96 - Intervention implemented
97 - infectiousness and/or susceptibility parameters turned on for individuals
98  affected by intervention
99 
100 The following interventions are described with reference to particular functions
101 and parameters in code, and the parameter descriptions in parameter files
102 (`p_XX.txt`), which are read in through `ReadParams` function in `CovidSim.cpp`.
103 Functions `TreatSweep` in `Update.cpp` and `RecordSample` in `CovidSim.cpp`
104 determine whether thresholds have been exceeded.
105 
106 Notes on variable naming: Parameters with prefix `us` are unsigned short
107 versions of their namesakes, that have been multiplied by parameter `P.TimeStepsPerDay`
108 (e.g. `P.usHQuarantineHouseDuration = P.HQuarantineHouseDuration * P.TimeStepsPerDay`).
109 
110 ## CASE ISOLATION (CI)
111 
112 Policy implemented after time `P.CaseIsolationTimeStartBase`
113 (“Case isolation start time”) for duration of `P.CaseIsolationPolicyDuration`
114 days. A value of `P.CaseIsolationTimeStartBase` greater than simulation duration
115 (`P.SampleTime` “Sampling time” in pre-parameter file) indicates that policy
116 will not be implemented (e.g. if simulation runs for 720 days and start time set
117 to 1000 days). If threshold `P.CaseIsolation_CellIncThresh` exceeded, symptomatic
118 cases stay home for period of `P.CaseIsolationDuration` days, starting after
119 `P.CaseIsolationDelay` days. Durations and delays can alternatively be specified
120 at admin unit level.
121 
122 After infection and upon case detection (`DoDetectCase` function in `Update.cpp`),
123 a case isolates with probability `P.CaseIsolationProp`.
124 Their isolation_start_time is set. Isolation stop time formula:
125 `isolation_start_time + P.usCaseIsolationDelay + P.usCaseIsolationDuration`).
126 These values are relevant to `HOST_ISOLATED` macro, which returns true or false.
127 `HOST_ISOLATED` affects every infectiousness function (at person, house, place,
128 spatial levels) but not susceptibility functions in `CalcInfSusc.cpp`.
129 
130 If `HOST_ISOLATED`,
131 place and spatial infectiousness scaled by `P.CaseIsolationEffectiveness`,
132 whereas household infectiousness scaled by `P.CaseIsolationHouseEffectiveness`.
133 
134 Additionally, case isolation amends absent start and stop time, in scenarios
135 where isolated person is a child requiring adult supervision, and where host was
136 already absent and requires their period of absence amended due to case isolation.
137 Macro `HOST_ABSENT` relevant in `InfectSweep` in `Sweep.cpp` – all place
138 infections are contingent on host not being absent from their place.
139 
140 ## HOUSEHOLD/HOME QUARANTINE (HQ)
141 
142 Policy implemented after time `P.HQuarantineTimeStartBase` (“Household quarantine
143 start time”) for period of `P.HQuarantinePolicyDuration` days.
144 Value of `P.HQuarantineTimeStartBase` greater than simulation duration indicates
145 that policy will not be implemented (e.g. if simulation runs for 720 days and
146 start time set to 1000 days). If threshold `P.HHQuar_CellIncThresh` exceeded,
147 people who share household with a symptomatic case stay home for period of
148 `P.HQuarantineHouseDuration days`, starting after `P.HQuarantineHouseDelay days`.
149 Durations and delays can alternatively be specified at admin unit level.
150 
151 Upon case detection (`DoDetectCase` function in `Update.cpp`), `quar_start_time` is set.
152 A person’s quarantine stop time is `quar_start_time + P.usHQuarantineHouseDuration`.
153 Compliance is set first at household and then at individual level, both of which
154 are randomly determined with respective proportions `P.HQuarantinePropHouseCompliant`
155 and `P.HQuarantinePropIndivCompliant`. Note that 50% compliance means that 50%
156 of people are 100% compliant, and not that 100% of people are 50% compliant
157 (although the latter probably more realistic).
158 
159 Macro `HOST_QUARANTINED` asks whether host is a) compliant with HQ; b) currently
160 between their quarantine start and stop times. `HOST_QUARANTINED` scales
161 infectiousness: at household level by `P.HQuarantineHouseEffect`; at spatial
162 level by `P.HQuarantineSpatialEffect`; and at place level by
163 `P.HQuarantinePlaceEffect[k]` for place type `k`. `HOST_QUARANTINED` scales
164 susceptibility: at spatial level by `P.HQuarantineSpatialEffect`; and at place
165 level by `P. HQuarantinePlaceEffect[k]` for place type `k`.
166 
167 ## SOCIAL DISTANCING (SD)
168 
169 Policy implemented after time `P.SocDistTimeStartBase` (“Social distancing start
170 time”) for period of `P.SocDistDuration` days. Value of `P.SocDistTimeStartBase`
171 greater than simulation duration indicates that policy will not be implemented
172 (e.g. if simulation runs for 720 days and start time set to 1000 days).
173 Durations and delays can alternatively be specified at admin unit level.
174 
175 Social distancing implemented mainly in `TreatSweep`, which determines whether
176 `P.SocDistCellIncThresh` incidence threshold exceed. If so, then the
177 susceptibility of all people residing in microcell currently undergoing social
178 distancing is scaled, either by enhanced or non-enhanced effects (see below).
179 Infectiousness functions are unaffected by social distancing.
180 
181 Distinction between social distancing and enhanced social distancing effect:
182 
183 - Household (`P.SocDistHouseholdEffect` vs. `P.EnhancedSocDistHouseholdEffect`)
184 - Place (`P.SocDistPlaceEffect[k]` vs. `P.EnhancedSocDistPlaceEffect[k]`, for place type `k`)
185 - Spatial (`P.SocDistSpatialEffect` vs. `P.EnhancedSocDistSpatialEffect`)
186 
187 These scale a person’s contact rate at household, place and spatial level.
188 
189 Both sets of parameters can implemented at the same time, in which case a given
190 person is compliant with enhanced social distancing (`person.esocdist_comply == 1`)
191 with age-specific probability `P.EnhancedSocProportionCompliant[age]`
192 (decided for each person in `SetupModel.cpp`).
193 
194 A social distancing policy can occur once only (if `P.DoSocDistOnceOnly`), or repeatedly.
195 
196 ## SOCIAL DISTANCING FOR OVER 70s (SDO/SDOL70)
197 
198 Differences between this and social distancing are in parameter values, rather than source code.
199 
200 `ReadParams` in `CovidSim.cpp` populates `P.ESocProportionCompliant` array by
201 scanning first for “Proportion compliant with enhanced social distancing by
202 age group”, and failing that the non-age-specific “Proportion compliant with
203 enhanced social distancing”, in which case all values of array same for all age groups.
204 If this is not found, values default to 0, i.e. zero compliance with enhanced social distancing.
205 
206 ## PLACE CLOSURE (PC)
207 
208 Policy implemented after time `P.PlaceCloseTimeStartBase` (“Place closure start time”).
209 Values of `P.PlaceCloseTimeStartBase` greater than simulation duration indicates
210 that policy will not be implemented (e.g. if simulation runs for 720 days and
211 start time set to 1000 days). Durations can alternatively be specified at admin
212 unit level.
213 
214 `RecordSample` in `CovidSim.cpp` determines whether trigger has exceeded
215 `P.PlaceCloseCellIncThresh`, and if so sets `P.PlaceCloseTimeStart`.
216 A subsequent call to `TreatSweep` function in `Sweep.cpp`, determines whether
217 incidence threshold `P.PlaceCloseCellIncThresh` exceeded. If so, then all places
218 in microcell marked as closed (and trigger reset), and `DoPlaceClose` in
219 `Update.cpp` is called. DoPlaceClose changes quantities `place.close_start_time`
220 and `place.close_stop_time`, which are used in macro function `PLACE_CLOSED`.
221 
222 Unlike other measures, place closure does not affect infectiousness and
223 susceptibility functions in `CalcInfSusc.cpp`, but it does affect infectiousness
224 and susceptibility indirectly in `InfectSweep` function in `Update.cpp` with
225 calls to `PLACE_CLOSED`. If person has their places closed, their household
226 infectiousness is scaled by `P.PlaceCloseHouseholdRelContact`. Similarly, infected
227 people’s spatial infectiousness also scaled by `P.PlaceCloseSpatialRelContact`,
228 and potential infectee’s susceptibility to spatial infections is also scaled by
229 `P.PlaceCloseSpatialRelContact`. Further, infected people cannot infect anyone
230 in their place (and therefore have zero Place infectiousness) when their place
231 is closed.
232 
233 Like social distancing, place closure can occur intermittently if parameter
234 `P.DoPlaceCloseOnceOnly` set to 0.