00:01
In this question, to solve this problem, we'll create a discrete event simulation in python.
00:09
So we'll use a sympy library for that, like this, and which is a process -based discrete event simulation library.
00:27
So that is why we have to make sure that sympy is installed.
00:33
So we have to install it using the pip, can do it like this, pip install sympy in such a way.
00:52
So in this code, we have to define, this is about the library.
00:58
So in this code, we have to define the customer process that represents a customer entering the system being served.
01:05
Then this is server service time function will generate service times based on the data in the data .csv file.
01:21
Then after we do this, we start, we then set the simulation parameters that will create an environment and a resource for the service desk.
01:35
So we create customer processes based on the number of batches, that is n, number of batches, that is n, multiplied by, that means times, it will be by the total simulation, total simulation time, that is t.
02:07
So after running the simulation, we discard the initial samples and calculate the probability of waiting less than eight minutes.
02:16
And then we have to iterate to find the minimum number of service desks required to achieve 90 % of the customer satisfaction.
02:26
So after doing this, the result will be printed in the end.
02:32
So let us see how we have to achieve this using a simple compiler.
02:43
I'll explain you the code here.
02:46
Now we can see that we have to first import the necessary libraries that are there.
02:55
I am doing that.
02:57
Then we have to simply define the customer function that is there that will represent the customer reading, entering a system.
03:12
So we will define it like this.
03:15
So as you can see, the customer function has been created, defined, that represents a customer entering the system and being served.
03:27
It starts by recording the arrival time, that is arrival time .anv .now and requesting a service desk from the service desk resource.
03:38
The customer then yields until the service desk becomes available.
03:42
So once the customer is granted access to the service desk, the customer's wait time is calculated by subtracting the arrival time from the current simulation time, that is anv .now.
03:56
So the customer then yields for the service time based on the data in the data .csv file.
04:05
Finally, the customer's waiting time is stored then, as you can see in the waiting times list.
04:11
So now we have to give a service time function.
04:16
So that will read the data, that is data .csv file and yield the service time for each row.
04:24
So for that we have to give a service time function as you can see here.
04:30
So now this will read the data .csv file and it will yield the service time...