Chapter 5 of The Nature of Code, Autonomous Agents, implements Reynolds steering and the three boids rules: separation, alignment, and cohesion. The environment here contains real independent agents.
I drop the flock into live OpenSky traffic over the Alps, so separation has to work against real aircraft, not only other boids.
The page fetches live aircraft states over the Alps from the OpenSky Network (position, true track, ground speed) and draws each as an oriented marker. A boids flock runs the three rules plus a repulsion from every real aircraft, so the emergent flocking must resolve against measured air traffic.
The three steering vectors are separation \(\mathbf{s} = -\sum_{j} \mathbf{r}_{ij}/\lVert \mathbf{r}_{ij} \rVert^2\), alignment \(\mathbf{a} = \langle \mathbf{v}_j \rangle - \mathbf{v}_i\), and cohesion \(\mathbf{c} = \langle \mathbf{x}_j \rangle - \mathbf{x}_i\), summed into a force limited by \(\lVert \mathbf{F} \rVert \le F_{\max}\) with speed capped at \(\lVert \mathbf{v} \rVert \le v_{\max}\). The naive neighbor evaluation over \(n\) agents is \(O(n^2)\). Aircraft headings are ADS-B true-track angles.
Data source: The OpenSky Network states API
Endpoint:https://opensky-network.org/api/states/all?lamin=45&lomin=5&lamax=48&lomax=11
Access: Public, no key. Loaded from an hourly server-side refresh when possible, with a bundled snapshot fallback, and a live browser fetch only when the API allows CORS. Data window: Aug 6, 2026 (pulled Aug 6, 2026 UTC)
All 247 aircraft are listed below.