/* We really only need to adapt one method from the original ParticleSystem to make this suitable for our Flocking simulation. We need to pass the list of all particles to each Boid for processing it's own rules and flocking forces. */ class FlockSystem extends ParticleSystem { public FlockSystem() { super(); } public void simulate() { for (int i = 0; i < particles.size(); i++) { Boid b = (Boid)particles.get(i); b.simulate(particles); } } }