Improving Freeway Driving

What a computer simulation program reveals about good and bad driving habits

by Hans Camenzind
San Francisco

It is Friday 3 PM.  You are on the freeway, heading home.  Well, you are heading that way, but you are not moving much.  There are four lanes of smooth concrete and the sign you have been staring at for the past minute says you are not allowed to exceed 65 mph.  The cars in another lane move forward slowly, then finally your own lane.  You gain speed, all the way up to 25 mph and then the column stops again,

Finally, after 20 minutes and a total of 2 miles, your column slowly gains speed and you are past the obstruction.  But what obstruction?  You don’t see anything.  No accident.  No highway patrol cars.  No visible reason for a slow-down.

I have been driving for more than 40 years, in California and Massachusetts and in cross-country trips in just about any other state.  I grew up in Switzerland and, for a few years (and periodically since then), got acquainted with the driving there and in Germany, France, Great Britain and Italy.  I noticed a difference.  European traffic – especially on the Autobahn in Germany – appears to be more disciplined and they seem to move more cars in fewer lanes.  Sure, some of their speed limits are higher than ours (and in a few sections of the Autobahn there is no speed limit at all), but even when they are the same you seem to be getting there faster.  The difference then must be in the drivers, not the freeways or the cars.

Of course it is one thing to suspect a cause and quite another to prove it.  I didn’t find any literature on the subject; all the articles I found were very either vague or scholarly and didn’t provide the answers for which I was looking.

I have used computer simulation in my work as an electronics engineer many times before.  Some of it is plain garbage, but if a simulation is done carefully you get results you can trust.  In fact, simulation is often the only way you can investigate the behavior of a system or a gadget.

A car on a freeway is autonomous.  Thousands of drivers make independent decisions, influenced by the law (most of the time) and what other drivers do.  So it should be possible to design a program that gives each car a certain behavior, then put it on a simulated freeway with hundreds of others, and simply let it go.  The behavior would be described by a fairly large number of driver characteristics, such as the desired speed, how fast it accelerates, how close it gets to the car in front, whether it chooses a lane and stays in it or drives as far to the right as possible (as the law says).

I wrote a detailed outline of the program with 14 driver characteristics and then set out to find a programmer (I’m a hardware guy who knows just enough about programming to achieve the level of klutz).  Thanks to Craigslist I found one almost immediately: John Givens.  John has a flowing white beard, an enormous amount of experience and has turned out to be easy to work with.  It took him only a month to have a program running.  Since we both use PCs, John wrote the program for Windows.

The simulation program looks at a stretch of a 4-lane freeway.  On the screen is shows 16 straight sections of 1/4 mile each, for a total of 4 miles.  The cars, shown as small rectangles of various colors, start in the top left corner, move through the first section and then continue in the section below it, and so on.  When they reach the bottom on the right side of the screen they continue uninterrupted in the top right corner.  It is an endless loop in which only driver behavior counts; there are no entrances or exits, no accidents, no highway patrol cars, no trucks and no distracting events at the edge of the freeway

You can choose the total number of cars on the freeway and put them into as many groups as you like, represented by different colors on the screen.  They start out bumper-to-bumper in the lane 1 (the right-most lane) and, if that overflows, in the next lane.  When you hit “enter” they start moving, gradually gaining speed and spreading out over all four lanes.  The screen displays the average speed of all cars, as well as the speed of any group or car.

The program calculates the position of each car 16 times a second, which is just enough to get the impression of continuous movement but slow enough to work on even a relatively slow netbook laptop.  Which is quite remarkable since, with say 1000 cars, it has to calculate the positions 16,000 times a second, keeping in mind 14 driver characteristics and the behavior of several neighboring cars.

(You can run this program on your own PC.  See the instructions at the bottom of this web-page.  The program is available at no charge to anyone.)

*      *      *

So I started a large number of simulations, more than 100 of them.  After about 5 minutes, when the cars have reached their traveling positions, you can see the pattern: cars changing lanes to go faster, being slowed down by drivers in front, and cars trapped in a lane by faster traffic in neighboring lanes.  This interplay is quite fascinating to watch, as if you are looking at a real freeway from1000 feet up.

But of course the purpose of the project was to see how driver behavior influences speed.  Among the many simulations I ran, I found that 5 groups of cars with driver habits I have often observed give a very telling result.  I have given each group a name:

  1. Speeder – Willing to go up to 80 mph.  Moves to any lane to achieve that speed.
  2. Lane 3 Resident – Moves straight-away to the third lane and stays there, even though faster cars have to pass on the right.  Moves at the speed limit.
  3. Normal – Wants to go a little faster than the speed limit and uses any lane .
  4. Cautious – Travels near the speed limit and moves immediately to lane 2 and stays there.
  5. LOL (Little Old Lady) – Never leaves lane 1 or exceeds 60 mph.

