Lab 5 Assignment: -- Second Automobile Traffic Simulation Lab
COM1101 Winter 2001

(Version of 2/4/2001)

Professor Futrelle
College of Computer Science, Northeastern U., Boston, MA

IMPORTANT NOTICE -- Because this lab is not trivial and because we have a quiz and the Midterm coming up, the lab will be split into two parts, with the final part, now lab 6, not being due until Monday the 19th, after the Midterm.

This page explains what you are to do and turn in for this assignment. The background and details for the lab are in the details page [in preparation]. The lab will take place on Tuesday, February 6th and is due by 4pm on Monday, February 12th.

Overview: This lab will be somewhat different from the previous lab. In this lab, there'll be a total of ten cars, started at various positions, with slightly varying speeds. Each car "watches" the car ahead, noting the speed difference and separation between them. One of the cars slows to a stop, remains stopped for a while and then accelerates. The cars in front continue, but the cars behind come to a stop eventually (and hopefully in time!). To see a plot of a run of my version of the lab, look at this page and another run with different parameter settings.

An important page, available now, is the draft API and related details, derived from my finished Lab5/Lab 6 code. Be sure to look it over carefully.

From the point of view of program design and implementation, this lab will include the use of pointers as well as a "policy" for the car objects -- how they react to their going too fast or too slow or being too close to or too far away from the car ahead.

WHAT YOU ARE TO DO AND HAND IN FOR LAB 5

  1. Any additions you make to the API specification for the two classes, simulation and car, on top of the ones I give you. You may also want to clean up my descriptions, which are more of rough drafts.
  2. To make the design and implementation less burdensome, you are welcome to make all members of your classes public and write no member accessor functions. You may do all your work in a single file, if you choose to, but for Lab 6 you will be required to have your project in multi-file form, using separate compilation, as for Lab 4.
  3. Do as much implementation as you have time for, with the final implementation due as Lab 6, not this Lab 5. For Lab 5 try to write at least stubs for all your functions, so you'll have implementation files; they just won't do anything except possibly call one another and print.
  4. The only results you might have is runs in which stubs print out "So-and-so stub ran."
  5. For Lab 5 you only need to hand in hardcopies of your various files, including any output you have.

EXTRA CREDIT

As I've said in my note on APIs, you will get extra credit if you track down and use an automated API documentation generator for C++.