Data Structures - Project 3 Programming Assignment
Traffic Light Simulation

The Assignment:
You will implement and test a small program that simulates two synchronized traffic lights. Some of the work has already been done--your primary job is to implement a function called traffic which does the simulation.
Purposes:
Give you practice in using the Queue class.
Give you practice in reading header files and using classes that are written by someone else.
Due Date:
April 15, 2001
Files that you must write:
  1. traffic.cxx: This is the main program for the traffic light simulation. You can start with the version in "/afs/umbc.edu/users/r/a/rabi/pub/CMSC341/Proj3/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.
  2. 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!
Other files that you may find helpful:
  1. "/afs/umbc.edu/users/r/a/rabi/pub/CMSC341/Proj3/queue2.h" and "/afs/umbc.edu/users/r/a/rabi/pub/CMSC341/Proj3/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.
  2. "/afs/umbc.edu/users/r/a/rabi/pub/CMSC341/Proj3/link2.h" > and "/afs/umbc.edu/users/r/a/rabi/pub/CMSC341/Proj3/link2.template"
    Yet another linked list with iterators that is used in the queue implementation.
  3. "/afs/umbc.edu/users/r/a/rabi/pub/CMSC341/Proj3/things.h" and "/afs/umbc.edu/users/r/a/rabi/pub/CMSC341/Proj3/things.cxx"
    A collection of useful classes. You'll need to use the Averager, the BooleanSource, and the TrafficLight.


Discussion of the Assignment

Most of the information that you need for this assignment is in the traffic.cxx file.

Note, you don't need to copy the supporting files i.e. things.h, things.cxx, queue2.h, queue2.template, link2.h, and link2.template to your directories, just point to them in your makefile.

Submit your makefile and the modified traffic.cxx files.

There will be no questions with this project.