Skip to content

laser.measles.abm.components.process_wpp_vital_dynamics

laser.measles.abm.components.process_wpp_vital_dynamics

Inititializes the age distribution of the population and enforces age structure with age based mortality

laser.measles.abm.components.process_wpp_vital_dynamics.WPPVitalDynamicsParams

Bases: BaseModel

Parameters for WPP-based vital dynamics (country code and reference year).

Example:

1
2
3
4
5
```python
from laser.measles.abm.components.process_wpp_vital_dynamics import WPPVitalDynamicsParams

params = WPPVitalDynamicsParams()
```

laser.measles.abm.components.process_wpp_vital_dynamics.WPPVitalDynamicsProcess(model, verbose=False, params=None)

Bases: BasePhase

Vital dynamics using UN World Population Prospects data for age-specific birth and death rates.

Initialises the age distribution of the population and enforces age structure with age-based mortality throughout the simulation. This is an ABM-only component that belongs in the per-timestep stage and should be listed before transmission components.

Parameters:

Name Type Description Default
model

The ABM model instance.

required
verbose bool

Enable verbose logging.

False
params WPPVitalDynamicsParams | None

Country and year settings.

None

Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
```python
from laser.measles.scenarios.synthetic import single_patch_scenario
from laser.measles.abm import ABMModel, ABMParams
from laser.measles.abm import components
from laser.measles import create_component

scenario = single_patch_scenario(population=50_000, mcv1_coverage=0.85)
params = ABMParams(num_ticks=365, seed=42, start_time="2000-01")
model = ABMModel(scenario, params)
model.add_component(create_component(components.WPPVitalDynamicsProcess, components.WPPVitalDynamicsParams()))
```

laser.measles.abm.components.process_wpp_vital_dynamics.WPPVitalDynamicsProcess.calculate_capacity(model, buffer=0.05)

Estimate the agent-array capacity needed for the full simulation.

Parameters:

Name Type Description Default
model ABMModel

The ABM model instance.

required
buffer float

Fractional safety margin above the projected population.

0.05

laser.measles.abm.components.process_wpp_vital_dynamics.WPPVitalDynamicsProcess.calculate_wpp_total_pop(year)

Return the total WPP population for the given calendar year.