Birds in Flight
This simulation models the behavior of bird flocks and predator-prey dynamics using 'boid' algorithms. Birds follow rules of alignment, cohesion, and separation to form flocks, while a predator actively pursues them. The prey birds maintain their flocking behavior but prioritize predator avoidance when threatened.
Rules
- Separation - Each bird tries to maintain a minimum distance from its neighbours to avoid crowding.
- Alignment - Each bird aligns its direction with the average direction of its nearby flock-mates.
- Cohesion - Each bird moves towards the average position of its nearby flock-mates.
- Velocity - Each bird has a maximum speed and steering force.