An SIRS epidemic on a random contact network, from the Python ABM lab. Infected agents lose health and can die, recovered agents stay immune for a while and then become susceptible again, and a small chance of infection from outside keeps the disease circulating. Susceptible agents watch their neighbours and isolate when too many are sick. Optuna searched for an infection that never dies out but returns in regular waves without wiping out the population; this is the winning setting, run offline and played back.


Infection, waning immunity and self-isolation on a contact network, tuned so the disease returns in regular waves. A recorded run.