Traffic light control: **** [glow=red,2,300][b]click the following tabs for more information[/b][/glow]
Would you like to engineer the traffic light system for a one-way street that consists of several lanes along which rush-hour traffic flows?
How would you time the onset of green lights at the various intersection?
How to promote the traffic flow? This java applet let you play with it.
[color=red]Due to java version changes, this simulation become very slow.
Please check out [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=365.0]Ejs version of traffic control simulation[/url][/color]
[b][color=blue]Due to so many requests from the users, source code for this applet is distributed with the ZIP files you will receive if you click [u]get file for offline use[/u] button. It is also available as attached file. Please do not ask me to send you the source code again, help yourself-- it is just a click away![/color][/b]
You are welcomed to check out [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=365.0]Ejs version of traffic control simulation[/url],too.
- The traffic lights at interactions are for cars moving from left to right. The traffic on the perpendicular streets can only move when light is RED.
- You can change the period of each light
- clicking the traffic light at the top-left cornor
- the number near each color is the period for that particular light (second)
- left/right mouse click will decrease/increase one second( for MAC user, click between light and number to the right to increase the length of time)
- parameter controls
each click to the arrow at left/right of the number will decrease/increase
the parameter by 1 unit.
- delay time
control near the traffic light controls the delay of the onset of green light at the interaction relative to that at prevous ntersection.
- max Velocity control represents the speed limitˇ]Vmin=5, Vmax= 50ˇ^
- acceleration control represents the acceleration for the car when it speeds up.ˇ]Amin=1 , Amax=20ˇ^
- TextField values
- TˇGtime in second after pressing the start button
- N1/N2/flow rateˇG total number of cars passes intersection (N1:left-right/N2:up-down)
- n1/n2/flow rateˇG number of cars passes intersection during last minute.
- Color code for car
- yellow: accelerating (A>0.)
- green: moving with constant speed (include stopped) A=0.
- red: stopping (A<0.)
- Velocity of each car is represented by a blue dot.
- A new function has been added to help you determine the delay time between traffic lights.
Click the right mouse button to suspend (the animation).
The time intervals (for the first car ) during which the signals are green/yellow/red
are represented by thin (colored)lines at one side of the road.
A blue curve represent x-t (displacement verse time) for the first car is shown.
Use that curve with those color intervals to adjust the delay time between
traffic lights. Click the right mouse button again to resume.
- Suppose a platoon is stopped at interaction. When the green light comes on, there is a "start-up wave" travels from the leader along the length of the platoon at a speed vs.
- How to adjust parameters to increase the traffic flow?
- adjust timing of each light
- adjust delay time control
- adjust Vmax
- adjust A(acceleration)
Think of it! Play with it! I hope you do learn some physics from this applet.
If you click the right mouse button in the simulation, you will see a curve similar to the following figure (Hints to adjust the traffic flow) [img:ebda2bdfd4]http://www.phy.ntnu.edu.tw/ntnujava/pics/trafficControl.png[/img:ebda2bdfd4]
Applet latest updated: 2009/12/25
I have created another version of [url=http://www.phy.ntnu.edu.tw/ntnujava/viewtopic.php?p=1614]traffic light control applet with EJS[/url] and you can view how it was implemented with EJS(You can find the code).
Please download the last trafficControl.java if you want latest version code (2009 Dec. 25).