The grid has two cell types: river cells \(R(\mathbf{x},t)=1\) (blue) and floodplain cells \(R=0\) (black). Floodplain cells can host settlement cells \(V(\mathbf{x},t)=1\), colored by their status each timestep: stable (orange — persisted from the previous step), new settlement (green — just placed), abandoned (white — voluntarily vacated), and drowned (red — destroyed by the advancing river). Population is conserved: \(\sum V(\mathbf{x},t) = N\) for all \(t\).

Each floodplain cell has a utility

\[ U(\mathbf{x}, t) \;=\; -\,w_d \, \mathcal{D}(\mathbf{x}, t) \;+\; w_c \, \mathcal{C}(\mathbf{x}, t) \]

where \(\mathcal{D}(\mathbf{x},t) = \min_{\mathbf{y}:\,R(\mathbf{y},t)=1} \|\mathbf{x}-\mathbf{y}\|_2\) is the Euclidean distance to the nearest river cell and \(\mathcal{C}(\mathbf{x},t) = \sum_{\mathbf{y}\in\mathcal{N}_8(\mathbf{x})} V(\mathbf{y},t)\) counts the occupied Moore neighbors (8-connected). Higher \(w_d\) makes proximity to the river matter more, while higher \(w_c\) makes clustering with other settlements matter more. When the river erodes a settlement cell, that cell is automatically relocated to the highest-utility empty site. Voluntary migration is governed by the friction threshold \(\mu\): the worst cell swaps with the best empty cell only if the utility difference exceeds \(\mu\). Press Play and tune the sliders.

Timestep: 0 / 1001  •  Population: 0  •  Clusters: 0
River Stable 0 New 0 Abandoned 0 Drowned 0
2.0 4.0 5 1000 20 50 ms

Loading river data…