sim14 โ€” Heterogeneous Agents

Open the interactive visualization โ€” renders the grid heatmap (play/pause, step slider) and all metric charts from results.json.

One-line: Agents carry a structure ID; deposits are tagged with the depositor's ID; co-presence checks for material from TWO DISTINCT IDs โ€” so a 1-seed control is structurally zero, regardless of agent wander.

The question

sim13 showed that agent wander (not the torus leak) causes false boundaries: agents on a torus deposit material in both halves, creating real co-presence from a single structure. Every spatial filter โ€” diffusion (sim12), direct-material max filter (sim13) โ€” picks up wander material because it detects WHERE material is, not WHOSE it is.

sim14 tests agent-level fidelity: each termite carries a structure ID (0=left, 1=right). Deposits go into material_by_id[agent.id]. Co-presence = min(dilate(material_by_id[0]), dilate(material_by_id[1])). For a single seed, all agents have id=0, so material_by_id[1] is zero everywhere โ†’ co-presence = 0 โ†’ B = 0. This is a structural guarantee โ€” no spatial filter can achieve it.

Design

  • HeteroTermites: first n//2 agents get id=0 (left), rest get id=1 (right). For 1-seed control, all get id=0.
  • Material tracking: material_by_id[0] and material_by_id[1] track deposits by ID. Total field.material = sum (for compatibility with sim09 curvature/on_surface/metrics).
  • Deposits: material_by_id[agent.id] += pellet AND field.material += pellet.
  • Excavation: proportional removal from both ID arrays.
  • Co-presence: min(dilate_no_x_wrap(material_by_id[0]), dilate_no_x_wrap(material_by_id[1])) โ€” sim13's max filter, but on ID-separated arrays.
  • Boundary B: identical growth/decay to sim12 (B_new = B*(1-decay) + growth*co_presence).
  • Suppression: identical to sim12 (p_dep *= (1 - g*B_norm/(1+B_norm))).

Results

8-Condition experiment (seed 42, g=0.9)

ConditionL2OutcomeStableH7CellsL_retainR_retain
hetero 2-seedYEScoexistYESNO1670.550.49
hetero 1-seedNOnoneNOYES39360.951.00
passive 2-seedYEScoexistNOYES17790.991.00
passive 1-seedYESnoneYESYES17270.951.00
none 2-seedNOnoneNOYES48321.001.00
none 1-seedNOnoneNOYES44940.991.00
shadow 2-seedYEScoexistYESYES37140.991.00
shadow 1-seedYEScoexistYESYES31290.991.00

4-Seed robustness sweep

ModeSeedsL2CoexistStableH7Clean
hetero24/42/42/40/42/4
hetero10/40/40/44/4โ€”
shadow24/44/44/44/42/4
shadow14/42/42/44/4โ€”
passive24/42/41/44/42/4
passive14/41/42/44/4โ€”
none20/40/40/44/40/4
none10/40/40/44/4โ€”

Key findings

  1. The 1-seed control is 0/4 on ALL metrics. l2_crossed=0/4, coexist=0/4, stable=0/4, B_max=0.0 across all seeds. This is the first time the false-positive rate has been structurally zero. No spatial filter achieves this โ€” sim12's shadow has 4/4 l2_false positives, sim13's direct-material has 4/4 l2 and 1/4 coexist.

  2. Clean composition: 2/4 โ€” matching shadow and passive. The heterogeneous approach achieves the same clean rate, but through a different mechanism: eliminating false positives (0/4 in 1-seed) rather than generating enough true positives to overcome them.

  3. H7 crossing suppressed: 0/4. The ID-based boundary is too strong โ€” it suppresses growth below the H7 crossing threshold (cells: 167 vs 3714 for shadow). The cost of structural specificity is a boundary that is too aggressive.

  4. The memory-specificity trade-off is broken on the specificity axis but not on the strength axis. Agent IDs eliminate false positives (specificity), but the boundary's strength (memory) needs tuning โ€” the same trade-off in a new form.

Selftest

All 7 parts pass: ID co-presence high for 2 seeds (1.83), EXACTLY zero for 1 seed (max=0.0), B grows/decays, B=0 for 1 seed, full run produces ID metrics, B=0 throughout 1-seed run, determinism verified.

