BiweeklyModel#

class BiweeklyModel(scenario, params, name='biweekly')[source]#

Bases: BaseLaserModel

A class to represent the biweekly model.

Parameters:
  • scenario (BaseBiweeklyScenario | DataFrame) – A scenario containing the scenario data, including population, latitude, and longitude.

  • params (BiweeklyParams) – A set of parameters for the model.

  • name (str) – The name of the model. Defaults to “biweekly”.

Notes

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.

Parameters:
  • scenario (BaseBiweeklyScenario | DataFrame) – 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) – The name of the model. Defaults to “biweekly”.

Returns:

None

Attributes

ParamsType

ScenarioType

components

Retrieve the list of model components.

patches

Methods

scenario_wrapper_class#

alias of BaseBiweeklyScenario

__call__(model, tick)[source]#

Updates the model for the next tick.

Parameters:
  • model – The model containing the patches and their populations.

  • tick (int) – The current time step or tick.

Return type:

None

Returns:

None

infect(indices, num_infected)[source]#

Infects the given nodes with the given number of infected individuals.

Parameters:
  • indices (int | ndarray) – The indices of the nodes to infect.

  • num_infected (int | ndarray) – The number of infected individuals to infect.

Return type:

None

recover(indices, num_recovered)[source]#

Recovers the given nodes with the given number of recovered individuals. Moves individuals from Infected to Recovered compartment.

Parameters:
  • indices (int | ndarray) – The indices of the nodes to recover.

  • num_recovered (int | ndarray) – The number of recovered individuals.

Return type:

None