Question: Data structure and Algorithm Urgently needed in 1 day in python Language. Recently added new function picture I think that will help. We have to

Data structure and Algorithm Urgently needed in 1 day in python Language.

Recently added new function picture I think that will help.

We have to implement a queuing system for a Bank of Digital Currency. The bank is first of its kind and people are taking a lot of interest in the bank. The bank decided to open different branches across the country to facilitated their customers. The management has to decide the number of counters and their types for each branch. Instead of deciding randomly, they decided to take advantage of simulations for this purpose. They have generated the list of customers with their type and time taken by each customer. You have to build a queueing system to simulate in order to calculate different values. For this task, you have to build simulation only for four counters. The bank can have four kind of customers as given below. Our system will designate a separate queue for each type of customer.

- Queue 1: People want to open a new account

- Queue 2: People want to deposit cash into the account

- Queue 3: People want to inquire about the account information

- Queue 4: People want to close their account.

We will be providing a list of customers with their type and time taken by the respective customer. Since, the space in the bank is limited so the security guard of the bank is allowing only 10 people per queue. The rest of the people have to wait outside of the bank. So, each queue will have a length 10 customers. If a customer arrives and the respective queue is full then we consider that customer will not wait and go away. The bank operates from 9:00 am to 5:00 pm with lunch break of one hour. So, each counter/queue can server 420 minutes. We assume that customer arrives as the we start the day. Our simulation should provide the following analysis: - The number of customers deal for each type of counter/queue - Average time taken by customers for each type of counter/queue - Maximum length of a queue during any time of the day - Number of customers we could not serve as queue was full (turned away)

Implementation:

1. Create a class BankQueue with the following functions:

a. Constructor: takes two parameters typeId and size. The typeId describe an identifier for the queue and size is the size of the queue i.e. number of customers can be stored by the queue.

b. EnqueueCustomer: takes a number as parameter which shows the time/minutes required

c. DequeueCustomer: returns a customer from the queue as per FIFO

d. IsFull: returns true if queue has number of customers equal to size of the queue, otherwise returns false.

e. IsEmpty: returns true if queue is empty, otherwise returns false.

2. Create a class BankSimulation with the following functions:

a. Constructor: takes a parameter filename: a filename with path to load customer data (description of the file format is given below) Data Structures & Algorithms Fall 2020 Final Lab Exam

b. Process: Process all customers one by one as per the requirements mentioned above.

c. CustomersServed: returns a python list of size 4 where each element shows the total number of customers served for each type of queue. First entry shows for queue type 1 and so on.

d. AverageTime: returns a python list of size 4 where each element shows the taken by customers for each type of queue. First entry shows for queue type 1 and so on.

e. MaxLength: returns a python list of size 4 where each element shows the maximum length of each type of queue. First entry shows for queue type 1 and so on.

f. NotServerd: returns a python list of size 4 where each element shows the number of customers not served for type of queue. First entry shows for queue type 1 and so on.

Data structure and Algorithm Urgently needed in 1 day in python Language.Recently added new function picture I think that will help. We have

File Format Each line of the file contains two integers X and Y where X is type of customers and Y is the time in minutes taken by the respective customer 1 Obj. Process() print (Obj. CustomersServed()) print (Obj. Average Time() print (Obj. MaxLength()) print (Oby. NetServerd()) 14, 2, 2, 3] 13.5, 5, 3, 4.66) 14, 2, 2, 31 [0, 0, 0, 0] class BankQueue: # you can add further functions / attributes det _init__(self, typeId, size): selt.type = typeId self.size - size pass def EnqueueCustomer (self, time): pass def DequeueCustomer (self): pass def IsFull (self): pass def IsEmpty (self): pass class BankSimulation: # you can add further functions / attributes def __init__(self, filename) : pass def Process (self): for i in range (420): # at each minute we see for a new customer # if we have space in the queue then we can # add customer in the respective queue # we also have to process the existing customers # see the attached file for specifications pass def CustomersServed (self): pass def AverageTime (self): pass def MaxLength (self): pass det NotServerd (self)

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 Databases Questions!