InfectionProcess#

class InfectionProcess(model, verbose=False, params=None)[source]#

Bases: BaseInfectionProcess

Component for simulating the spread of infection in the model.

This class implements a stochastic infection process that models disease transmission between different population groups. It uses a seasonally-adjusted transmission rate and accounts for mixing between different population groups.

The infection process follows these steps:

  1. Calculates expected new infections based on:

    • Base transmission rate (beta)

    • Seasonal variation

    • Population mixing matrix

    • Current number of infected individuals

  2. Converts expected infections to probabilities

  3. Samples actual new infections from a binomial distribution

  4. Updates population states:

    • Moves current infected to recovered (configurable recovery period)

    • Adds new infections to infected population

    • Removes new infections from susceptible population

Parameters:
  • model (BaseLaserModel) – The simulation model containing population states and parameters

  • verbose (bool) – Whether to print detailed information during execution

  • params (InfectionParams | None) – Component-specific parameters. If None, will use default parameters

Notes

The infection process uses a configurable recovery period and seasonal transmission rate that varies sinusoidally over time.

Initialize the component.

Parameters:
  • model (BaseLaserModel) – The model instance this component belongs to.

  • verbose (bool) – Whether to enable verbose output. Defaults to False.

__call__(model, tick)[source]#

Execute component logic for a given simulation tick.

Parameters:
  • model (BaseLaserModel) – The model instance.

  • tick (int) – The current simulation tick.

Return type:

None