Java Reference
In-Depth Information
Figure 11.10 ( continued ). Copyright © 2005 Sun Microsystems, Inc. All rights reserved. Reproduced by permission of
Sun Microsystems, Inc.
correspondence between the state of the system and the events generated by
each component.
11.6
Extension
The second prototype does not simulate the situation where a queue of
cars is waiting outside the parking access lane. Typically, while a car is pro-
ceeding along the access lane, another car is waiting for the traffic light to go
green. The simulator can be extended in such a way that three cars (red,
green, blue) are active in the system. For example, at a given time instant,
the red car is withdrawing the ticket, the green car is waiting the traffic light
to go green, and the blue car is outside the access lane waiting for the green
car to proceed. When the red car completes the access procedure, the green
car proceeds along the access lane and the blue car stops at the traffic light.
In order to animate the simulation repeatedly, cars go to the end of the
waiting queue when they exit the access lane. The controller might imple-
ment a variety of alternative behaviours. For example, when a fire engine
needs to get into the parking area, the ticket is not delivered and the
stopping bar goes up immediately.
 
Search WWH ::




Custom Search