🦠 Disease Spread

S: 100% E: 0% I: 0% R: 0% R₀=0 ← Back
SEIR model: Susceptible → Exposed → Infectious → Recovered. Click on the field to infect, or vaccinate (Shift+click).

🦠 Disease Spread — Agent-Based Model

Individual agents move, interact and spread disease through a population. Watch epidemics emerge from spatial interactions, not just mathematical equations — each person is simulated individually.

🔬 What It Demonstrates

Agent-based modelling: each person has a state (susceptible, infected, recovered) and moves in 2D space. Infection spreads when susceptible and infected agents are close enough.

🎮 How to Use

Adjust infection radius, transmission probability and recovery time. Add barriers, quarantine zones or vaccination programs to see their effect on the epidemic curve.

💡 Did You Know?

Agent-based models are used by epidemiologists to simulate real epidemics. During COVID-19, the Imperial College model (by Neil Ferguson's team) simulated individual movements across entire countries.

About the SEIR Disease Spread Model

This simulation visualises an infectious disease sweeping through a population using the SEIR compartmental model, implemented on a grid of cells. Each cell is Susceptible, Exposed, Infectious, Recovered or Vaccinated. Rather than solving differential equations globally, the model advances spatially: at every step a susceptible cell can be infected by its eight neighbours with probability 1 − (1 − β/8)ⁿ, where n is the count of infectious neighbours.

The β slider sets the per-contact transmission rate, σ the incubation rate (how fast Exposed cells become Infectious), and γ the recovery rate. A vaccination slider seeds immune cells before the run, and you can click the field to infect a patch or Shift-click to vaccinate one. The live SEIR curve and estimated R₀ ≈ (β/γ)×8 show whether an outbreak grows or fizzles — the core question in real epidemic planning.

Frequently Asked Questions

What is the SEIR model?

SEIR is a compartmental epidemiology model that divides a population into four states: Susceptible, Exposed (infected but not yet contagious), Infectious, and Recovered. People flow S to E to I to R over time. This page adds a fifth Vaccinated state for cells made immune in advance.

How does this simulation actually spread the disease?

It uses a spatial grid, not a single equation. Each step, every Susceptible cell looks at its eight neighbours and becomes Exposed with probability 1 − (1 − β/8)ⁿ, where n is the number of infectious neighbours. This makes infection a local, contact-driven process that produces visible epidemic waves.

What do the β, σ and γ sliders control?

β (beta) is the transmission rate per infectious contact, σ (sigma) is the incubation rate that converts Exposed cells to Infectious, and γ (gamma) is the recovery rate moving Infectious cells to Recovered. Each step an Exposed cell becomes Infectious with probability σ, and an Infectious cell recovers with probability γ.

What is R₀ and how is it calculated here?

R₀, the basic reproduction number, is the average number of new infections one case causes in a fully susceptible population. The simulation estimates it as R₀ ≈ (β/γ)×8, reflecting the eight neighbouring contacts per cell. If R₀ is above 1 the epidemic grows; below 1 it dies out.

What does the vaccination slider do?

Before the run starts, the vaccination percentage randomly marks that share of cells as Vaccinated (immune). These cells cannot be infected, breaking chains of transmission. Raising it demonstrates herd immunity: above a threshold roughly equal to 1 − 1/R₀, the outbreak cannot sustain itself.

Can I interact with the outbreak directly?

Yes. Clicking on the field infects a small 3×3 patch of susceptible cells, letting you start new outbreaks anywhere. Shift-clicking vaccinates a larger 5×5 area, so you can build firebreaks or ring-vaccinate around an active cluster and watch the spread stall.

Why is there an Exposed stage between Susceptible and Infectious?

Many real diseases have a latent period: a newly infected person is not yet contagious. The Exposed compartment captures this delay, controlled by σ. A low σ means a long incubation, which slows the epidemic and separates infection from transmissibility — a key difference from the simpler SIR model.

Is this simulation physically accurate?

It is a faithful qualitative teaching model, not a forecasting tool. The compartments, flow structure and R₀ relationship mirror real epidemiology, but it assumes a fixed grid, uniform local mixing and stochastic transitions. Real models add age structure, travel networks, varying contact rates and demographic data.

Why does the epidemic curve form a wave that rises and falls?

Early on, many susceptibles surround each infectious cell, so cases grow rapidly. As susceptibles are used up and recovered cells accumulate, the effective reproduction number falls below 1 and new infections decline. The classic single-peaked epidemic curve is the result of this depletion of susceptibles.

How is this different from an agent-based model?

This page uses a cellular grid where each fixed cell holds a state and infection passes between adjacent cells. A true agent-based model gives each individual a position and movement. Both capture spatial spread, but agents can travel, whereas grid cells interact only with their immediate neighbours.

What real-world uses does compartmental modelling have?

Public health agencies use SIR and SEIR models to estimate R₀, project hospital demand, and assess interventions such as vaccination, isolation and lockdowns. During COVID-19, models of this family informed decisions about herd immunity thresholds and the timing of social-distancing measures.