Assignment #07: Pydemic
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 (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 new agent status: hospitalized. When an agent is hospitalized it is out of the domain and may die.
add a healthcare threshold, above which the hospitalized patients are more likely to die.
add politics: when a certain threshold is reached, impose a lockdown.
etc.
You don’t have to add too many of those (unless you have a lot of fun). Pydemic will keep us busy for the next couple of weeks, so take it easy!