Comparison to previous simulations

sim1-seed l2_false1-seed coexist2-seed coexistcleanmechanism
sim11 (passive)4/41/42/42/4passive lateral inhibition
sim12 (shadow)4/42/44/42/4diffused-shadow autopoietic
sim13 (direct)4/41/41/41/4direct-material max filter
sim14 (hetero)0/40/42/42/4ID-tagged agents

sim14 is the first approach where the 1-seed control fires 0/4 on l2_crossed. The structural guarantee (id1 material = 0 for a single seed) is absolute โ€” it cannot be broken by agent wander, torus topology, or boundary radius.

Limitations

  • H7 crossing suppressed (0/4). The boundary is too strong at g=0.9. A lower inh_gain might allow both crossing and composition โ€” but that is a parameter-tuning question, not a mechanism question.
  • 2/4 coexist, not higher. The same rate as passive and shadow. The heterogeneous approach improves specificity without improving the raw coexistence rate.
  • Agents still wander freely. The IDs tag deposits, not movement. Agents from the left can still wander to the right and deposit there โ€” their deposits carry id=0, which doesn't create false co-presence, but it does mean the boundary's spatial location is still determined by where agents deposit, which is influenced by wander.

Files

  • sim14.py โ€” the simulation (imports sim13/sim12/sim11/sim10/sim09)
  • results.json โ€” 8-condition experiment
  • output/robustness_sweep.json โ€” 4-seed robustness sweep
  • visualize.html โ€” interactive visualization

Run

python3 sim14.py selftest     # 7-part selftest
python3 sim14.py run         # 8-condition experiment
python3 sim14.py robustness  # 4-seed robustness sweep

Density Scaling (Session 41)

Queued-topic #119: does scaling n_termites with grid area rescue the 160ร—160 grid's degradation?

gridnTdensityjitl2(2s)coexiststableh7(2s)l2(1s)cells
8015023.440.04/44/44/44/40/41770
8015023.4410.04/44/44/44/40/41970
8015023.4420.02/41/40/44/40/42022
1601505.860.04/44/43/44/40/41674
1601505.8610.04/44/41/42/40/41685
1601505.8620.04/40/40/40/42/41216
16030011.720.04/44/44/44/40/42744
16030011.7210.04/42/42/44/40/43393
16030011.7220.04/40/40/44/43/43324
16060023.440.04/44/44/44/40/44515
16060023.4410.04/44/43/44/42/45780
16060023.4420.04/42/40/44/44/46748

H7 fully rescued by density (4/4 at all jitter). Composition partially rescued (4/4 at jit=0, 3/4 stable at jit=10, 2/4 at jit=20). 1-seed structural guarantee leaks at 160ร—600 (absolute-size effect โ€” bigger structure overwhelms midline). See density_sweep.py.

N550 Plateau (Session 66)

Queued-topic #157/#161: does g* ever hit zero at n=550โ€“600 (~31% grid fill)?

Labelndensitygl2(2s)coexiststableh7(2s)cleanfullcfl2(1s)h7(1s)cellsfill%
n550_g00355021.480.0034/44/43/44/44/43/40.6002/44/4784830.7%
n550_g00555021.480.0054/44/43/44/44/43/40.6372/44/4779530.4%
n550_g01055021.480.0104/44/44/44/44/44/40.7122/44/4777530.4%
n600_g00360023.440.0034/43/42/44/43/42/40.5372/44/4804731.4%
n600_g00560023.440.0054/44/41/44/44/41/40.4502/44/4797731.2%
n600_g01060023.440.0104/44/43/44/44/43/40.5382/44/4796031.1%

g does NOT hit zero.* The 1/โˆšn scaling holds at ~31% fill. H7=4/4 at all combos. n=550 g=0.01 achieves 4/4 full (cf=0.712). The LSW "droplet dissolves" prediction is not realized โ€” ~31% fill is far below the 2D percolation threshold (~59%). The 43rd mechanism: the 1/โˆšn scaling is conservative (actual optimal > predicted). The 30th mechanism (stability-density trade-off) continues at n=600. See n550_plateau_sweep.py.

No-inhibition control: n=550 g=0 โ†’ 3/4 coexist, 1/4 stable, cells=15691 (61% fill). n=600 g=0 โ†’ 0/4 coexist, cells=17020 (66% fill). The boundary remains necessary at every density.

