quarantines.py¶
quarantines¶
Provides infrastructure to initialize and store quarantines policies.
__init__(self, qrnt_param, comm)
special
¶
Initialize quarantines.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters |
dict |
Parameters for the simulation. |
required |
comm |
community |
The community object. |
required |
Returns:
Type | Description |
---|---|
List |
List of the quarantine objects. |
Source code in
13 14 15 16 17 18 19 20 21 22 23 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 |
|
quarantine(self)
¶
Runs quarantines policies set on self.quarantines and checks if there isn't any particle violating a quarantine.
Source code in
74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
quarantine¶
This class stores the attributes for a quarantine policy and the methods for its progression.
Attributes:
Name | Type | Description |
---|---|---|
name |
str |
Name of the quarantine. |
id |
int |
Id of the quarantine (same as qrnt_state). |
filter_in |
str |
Parsed filter to select particles to start quarantine. |
filter_out |
str |
Parsed filter to select particles to end quarantine. |
delay |
float |
Delay between a particle is selected to start quarantine and when it is effectively started. |
qrnt_state |
int |
Marker to use in the population's quarantine_states for particles in this quarantine. |
placement |
int |
Placement for particles in this quarantine. |
service |
service |
If particles are put in a service in this quarantine this will point to the service. |
to_be_quarantined |
np.ndarray |
A mask to mark particles during the delay to enter quarantine. |
time_identified |
np.arry |
Time when a particle was identified to enter quarantine (used with delay). |
__call__(self)
special
¶
Runs methods related to this quarantine.
Source code in
150 151 152 153 154 |
|
__init__(self, qrnt_param, comm, srvc=None)
special
¶
Initialize a quarantine policy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qrnt_param |
dict |
Parameters related to the quarantine. |
required |
comm |
community |
The community object. |
required |
srvc |
service |
The service to quarantine particles. |
None |
Source code in
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 |
|
put_in(self)
¶
Evaluates filters and put selected particles in quarantine.
Source code in
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 |
|
release(self)
¶
Evaluates filters and release selected particles from quarantine.
Source code in
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 |
|
DIAGNOSTICS
¶
Diagnosed particles will quarantine at home 1 day after the diagnostic and stay quarantined for 14 days.
HOSPITALIZATION
¶
All symptomatic severe particles will imediatly be quarantined on Hospitals and stay quarantined until the particle recovers.
SYMPTOMS
¶
Symptomatic particles will stay home until they recover.
TRACING
¶
Particles with tracing capabilities (see tracing_percent) that had contact with diagnosed particles also with tracing capabilities in the last 5 days will be quarantined at home 1 day after they are identified and stay quarantined for 14 days.