Case study: Epidemics - Susceptible-Infected-Removed Model
==========================================================

The Susceptible-Infected-Removed (SIR) model is an early (1927) model
for the spread of diseases like the plague or cholera in a population.
The model assumes that initially, almost everyone in the population is
not infected but *susceptible* to infection and only a very small
fraction of the population is *infected.* Infected people recover from
their illness after a certain time and are then part of the group of
*recovered* class.

Mathematically, we can model this as a set of three differential
equations


where :math:`$\beta$` is the transmission rate (it encompasses
the encounter rate and the probability of infection) and where
:math:`$\gamma$` is the recovery rate.

The mathematical approach has three problematic assumptions:

-  that the population is homogeneous,

-  that everyone is equally well connected to everyone else,

-  that connections between parts of the population are static, that is
   to say, do not change with time.

These assumptions, however, are too general if we wish to have any
amount of detail from our model. It is clear that we are in contact more
with certain people than with others, and that these contact frequencies
change, thus a simple static connection graph does not present us with a
means to model certain diseases adequately.

In an **agent-based approach**, we can specify the behaviour of
every agent in a more natural way, by defining how every individual
agent behaves.

::

    for every timestep:
        if SUSCEPTIBLE:
            for each infected neighbour: 
                become infected at a certain probability
        else if INFECTED:
            wait until recovery happens a few days later  