Schelling's Segregation Model (1971)
Developed by economist Thomas Schelling, this classic agent-based model demonstrates how macroscopic segregation can emerge from very mild local preferences.
There are two groups (Cyan @ and Green @). Empty spaces are dots (.). Each agent wants a minimum percentage of its neighbors to be of the same group. If that threshold isn't met, the agent is "unhappy" and moves to a random empty spot.
Even with a low preference (e.g., only needing 35% of neighbors to be similar), the grid rapidly self-organizes into highly segregated, stark borders. Here, the threshold is 40%.