THREE RULES. “He programmed virtual flying objects—the eponymous Boids—to move according to three simple rules. They aligned with the average heading of their neighbours; they were attracted to each other; and they also repulsed each other to keep some personal space. These three simple rules were enough to simulate a realistic bird-like flock.”
http://phenomena.nationalgeographic.com/2014/02/27/a-bird-like-flock-of-autonomous-drones/