Shift key while clicking flag for turbo. Turbowarp is best: https://turbowarp.org/644839659?fps=60 Adjust the 3 variables to see how they affect flocking. Try to simulate murmurations seen in starling flocks. Starting from random positions, birds form flocks by aligning, cohering, and separating from neighbors. Best not to use more than 60 birds unless using turbowarp (where you could try even 200 birds): https://turbowarp.org/644839659?fps=60
The 3 variables correspond to the main rules: align, cohere, and separate. Each of those 3 rules has a weight variable that you can adjust. Setting a vriable to zero turns it off. The main point of the model is that there is no leader, yet flocking patterns emerge from just those three rules, aligning, cohering, separating. Birds only see nearby neighbors, not the whole flock, but the group self-organizes. My variant of Reynolds' "Boids" model. I added flapping, simlified code, used vectors, added sliders. See also my boids of a feather (two separate flocks, and predator-prey flocks). Music: Aviary, from The Carnival of the Animals, by Camille Saint-Saëns