dime-worldbank / Disease-Modelling-SSA

This repository contains the code for an agent-based model used for COVID-19 in Sub-Saharan Africa. The original code was written in Python by Aivin Solatorio and is since being developed in Java. Complimentary risk modelling has been conducted in R as an intermediate product and is also part of this repo
MIT License
6 stars 2 forks source link

Make demography predetermine mortality at the first step of simulation rather than scheduling multiple times #31

Open RobertManningSmith opened 4 months ago

RobertManningSmith commented 4 months ago

Currently mortality is initially decided at the start of the year. Those who are determined to die do so, those that aren't have their mortality decided again once the next simulation year happens.

We could probably reduce the number of times this happens as follows:

1) Include a simulation length variable in the sim object say N days 2) At the start of the simulation do mortality calculations for each person for the time period that the simulation is being run. (I.e. say we run for 800 days, floor (800 / 365) = 2 (years). Calculate the probability of dying in the simulation for each person at age A as prob_dying(A) + prob_dying(A+1) to cover probability of death for both years) 3) Schedule death for some point in the simulation using existing structures