Agent-based simulation of emergent spatial segregation from individual preferences
Parameters
Number of groups
?
Population Groups
The number of distinct populations. Each group has
its own colour and agents prefer neighbours of their own group. More groups create more complex
dynamics.
2
Tolerance threshold
?
Tolerance Threshold
Minimum fraction of similar neighbours required
for satisfaction. At 0.3, agents tolerate up to 70% different neighbours. Schelling's key insight:
even mild preferences (0.3) produce strong segregation.
0.30
Neighbourhood radius
?
Neighbourhood Radius
How far agents look when assessing neighbours.
Radius 1 = immediate 8 neighbours (Moore neighbourhood). Larger radii mean agents consider a wider
area when deciding satisfaction.
1
Empty cells
?
Vacancy Rate
Percentage of cells left empty. Empty cells provide
space for relocation. Local movement mode requires higher vacancy (~25–35%) to avoid gridlock.
15%
Grid size
Movement
Local movement only
?
Local Movement
When enabled, unhappy agents can only relocate to an
adjacent empty cell (one step away), rather than anywhere on the grid. More realistic but requires
higher vacancy to avoid gridlock.
Simulation
Speed10 fps
Ready
Step 0
Metrics
Segregation Index
?
Segregation Index
Average fraction of same-type neighbours across
all agents (0–1). Higher = more segregated. Calculated using the neighbourhood radius. Random
placement yields ~1/N for N equal groups.
0.00
Unhappy Agents
?
Unhappy Agents
Agents whose same-type neighbour fraction falls below
tolerance. These will attempt to relocate. Zero = equilibrium reached.
0
Stuck Agents
?
Stuck Agents
Unhappy agents that couldn't find an empty cell to move
to (local movement mode only). High numbers = gridlock. Try increasing vacancy.
0
Population by Group
About the Schelling Model
The Schelling segregation model, developed by economist Thomas Schelling in 1971, simulates
how individual preferences about neighbours can lead to large-scale residential segregation, even when those
preferences are relatively mild.
Each cell represents a location occupied by an agent from one of several groups (e.g., different racial,
ethnic, or political communities) or left empty. Agents evaluate satisfaction based on their neighbourhood
composition.
How It Works
Each step, every agent checks what fraction of neighbours (within their neighbourhood radius) belong to the
same group. If below their tolerance threshold, the agent becomes "unhappy" and attempts to
relocate.
Movement Modes
Global movement (default): Unhappy agents can relocate to any empty cell. Faster equilibration
but less realistic.
Local movement: Agents can only move to an immediately adjacent empty cell. More realistic but
requires higher vacancy to avoid gridlock.
Neighbourhood Radius
Controls how far agents look when assessing their surroundings. Radius 1 = immediate 8 neighbours (Moore
neighbourhood). Larger radii mean agents evaluate wider areas, producing different segregation dynamics.
Key Insight
Even when agents are tolerant—satisfied with only 30% same-type neighbours—collective dynamics still produce
highly segregated patterns. Macro-level segregation emerges from micro-level preferences that
aren't strongly exclusionary.
What to Explore
Tolerance: Compare 0.3 vs 0.5 vs 0.7
Groups: Multi-group dynamics differ from binary
Neighbourhood radius: Larger radii can slow or change patterns
Local movement: More realistic but slower
Vacancy: Local mode needs ~25–35%
Reference
Schelling, T.C. (1971). Dynamic models of segregation. Journal of Mathematical Sociology, 1(2),
143–186.