recovered
laser.cholera.metapop.recovered
¶
Recovered compartment — natural-immunity population that wanes back to susceptible.
Allocates model.people.R (shape (nticks + 1, npatches)), seeds it
from params.R_j_initial, and on each tick applies non-disease
mortality (d_jt) and waning immunity (epsilon). Waned individuals
are funneled directly into S[tick + 1]. Recovery inflows into R are
managed by Infectious
via the gamma_1 / gamma_2 rates.
Recovered
¶
Recovered compartment: tracks R_j(t) and lets natural immunity wane back to S.
Attributes:
| Name | Type | Description |
|---|---|---|
model |
The parent |
Source code in src/laser/cholera/metapop/recovered.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 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 | |
__init__
¶
Allocate the R state vector and seed it from R_j_initial.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
The |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
When |
ValueError
|
When |
Source code in src/laser/cholera/metapop/recovered.py
check
¶
Validate that S (waning destination), d_jt, and epsilon are available.
Raises:
| Type | Description |
|---|---|
AttributeError
|
When |
ValueError
|
When |
Source code in src/laser/cholera/metapop/recovered.py
__call__
¶
Advance R from tick to tick + 1: carry forward, subtract deaths, wane to S.
Waning is computed against the post-deaths cohort so dying-then- waning individuals are not counted twice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
The parent |
required |
tick
|
int
|
Current simulation tick. |
required |
Raises:
| Type | Description |
|---|---|
AssertionError
|
When the post-deaths-and-waning recovered population goes negative. |
Source code in src/laser/cholera/metapop/recovered.py
plot
¶
Yield one Matplotlib figure of R(t) for the ten largest patches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fig
|
Figure
|
Optional existing Matplotlib |
None
|
Yields:
| Type | Description |
|---|---|
str
|
The string label |