package class4_2_Observer; import java.util.Random; /** * Author: Josiah Yoder et al. * Class: SExxxx-xx * Date: 1/7/14 7:45 AM * Lesson: Week x, Day x */ public class Example { public static void main(String[] ignored) { Car car = new Car(); car.addObserver(new SimplePositionObserver()); car.addObserver(new VelocityObserver()); car.addObserver(new NamedPositionObserver()); car.run(); } // TODO: Implement the AverageObserver and tie it in with the rest! // public void run() { // double smoothedPosition = 0; // // for( each time-step) { // // car moves.. // // // Compute average position // smoothedPosition = 0.9 * smoothedPosition + 0.1 * positionMeters; // System.out.println("Smoothed position: "+smoothedPosition); // // } // } }