Question: Using a python queue data structure: Design a simulation experiment to evaluate the effectiveness of an express lane at the grocery store. Use items in
Using a python queue data structure:
Design a simulation experiment to evaluate the effectiveness of an express lane at the grocery store.
Use items in a queue to represent customers. Each customer has a service time and an arrival time (can use either two queues or one queue with tuples), which is to be generated from a random number generator. In one simulation, use two concurrent cashiers that handle the customers in order. In a second simulation divide the customers so that one cashier handles the customers with the shortest service times, but will taker longer service time customers if no customer's with shorter service times have arrived.
Measure the effectiveness by the average turn around time (wait + service) of the customers.
How could you modify this experiment to more closely model a real grocery store?
Hint: you may need a "peek" method like the Stack had that can look at an item without removing it from the queue.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
