Robot heading (wedge) Arena boundary

Robot Swarm Flocking (2D) — Metric vs Topological Neighbor Selection

This simulator runs the Reynolds separation/alignment/cohesion flocking algorithm on a 2D top-down swarm of simulated ground robots and lets you switch the neighbor-sensing model between two real design choices used in swarm robotics: a fixed-radius "metric" sensor range and a fixed-count "topological" nearest-k model. Because the arena is genuinely two-dimensional — the model a ground-based robot swarm with 2D LIDAR or proximity rings actually experiences — neighbor counting follows the 2D Poisson-disc law ρ·π·R² rather than the 3D sphere-volume law used by an aerial swarm, and the live readouts measure that relationship directly against the theoretical prediction. Tune the three rule weights, change robot density, and trigger a scatter disruption to see live polarization, neighbor-count, and spread readouts reveal why topological sensing keeps a swarm coherent when metric sensing fragments it.