Traffic Simulation Applet

Written in Java, this traffic simulation applet illustrates autonomous vehicles. Requires Java: http://www.java.com/


Traffic Simulation Applet. Click to start and stop. Spacebar to add cars.
Each car drives autonomously and maintains a safe following distance.

With the default number of cars, they rapidly space themselves out and travel smoothly at maximum speed. As cars are added, slowing behavior occurs, much as we observe on a freeway as traffic density increases. Unlike a real freeway, however, this simulation is only one lane and runs in a loop.

This Java source code is for educational purposes only. Viewing or downloading the source implies your consent to obey the restrictions:

  1. Use the source code for educational purposes only.
  2. Give appropriate attribution in all executables and listings derived from this source.
  3. Reproduce these restrictions and conditions in any derived programs.

I agree to the restrictions and conditions on the source code.

Version 1.12, compiled July 4, 2008, with Sun JDK 1.6.


This page established December 3, 2001; last updated July 12, 2010 by Rick Wagner. Copyright © 2001-2010, all rights reserved.