event_coordinator
VectorCounter
Defines the sampling parameters for a VectorSurveillanceEventCoordinator. Specifies which vector species and gender to sample, how many to sample, how often, and what statistic to compute from the sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
species
|
(str, required)
|
The name of the vector species to sample. Must match a species added via
|
required |
sample_size_distribution
|
(BaseDistribution, required)
|
The distribution used to determine the number of vectors in the sample for
each sampling event. If the population is smaller than the drawn sample size,
the entire population is selected.
Use any distribution class from
Distributions:
|
required |
count_type
|
(Union[VectorCountType, str], required)
|
The attribute to count in the sampled mosquitoes. Use the VectorCountType enum values:
|
required |
gender
|
(Union[VectorGender, str], required)
|
The sex of the vectors to sample. Use the VectorGender enum values:
|
required |
update_period
|
(float, required)
|
The number of days between sampling events. If sampled on day 1 with a period of 30, the next sample is taken on day 31. Minimum value: 0 Maximum value: 999999. |
required |
Source code in emodpy_malaria/campaign/event_coordinator.py
VectorSurveillanceEventCoordinator
Bases: BaseEventCoordinator
The VectorSurveillanceEventCoordinator monitors vector populations by periodically sampling vectors and computing statistics (allele frequencies or genome fractions). Unlike most event coordinators, it does not distribute interventions. Instead, it delegates response logic to an embedded Python script, dtk_vector_surveillance.py, which must be placed in the simulation working directory.
Sampling is controlled by coordinator-level trigger events: the coordinator begins
periodic sampling when an event from start_trigger_condition_list is received,
and stops when an event from stop_trigger_condition_list is received or
duration expires.
.. important::
The ``respond()`` function can return coordinator-level event names at
runtime. These events are determined dynamically and **cannot** be
auto-detected from the script. You must manually register any event
names that ``respond()`` might return in **Custom_Coordinator_Events**
in the simulation configuration. Failing to register them will cause
the simulation to fail at runtime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign
|
(campaign, required)
|
The campaign object. |
required |
counter
|
(VectorCounter, required)
|
Sampling configuration specifying which species and gender to sample, how many vectors to sample (via a distribution), how often to sample, and what statistic to compute. |
required |
survey_completed_event
|
str
|
Coordinator-level event broadcast every time the coordinator completes a survey of the vector population. Default value: None (no event broadcast) |
None
|
duration
|
float
|
The number of days the coordinator remains active after creation. After this many days, the coordinator unregisters and expires. A value of -1 keeps it running indefinitely. Minimum value: -1. Default value: -1. |
None
|
start_trigger_condition_list
|
(list[str], required)
|
A list of coordinator-level events that, when heard, start the coordinator's
periodic sampling at the interval specified by the counter's |
required |
stop_trigger_condition_list
|
list[str]
|
A list of coordinator events that, when heard, stop sampling and prevent the
responder from responding. The coordinator does not expire until |
None
|
coordinator_name
|
str
|
A descriptive name for this coordinator instance, useful in output reports
such as ReportCoordinatorEventRecorder.csv and
ReportSurveillanceEventRecorder.csv. EMOD does not enforce uniqueness.
Assign unique names to each coordinator to make it easy to route logic in
the |
None
|
Source code in emodpy_malaria/campaign/event_coordinator.py
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 | |