Java Reference
In-Depth Information
dispenser, when the driver withdraws a ticket. The driver watches the
semaphore, the ticket dispenser and the stopping bar to ascertain when it is
time to proceed and to withdraw the ticket.
11.1.3
The control program
The controller imposes a behaviour on the access control system consisting
of the following sequence of phases.
Phase 1: The controller is waiting for a car to occupy the area of the first
photocell.
Phase 2: The car is proceeding towards the ticket dispenser. The con-
troller waits for the car to clear the first photocell. The controller sets the
semaphore to red and sends the command to deliver a ticket. If a new car
arrives, it must wait for the semaphore to become green.
Phase 3: Both the car and the controller are waiting for the ticket to be
delivered.
Phase 4: The ticket dispenser delivers the ticket. The controller waits for
the car driver to withdraw the ticket. When the driver withdraws the
ticket, the controller sends the command to raise the stopping bar.
Phase 5: Both the car and the controller wait for the stopping bar to be up.
Phase 6: The stopping bar is up. The car proceeds into the parking area.
The controller waits for the car to occupy the second photocell.
Phase 7: The car has occupied the second photocell. The controller waits
for the car to clear the second photocell. When the car has cleared the
second photocell, the controller sends the command to lower the stopping
bar
Phase 8: The controller waits for the stopping bar to be down. When the
stopping bar is down the controller sets the semaphore to green. A new
car can proceed along the access lane.
The control program should be highly reconfigurable: the programmer
might implement control programs that handle new scenarios. For example,
the behaviour of the access control system is different in the case of mal-
functioning (e.g. the dispenser needs maintenance) or emergency (e.g. a fire
engine is not required to obtain a ticket).
11.1.4
The simulator
The simulator is a program that animates the access area depicted in
Figure 11.1.
It visualizes the car while it is proceeding along the access lane. The car
should be represented graphically in a sequence of consecutive positions
every 100 milliseconds.
It visualizes the light beam of the photocells with a dashed red line that
crosses the access lane. When the car occupies the photocells, the red line
is not displayed.
 
Search WWH ::




Custom Search