/*A class to describe a group of Particles*/ class FlockSystem { ArrayList boids; //an arraylist for all the particles Vector3D origin; //an origin point for where particles are birthed FlockSystem(Vector3D v) { boids = new ArrayList(); //initialize the arraylist origin = v.copy(); //store the origin point } FlockSystem() { boids = new ArrayList(); //initialize the arraylist origin = new Vector3D(0,0,0); //store the origin point println("flock generated"); } void run() { Iterator iter = boids.iterator(); while(iter.hasNext()) { Boid b = (Boid)iter.next(); b.run(boids); } } void addBoid(Boid b) { boids.add(b); } }