flexelektro / schelling

A grid-based implementation of Schelling model of emergent segregation

Home Page:https://sleepokay.github.io/schelling/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Schelling Model of Racial Dynamics

alt tag

A grid-based implementation of the Schelling model of racial dynamics. The model illustrates how micromotives can lead to macrobehavior, in particular, how local preferences for neighbors similar to oneself can lead to segregation on a large scale.

The rules for the model are simple:

  • Iterate over the non-empty cells.
  • If the inhabitant of a cell is surrounded by a certain number of same-colored neighbors, the inhabitant is happy.
  • Otherwise, the inhabitant is unhappy, and we move them to an empty cell at random.
  • Repeat until we reach an equilibrium.

Play around here.

About

A grid-based implementation of Schelling model of emergent segregation

https://sleepokay.github.io/schelling/


Languages

Language:JavaScript 77.9%Language:HTML 16.4%Language:CSS 5.7%