Determine Traffic in Real-Time?

Goal: determine traffic for Streets and Rail

Given:
-Grid: X * Y (e.g. 100*100)
-Houses (each house is occupied by M people)
-Workplaces (each workplace can employ N people)
-Streets & Rail

Constraints:
-People move from houses to their workplaces and back
-update whole world in approximately every 3-5 seconds. The world doesn’t need to be updated every iteration. every iteration only updates a part of the world

How would I go about to determine the traffic/congestion for each street/rail tile on the grid? I want to simulate people moving from their house to the closest available workplace. I cannot do the calculation for the whole map in a single iteration, so I figured I calculate only part of the map in each iteration, reducing computations.

There is a very easy way calculating traffic by counting the number of people close to a street/rail tile. But that’s not what I want to do. It’s not very realistic.

Suggestions? Algorithms? Do you know of anyone/link showing similar approaches? Similar discussions on the topic?

Thanks! Any ideas/pointers are highly appreciated. Please note, that this is for a city simulation type of game ;D

How about using path finding to create a route which lists which road/rail segements a person will use between their house and place of work. This can probably be done once for each house.

And then each “commute initiation” time for the person (which i suggest to be random distributed around the usual morning and afternoon peak times) simply add to a counter each of the roal/rail segments.

i think this would probably be a bit more realistic.

Perhaps you might want to periodically attempt a new path between the house and the workplace and take into account a penalty with traffic congestion. This way a person can change their route to work and make the traffic congestion more realistic as people “learn” to avoid the hot spots.

First of all get statistics on people’s travel choices to make your results more realistic.

People tend to take the same sort of route and have a travel plan, which works well with AI. First create a general plan, first of all they need to have some idea of how they get to work, then they need some directions and so on. People don’t think in terms of many nodes, our nodes are much more abstract. For example if you are planning a journey involving say, two buses and 3 separate trains we only care about the interconnections between the two. Often you have many choices …

p.s. I think the route finding per person would be easier with a genetic algorithm! The fitness function can take in things such as waiting time, i.e. I had to wait for 10 minutes between each bus; simplicity, i.e. I only needed to take 2 buses even though it took long; and speed. Each person will have different preferences and many other factors, cost, reliability. You may also want to simulate traffic jams depending on your road plan; some junctions are hotspots for traffic jams - this will alter the people’s choice in route big time. Plus you have signal failures on some routes, etc.

EDIT: also if this is for a game then you need to think of the main goals it has in the game. Without specifications there is no good or bad answer!