Skip to content
HackRPI 2014 fall
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

RPI Hackathon 2014

Flocking simulation


Boids stay together to save themselves from predators, creating swarming effect that can be used to visualize other complex systems (e.g. stock markets).

Three principles (by Craig Reynolds)

  • Cohesion (flock centering)
  • Flocking (velocity matching)
  • Separation (collision avoidance)


The boids which are far from the center of the flock are more likely to be caught by predators.

Model: the acceleration of each boid points to the center of mass of the nearby boids.


The boids travel in the same direction and speed as nearby boids do.

Model: the acceleration of each boid points to the sum of velocities of nearby boids.


The boids try to avoid running into each other.

Model: the acceleration of each boid points away from the sum of distances of nearby boids.


Each entity, whether it is a prey or predator, has vision, within which it perceives food or danger. Therefore our model

Model: interaction considered only within a certain radius.



The Reactive Swarm

You can’t perform that action at this time.