Skip to content

laser.measles.abm.components.tracker_age_pyramid

laser.measles.abm.components.tracker_age_pyramid

Age Pyramid Tracker

This component tracks the age distribution of the population.

laser.measles.abm.components.tracker_age_pyramid.AgePyramidTracker(model, verbose=False, params=None)

Bases: BasePhase

Track the age distribution of the population.

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.AgePyramidTracker, components.AgePyramidTrackerParams()))
```

laser.measles.abm.components.tracker_age_pyramid.AgePyramidTrackerParams

Bases: BaseModel

Parameters for the age-pyramid tracker (recording frequency and age bins).

Example:

1
2
3
4
5
```python
from laser.measles.abm.components.tracker_age_pyramid import AgePyramidTrackerParams

params = AgePyramidTrackerParams()
```

laser.measles.abm.components.tracker_age_pyramid.AgePyramidTrackerParams.validate_age_bins(v)

Validate that age_bins are in strictly increasing order.

laser.measles.abm.components.tracker_age_pyramid.AgePyramidTrackerParams.validate_frequency(v)

Validate that frequency is one of yearly, monthly, or daily.