![]() |
![]() |
![]() |
![]() |
Add widgets to display simulation information
Running the lights may be interesting, but not very useful - let's add some displays that will tell us what's happening to the cars at the intersection.
Now you will add queue widgets to display the sum of the length of each pair of queues as we simulate.
- The East/West widget for displaying the total East/West queue length is already provided. Let's edit the source to add a display for the North/South direction. Use the notepad:
notepad queues.tclThe solution is commented out in queues.tcl.
The Queue Display widget consists of an enclosing frame with two label widgets. The first label is a simple text string. The second label is the value of the queue length. The text in the second label will be updated whenever the queue lengths change.
- After you have added your North/South widget, run your program by invoking this command:
source queues.tcl draw_queuesAccording to the traffic indicators, the cars are leaving the intersection at the same rate. That seems fair, but if you are designing an intersection that responds to the traffic flow into the intersection you might want to change the light cycles. Perhaps one of the directions has more incoming traffic than the other.
Adding controls, in the form of scale widgets, allows you to quickly change the assumptions about traffic flow into the intersection.
![]() Model Technology Incorporated Voice: (503) 641-1340 Fax: (503)526-5410 www.model.com sales@model.com |
![]() |
![]() |
![]() |
![]() |