ConstantPopProcess#

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

Bases: BaseConstantPopProcess

A component to handle the birth events in a model with constant population - that is, births == deaths.

model#

The model instance containing population and parameters.

verbose#

Flag to enable verbose output. Default is False.

Type:

bool

initializers#

List of initializers to be called on birth events.

Type:

list

metrics#

DataFrame to holding timing metrics for initializers.

Type:

DataFrame

Initialize the Births component.

Parameters:
  • model (BaseLaserModel) – The model object which must have a population attribute.

  • verbose (bool) – If True, enables verbose output. Defaults to False.

  • params (BaseConstantPopParams | None) – Component parameters. If None, uses model.params.

__call__(model, tick)[source]#

Adds new agents to each patch based on expected daily births calculated from CBR. Calls each of the registered initializers for the newborns.

Parameters:
  • model – The simulation model containing patches, population, and parameters.

  • tick – The current time step in the simulation.

Return type:

None

Returns:

None

This method performs the following steps:

  1. Draw a random set of indices, or size size “number of births” from the population,