traffic
which does the simulation.
traffic.cxx:
This is the main program for the traffic light simulation.
You can start with the version in
~main2270/programs/traffic.cxx
and add your name and other information at the top.
You'll have to read and understand all of this program, and you'll
implement the specified traffic
function.
THe algorithm for the traffic function will be discussed in class.
You'll also discuss
what kind of results to expect from the simulation.
makefile:
This is a makefile for the assignment.
The file should contain targets for things.o, traffic.o and
traffic (an executable file).
The source code things.cxx
is available in the locations listed below. Your makefile should
also include "all" and "clean" options--but there is no target
for the Queue template class!
queue2.h
and
queue2.template:
My implementation of the Queue class. Notice that this version
includes a peek() member function to get a copy of the front item
without removing it.
things.h
and
things.cxx:
A collection of useful classes. You'll need to use the Averager,
the BooleanSource, and the TrafficLight. (Some of these classes are
from the car wash example of Section 8.2).
Most of the information that you need for this assignment is in the traffic.cxx file. Some further discussion will be done in the Oct 13-14 tutorial groups.