/flock

Flocking demo using quil

Primary LanguageClojure

# flock

This is an implementation of a flocking model first designed by Craig Reynolds in 1986.
You can see Craig's discussion of it here: http://www.red3d.com/cwr/boids/

This also draws on some ideas from 'The Computational Beauty of Nature' - Gary William Flake

It is a very straight foward implementation that is not efficient but allows for rules
to be added, removed and modified while the application is running.

TODO:
 * Add some form of data structure for efficently calculating neighbours,
   possibly a quad-tree or kd-tree.
 * Write or find faster vector operations (could use PVector from proccessing libs).
 * Refine the boid neigbourhood by restricting the angular range.
 * Add 'sight' rule from Flake to produce V shape.

You can check it out by downloading https://github.com/jsofra/flock/raw/master/target/flock-1.0.0-SNAPSHOT-standalone.jar
and running: java -jar flock-1.0.0-SNAPSHOT-standalone.jar

Click the window to add new boids, they will flock and avoid the mouse cursor.

-------------------------------------------------------------------------------

Other Clojure flocking examples:
http://www.fatvat.co.uk/2009/07/flocking-about-with-clojure.html
https://github.com/swannodette/flocking
https://github.com/rosejn/flocking

Other neat examples:
http://breefield.com/lab/flock/
http://harry.me/2011/02/17/neat-algorithms---flocking