Quick info: Spacebar adds birds, 'P' pauses / Source code: flock02.jar
An explanation of what you're seeing might be in order. This is my first successful implementation of Craig W. Reynolds' Flocking Behavior. It is not a very good implementation, but I'm extremely pleased with it.
What you should be seeing above this text is a lot of little brown dots swimming around. If you watch them, you should notice that they are forming and maintaining flocks. The flocks are formed based on three simple steering rules: Cohesion, Separation and Alignment.
In the model above, you can enable or disable the three steering rules by pressing the number keys 1, 2 and 3. Some interesting behavior emerges if you only have combinations of the three on. You can also turn on and off the drawing of the birds vision, friendliness and steering vector by pressing the keys Q, W and E.
If you have turned on the drawing of vision (Q) you should see a lot of gray circles around the birds. The birds can only see other birds that are inside that circle, so they will only react to (and flock with) those birds. If you have turned on the drawing of friendliness (W), you should see a lot of green circles around the birds. That is each bird's comfort zone, so if any other birds get too close, evasive action is taken.
I don't really want to explain it any more... I think I've already made this relatively simple idea pretty murky. If you want to know more, visit the aforementioned web site.
A quick rundown of my past run-ins with what I call "organic motion":
As always... Back to Humor Tree!