private void aggregateForces() { // tell all of the springs to apply their forces for (Spring s : springs) { s.applyForce(); } // tell all the dampers to apply their forces for (Damper d : dampers) { d.applyForce(); } // tell all the zaps to apply their forces for (Zap z : zaps) { z.applyForce(); } }
void add_spring(int start, int end) { Spring s = new Spring(); s.start = start; s.end = end; springs.add(s); }