N700 Plateau (Session 67)

Queued-topic #157 (continuation): does g* hit zero at n=700โ€“800 (~33โ€“35% grid fill)? The 1/โˆšn formula predicts NEGATIVE g* at n=700โ€“800 โ€” the 43rd mechanism says actual > predicted.

Labelndensitygl2(2s)coexiststableh7(2s)cleanfullcfl2(1s)h7(1s)cellsfill%
n700_g00370027.340.0034/44/41/44/44/41/40.3251/44/4853833.4%
n700_g00570027.340.0054/44/42/44/44/42/40.5001/44/4847933.1%
n700_g01070027.340.0104/44/42/44/44/42/40.5001/44/4847433.1%
n800_g00380031.250.0034/44/43/44/44/43/40.5753/44/4883234.5%
n800_g00580031.250.0054/44/42/44/44/42/40.5003/44/4885234.6%
n800_g01080031.250.0104/41/42/44/41/40/40.4503/44/4881334.4%

g does NOT hit zero.* The 43rd mechanism (conservative scaling) confirmed: the 1/โˆšn formula predicts NEGATIVE g* but actual g* is positive. H7=4/4 at all 8 combos. n=800 g=0.003 achieves 3/4 full (cf=0.575). The 30th mechanism (stability-density trade-off) worsens at n=800 g=0.01 (coexist 1/4, 3/4 fragmented). The 1-seed structural guarantee degrades: 1/4 at n=700, 3/4 at n=800. See n700_plateau_sweep.py.

No-inhibition control: n=700 g=0 โ†’ 0/4 coexist, cells=18954 (74% fill). n=800 g=0 โ†’ 2/4 coexist (measurement artifact at 82% fill), cells=20960. The boundary remains necessary at every density tested.

N900 Plateau (Session 68)

Queued-topic #157 (continuation): does g* hit zero at n=900โ€“1000 (~36% grid fill)? The 1/โˆšn formula predicts deeply NEGATIVE g* (g*โ‰ˆ-0.44 to -0.47) โ€” the 43rd mechanism says actual > predicted.

Labelndensitygl2(2s)coexiststableh7(2s)cleanfullcfl2(1s)h7(1s)cellsfill%
n900_g00390035.160.0034/44/40/44/44/40/40.3001/44/4916435.8%
n900_g00590035.160.0054/43/42/44/43/42/40.4501/44/4901735.2%
n900_g01090035.160.0104/44/42/44/44/42/40.5251/44/4907735.5%
n1000_g003100039.060.0034/44/42/44/43/41/40.4754/44/4935736.6%
n1000_g005100039.060.0054/44/42/44/43/41/40.4504/44/4933736.5%
n1000_g010100039.060.0104/44/42/44/43/42/40.4004/44/4935636.5%

g does NOT hit zero.* The 43rd mechanism (conservative scaling) confirmed at a third density range: the 1/โˆšn formula predicts deeply NEGATIVE g* but actual g* is positive. H7=4/4 at all 8 combos. n=900 g=0.01 achieves 2/4 full (cf=0.525). The 30th mechanism (stability-density trade-off) persists: stable 0โ€“2/4. The 1-seed structural guarantee is stochastic, not monotonic: 1/4 at n=900, 4/4 at n=1000 โ€” the 12th member does not degrade monotonically. See n900_plateau_sweep.py.

No-inhibition control: n=900 g=0 โ†’ 0/4 coexist, cells=22240 (87% fill). n=1000 g=0 โ†’ 0/4 coexist (1/4 l2_crossed artifact at 92% fill), cells=23519. The boundary remains necessary โ€” it prevents percolation.

N1200 Plateau (Session 69)

Queued-topic #157 (continuation): does g* hit zero at n=1200โ€“1500 (~38โ€“39% grid fill)? The 1/โˆšn formula predicts deeply NEGATIVE g* (g*โ‰ˆ-0.51 to -0.56) โ€” the 43rd mechanism says actual > predicted.

