Skip to content

A simple Python/Mesa model of COVID-19 contagion and possible measures

License

Notifications You must be signed in to change notification settings

ncsa/COVID19-mesa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COVID19-mesa

Authors

Santiago Nunez-Corrales, Informatics and NCSA, UIUC ([email protected])

Eric Jakobsson, Molecular and Cell Biology and NCSA, UIUC ([email protected])

Developers

  • Angelo Santos
  • Boda Song
  • Xinyi Huang

A simple simulation to explore contagion by COVID-19 via agent-based modeling (ABM), as well as potential effectiveness of various measures.

This software is under development rapidly to attempt to respond to the current situation, and should be used bearing this in mind. Any scenarios for specific communities should be considered provisional at all times and revised constantly against the most recent and best curated field evidence.

Reference publication:

Núñez-Corrales, S., & Jakobsson, E. (2020). The Epidemiology Workbench: a Tool for Communities to Strategize in Response to COVID-19 and other Infectious Diseases. medRxiv.

Installation (Linux and friends)

  1. Clone the repository:
git clone https://github.com/snunezcr/COVID19-mesa.git
  1. Create, and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate
  1. Update pip
pip install --upgrade pip
  1. Install dependencies
pip install -r requirements.txt

Execution

The following requires activating the Python virtual environment of your COVID19-mesa install if it is not previously active:

source .venv/bin/activate

To execute the dashboard interface:

(.venv) python covidserver.py scenarios/[variant_data_filename]

To execute a scenario stored in scenarios/:

(.venv) python model_runner.py [processors] scenarios/[filename]

After execution, a CSV file will be stored.

Model features

  • JSON configurable
  • Single-run visual dashboard for a selection of variables of interest
  • Batch execution of models with graphic reporting and multiprocessing
  • Models
    • Demographic (age/sex distribution/mortality)
    • Epidemiological (extension of SEIR), including R(t)
    • Policy measures including
      • Shelter at home
      • Social distancing based on latest findings (8-feet aerosol spread)
      • Testing based on random resampling of not-infected parts of the population
      • Testing based on contact tracing
    • Simple micro/macro input-output matrix economic response [experimental]
    • Simple pandemic-driven unemployment trends

Model callibration protocol

Model callibration requires the best possible clinical data estimates for two parameters: the average incubation time and proportion of asyomptomatic patients:

  • For the average incubation time, hospital triaging of COVID-19 cases can provide information leading to estimates. Incubation time is likely to be blurred by multiple confusion variables captured in our model as a Poisson distribution. Despite its stochasticity, the model supposes that large population sizes group tightly towards a mean value. This assumption may need to be revised retrospectively later.
  • For the proportion of asymptomatics, contact tracing and structured testing can provide specific local information.

Suggested callibration steps

  1. Adjust grid size based on fixed population density until R0 matches the best known value for the area in the first days of the model (steps = 96) and > 30 runs. Population density in the model loosely includes average mobility patterns, and cell sizes reflect the distance traversed every 15 minutes. Also -but not recommended- the probability of contagion may be used to callibrate. This may imply unknown population conditions and should be used only to test hypotheses about individual variations that manifest in the ability of COVID-19 to spread.
  2. Execute the model to the point where the number of symptomatic agents corresponds to one representative agent. For example, with an ABM of 1000 agents and a population of 100k individuals, the critical infected agent-to-population ratio is 1:100. Use the point in time rounded to the nearest integer day as point of departure for policy measures. In practice, this implies executing the model in excess of three days the incubation period.
  3. If policy measures have been introduced mandatorily, use date above as the reference point for their introduction.

Scenario creation

To develop scenarios, we strongly recommend starting from the most recently callibrated model that includes policies as well as usin a model without measures as a basis for counterfactual arguments.

Acknowledgments

The following individuals have contributed directly and indirectly to rapid development of this software package.

About

A simple Python/Mesa model of COVID-19 contagion and possible measures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published