Skip to content

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

A class to represent the biweekly model.

Args:

1
2
3
scenario (BaseScenario): A scenario containing the scenario data, including population, latitude, and longitude.
params (BiweeklyParams): A set of parameters for the model.
name (str, optional): The name of the model. Defaults to "biweekly".

Notes:

1
2
3
4
5
6
7
This class initializes the model with the given scenario and parameters. The scenario must include the following columns:

    - `id` (string): The name of the patch or location.
    - `pop` (integer): The population count for the patch.
    - `lat` (float degrees): The latitude of the patches (e.g., from geographic or population centroid).
    - `lon` (float degrees): The longitude of the patches (e.g., from geographic or population centroid).
    - `mcv1` (float): The MCV1 coverage for the patches.

Initialize the disease model with the given scenario and parameters.

Args:

1
2
3
scenario (BaseScenario): A scenario containing the scenario data, including population, latitude, and longitude.
params (BiweeklyParams): A set of parameters for the model, including seed, nticks, k, a, b, c, max_frac, cbr, verbose, and pyramid_file.
name (str, optional): The name of the model. Defaults to "biweekly".

Returns:

1
None

laser.measles.biweekly.model.BiweeklyModel.__call__(model, tick)

Updates the model for the next tick.

Args:

1
2
model: The model containing the patches and their populations.
tick (int): The current time step or tick.

Returns:

1
None

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