laser.measles.components.base
laser.measles.components.base
laser.measles.components.base.BaseVitalDynamicsProcess(model, verbose=False, params=None)
Bases: BasePhase
Abstract base for vital-dynamics components (births, deaths, aging).
Subclasses handle population turnover during the per-timestep stage of the simulation. A vital-dynamics component must appear in the component list before any infection or transmission component so that the population counts are up-to-date when transmission is calculated.
Subclasses must implement both initialize (called once at the start of
model.run()) and calculate_capacity (called during model construction to
pre-allocate agent storage in
ABMModel).
Example:
1 2 3 4 5 6 7 8 9 10 11 | |
laser.measles.components.base.BaseVitalDynamicsProcess.calculate_capacity(model)
abstractmethod
Return the total agent capacity needed for the simulation.
Called during model construction to pre-allocate the people LaserFrame. The returned value should account for the initial population plus projected births over the full simulation duration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
BaseLaserModel
|
The simulation model instance. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Total number of agent slots to allocate. |
laser.measles.components.base.BaseVitalDynamicsProcess.initialize(model)
abstractmethod
Set up initial population structure for the model.
Called once at the beginning of model.run() before the first tick.
Implementations typically distribute agents across age groups and
vaccination states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
BaseLaserModel
|
The simulation model instance. |
required |