Assignment #08: Pydemic - second wave
Assignment #08: Pydemic - second wave#
Pydemic is a simple agent-based model of a pandemic.
We already used it for the previous assignment.
Warning
I changed parts of the code since the last version of pydemic to make the tool a bit more realistic, and I also standardized the output (it is now an xarray
dataset). Your code from last week may need to be adapted if you want to carry it over to this new version (not necessary).
This time, we want to illustrate how to use inheritance in OOP. Your task is to develop a child class of NaiveAgent
called PolicyAwareAgent
. These agents behave much like NaiveAgents
, with one exception: they can go into quarantine. After a given incubation time (say 3 days) during which the agents are contagious but unaware that they are sick, the agents will go into quarantine and therefore are out of the domain and do not pose a risk to the other agents.
Other possible enhancements:
PolicyAwareAgents
are aware of the number of contagious agents at a given time and decide to quarantine themselves when the infection rate is highthe simulation is a mix of
NaiveAgents
andPolicyAwareAgents
hospitals have a capacity limit, above which the mortality rate doubles
etc.