The Disease Model

This module contains a state machine driver for disease models. Its primary function is to provide coordination across a set of disease states and transitions at simulation initialization and during transitions.

exception vivarium_public_health.disease.model.DiseaseModelError[source]
class vivarium_public_health.disease.model.DiseaseModel(cause, initial_state=None, get_data_functions=None, cause_type='cause', **kwargs)[source]
Parameters:
property columns_created: List[str]

Provides names of columns created by the component.

Returns:

Names of the columns created by this component, or an empty list if none.

Return type:

List[str]

property columns_required: List[str] | None

Provides names of columns required by the component.

Returns:

Names of required columns not created by this component. An empty list means all available columns are needed. None means no additional columns are necessary.

Return type:

Optional[List[str]]

property initialization_requirements: Dict[str, List[str]]

Provides the names of all values required by this component during simulant initialization.

Returns:

A dictionary containing the additional requirements of this component during simulant initialization. An omitted key or an empty list for a key implies no requirements for that key during initialization.

Return type:

Dict[str, List[str]]

property state_names: List[str]
property transition_names: List[TransitionString]
setup(builder)[source]

Perform this component’s setup.

Parameters:

builder (Builder) –

Return type:

None

load_cause_specific_mortality_rate_data(builder)[source]
on_initialize_simulants(pop_data)[source]

Method that vivarium will run during simulant initialization.

This method is intended to be overridden by subclasses if there are operations they need to perform specifically during the simulant initialization phase.

Parameters:

pop_data (SimulantData) – The data associated with the simulants being initialized.

Return type:

None

on_time_step(event)[source]

Method that vivarium will run during the time_step event.

This method is intended to be overridden by subclasses if there are operations they need to perform specifically during the time_step event.

Parameters:

event (Event) – The event object associated with the time_step event.

Return type:

None

on_time_step_cleanup(event)[source]

Method that vivarium will run during the time_step__cleanup event.

This method is intended to be overridden by subclasses if there are operations they need to perform specifically during the time_step__cleanup event.

Parameters:

event (Event) – The event object associated with the time_step__cleanup event.

Return type:

None

adjust_cause_specific_mortality_rate(index, rate)[source]
get_state_weights(pop_index, prevalence_type)[source]
static assign_initial_status_to_simulants(simulants_df, state_names, weights_bins, propensities)[source]