Fig. 2: Arenas for the five missions.

a XOR-AGGREGATION, simulation; b, real robots. c, HOMING, simulation; d, real robots. e, FORAGING, simulation; f, real robots. g, SHELTER, simulation; h, real robots. i, DIRECTIONAL-GATE, simulation; j, real robots. The 20 robots operate in a dodecagonal arena of 4.91 m2, the red glow in (e, f, g, h, i), and (j) indicates the presence of a light source at the bottom side of the arena. Dimensions (in meters) of the elements present in the arenas are given in (a, c, e, g,) and (i). Details on the experimental setup are provided in “Methods” and videos of the robot experiments are available as Supplementary Movies 1–5.