Labelndensitygl2(2s)coexiststableh7(2s)cleanfullcfl2(1s)h7(1s)cellsfill%
n1200_g003120046.880.0034/44/42/44/44/42/40.5123/44/4976238.1%
n1200_g005120046.880.0054/44/41/44/44/41/40.4383/44/4975538.1%
n1200_g010120046.880.0104/44/41/44/44/41/40.4003/44/4984738.5%
n1500_g003150058.590.0034/44/43/44/44/43/40.6001/44/41007539.4%
n1500_g005150058.590.0054/44/40/44/44/40/40.2751/44/41014239.6%
n1500_g010150058.590.0104/44/42/44/44/42/40.4751/44/41003739.2%

g does NOT hit zero.* The 43rd mechanism (conservative scaling) confirmed at a fourth density range: the 1/โˆšn formula predicts deeply NEGATIVE g* but actual g* is positive. H7=4/4 at all 8 combos. n=1500 g=0.003 achieves 3/4 full (cf=0.600) โ€” the best overall since n=800. The 44th mechanism: the boundary caps fill at ~39% (not 45% expected) โ€” the no-inhibition control fills 96โ€“100%. The 30th mechanism is non-monotonic: 3/4 stable at g=0.003 but 0/4 at g=0.005 โ€” a sharp gain-dependent transition. The 1-seed guarantee is stochastic: 3/4 at n=1200, 1/4 at n=1500. See n1200_plateau_sweep.py.

No-inhibition control: n=1200 g=0 โ†’ 0/4 coexist, cells=24669 (96% fill). n=1500 g=0 โ†’ 0/4 coexist, cells=25537 (100% fill). The boundary prevents percolation โ€” it keeps the system in the droplet regime below the 2D percolation threshold (~59%).

N1800 Plateau (Session 70)

Queued-topic #186 (continuation of #157): does g* hit zero at n=1800โ€“2000 (~40โ€“41% grid fill)? The 1/โˆšn formula predicts deeply NEGATIVE g* (g*โ‰ˆ-0.59 to -0.61) โ€” the 43rd mechanism says actual > predicted.

Labelndensitygl2(2s)coexiststableh7(2s)cleanfullcfl2(1s)h7(1s)coex(1s)cellsfill%
n1800_g001180070.310.0014/44/42/44/43/42/40.4501/44/41/41039340.6%
n1800_g003180070.310.0034/44/42/44/43/42/40.5121/44/41/41038040.5%
n1800_g005180070.310.0054/44/42/44/43/41/40.4751/44/41/41031040.3%
n2000_g001200078.120.0014/44/43/44/43/42/40.5122/44/41/41054241.2%
n2000_g003200078.120.0034/44/41/44/43/41/40.3882/44/41/41051641.1%
n2000_g005200078.120.0054/44/41/44/43/41/40.4382/44/41/41057341.3%

g does NOT hit zero.* The 43rd mechanism (conservative scaling) confirmed at a fifth density range: the 1/โˆšn formula predicts deeply NEGATIVE g* but actual g* is positive. H7=4/4 at all 6 plateau combos. The 44th mechanism (boundary caps fill) confirmed at a 5th density range: fill plateaus at ~41% (not ~45โ€“50% expected) โ€” the no-inhibition control fills 100%. The 30th mechanism is a gain-density interaction: at n=2000, stable drops 3/4โ†’1/4 as g rises 0.001โ†’0.005; at n=1800, stable is 2/4 at all gains (less sensitive). The 1-seed guarantee is stochastic: 1/4 at n=1800, 2/4 at n=2000. See n1800_plateau_sweep.py.

No-inhibition control: n=1800 g=0 โ†’ 0/4 coexist, cells=25599 (100% fill). n=2000 g=0 โ†’ 0/4 coexist, cells=25600 (100% fill). The boundary prevents percolation โ€” it caps fill at ~41% even with 2000 termites.

N2500 Plateau (Session 71)

Queued-topic #189, #190 (continuation of #157): does g* hit zero at n=2500โ€“3000 (~42โ€“44% grid fill)? Is the fill cap logarithmic? The 1/โˆšn formula predicts deeply NEGATIVE g* (g*โ‰ˆ-0.64 to -0.65) โ€” the 43rd mechanism says actual > predicted.

