traffic simulations and paths

New Message Reply Date view Thread view Subject view Author view

Dee A. Chapman (dchapman++at++ncsa.uiuc.edu)
Mon, 2 Dec 1996 15:59:59 -0600 (CST)


Hello,

I'm trying to create a simulation in which cars follow simulated
traffic lights. I have the control of the lights working, but getting
the cars to obey the signals is causing me some trouble.

What I've done so far is create 4 segments. The 1 segment is always
followed, the 2nd segment is followed if the traffic signal is red or
yellow (car slows and stops), the 3rd segment is followed after the
light switches from red to green (car accelerates and goes), and the
4th segment is followed if the light is green when the car approaches
the intersection (car keeps driving through intersection).

The part I'm having trouble with is getting the car to follow the
appropriate segments. (Note each segment is actually a separate path
I've created). Actually, I'm having trouble getting them to follow
any segment but the very first one.

So... finally, my questions are:

1. I want to be able to decide which segment (path) to follow
on the fly. I can check the value of the traffic signal and choose
the appropriate path... but I can't get the car to take if for some
reason. Any ideas? Do the segments need to be connected in some
way first in order for the same car to follow multiple paths? And if so,
how can I do this while still maintaining the ability to choose on the
fly.

2. Is there a way to know when the car has completed the following
of a path? I didn't notice any such call in the pfuPath man pages.

I'm guessing this traffic simulation has been done before, so if any
one can share some sample code, I'd be most thankful.

Thanks much for any help you can provide.
Dee

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:04 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.