This simulation is similar to the [url=http://www.phy.ntnu.edu.tw/ntnujava/viewtopic.php?t=226]traffic light contril[/url] I have created many years ago.
But I rewrited it with ejs.

Each square represent a car. It could be painted with three different color depends on it's acceleration a.
1. a>0 (yellow): when there is no car in front of it or the car in front is far away (the distance is more than d[sub]min[/sub]) and the street light is not red.
2. a=0 (green): it will keep move with the same speed when it reach maximum speed.
3. a<0 (red): when the street light turn red or the car in front is too close (distance < d[sub]min[/sub]).

d[sub]min[/sub]= v* t[sub]reaction time[/sub], where t[sub]reaction time[/sub] is the reaction time of the driver.

You can click the +/- sign to change the time delay between traffic lights.


VIEW or DOWNLOAD ejs xml source
then click to translate strings for selected locale.


Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop.


acceleration=m/s[sup]2[/sup] (modify value and hit return to change acceleration)
reaction time=s