Labelndensitygl2(2s)coexiststableh7(2s)cleanfullcfl2(1s)h7(1s)coex(1s)cellsfill%
n2500_g001250097.660.0014/44/42/44/43/41/40.4004/44/41/41077342.1%
n2500_g003250097.660.0034/43/40/44/42/40/40.2504/44/41/41085442.4%
n2500_g005250097.660.0054/43/40/44/42/40/40.3004/44/41/41071141.8%
n3000_g0013000117.190.0014/43/40/44/42/40/40.1634/44/41/41116943.6%
n3000_g0033000117.190.0034/44/40/44/43/40/40.2134/44/41/41107443.3%
n3000_g0053000117.190.0054/42/40/44/42/40/40.1884/44/41/41115943.6%

g does NOT hit zero.* The 43rd mechanism confirmed at a sixth density range. H7=4/4 at all 6 plateau combos. The 44th mechanism: the fill cap rises LOGARITHMICALLY โ€” fill% โ‰ˆ 13.1ยทlogโ‚โ‚€(n) โˆ’ 2.14 (Rยฒ=0.991). The fill cap trajectory: n=1200โ†’38.3%, n=1500โ†’39.4%, n=1800โ†’40.4%, n=2000โ†’41.2%, n=2500โ†’42.1%, n=3000โ†’43.6%. The 44th mechanism is a soft cap, not a hard constant. The 30th mechanism worsens: stable collapses to 0/4 at n=3000 (all gains). The 1-seed structural guarantee is fully lost: l2(1s)=4/4. See n2500_plateau_sweep.py.

No-inhibition control: n=2500 g=0 โ†’ 0/4 coexist, cells=25600 (100% fill). n=3000 g=0 โ†’ 0/4 coexist, cells=25600 (100% fill). The boundary prevents percolation โ€” it caps fill at ~42โ€“44% even with 3000 termites. At ~44% fill, the structures are at ~74% of the 2D percolation threshold (~59%).

N4000 Plateau (Session 72)

Queued-topics #193, #194 (continuation of #157): does g* hit zero at n=4000โ€“5000 (~46โ€“48% grid fill)? The 1/โˆšn formula predicts deeply NEGATIVE g* (g*โ‰ˆ-0.71 to -0.74) โ€” the 43rd mechanism says actual > predicted. The 6-point log fill cap (13.1ยทlogโ‚โ‚€(n) โˆ’ 2.14, Rยฒ=0.991) predicts ~45.1% at n=4000 and ~46.3% at n=5000.

Labelndensitygl2(2s)coexiststableh7(2s)cleanfullcfl2(1s)h7(1s)coex(1s)cellsfill%
n4000_g00054000156.250.00054/40/40/44/40/40/40.0624/44/42/41173545.8%
n4000_g0014000156.250.0014/40/40/44/40/40/40.0254/44/42/41180846.1%
n4000_g0034000156.250.0034/43/40/44/41/40/40.0874/44/42/41152945.0%
n5000_g00055000195.310.00054/40/40/44/40/40/40.0134/44/40/41234848.2%
n5000_g0015000195.310.0014/40/40/44/40/40/40.0874/44/40/41222847.8%
n5000_g0035000195.310.0034/40/40/44/40/40/40.1384/44/40/41228248.0%

g does NOT hit zero.* The 43rd mechanism confirmed at a seventh density range. H7=4/4 at all 6 plateau combos. The 44th mechanism BREAKS the logarithmic fit โ€” the fill cap is accelerating. Fill rises to ~45.8% (n=4000) and ~48.0% (n=5000) โ€” the 6-point log fit underestimates by +0.7% and +1.7%. The 8-point refit (15.39ยทlogโ‚โ‚€(n) โˆ’ 9.58) has Rยฒ=0.984 (lower than the 6-point Rยฒ=0.991). The 30th mechanism persists: stable 0/4 at ALL 6 combos (does NOT recover at g=0.0005). Composition collapses at n=5000 (coexist 0/4 all gains). The 1-seed guarantee is fully lost (4/4 all combos, coex(1s)=0/4 at n=5000). At ~48% fill, ~81% of the 2D percolation threshold (~59%). See n4000_plateau_sweep.py.

No-inhibition control: n=4000 g=0 โ†’ 0/4 coexist, cells=25600 (100% fill). n=5000 g=0 โ†’ 0/4 coexist, cells=25600 (100% fill). The boundary prevents percolation โ€” it caps fill at ~46โ€“48% even with 5000 termites.

