Next: About this document ...
Simulation Lab 3
Scott D. Anderson
Read the inv.cc program in the lab directory, think about it, and
answer the following questions:
- 1.
- What is the meaning of each line of the input file?
- 2.
- What is the meaning of each line of the output file?
- 3.
- What is the best strategy?
- 4.
- How are the demands generated? (Hint: it's a generalization of
what we did in class.)
- 5.
- How are the ordering lag times generated. (Hint: this is
just like we did in class.)
- 6.
- How are the various costs computed?
- 7.
- Change the simulation so that
- The simulation is for 60 months
- The initial inventory is zero units
- The shortage cost is 10 dollars
- Demands arrive at a rate of 20 per month
Before you re-run the simulation, what expectations do you have? What
strategy do you think will be best?
- 8.
- What difference do you think the initial inventory makes?
- 9.
- Look at how the program does formatted output. This is C style
formatted output, which I personally find to be much better than C++
style formatted output. Do you know how to do formatted output in C++?
Do a man printf to find out more about C style formatted
output.
- 10.
- Why is it important that the variables are initialized in a
function? Why not just initialize them when they are declared?
- 11.
- Notice the great number of global variables. Do they all have to be
global? Why or why not?
- 12.
- How would this program have to change if there were n different
products, instead of just one?
Next: About this document ...
Scott D. Anderson
1999-09-20