infectious
laser.cholera.metapop.infectious
¶
Infectious compartment — symptomatic and asymptomatic cholera cases, plus disease mortality.
Owns four state vectors:
model.people.Isym— symptomatic infectious population.model.people.Iasym— asymptomatic infectious population.model.patches.disease_deaths— per-tick deaths from disease.model.patches.new_symptomatic— per-tick incident symptomatic cases.model.patches.reported_cases/reported_deaths— observed counts (subject to under-reporting viarho,rho_deaths, and thechi_endemic/chi_epidemichealthcare-access modifier).
On each tick the component:
- Applies non-disease mortality (
d_jt) to bothIsymandIasym. - Computes a per-patch
mu_jtdisease-mortality rate that blends a baseline, a tick-linear slope, and an epidemic-factor multiplier gated on whetherIsym / Nexceededepidemic_thresholdat the reporting-lag tick. - Samples disease deaths and recoveries (
gamma_1for symptomatic,gamma_2for asymptomatic). - Progresses individuals out of
Eaccording toiota, splitting them into symptomatic (sigma) and asymptomatic (1 - sigma). - Updates the lagged
reported_casesandreported_deathsseries.
Force-of-infection — both human-to-human and environment-to-human — is
handled by the dedicated components downstream
(HumanToHuman,
EnvToHuman); this
component focuses on the within-compartment dynamics.
Infectious
¶
Infectious compartment: tracks Isym(t), Iasym(t), disease deaths, and reported cases.
Attributes:
| Name | Type | Description |
|---|---|---|
model |
The parent |
Source code in src/laser/cholera/metapop/infectious.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | |
__init__
¶
Allocate Isym / Iasym and the disease-deaths / reporting bookkeeping vectors.
Splits params.I_j_initial into symptomatic and asymptomatic
seed populations using the symptomatic fraction params.sigma.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
The |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
When |
ValueError
|
When a required |
Source code in src/laser/cholera/metapop/infectious.py
check
¶
Validate every parameter and prerequisite attribute used by __call__.
Asserts that model.people.R exists (so recovery can route into
it) and that params contains d_jt, mu_j_baseline,
mu_j_slope, mu_j_epidemic_factor, epidemic_threshold,
gamma_1, gamma_2, iota, sigma, rho, and rho_deaths.
Raises:
| Type | Description |
|---|---|
AttributeError
|
When |
ValueError
|
When any of the required |
Source code in src/laser/cholera/metapop/infectious.py
__call__
¶
Advance Isym / Iasym one tick: deaths, recoveries, then E -> I progression.
For each patch and within each of Isym and Iasym:
- Carry forward; subtract non-disease deaths (
d_jt). - For
Isymonly: computemu_jt = mu_baseline * (1 + slope * t_factor) * (1 + epidemic_factor * epidemic_flag), sample disease deaths fromBinomial(Isym, 1 - exp(-mu_jt)), and updatepatches.disease_deathsand laggedreported_deaths. - Sample recoveries (
gamma_1for symptomatic,gamma_2for asymptomatic) and add toR[tick + 1]. - Sample
E -> Iprogression fromBinomial(E_next, 1 - exp(-iota)), split bysigma, and add intoIsym/Iasym. - Update lagged
reported_casesusingrhoand thechi_endemic/chi_epidemichealthcare-access modifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
The parent |
required |
tick
|
int
|
Current simulation tick. |
required |
Raises:
| Type | Description |
|---|---|
AssertionError
|
When any compartment goes negative after a draw (indicates the implementation's invariants have regressed). |
Source code in src/laser/cholera/metapop/infectious.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
plot
¶
Yield four Matplotlib figures: symptomatic, asymptomatic, total, and reported-vs-actual cases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fig
|
Figure | None
|
Optional existing Matplotlib |
None
|
Yields:
| Type | Description |
|---|---|
str
|
Four labels in order: |
str
|
|
str
|
|