👥 Crowd Evacuation

Evacuated: 0 / 0 Time: 0s ← Back
Social Force Model: each person is attracted toward the exit and repelled by the walls and other people. A narrow spot → a crush!

🚪 Evacuation — Crowd Simulation

Agents evacuate a room through narrow exits using social force dynamics. Watch bottlenecks form, the "faster-is-slower" effect emerge, and see how exit placement affects evacuation time.

🔬 What It Demonstrates

Social force model (Helbing & Molnár, 1995): agents feel repulsive forces from walls and other agents, while being attracted toward the nearest exit.

🎮 How to Use

Adjust agent count, desired speed and exit width. Watch the "faster-is-slower" paradox — higher desired speeds create more congestion at exits.

💡 Did You Know?

Dirk Helbing discovered that placing a column slightly before an exit actually speeds up evacuation — it breaks the arch-shaped clogging pattern. This counterintuitive finding now influences building design.

About this simulation

This simulation models how a crowd escapes a closed room through a single exit using the Social Force Model of Helbing and Molnár (1995). Each person is treated as a particle driven by an attractive force toward the door and exponential repulsive forces from walls and neighbours, plus a sharp contact force when bodies overlap. The result reproduces real crowd phenomena such as arch-shaped clogging at narrow openings and the counter-intuitive faster-is-slower effect, where pushing harder increases evacuation time.

🔬 What it shows

A 2D top-down room with one exit gap in the bottom wall. Every agent updates by summing a self-driving term toward the door, an A·exp((r−d)/B) social repulsion (A=2000, B=0.08) from walls and other people, and a stiff k·overlap contact term (k=120000). Velocity is capped near a desired speed, so jams and bottlenecks emerge purely from these local rules.

🎮 How to use

Press Evacuate to run the dynamics and again to pause; Reset rebuilds the room. The People slider sets the crowd size from 20 to 300, and Exit width adjusts the door gap from 1 to 5. The Panic button raises the desired speed by 1.8× and adds random jitter. Live readouts show evacuated count and elapsed time, with a small flow chart tracking escape progress.

💡 Did you know?

Helbing's simulations predicted that placing a column just in front of an exit can speed evacuation by breaking the symmetric clogging arch — a counter-intuitive result now studied in real building design.

Frequently asked questions

What is the Social Force Model?

It is a continuous model of pedestrian motion in which each person is a particle steered by virtual forces rather than explicit decisions. A driving force pulls them toward their goal (here, the exit), while repulsive forces keep them away from walls and other people. Introduced by Helbing and Molnár in 1995, it reproduces realistic lane formation, bottlenecks and crowd pressure.

What is the faster-is-slower effect?

It is the paradox that when people try to move faster, the crowd as a whole evacuates more slowly. Higher desired speeds increase the contact and friction forces at the exit, producing tighter clogs and intermittent flow. You can trigger it here with the Panic button, which boosts desired speed by 1.8× and adds random jitter, often raising the total evacuation time.

What do the People and Exit width sliders do?

The People slider sets how many agents start in the room, from 20 up to 300 in steps of 10, so you can compare sparse and dense crowds. The Exit width slider changes the size of the door gap from 1 to 5, scaling the actual opening in the bottom wall. Wider exits clear the room far faster because flow through a doorway scales roughly with its width.

Is this simulation physically accurate?

It captures the qualitative behaviour of the published Social Force Model, including clogging and the faster-is-slower effect, using the standard exponential repulsion and linear contact terms. However, it is a simplified 2D demonstration with tuned constants and a fixed time step, not a calibrated engineering tool. Real evacuation planning uses validated software and empirical flow data for life-safety decisions.

Why do bottlenecks and arches form at the exit?

As many agents converge on a single narrow opening, their mutual repulsion and contact forces balance into a stable arch around the doorway, much like grains jamming in a hopper. The arch periodically breaks and reforms, so people leave in bursts rather than a steady stream. Narrowing the exit makes these clogs more frequent and lengthens the overall evacuation time.