Advanced topics¶
Here we describe how the multi-state life tables (MSLT) components are implemented.
Note that when you run a simulation using the simulate command:
simulate run reduce_acmr.yaml
The following sequence of operations will be performed:
The model specification will be read (in this case, from the file
reduce_acmr.yaml) and a simulation object will be created.The
simulation.setup()method will call thesetup()method for each of the MSLT components defined in the model specification.Note
This is where components will load data tables, register event handlers, etc.
The initial population is created (typically by the
BasePopulationcomponent).The time-steps will be simulated, with each time-step triggering the following events in turn:
"time_step__prepare": TheDelayedRiskcomponent uses this event to account for transitions between exposure categories (i.e., uptake, cessation, and transitions between tunnel states). TheDiseasecomponent uses this event to update disease prevalence and mortality for both the BAU and intervention scenarios, so that mortality and morbidity adjustments can be calculated. TheTobaccoEradicationcomponent uses this event to move current smokers to the 0 years post-cessation exposure category when tobacco is eradicated."time_step": TheBasePopulationcomponent uses this event to remove cohorts once they’ve reached the maximum age (110 years). TheMortalitycomponent uses this event to calculate the number of deaths and survivors at each time-step. TheDisabilitycomponent uses this event to calculate the HALYs for each cohort for both the BAU and intervention scenarios."time_step__cleanup": no MSLT components respond to this event."collect_metrics": the observer components will record relevant population details at the end of each time-step.
The simulation will trigger the
"simulation_end"event and finish. The observer components use this event to write output tables to disk.
Model analysis
Writing your own MSLT components