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.