BONABEAU APPS

Lattice swarms

Agents walk at random on a 3D lattice and deposit one of two brick types whenever the 26 cells around them match a stimulating configuration in a shared lookup table. No agent knows the plan; coordination comes only from the structure being built. Based on Theraulaz and Bonabeau, Science 269 (1995) and J. Theor. Biol. 177 (1995), and Bonabeau, Guérin, Snyers, Kuntz and Theraulaz, BioSystems 56 (2000).

Brick type 1Brick type 2Drag to rotate, scroll to zoom, double-click to reset the view.

The model

The lattice is 20 × 20 × 20 cells with 10 agents, as in the papers. One brick of type 1 starts the nest near the top; the nests hang from it and grow downward. At each step every agent moves to a random free face neighbor, then reads the 26 surrounding cells. If that configuration is in the table, it deposits the brick the table names. Bricks are never removed. The tables list each configuration once; rotations about the vertical axis and reflections are also stimulating, as stated in the appendix of the J. Theor. Biol. paper.

Coordinated algorithms. The papers' main result is that coherent architectures need tables whose stimulating configurations fall into successive building stages that do not overlap: finishing one stage creates the configurations of the next, and no configuration of a later stage appears early. The stage panel shows this for the Chartergus table: stages fire in order. A random table, by contrast, grows a structureless shape that differs from run to run.

About the published tables
  • Stelopolybia (Fig. 4d, e). Works as printed. The papers show it at 20,000 steps: a large top plateau with smaller plateaus hanging below on several pedicels. If left running, the plateaus keep growing until they fill the lattice.
  • Chartergus (Fig. 4n, Fig. 5 stages). As printed, rule 2.6 cannot match any configuration that occurs: its middle slice is mirrored relative to its top slice. The printed table also lacks configurations for completing the 3 × 3 ring in step 2, so in our tests about two runs in three stopped there. The "step 2 completed" version corrects 2.6 to the mirror-consistent form and adds seven step 2 rules, labeled 2.2a to 2.2g. With it, nearly all runs pass step 2 and go on to build the envelope and internal combs, but the envelope rules of steps 6 and 7 still leave gaps: in our tests about one run in ten completed the full nest within 185,000 steps, while the others stopped with a partial envelope. Adding rules for those gaps made things worse, because the same configurations also occur inside the nest, which is the overlap the papers warn about.
  • Parachartergus (Science Fig. 2, for Fig. 1b). Transcribed from the figure; rules 2.11, 2.12 and 2.18 (marked *) are also stimulating under rotations about z, the others only as printed. The first deposit is a race between rule 1.1 (a type 1 brick under the starting brick, which starts the vertical axis) and rule 2.1 (a type 2 brick beside it). When the axis starts first, in about half of the runs, the table builds Fig. 1b: a vertical type 1 axis with type 2 combs attached on one side at several levels. Otherwise only one flat comb forms. Use "New run" to see both outcomes.
About the inferred tables

The papers built their architectures by working backwards from the shape to the rule table. These tables were obtained the same way, automatically. For each architecture I specified a target: which cells hold which brick type. A learner then ran the swarm with the current table. When the swarm had stalled, and an agent stood at a target cell on the growth front, the configuration it saw became a new rule. Whenever a rule in the table matched at a cell outside the target, or asked for the wrong type, that configuration was banned for good: this is the overlap between building stages that the papers show disorganizes construction. Learning stopped after 20 runs with no change. Each table was then tested in 20 independent runs of the plain swarm, and the best of several learning attempts was kept. The tables are explicit, without symmetric variants, so they list more rules than the published ones.

Not every architecture could be specified from the figures, which show only finished shapes, so the targets are my reading of them, designed so that local cues can tell building stages apart. Where the brick types differ from the figures, it is because that is what made the stages distinguishable.

  • JTB Fig. 4(c): 10 rules; mean completion 100.0%, 20 of 20 runs complete, 0.0 extra bricks per run.
  • JTB Fig. 4(l): 63 rules; mean completion 100.0%, 20 of 20 runs complete, 0.0 extra bricks per run.
  • JTB Fig. 4(m): 194 rules; mean completion 99.7%, 17 of 20 runs complete, 0.0 extra bricks per run.
  • JTB Fig. 4(i): 211 rules; mean completion 99.3%, 5 of 20 runs complete, 0.0 extra bricks per run.
  • JTB Fig. 4(o): 43 rules; mean completion 100.0%, 20 of 20 runs complete, 0.0 extra bricks per run.
  • BioSystems Fig. 2(a): 70 rules; mean completion 94.5%, 8 of 20 runs complete, 0.0 extra bricks per run.
  • Science Fig. 4: 512 rules; mean completion 97.1%, 9 of 20 runs complete, 0.2 extra bricks per run.
  • BioSystems Fig. 2(e): 605 rules; mean completion 97.4%, 11 of 20 runs complete, 0.0 extra bricks per run.
  • BioSystems Fig. 2(b): 35 rules; mean completion 100.0%, 20 of 20 runs complete, 0.0 extra bricks per run.

The helices. These needed three changes from the first attempts. The roof is grown in the plane of the starting brick and bounded by the pillar below it, instead of being a separate stage that the envelope later mimics. The ramp's starting sector is not prescribed: the first ring cell the swarm deposits under the roof fixes the phase, and the learner accepts every rotation of the target. And the brick types are assigned so that no two stages share a configuration: with pillar, walls and ramp all of one type, a wall cell under a wall with the ramp beside it looks exactly like an interior cell under the ramp with the pillar beside it. On the cubic lattice the pillar and walls are type 1 and the ramp type 2; on the hexagonal lattice the rim and walls must be type 2, because there a cell outside the rim touches only one rim brick and would otherwise look like the first inner-ring cell.

Not reproduced. I could not obtain working tables for JTB Fig. 4(k) and BioSystems Fig. 2(c) (Chartergus-like envelopes with regularly spaced combs) or JTB Fig. 4(p). In each case the second deposit of the nest (a rim brick beside the center, diagonally below the starting brick) sees a configuration with one type 2 brick beside it and one type 1 brick diagonally above. With two brick types and a single starting brick, the envelopes I designed contain a type 1 brick directly above a type 2 brick, so that same configuration occurs next to the wall while the structure is partly built. Alternating the envelope's types by level, which is what spaces the combs, creates such pairs unavoidably. Banning the configuration then stops the nest at its second brick. The published Chartergus table avoids strict comb spacing (its combs are spaced irregularly) and, as noted above, completes the full nest in only about one run in ten. JTB Fig. 4(p) needs three locally distinguishable kinds of comb (the first one, left-leg combs and right-leg combs), and every typing I tried either repeated the starting brick's configuration or made two kinds look alike.