Basic models of flocking behavior are controlled by three simple rules:
Main parts are from http://harry.me/blog/2011/02/17/neat-algorithms-flocking/
Some more resources from https://en.wikipedia.org/wiki/Flocking_(behavior)
Source code https://github.com/bobuss/flocking