Intelligent Traffic Light

Objective:

This simple demonstration shows how three analog sensors can easily be integrated into a cognitive model that can be deployed in a simple device. In this case, we are accumulating three risk factors and controlling the length of time that the yellow light will remain on. The assumption is that collisions at an intersection can be reduced if the yellow light remains on longer giving the drivers longer time to react. The objective is also to keep traffic moving through the intersection without any extra delays if the risk factors are low.

Description:

This demonstration assumes that there are three analog sensors: One that detects the speed of the traffic, one that detects the volume of traffic, and one that measures weather conditions.

The speed detector measures average speed of the traffic going through the intersection. For example, suppose that the sensor detects the average speed for the last x number of vehicles between 0 and 100 MPH.

The traffic volume sensor counts vehicles per minute and keeps a running average. Assume it counts from 0 to 200 vehicles per minute.

The weather sensor detects weather conditions and it measures 0 (best conditions) for perfectly clear sunny day to 100 for snow, ice, 0 visibility (worst conditions).

In this demonstration we have set some thresholds such that if there is high volume, but the speed is almost 0, then there will be no increased risk and we won't increase the length of time for the yellow light.

Also, if there is almost no traffic (potentially at an off hour), and one car speeds through at 100 MPH, then we will also not increase the length of time for the yellow light.

In this system we are defining a model where the impact of speed in the overall risk is non-linear. A curve defines the increasing risk associated with speed. We are also defining the maximum impact of speed in the overall integration of speed, traffic volume and weather.

With traffic volume, we are defining a linear relationship as volume increases.

And also with the weather sensor, we will assume that as the weather degrades from 0 (best weather) to 50 (cloudy) that this will have no impact on the risk and therefore no impact on the length of time for the yellow light. When it degrades past 50 towards 100 (worst), then the risk will rise according to the S curve shown above.

In this demonstration we are showing two configuration parameters that might be set with DIP switches or potentiometers in a productized design: Base Time and Max Time. The Base Time value would be the time that the yellow light stayed on with no added risk. The Max Time would be the maximum time that the yellow light remained on with maximum risk detected.

In this demonstration, the maximum impact of speed and traffic volume has been set at design time. The same is true for the shape of the curves for the three sensors. All of these could be controlled with other configuration parameters.

Design

The KEEL source code below shows the design of the traffic signal logic. It was created in about 30 minutes by merging existing design segments together and linking them into the final model. This design was originally created by individuals that had been through an initial 4 hours of KEEL training and they wanted to see what they could do on their own.

The Speed sensor is connected to Input 0; the Traffic Volume sensor is connected to Input 1; and the Weather sensor is connected to Input 2 in the design above.

You can manipulate these inputs and see the system react. The accumulated Risk output is shown as the Modified Value of the first position (left most item).

Many of the elements in the code are interactive. For example, if you click on end points of the "wires", the wires from that point will turn red so they can be traced and you can see how the data items interact. Click on other connection points and you can see their "value". Click on the arguments (vertical scroll bars at the bottom) and you can see how they are labeled and see their values.

NOTE: This is just a "rendering" of the source code that is manipulated with the KEEL Toolkit. From within the toolkit you can define new data items, organize them on the screen, create selective "views" of the data, graph relationships, create reports, and translate the design to conventional code (C, C++, C#, Flash, Java, Python,VB...).

Traffic with Language Animation

For Introductions to Non-Flash Users