Model Distributed Traffic Control System by Using Messages - MATLAB & Simulink (original) (raw)

This example shows how to model a distributed control system for an intersection of one-way roads. To coordinate the state of the traffic lights, the two charts communicate with each other by using messages. The design of the two charts is identical.

You can interact with the traffic signals through a MATLABĀ® UI. To request a pedestrian crossing, click one of the dark gray request buttons at the bottom of the traffic signal.

The controller for each road is implemented by the traffic light controller subsystems Traffic Light 1 and Traffic Light 2.

In each subsystem, the Controller chart describes the main logic of the traffic controller through the various states of the traffic signal.

This model takes advantage of these semantic features of messages:

To change the speed of the simulation, in the Simulation tab, select Run > Simulation Pacing. In the Simulation Pacing Options dialog box, adjust the slider setting. For more information, see Simulation Pacing Options (Simulink).

See Also

Simulation Pacing Options (Simulink)

Topics