Consider a traffic light system at a four-way crossroads (e.g., two roads intersecting at right angles). Assume the simplest algorithm for cycling through the lights (e.g., all traffic on one road is allowed to go through the crossroad while the other traffic is stopped). Identify the states of this system and draw a statechart describing them. Remember that each individual traffic light has three states (i.e. green, yellow, and red).

What will be an ideal response?


We model this system as two groups of lights, one for each road. Opposing lights have always the same value. Lights

from at least one group must always be red for safety reasons. We assume there are no separate lights for left and right

turns and that cycles are fixed. Figure 5-6 depicts the startchart diagram for this solution.



Computer Science & Information Technology

You might also like to view...

USB (choose the correct one.)

a. is intended as a long distance network connection b. is intended as a high-speed desktop serial interface c. offers parallel transmission options d. is faster than Firewire

Computer Science & Information Technology

You can create a new folder using the ________ dialog box

A) Save As B) New Folder C) Files D) New Files

Computer Science & Information Technology

The item marked ____ in the accompanying figure is the Stage.

A. 2 B. 3 C. 4 D. 6

Computer Science & Information Technology

Tracking security software will send the ________ of the user's Web service to the tracking company's Web site

A) IP address B) system unit ID C) CPU address D) processor ID

Computer Science & Information Technology