Personal Projects

Covid Simulator

Covid Simulator

Work
Processing, SIR Modelling, Algorithmic Modelling, Simulation
A Processing simulation to represent the ways an epidemic spreads and how the spread is effected by certain protective measures.

The Process

This Covid-19 simulator uses SIR modelling (read more), a compartmental model from which many other models are derived. The S stands for the number of individuals who are susceptible to the illness, the I stands for the number of individuals who are infectious, and the R stands for the number of individuals who have been removed. Being removed means that individual has already contracted the illness and cannot contract it again (basically, it's a nice way to say either recovered or died.)

I used this model, along with an OOP (Object-Oriented Programming) approach to develop this simulation.

After creating the basic simulation, in which individuals move around randomly, I decided to implement simulations in which certain specific changes were integrated to determine how helpful preventative measures are.

I began by creating a simulation in which everybody is wearing masks - essentially, I lowered the likelihood of contracting the illness.

I then created a simulation in which individuals had incentive to visit some central location, be it a mall, a supermarket, or something of the sort.

Next, I created a simulation in which individuals actively tried to stay away from one another (social distancing.)

Finally, I tried to lower the contraction rate to a minimum by creating a simulation in which individuals wore masks as well as social distances.

The results are all posted below.

The Results

At the end of each simulation, the program displays the rate of contraction and the number of infected/safe individuals. This is useful because it allowed me empirically compare each simulation to see which one was the safest:

A: No preventative measures: 77.72% contraction rate

B: Wearing a mask: 66.42% contraction rate

C: Visiting a central location: 88.29% contraction rate

D: Social distancing: 70.12% contraction rate

E: Wearing a mask and social distancing: 36.85% contraction rate

These numbers are certainly not final; there is an element of chance in these simulations, and the results can vary. However, it's very unlikely that the basic simulation will ever reach a contraction rate as low as simulation E did.

In short, the program's results urge you to wear masks and social distance!

Other Projects