Assignment #07: Pydemic#
Pydemic is a simple agent-based model of a pandemic.
Agents are perfect to teach the basics of object-oriented programming. Note that I wrote the program with this goal in mind, not for performance or accuracy. I also just wrote the program in a few hours, so there is room for improvement. You are welcome to help me out!
Start by getting an overview of the model structure.
Sensitivity analyses: starting from the default parameter values, vary one parameter at a time and study the consequences for the temporal trajectory of the pandemic. Of particular relevance are the following: (i) agent density (number of agents per pixel), (ii) initial number of infected agents (is it possible to start a pandemic with a single infected individual? What are the settings that favor this?), (iii) agent mobility, (iv) probability of infection, (v) time until recover.
Add at least one functionality to the model. Ideas:
add a timer for immunity loss: agents loose their immunity after N days (this can be complexified by computing the probability of infection as a function of time since infection / vaccination).
add vaccination as a way to gain immunity
add a healthcare threshold: above a certain number of people in the hospital, the hospitalized patients are more likely to die.
add politics: when a certain contamination threshold is reached, impose a lockdown (reduce agent mobility).
etc.
You don’t have to add too many of these options (unless you have a lot of fun). Pydemic will keep us busy for the next couple of weeks, so take it easy!