Next: About this document ...
Simulation Lab 1
Scott D. Anderson
I've typed in all the code from your book for the M/M/1 queue simulation.
(I hope you appreciate it.) Here are your tasks
- 1.
- Copy the program files from the class directory (poke around; you'll
find it) and compile it.
- 2.
- Test it. Do you get the same values as the book does?
Average delay in queue 0.430 minutes
Average number in queue 0.418
Server Utilization 0.460
Time simulation ended 1027.914
- 3.
- Modify the program to read inputs from the console and write to the
console. (Comment out the file I/O, you may need it again.) You might
make the output a bit more terse, too.
- 4.
- Try a range of service and arrival means. How do the output
statistics change? Does it make sense? Can you find inputs that
overflow the queue?
- 5.
- Add code to print out the queue length and time stamp. Next week,
we'll learn how to make a graph of this. Meanwhile, sketch it for a
reasonable size sample of runs.
- 6.
- Add code to compute the maximum queue length for a run.
- 7.
- Add code to compute the mean interarrival time and mean service
time. How well do they approximate the population means? Try using
shorter runs. How do the approximations change?
- 8.
- Homework Add code to do ``balking,'' where a customer
arrives, sees that the queue is too long, and leaves. Make the balk
length an input parameter. Compute statistics on the number of
customers lost due to balking and the amount of time that the queue is
at the balk length.
Next: About this document ...
Scott D. Anderson
1999-09-10