Each agent i reads its 8-cell Moore neighbourhood Ni and is happy only if enough neighbours are the same type:
Ci ∈ {1, 2} = agent type (blue / red); Cj = 0 = empty cell; I(·) = indicator (1 if true). An agent with no occupied neighbours counts as content.
Relocation — time advances in discrete step() ticks; an
unhappy agent jumps to a random empty cell:
Full segregation is the inevitable emergent outcome, yet the exact final map is unique to each random seed — path dependence, the same property that drives hysteresis in the trade model.
Many autonomous agents, each following simple local rules on a shared space. No central planner — macro patterns emerge from micro behaviour, and the path is history-dependent.
This is Schelling (1971): drag tolerance and watch a global pattern self-organize that nobody intended — then we point the same idea at world trade →
The leap: swap households for countries, “move” for tariff / retaliate / reroute, and segregation for trade-bloc formation.
Every behavioural rule and slider in the live model above corresponds to a specific
equation executing in the JavaScript engine, grounded in the literature cited in the research proposal.
Variable names below match the code exactly (P.sigma, P.alpha,
P.lambda, P.p, P.tau, model.tau, model.R,
model.ftaMul).
Goods are differentiated by country of origin, not homogeneous — so a tariff reroutes demand toward cheaper origins rather than eliminating it. Each importer j assigns an allocation weight to every exporter i:
In the app:
σ — the Armington / substitution elasticity (σ slider, P.sigma; ×1.5 in AI-goods mode).τj,i — bilateral tariff (model.tau).Ri,j — relationship capital (model.R, see §4).ftaMul — FTA-deepening multiplier (Extensions toggle).Bilateral tariff shocks aggregate into a macro Constant-Elasticity-of-Substitution price index for each importer. Because the index rises even after substitution, a trade war genuinely shrinks trade rather than only reshuffling it:
The index scales each country’s import capacity (trade destruction):
where capj = Σi T0i,jRi,jftaMuli,j ⁄ Σi T0i,j carries the permanent capacity loss from §4.
Unlike a static CGE equilibrium, the model traces the out-of-equilibrium path: flows move only part-way toward their target each tick (sticky contracts & logistics):
The target T* includes an anticipatory frontloading pulse during a tariff’s
announcement→effect window. Slow α (P.alpha; ×0.5 in AI mode) plus forward-looking
frontloading (P.f) is what produces the import spike and subsequent overshoot (Q2).
Severed supply-chain links lose relationship capital that never fully rebuilds, so de-escalation does not restore pre-war trade — an irreversible structural scar:
If a flow falls below 90% of its historical level, capital degrades by λ
(P.lambda) and ratchets down to a floor of 0.40 — locking in the altered network even
after tariffs are removed (Q2, hysteresis).
Escalation is emergent, not scripted: when struck, an agent plays probabilistic tit-for-tat, scheduling a counter-tariff a few ticks later:
The retaliation probability p (P.p) drives the cascade; this
stochastic draw is precisely why outcomes are averaged over the Monte-Carlo ensemble (the 5–95% bands).
East→West flow blocked by tariffs is partly re-exported through connector economies (re-labelled origin) to dodge the wedge — distinct from genuine diversion:
A fraction τ (P.tau) of China’s lost Western exports is distributed across
connectors (∝ size) and on to the West — the pink packets and the “% really Chinese” counter (Q1).
p tit-for-tat retaliation protocol (§5).σ substitution structure (§1–2).