OO Programming in Java
Class Material
Simulator
Here's the actual Code |
- If you load this and select 'Test' from the 'Test' menu the LightTester class will exercise the lights thru the TrafficLiteSimulator calls ..nPedLite("walk") .. etc.
- Don't forget to make sure your TrafficLiteController is hooked up in the TLCAdapter.
- TrafficLiteSimulatorView is 'main'.
Here are the object relationships for the simulator.
(There's an error in the TLCAdapter diagram (not the code). It should have an additional reference, one to the
TrafficLiteSimulator)
and here is what the simulator looks like ...
The pedistrian buttons are on the sidewalk, the traffic sensors are in the street.
.