I know my program is not the best in the world, however I believe that
it is a start. What I did was I went out to a local intersection
that met my assumptions as closely as possible. I recorded some data
to see if my code was right. In comparison to my code's results and
the actual results for this particular intersection the findings were fairly
close to each other give or take a few seconds.
My code does not work for large amount of cars (traffic)
because it is a 1 lane street in each direction. If I was to continue
my data table neither a stop
sign nor a signal
light would reduce
the waiting time. At that point one must begin to look at other methods
of traffic control possibly expanding the road. My code is a base
that other people could possibly build on.