|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Phase 8 example: local Schelling segregation on a 2-D lattice. More...
#include <algorithm>#include <array>#include <cstddef>#include <cstdint>#include <iomanip>#include <iostream>#include <random>#include <string>#include <ca-rng.H>#include <ca-traits.H>#include <tpl_ca_engine.H>#include <tpl_ca_lattice.H>#include <tpl_ca_neighborhood.H>#include <tpl_ca_storage.H>#include <tpl_ca_stochastic_rules.H>Go to the source code of this file.
Functions | |
| int | main () |
Phase 8 example: local Schelling segregation on a 2-D lattice.
Builds a 48x48 toroidal lattice seeded with two agent types (A, B) and a small fraction of empty cells, and runs the local Schelling approximation:
threshold, the cell vacates with probability p_move.p_fill.The example sweeps three intolerance thresholds (0.30, 0.50, 0.70). For each one we report a cluster-quality proxy — the fraction of same-type pairs among occupied edges of the lattice graph — at the initial frame and at the end of the simulation. The visualisation renders the final configuration with three glyphs.
Glyphs: '.' empty 'A' type A 'B' type B
Definition in file ca_schelling_segregation_example.cc.
| int main | ( | void | ) |
Definition at line 176 of file ca_schelling_segregation_example.cc.
References bar(), Aleph::blossom_maximum_cardinality_matching(), cols, rows, and seed.