Question: You should write a program to simulate the queuing and service of bank customers. The simulation should be discrete event driven. Your program should: 1

You should write a program to simulate the queuing and service of bank customers. The simulation should be
discrete event driven.
Your program should:
1. Read in the number of servers/tellers for the simulation,
2. Read in the file name from standard input and then open the file,
3. Read data record by record from the named file,
4. Perform the simulation according to the input records, and
5. Output the statistics of the services as specified below.
The input text file (as-sample.txt) contains the following data:
1. A set of customers, one customer per line and each line consisting of a customers arrival time, the
corresponding service time, and the customers priority (1 for low, 2 for normal, 3 for high).
2. The set of customers is sorted in the ascending order of their arrival times.
3. This set is terminated by a dummy record with the arrival time and the service time all equal to 0.
The simulation is to be a bank branch with multiple tellers (i.e., servers) and a single queue. The simulation
should be run as follows:
1. Setup the total number of tellers;
2. Read the text file to start the simulation;
3. Allocate the new arrival customer to the next idle tellers (if applicable);
4. If all tellers are busy, add the new arrival customer to the queue;
5. The queue shall be updated based on two criteria of the customers, i.e., their arrival times and their priorities.
For the customers with the same priority level, the customers who arrive earlier shall be put in front of the
customers who arrive late. However, the customers with a higher priority shall be put in front of the customers
with a lower priority regardless of their arrival times. For example, if we have three customers, i.e., c1(2.8,
4.8,2), c2(1.5,3.1,2), and c3(3,5.6,3), then their order in the queue should be c3, c2, c1;
6. If a busy teller finishes a service request, then the teller will serve the first customer in the queue (the customer
will be removed from the queue). If the queue is empty, then the busy teller will become idle;
7. The simulation should be run until the queue is empty and the last customer has left the system.
The simulation will run multiple times to gather statistics on the efficiency of the service with a different number of
tellers on duty. You are required to run the simulation three times with the number of servers being set to 1 teller, 2
tellers and 4 tellers, respectively. Each simulation runs on the sample input file and outputs the statistics as
specified below.
Output for each run will consist of the following data:
Number of customers served by each teller;
Total time of the simulation, i.e., the time difference between the simulation starts and the simulation ends;
Average service time per customer (this excludes the time spent in the queue);
Average waiting time per customer (this excludes the time spent in the service);
The maximum length of the queue;
The average length of the queue (this can be estimated as the ratio between the total queuing time and the time
the last service request is completed);
Implementation Requirements:
The pseudocode should be provided first to explain the principle of your program.
You are only allowed to include or import input, output, and file streams in the beginning of your program. That is, you should only use built-in data structures and functions to implement your program. For instance, if you want to use data structure heap and functions related with heap in your program, you should implement heap and the relevant functions by using built-in array instead of calling heap from existing library
If needed, you may assume the queue will never have more than 100 customers.
Please do this in python please??

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!