Boids Flocking Behavior by Scott Robert Ladd , includes a control panel. See also his Pest Control applet and his dissertation . It allows to drop in obstacles with a mouse click. Provides control panels to adjust flocking parameters. In addition, the battling boids can be put under the control of a genetic algorithm which gradually evolves their behavior based on their success in battle.
Source code is available.
Java Flies by Alex Vulliamy. Hungary Swarm from The Temple of ALife features swarming around obstacles. Frog Queue by Maeda Mameo appears to be based on a follow the nearest leader rule, but I cannot read the Japanese descriptions. Source is included.