Question: Queues & Simulation C++ code using a linked list and queue and possibly vector, list, or sequence. Make sure to fully utilize OOP approach. ABC
Queues & Simulation
C++ code using a linked list and queue and possibly vector, list, or sequence. Make sure to fully utilize OOP approach.
ABC calling center would like to provide adequate service representatives to staff its calling center and it hired you to write a program that simulates call lines at a calling center. A line is basically a queue object and you can assume one customer representative per line. After some analysis, you decided to implement aLinkedQueue class to perform the simulation as described below (i.e., linked list must be used to implement a queue and relevant information for each customer should be stored in a node). Based on some preliminary estimate, customres are expected to call in random integer intervals of 1 to n minutes (inclusive and two customers are expected to call between that interval so if customer 1 calls at minute 3, then customer 2 is expected to call between minute 4 and 7 when n is 4). Also, it is expected to take a random integer interval of 1 to m minutes to serve each customer. If the call arrival rate is faster than the service rate (n > m), the line will grow indefinitely. Even with a "Balanced" rate (n = m), randomness can still possibly cause a long line over a period of time. You are going to run the calling center simulation with one line (1=1) for a period of t minutes using the following algorithm (enter input parameters from keyboard and use 1=1, t= 30, n = 4, and m = 4 as test case 0):
Determine first customer's call time (random integer between 1 and n) For i = 1 to t Display "MinuteL ", i If a customer calls Say so; Enqueue that customer Schedule the call time of the next customer (random integer 1 to n is added to the just enqueued customer's timel next customer comes 1 to n minutes after current customer). End if If service was just completed for customer, Say so, Process accordingly, End if If no customer is being served and there is at least one customer in the queue Dequeue next customer to be served Determine customer's service time (Random integer 1 to m is added to the current time) End if End for
Make sure to provide a reasonable output and it is best to output most information to an output file. Use 1, 2, 3, ..., 30 to label each minute and a customer ID of 1, 2, 3, and so forth. Your program must be able to determine the following at he end of the simulation and output appropriate information: - Maximum number of customers in the line at any time (longest line) - Longest wait that a customer experiences - Average wait time for all customers (use floating-point value)?
Check output for test case 0 to make sure everything works as expected. Now run the following 3 test caes below. For each set of output, provide just the first 15 minutes and last 15 minutes or so and summary information. - Test case 1: 1 = 1, t= 600, n = 4, m = 4 - Test case 2: 1 = 1, t = 600, n = 3, m = 4 - Test case 3: 1 = 1, t = 600, n = 5, m = 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
