Skip to content

brayvid/epidemic-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

Epidemic Simulator

WARNING: This program is not a reliable source of epidemiological information.

Description:

Simulates a disease spreading through a community in random motion. Individuals are represented as points undergoing independent random walks in a bounded 2D environment. Parameters include: the population size, the average population density, the number of times to evolve the system, the number of trials to conduct, and the fraction of the available space that individuals will traverse each timestep (which amounts to their speed). After a randomly-chosen period of time within a given range, infected individuals either recover or die. The probability of death varies by age group:

Outputs:

  • One CSV file containing the expected population breakdown by category (Susceptible, Infected, Recovered, Deceased) at each timestep, as well as the observed reproduction number for that timestep.

  • One PNG file with two figures: a stackplot depicting the expected state of the population at each timestep, and a graph of the expected rate of change of infections (with error bounds of +/- one standard deviation).

Usage:

  1. Save your own copy of this notebook to your Google Drive (once in the Colab environment) by selecting File (next to Colab logo at top left) --> Save a copy in Drive.

  1. In the top right corner of the new window that appears, click Connect to allocate some of Google's computing resources.

  1. Edit the parameters in the section called User Inputs below if desired.

  1. Select Runtime (to the right of File) --> Run all.

  1. Repeat steps 3 and 4 as desired.

Sample output