laser.measles.biweekly.model
laser.measles.biweekly.model
A class to represent the biweekly model.
laser.measles.biweekly.model.BiweeklyModel(scenario, params, name='biweekly')
Bases: BaseLaserModel
Population-level measles model with 14-day (biweekly) timesteps.
Tracks SEIR compartment counts per patch without individual agents,
making it significantly faster than
ABMModel for large-scale parameter
sweeps and multi-country analyses. Choose this model when individual-level
detail is not required and computational speed is a priority. For daily
timesteps with explicit SEIR compartment dynamics, see
CompartmentalModel.
This is the first object created in the build model stage of the
researcher workflow. After construction, attach components with
add_component or
by setting the components property, then call model.run().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
DataFrame | BaseBiweeklyScenario
|
Metapopulation patch
data. Required columns: |
required |
params
|
BiweeklyParams
|
Simulation parameters including
|
required |
name
|
str
|
Display name for log messages. Defaults to
|
'biweekly'
|
Example:
1 2 3 4 5 6 7 8 | |
laser.measles.biweekly.model.BiweeklyModel.__call__(model, tick)
Updates the model for the next tick.
Args:
1 2 | |
Returns:
1 | |
laser.measles.biweekly.model.BiweeklyModel.infect(indices, num_infected)
Infects the given nodes with the given number of infected individuals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
indices
|
int | ndarray
|
The indices of the nodes to infect. |
required |
num_infected
|
int | ndarray
|
The number of infected individuals to infect. |
required |
laser.measles.biweekly.model.BiweeklyModel.recover(indices, num_recovered)
Recovers the given nodes with the given number of recovered individuals. Moves individuals from Infected to Recovered compartment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
indices
|
int | ndarray
|
The indices of the nodes to recover. |
required |
num_recovered
|
int | ndarray
|
The number of recovered individuals. |
required |