Java Reference
In-Depth Information
TrafficLight
PhotoCell
TicketDispenser
StoppingBar
GREEN
CLEARED
DELIVERED
DOWN
setRed()
RED
setGreen()
GREEN
occupy()
OCCUPIED
clear()
CLEARED
withdrawn()
WITHDRAWN
deliver()
DELIVERED
raise()
UP
lower()
DOWN
RED
OCCUPIED
WITHDRAWN
UP
Figure 11.4 Finite state automata of traffic light, photocell, ticket dispenser and stopping bar
upper label indicates the condition that triggers the transition. For example,
occupy() is the method of PhotoCell that triggers the transition from CLEARED
to OCCUPIED . The lower label indicates the action that is performed during
state transition. For example, PhotoCell notifies event OCCUPIED . Event
names are in italic upper case.
Figure 11.5 depicts the controller's finite state automaton. It is made up of
eight states that represent the phases described in Section 11.1.3.
Figure 11.6 depicts the car's finite state automaton. For the sake of
simplicity, we assume that only one car is present in the system at any time;
that is, in this prototype we do not model the queue of waiting cars.
IN_PhC.
CLEARED
SEM.setRed()
TD.deliver()
IN_PhC.
OCCUPIED
TD.DELIVERED
PHASE 1
PHASE 2
PHASE 3
PHASE 4
TD.
WITHDRAWN
SB.DOWN
SEM.setGeen()
SB.raise()
PHASE 8
PHASE 7
PHASE 6
PHASE 5
OUT_PhC.
CLEARED
SB.lower()
OUT_PhC.
OCCUPIED
SB.UP
Figure 11.5 Finite state automaton of controller
 
Search WWH ::




Custom Search