N6000 Plateau (Session 73)

Queued-topics #197, #199, #200 (continuation of #193): does g* hit zero at n=6000โ€“8000 (~51โ€“61% grid fill)? The 1/โˆšn formula predicts deeply NEGATIVE g* (g*โ‰ˆ-0.75 to -0.78). The 8-point log fill cap predicts ~49.7% at n=6000 and ~50.5% at n=8000.

Labelndensitygl2(2s)coexiststableh7(2s)cleanfullcfl2(1s)h7(1s)coex(1s)cellsfill%
n6000_g00056000234.380.00054/40/40/44/40/40/40.103/44/41/41327451.9%
n6000_g0016000234.380.0014/40/40/44/40/40/40.123/44/41/41315551.4%
n6000_g0036000234.380.0034/40/40/44/40/40/40.103/44/41/41306451.0%
n8000_g00058000312.500.00054/40/40/44/40/40/40.043/44/41/41554260.7%
n8000_g0018000312.500.0014/40/40/44/40/40/40.063/44/41/41552660.6%
n8000_g0038000312.500.0034/40/40/44/40/40/40.103/44/41/41564261.1%

g does NOT hit zero.* The 43rd mechanism confirmed at an eighth density range. H7=4/4 at all 6 plateau combos. The 44th mechanism BREAKS โ€” the fill cap EXCEEDS the percolation threshold. Fill rises to ~51.9% (n=6000) and ~60.7% (n=8000) โ€” ABOVE the 2D percolation threshold (~59%). The 6-point log fit underestimates by +4.5% (n=6000) and +11.8% (n=8000); the 10-point Rยฒ=0.875. The 30th mechanism persists: stable 0/4 at ALL 6 combos. The 46th mechanism: the 30th is independent of the 44th. The 1-seed guarantee partially recovers (3/4, vs 4/4 at n=4000โ€“5000). Composition remains collapsed (coexist 0/4). See n6000_plateau_sweep.py.

No-inhibition control: n=6000 g=0 โ†’ 0/4 coexist, cells=25600 (100% fill). n=8000 g=0 โ†’ 0/4 coexist, cells=25600 (100% fill). The boundary remains necessary at every density.

Session 74 โ€” Fill Cap Functional Form + Percolation Spanning Cluster

Fill cap functional form โ€” 16 unique densities (n=550 to n=8000) fit to 5 candidate forms:

FitRยฒ (all 16)Rยฒ (sub-perc, nโ‰ค5000)n=8000 residual
Log0.9330.988+9.5%
Power law0.9500.977+7.6%
Power-in-log0.939โ€”โ€”
Stretched exp0.964 โ˜…0.921+1.5%
Sqrt-linear0.9620.948โ€”

The fill cap is super-logarithmic โ€” no simple closed-form law fits all 16 points. The stretched exponential (fill% = 26.7ยทexp(0.0089ยทโˆšn)) is the best all-16-point fit. The sub-percolation log fit (Rยฒ=0.988) underestimates n=8000 by +9.5%. The increment analysis reveals acceleration: +3.4% (n=5000โ†’6000), +9.4% (n=6000โ†’8000). See output/fill_cap_form_fit.json.

Percolation spanning cluster โ€” n=8000 (3 gains ร— 4 seeds) + n=6000 (1 gain ร— 4 seeds) + 2 no-inhibition controls:

LabelMean Fill%Mean #CompMean LargestMean %LargestSpanning
n8000_g00158.7%1391076671.4%4/4
n8000_g000558.8%139718147.7%4/4
n8000_g00359.1%1581076470.9%4/4
n6000_g00150.6%106625848.3%4/4
n8000_no_inhib100.0%125600100.0%4/4
n6000_no_inhib100.0%125600100.0%4/4

The percolation at n=8000 is GENUINE โ€” all 12 runs have spanning clusters. The largest component fraction is bimodal: 6/12 have giant components (93โ€“95%), 6/12 have two near-equal halves (~48%). The 47th mechanism: the bimodal largest-component fraction is the percolation order parameter โ€” the 44th mechanism's breakdown is a genuine phase transition. See percolation_spanning.py and output/percolation_spanning.json.