Tariff Retaliation Dynamics — Live ABM

An agent-based simulation of trade-war escalation & rerouting · MAAE 2026, Chulalongkorn University
Sridhar KN
① ABM 101
② Tariff World

The mathematics behind it — Schelling (1971)

Each agent i reads its 8-cell Moore neighbourhood Ni and is happy only if enough neighbours are the same type:

Hi = 1 if [ Σj∈Ni I(Cj=Ci) ⁄ Σj∈Ni I(Cj≠0) ] ≥ Tolerance  (else 0)

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:

if Hi = 0  →  Locationi,t+1 = Random({ empty cells }t)

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.

Reference: Schelling, T. C. (1971). “Dynamic Models of Segregation.” Journal of Mathematical Sociology, 1(2), 143–186.

What is an agent-based 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.

  • Agents — here, two kinds of households on a grid.
  • Rule — “move if too few of my neighbours are like me”.
  • Emergence — even mild preferences (30%) produce full segregation.

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.

Happy agents: · round 0
Tolerance — min. % similar neighbours each agent wants33%

Scenario

Behavioural rules

p — retaliation0.70
tit-for-tat: match a partner’s hike with prob. p → escalation cascade
σ — diversion4.0
Armington elasticity: reroute imports away from tariffed sources
f — frontloading0.50
pull purchases forward before a hike → the 2025Q1 spike
α — adjustment speed (sluggishness)0.25
LOW α = sticky contracts/logistics → overshoot & oscillation
λ — stickiness0.12
severed links don’t reform → hysteresis (no snap-back)
τ — transshipment0.45
China routes goods through connectors to dodge tariffs

Extensions

Speed

The agents — live trade network & decisions

West East (China) Connectors Transshipment
tick 0 · US-unilateral
US imports that are 0% Chinese-via-connectors (transshipment, Q1)
World trade vs pre-war: 100.0% · Polarization 0.00
Drag a slider, then press Play. Watch each country decide live →

Live agent decisions

Emergent macro outcomes

US total imports — frontloading spike & overshoot

Share of US imports — China ▼ vs ASEAN connectors ▲ (rerouting)

World trade vs pre-war baseline — overshoot & hysteresis gap ▮ mean · ▦ 5–95% (100 MC runs)

Bloc-Polarization Index (emergent fragmentation) — 0 integrated → 1 decoupled ▦ 5–95%

Welfare path — West vs East bloc (real imports, % of pre-war) — deadweight loss

Theoretical Framework & Econometric Specifications

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).

1 · Structural Trade Reallocation (Armington, 1969)

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:

wi,j,t = T0i,j · Ri,j,t · ftaMuli,j,t · (1 + τj,i,t)−σ

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).

2 · CES Import Price Index & Trade Destruction

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:

Pj,t = [ Σi T0i,j(1 + τj,i,t)1−σ ⁄ Σi T0i,j ]1⁄(1−σ)

The index scales each country’s import capacity (trade destruction):

Volj,t = M0j · (Pj,t ⁄ P0j)−1 · capj,t

where capj = Σi T0i,jRi,jftaMuli,j ⁄ Σi T0i,j carries the permanent capacity loss from §4.

3 · Frontloading & Sluggish Adjustment

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):

Ti,j,t = Ti,j,t−1 + α · (T*i,j,t − Ti,j,t−1)

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).

4 · Hysteresis Ratchet (Path Dependence)

Severed supply-chain links lose relationship capital that never fully rebuilds, so de-escalation does not restore pre-war trade — an irreversible structural scar:

Ri,j,t = max( 0.40, Ri,j,t−1 − λ · (0.90 − Ti,j,t⁄T0i,j) )

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).

5 · Strategic Retaliation (Axelrod, 1984)

Escalation is emergent, not scripted: when struck, an agent plays probabilistic tit-for-tat, scheduling a counter-tariff a few ticks later:

if U(0,1) < p :  τsrc,imp ← τsrc,imp + min(0.85·Δτ, 0.60), at t+3

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).

6 · Transshipment / Rerouting

East→West flow blocked by tariffs is partly re-exported through connector economies (re-labelled origin) to dodge the wedge — distinct from genuine diversion:

reroutet = τ · Σw∈West max(0, T0CN,w − TCN,w,t)

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).

Academic literature mapping
  • Strategic interaction — Axelrod, R. (1984). The Evolution of Cooperation. → the p tit-for-tat retaliation protocol (§5).
  • Demand allocation — Armington, P. S. (1969). IMF Staff Papers, 16(1). → the σ substitution structure (§1–2).
  • Methodology — Gulden, T. R. (2013). Journal of Artificial Societies and Social Simulation. → validation-first micro-foundations design.