Skip to content

laser.generic.importation

laser.generic.importation

This module defines Importation classes, which provide methods to import cases into a population during simulation.

laser.generic.importation.Infect_Agents_In_Patch(model, verbose=False)

A LASER model component that introduces infections into specific patches of the population at regular intervals. This is useful for modeling geographically targeted importations or outbreaks.

Initialize an Infect_Agents_In_Patch instance.

Parameters:

Name Type Description Default
model object

The LASER model object that contains the population, patches, and parameters. The following attributes must exist or may optionally exist in model.params: - importation_period (int): Number of ticks between infection events. - importation_count (int, optional): Number of agents to infect per patch per event. Defaults to 1 if not provided. - importation_patchlist (array-like of int, optional): Indices of patches where infections will be seeded. Defaults to all patches if not provided. - importation_start (int, optional): First tick to apply infections. Defaults to 0 if not provided. - importation_end (int, optional): Last tick to apply infections. Defaults to nticks if not provided. - nticks (int): Total number of ticks in the simulation.

required
verbose bool

If True, enables verbose output. Defaults to False.

False

Attributes:

Name Type Description
model object

The LASER model used by this component.

period int

Number of ticks between infection events.

count int

Number of agents infected per patch at each event.

patchlist ndarray

List of patch indices to target with infections.

start int

First tick to apply infections.

end int

Last tick to apply infections.

laser.generic.importation.Infect_Agents_In_Patch.__call__(model, tick)

Introduce infections into the specified patches at the given tick.

Infections are seeded if
  • The current tick is greater than or equal to start.
  • The tick falls on a multiple of period (relative to start).
  • The tick is less than end.

At each eligible tick, every patch in patchlist receives count infections via seed_infections_in_patch.

Parameters:

Name Type Description Default
model object

The LASER model containing the population and patches.

required
tick int

The current tick (time step) of the simulation.

required

Returns:

Type Description
None

None

laser.generic.importation.Infect_Agents_In_Patch.plot(fig=None)

Placeholder for visualization of targeted patch infections.

Parameters:

Name Type Description Default
fig Figure

A matplotlib Figure to plot into. If None, no plot is generated.

None

Returns:

Type Description
Any

None

laser.generic.importation.Infect_Random_Agents(model, verbose=False)

A LASER model component that introduces random infections into the population at regular intervals. This is typically used to simulate importation events or background infection pressure.

Initialize an Infect_Random_Agents instance.

Parameters:

Name Type Description Default
model object

The LASER model object that contains the population, patches, and parameters. The following attributes must exist in model.params: - importation_period (int): Number of ticks between each infection event. - importation_count (int): Number of agents to infect per event. - nticks (int): Total number of ticks in the simulation. - importation_start (int, optional): First tick to introduce infections. Defaults to 0 if not provided. - importation_end (int, optional): Last tick to introduce infections. Defaults to nticks if not provided.

required
verbose bool

If True, enables verbose output. Defaults to False.

False

Attributes:

Name Type Description
model object

The LASER model object used by the component.

period int

Number of ticks between infection events.

count int

Number of agents infected at each event.

start int

First tick to apply infections.

end int

Last tick to apply infections.

laser.generic.importation.Infect_Random_Agents.__call__(model, tick)

Introduce random infections into the population at the given tick.

Infections are seeded if
  • The current tick is greater than or equal to start.
  • The tick falls on a multiple of period (relative to start).
  • The tick is less than end.

This updates both the agent-level infections and, if present, the test arrays in model.patches for validation.

Parameters:

Name Type Description Default
model object

The LASER model containing the population and patches.

required
tick int

The current tick (time step) of the simulation.

required

Returns:

Type Description
None

None

laser.generic.importation.Infect_Random_Agents.plot(fig=None)

Placeholder for visualization of infection events.

Parameters:

Name Type Description Default
fig Figure

A matplotlib Figure to plot into. If None, no plot is generated.

None

Returns:

Type Description
Any

None