Also, the groups whose drivers stay in a fixed lane (3, 4 and 5) leave more space to the car in front and take a little longer to accelerate after a slow-down.  (I call lane one the first lane you enter.)

I repeated the simulations, each time increasing the total number of cars by 200, a range of 200 to 1400.  In doing this, a clear pattern emerged.  The “bunch-ups” become more frequent and more extreme.

Then I duplicated the five groups, but changed the driver behavior.  A driver in a European country must follow two very strict rules:

1. Never stay in the ultimate passing lane (in our case lane 4); after passing a car you must move back to the slower lane as quickly as you can.

2. Whenever there is a car behind you, you have to move to the right at the first opportunity.  This applies to all lanes.  In countries which drive on the left (Great Britain, Ireland, Malta and Cyprus) the sense is reversed but the rules are the same).

Just how serious these rules are is shown by a third one:  You are not allowed to pass to the right of any car.  So, if you stay in a passing lane too long (thereby preventing other cars from passing) you get a warning from the car behind you in the form of flashing high-beams.

In the new set of groups I changed only three parameters: 1) All cars move to the slower lane if a car is behind,  2)  No excessive spaces to the cars in front, and  3)  Everybody pays attention and accelerates with only a short delay after a slow-down.  I call this set “Yield”, the previous one “Don’t Yield”.

The difference is undeniable and stark:

At just over 100 cars per mile, “Don’t Yield” behavior begins to take a small toll  on average speed.  As the density of cars increases to 200 cars per mile (a Wednesday afternoon rush-hour), the average speed decreases from 63 mph to 43 mph, almost entirely because about 30% of the drivers insist on staying in lane 3.  At about 270 cars per mile (Friday afternoon rush-hour),  “Picking a lane and staying in it” reduces the average speed from 56 mph to 28 mph.  A ratio of 2 to 1!

Many “Third Lane Residents” I have talked to feel they are doing nothing wrong.  Many of them (and all of them in our example) are not violating the speed limit and, although a law exists which says “always drive as far to the right as possible”, it is not enforced in any state.  Few of them seem to realize that this driving habit reduces speed, including their own.

Additional simulations have shown that the effect on average speed of a “Fourth Lane Resident” is even more pronounced.  An a driver who stays in the second lane is not innocent either; he in effect wastes a quarter of the freeway.  No European driver would do that simply because it is less of a bother.  Nor would it be tolerated by the other drivers.

I have provided a short (2-minute) clip, showing the abbreviated results of two simulations, both with 250 cars per mile of road (a weekday rush hour).  For clarity only one stretch (1/4 mile) is shown, though the simulation produces 16 such ribbons, for a total of 4 miles (forming an endless loop).

In the top ribbon the cars follow the European driving rules (“Yield”), moving to the right whenever there is a car behind.  The cars in the bottom ribbon follow the US driving habits (“Don’t Yield”), with some drivers staying in their chosen lane oblivious to other cars.

 

As you can see, the average speed is 60 mph when the drivers yield, but drops to 33 mph when they don’t yield.

The analysis also showed the cause of the mysterious slow-downs.  Any freeway will eventually reach a breakdown point, when there are simply too many cars on the road for the freeway to handle them.  But by yielding to cars approaching from behind this point extends itself to almost twice as many cars per mile.  The stop-and-go phenomenon is made much worse by drivers who leave large gaps by accelerating slowly or belatedly after a stop.

If you would like to run this program on your PC click here.

Update 1/14/13

TrafficSim has been updated to a new version (0.8) which includes the following changes:

  • Cosmetic–for example, those ugly gaps in the dotted lines have been eliminated
  • Mousing a car(LEFT-CLICK) to get statistics has been made easier, and the formatting has been fixed.
  • CTL-LEFT-CLICK now shows statistics about the car’s group.
  • Cars have turn-signals now
  • File->Speed has been added. This will speed up time. No more waiting overnight to see what happens.
  • File->StepTo will stop the display at a given step-number
  • Keying a ‘c’ will impose a 5mph “construction zone” somewhere in the middle. It makes a big pile-up. Then hitting ‘c’ again shows that it takes quite a while to clear up–and the congestion seems to move backwards.
  • There is a help-file now. It is helpfile.txt and needs to be in the same directory as TrafficSim.exe. It can be edited offline.