tracts.demography.parametrized_demography.ContinuousEvent#

class ContinuousEvent(start_parameter, end_parameter, rate_parameter, source_population)#

Bases: BaseMigrationEvent

A class representing a continuous migration event, parametrized by start time, end time, and rate.

start_parameter#

The name of the parameter defining the start time of the continuous migration.

Type:

str

end_parameter#

The name of the parameter defining the end time of the continuous migration.

Type:

str

rate_parameter#

The name of the parameter defining the rate of the continuous migration.

Type:

str

source_population#

The name of the source population for the continuous migration.

Type:

str

__init__(start_parameter, end_parameter, rate_parameter, source_population)#

Initializes a ContinuousEvent object.

Parameters:
  • start_parameter (str) – The name of the parameter defining the start time of the continuous migration.

  • end_parameter (str) – The name of the parameter defining the end time of the continuous migration.

  • rate_parameter (str) – The name of the parameter defining the rate of the continuous migration.

  • source_population (str) – The name of the source population for the continuous migration.

execute(parametrized_demography, migration_matrix, params)#

Adds the continuous migration event to the migration matrix.

Parameters:
  • parametrized_demography (ParametrizedDemography) – The parametrized demographic model.

  • migration_matrix (ndarray) – The migration matrix to update.

  • params (list[float]) – The list of parameter values.