laser.measles.abm.components.process_infection_seeding
laser.measles.abm.components.process_infection_seeding
Component for seeding initial infections in the compartmental model.
This component allows initialization of infections in specific patches or automatically selects the largest patch by population for seeding.
laser.measles.abm.components.process_infection_seeding.InfectionSeedingParams
Bases: BaseModel
Parameters for the infection seeding component.
laser.measles.abm.components.process_infection_seeding.InfectionSeedingParams.validate_infections_per_patch(v, info)
classmethod
Validate that infections_per_patch matches target_patches length if both provided.
laser.measles.abm.components.process_infection_seeding.InfectionSeedingParams.validate_target_patches(v)
classmethod
Validate target_patches format.
laser.measles.abm.components.process_infection_seeding.InfectionSeedingProcess(model, verbose=False, params=None)
Bases: BaseComponent
Component for seeding initial infections in the compartmental model.
This component initializes infections by moving individuals from the Susceptible (S) compartment to the Infected (I) compartment. It can either:
- Automatically seed the patch with the largest population (default)
- Seed specific patches provided by the user
The seeding occurs during initialize() before the simulation begins.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
BaseLaserModel
|
The compartmental model instance. |
required |
verbose
|
bool
|
Whether to print verbose output during initialization. |
False
|
params
|
InfectionSeedingParams | None
|
Component-specific parameters. If None, uses default parameters. |
None
|
Example
.. code-block:: python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |