Credit
------
The simulation example presented here is based on a program originally
developed in Turing by Prof. M. Molle for CSC 270H.

Programming issues not cleaned up
---------------------------------
There are a couple of points that it would be nice to do better, but that
for lack of time (and out of worry that an improvement would make the program
forbiddingly complex for beginners at C and C++) I have left as they are.

First, the lists of #includes at the beginning of the .cc files are not
well organized. They are made less clear by the fact that the file
"global.h" depends on a couple of other .h's, and through them on a
couple more, so that ultimately most of the .cc's depend on nearly
all the .h's. It would be useful to take a more careful look at these
dependencies.

Secondly, the Makefile doesn't include all the dependencies. After
re-examining the .cc-.h dependencies, it would not be hard to fix the
Makefile, but the file would then be rather confusing, and I'm not sure
that would increase its benefit as a learning example. Beginners
should note, though, that this Makefile is not complete and that
it may be a good idea after making changes to watch carefully that
all affected .o files are re-compiled.

Output
------
Some of the results are very sensitive to the seeds used. Specifically,
the output columns labelled "NoQueue Fraction" may change by a factor of
more than two when the total time is small, as in the second example
output in the CSC 270 notes. The "Average Wait" column also varies
noticeably.

The reason for this is that an occasional interarrival time of 100 seconds
or more, while fairly unusual, will have a major effect on the average
time the queue is empty, until the simulation has run for quite a while.

Converting to a PC compiler
---------------------------
To get these programs to run on a PC, do these things:

1. Rename the .cc files to be .cpp files, if that's what your compiler
   wants for C++ source.
2. In random.cc, comment out the line "#define RAND48".
2. In porting.h, add a line "#define TURBO" before the line "#ifdef TURBO".
   That works for Turbo C++; if you're using another compiler, you're on
   your own (but I'd like to hear from you when you've figured out what
   you need to do!).

The current version of the main program allows a command-line argument
giving the name of a data file, so that you can say "sim data" instead
of "sim < data". This should make things easier for DOS-Windows use.

			-- J. Clarke, June 1996
