CS 153 Data Structures I
Programming Assignment #14
Due: 11/29/01
This programming assignment is designed to explore some of the important aspects
in performing a simulation. You may write this program in either the Dialog
or Console modes.
OVERVIEW: The simulation will be that of a large retail store. The important events
in the simulation are:
- The simulation will run for 24 hours.
- Time will increment/advance in one (1) second steps
- Vehicles arrive at the parking lot at frequency = 5
seconds - 60 seconds
- Each vehicle contains between 1 and 6 persons.
All of the persons in 1 vehicle constitute 1 shopping party.
- The shopping party loads between 1 and 75 items
into their cart.
- It takes the shopping party 300 seconds + (#items
* 45 seconds) to fill their cart
- The party enters the shortest checkout Q.
- It takes the party 90 seconds + (#items * 5 seconds)
to check out (once they reach the front of the Q).
The main question to answer with your program is; how many checkout Qs are
required so that no shopping party must wait longer than
5 minutes (300 seconds) before reaching the front of the Q.
Start your program with 1 checkout Q. If during the simulation a party must
wait longer than the maximum time then reinitialize all of your program variables
including TIME = 0 and try the simulation with 2 Qs. Continue increasing the
number of Qs until your program runs to completition without violating the MAX
wait time.
(NOTE: this reinitializing and restarting with 1 additional Q should be automatic
and not require operator intervention.)
The required output summary statistics include:
- Total vehicles to arrive
- Maximum vehicles in the parking lot at any one time (peak capacity)
- Total persons to arrive
- Maximum persons in the store at any one time (peak capacity)
- Maximum shopping parties in the store at any one time (peak capacity)
- Total items sold
- Average party shopping time
- Average time waiting in the checkout Q prior to reaching the front of the
Q
- Average checkout time (not to include time waiting in Q)
- Total number of queues