laser.measles.abm.components.process_importation
process_importation
Importation components: periodically introduce new infections into a population during simulation.
Classes:
| Name | Description |
|---|---|
ImportationParams |
Pydantic schema for configuring importation cadence, count, time window, and patch targets. |
InfectRandomAgentsProcess |
Periodically infects a random subset of agents drawn from anywhere in the population. |
InfectAgentsInPatchProcess |
Periodically infects a fixed number of agents in each patch listed in |
Both process classes share the same __init__(model, params: ImportationParams | None = None) signature; if params is omitted, values are read from model.params for backward compatibility.
ImportationParams
Bases: BaseModel
Parameters specific to the importation process components.
Examples:
1 2 3 | |
InfectAgentsInPatchProcess(model, params=None)
A component to update the infection timers of a population in a model.
Examples:
1 2 3 4 5 6 7 8 9 | |
Initialize an InfectAgentsInPatchProcess instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
ABMModel
|
The model object that contains the population. |
required |
params
|
ImportationParams | None
|
Optional importation configuration. When provided, this should
be an |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
model |
The model object that contains the population. |
Side Effects:
__call__(model, tick)
Updates the infection timers for the population in the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
The model containing the population data. |
required | |
tick
|
The current tick or time step in the simulation. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
plot(fig=None)
Nothing yet
InfectRandomAgentsProcess(model, params=None)
A component to update the infection timers of a population in a model.
Examples:
1 2 3 4 5 6 7 8 9 | |
Initialize an InfectRandomAgentsProcess instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
ABMModel
|
The model object that contains the population. |
required |
params
|
ImportationParams | None
|
Optional importation configuration. If provided, this should be an
|
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
model |
The model object that contains the population. |
Side Effects:
__call__(model, tick)
Updates the infection timers for the population in the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
The model containing the population data. |
required | |
tick
|
The current tick or time step in the simulation. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
plot(fig=None)
Nothing yet