OO Programming in Java

Class 8

Quiz 2


Design an object model and appropriate scenario diagrams for a program to handle road intersection control, a traffic light controller.


The intersection has one thru lane and a left turn lane for each of the four directions. The system receives input from an imbedded sensors in each of the lanes, and crosswalk request buttons on each of the four corners. The outputs are the state of the traffic lights with three colored light bulbs each, and the 'walk/don't walk' lights. There are a total of 8 traffic lights, one for the thru lane in each direction and one for each left turn lane. There are a total of 8 'walk/don't walk' signals. The system attempts to maximize the intersection resource. Priority is usually given on a first come, first serve basis.


Next week we will provide a simulator which you will interface to. You may need to write some small 'adapter' classes to achive this. The simulator will provide random inputs to your model and display the traffic light outputs using a simple text display which will allow you to completely test your model.