Python + Kivy
Implement three leaderless flocking behaviors: alignment, cohesion, and separation
There functions were created to calculate three vectors: cohesion, alignment and separation, then all three vectors were added to velocity in the update function. Visible radius were set as follows:
First three sliders in the demo are bind to weight of each vector. The last slider is for adjusting the field of view to change who the visible neighbors are.
If you’d like to explore the code, find it here.