Collective Behavior

 

![Fishswarm.png](https://scg.unibe.ch/assets/files/a9/28tb0n5sk45o3kfdbub4hklgz5ur6v/fishswarm.png)
 Shark shark = new Shark();
 Collection<Fish> swarm = new ArrayList();
 for ( ... ) swarm.add(new Fish());
 ...
 swarm.mimicryAttack(shark);

 

Swarm Behavior is a new composition operator that associates behavior with a collection of instances. The lookup of swarm behavior is based on the element type of a collection and is thus orthogonal to the collection hierarchy.

The method mimicryAttack

 

NB, useful for both static and dynamic languages.


Publications

Downloads

People