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=]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=]Ejs version of traffic control simulation[/url],too.
  1. 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.

  2. You can change the period of each light

    1. clicking the traffic light at the top-left cornor
    2. the number near each color is the period for that particular light (second)
    3. left/right mouse click will decrease/increase one second
    4. ( for MAC user, click between light and number to the right to increase the length of time)

  3. parameter controls
    each click to the arrow at left/right of the number will decrease/increase
    the parameter by 1 unit.

    1. 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.
    2. max Velocity control represents the speed limitˇ]Vmin=5, Vmax= 50ˇ^
    3. acceleration control represents the acceleration for the car when it speeds up.ˇ]Amin=1 , Amax=20ˇ^

  4. TextField values

    1. TˇGtime in second after pressing the start button
    2. N1/N2/flow rateˇG total number of cars passes intersection (N1:left-right/N2:up-down)
      flow rate=(N1+N2/3.)/T
    3. n1/n2/flow rateˇG number of cars passes intersection during last minute.
      flow rate=(n1+n2/3.)/60

  5. Color code for car
    1. yellow: accelerating (A>0.)
    2. green: moving with constant speed (include stopped) A=0.
    3. red: stopping (A<0.)

  6. Velocity of each car is represented by a blue dot.

  7. 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
    1. 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.

  1. 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.
  2. How to adjust parameters to increase the traffic flow?
    1. adjust timing of each light
    2. adjust delay time control
    3. adjust Vmax
    4. 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][/img:ebda2bdfd4]

Applet latest updated: 2009/12/25

I have created another version of [url=]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 if you want latest version code (2009 Dec. 25).