Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please do it in python data structures ASAP Task 3: Queuing System We have to implement a queuing system for a Bank of Digital Currency.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Please do it in python data structures ASAP

Task 3: Queuing System 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 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, cach 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 typeld and size. The typeld 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) 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. 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

a. How will the leader be selected?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago