Skip to content

Agent based Covid-19 particle simulation using a SEIR-model.

Notifications You must be signed in to change notification settings

till2/particle_sim

Repository files navigation

Agent-Based Simulation of the COVID-19 Pandemic
using a SEIR-Model

A university project by Till Zemann & Ben Kampmann.
showcase Our Covid-19 Particle Simulator.

Report

You can find our our executive report in this repository if you want to learn more about our project.

How it works:

The infectious particles can infect healthy ("susceptible") particles. After an incubation period, they become infectious too. We use an SEIR model to simulate the pandemic:

  • S = Susceptible
  • E = Exposed (infected but not infectious)
  • I = Infectious
  • R = Recovered/Removed

timeline

How to run our code

  1. Start the demo.ipynb Notebook
  2. Set install_dependencies to True in the first code cell to install all necessary libraries. You can set it to False for all runs that you start after the first one.
# install all dependencies
install_dependencies = True # set to False after the first execution
  1. Set your experiment parameters, for example:
config = {
    "run_name": "my_experiment_1",
    "save_plots": True,
    "n_people": 500,
    "infection_prob": 0.3,
    "avg_incubation_time":500,
    "avg_infectious_time": 1000,
    "max_timestep": 8000,
    "start_seed": 1,
    "n_runs": 3,
    "speedup_factor": 5,
    "debug_mode": False,
    "FPS": 60,
}
  1. For the first time that you execute our code, you have to compute the heatmaps (because the 150MB file is too large for an upload to GitHub). To do that, just set use_precomputed_heatmaps to False (the calculation might take a few minutes). In all runs that you start afterwards, please set it to True so that you use the saved heatmap and don't have to calculate it again.
pf = Pathfinder(sim, use_precomputed_heatmaps=False) # set to True after the first execution

BibTeX Citation

In case our software is used for future projects, you can refer to the following citation.

@software{zemann_kampmann_particlesim,
  author = {Till Zemann and Ben Kampmann},
  title = {Agent-Based Simulation of the COVID-19 Pandemic using a SEIR-Model},
  howpublished = {\url{https://github.com/till2/particle_sim}},
  year = {2023},
}