Disease Spread Simulation

The following canvas simulates how a disease spreads through a population.
The simulation is based on the SIR Model.

In the model, the population, represented by the dots on the canvas is divided into susceptible of being infected (the yellow dots), infectious (the reds), and recovered from the disease (the green ones).

The settable parameters are the population size - between 3 and 300, the probability of being infected, the recovery time, and the speed at which the dots move - the higher the speed, the higher the number of collisions between the dots, and the faster the disease spreads. The disease is spread by the infectious by the collision with a susceptible. Once recovered, one cannot be affected again by the disease.
The simulation starts with one infectious and all the others susceptible.

New features, bug fixes, and better style will be released soon, stay tuned!
Source code available at this link.

Parameters