Modelling contacts and transitions in the SIR epidemics model