*** Below is the assignment description. if you want a detailed version, read project3.pdf file ***
**You are to make a modification on a existing Python code to complete the below parts**
Your task for this assignment is to make all three of the following improvements for a more realistic grocery store simulation:
currently when a customer arrives at the check-out lines, the customer goes into the cashier queue with the fewest number of customers. However, a real arriving customer would look not just at the number of customers in a line, but also how many items those customers have to gauge their check-out time. Modify the simulator to add an arriving customer to the shortest line based on the total check-out time for all customers currently in line. You should not need to modify the FIFO queue class, but just keep an accumulator for each line to track the total check-out minutes of customers in line.
currently when the simulation ends, it outputs for each check-out lane the number of customers served and the length of the line at the end of the simulation. Additional information would be helpful since customers get frustrated if they have to wait along time in line. Modify the simulation to calculate and print the average waiting time in line across all customers checked-out. Hint: modify the information stored about each customer waiting in the FIFO queue to include the clock-time when they entered the line.
currently when the simulation starts, the number of cashiers/check-out lines is entered and fixed for the duration of the simulation. However, a real grocery stores might have 20 check-out lanes with only 8 cashiers open. If the open lines all get too long, then a new check-out line is opened and customers at the rear of existing lines shift into it. Modify the simulator to allow the user to specify additional simulation parameters for maximum number of check-out lines, initial number of open check-out lines, and a threshold for opening a new check-out line (i.e., length of shortest line in terms of total minutes across all customers in that line). Hint: use Deque instead of FIFO queue to model each waiting line so you can use the Deque’s removeRear method when shifting customers into the newly opened check-out line. For our simulation we will not worry about closing check-out lanes when they get too small. After completing your modifications, make sure that your simulation results seem reasonable.
I would expect all the check-out lines at the end of the simulation to be about the same length since arriving customers always get added to the smallest line based on the number of customers in line.
***BELOW is the script files available for you to make the right modification. ***
binheap.py - the BinHeap class previously used with a new peekMin method which returns the minimum item without removing it queue_text.py - the textbook’s Python-list based FIFO queue implementation priority_queue.py - the PriorityQueue and PriorityQueueEntry class implementations. The PriorityQueue uses a BinHeap to order PriorityQueueEntry items which bundle together a Priority and its corresponding Value. project3.py - the working discrete-event simulation of multiple check-out lines (e.g., like at a grocery store). The simulation is based on user inputs of: # of check-out lines, simulation length (# of minutes), probability of a customer finishes shopping within each minute, and average customer check-out time.