http://books.nap.edu/html/hs_math/tl.html
maybe do a search for "traffic light timing"
If they aren't timed you may end up with gridlock or
a build up in places. The town I live in just spent
40,000 dollars just to do a survey on a road to think
about getting it timed properly and they'll spend several
hundred thousand to fix the problem.
Yes an A* path finding routine, there are a few floating
around. Look on blitzcoder. You could also do a table
of predefined paths, that would be better for optimization
you'll need to set up your intersections in a timing loop
to change from red to green to yellow. for each car as
it is driving check for distance from each each intersection
if the car is in proximity to the intersection and heading
towards it, if light is red or yellow slow car down using
a curve value based on the stop mark for the intersection
and the distance the car is from that stop mark. When
the light is green just use the normal acceleration and
have the car continue on its path.
maybe do a search for "traffic light timing"
If they aren't timed you may end up with gridlock or
a build up in places. The town I live in just spent
40,000 dollars just to do a survey on a road to think
about getting it timed properly and they'll spend several
hundred thousand to fix the problem.
Yes an A* path finding routine, there are a few floating
around. Look on blitzcoder. You could also do a table
of predefined paths, that would be better for optimization
you'll need to set up your intersections in a timing loop
to change from red to green to yellow. for each car as
it is driving check for distance from each each intersection
if the car is in proximity to the intersection and heading
towards it, if light is red or yellow slow car down using
a curve value based on the stop mark for the intersection
and the distance the car is from that stop mark. When
the light is green just use the normal acceleration and
have the car continue on its path.