Вы находитесь на странице: 1из 5

3.

Simulation: A quick car repair shop has a bottleneck that is a single server
through which all the cars have to pass. The shop receives a number of
customers at varying intervals given by the distribution shown in the interarrival table. The service time is also random and the distribution is provided in
another table. Customers go to a different shop if the number of waiting garages
they have is completely full. Answer the following questions using Simulation
(100 days) assuming that the number of minutes for which the server is available
each day is from 6 am to 10 pm (i.e. arrivals are allowed only in the duration of
960 minutes).
Inter Arrival Probability Distribution
Probability
Time (Minutes)
0.3
30
0.4
40
0.2
50
0.1
60
a) If shop does not have waiting garage then what is average number of
customers who would leave without service per day (forced balking)?
Solution
First of all, we will derive function to determine inter-arrival times following the probability
distribution given in Table above. The inversion formula for the given probability distribution
to get the inter-arrival times between customers is as given below:
Inter-arrival time=if (u<=0.3, 30, if (u<=0.7, 40, if (u<=0.9, 50, 60)))
Where u =Random number between 0 and 1, defined by Rand ()
Similarly, service times for customers have been calculated using a similar formula and
probability distribution table for service time as stated above, but using a different random
number v.
Now, arrival time for the first customer is taken as zero. Afterwards, the arrival times for each
subsequent customer is taken as sum of arrival time of previous customer and inter-arrival
time obtained from formula stated above. Thus,
[Arrival time for customer n] = [Arrival time for customer n-1] + [inter-arrival time for n]

Now, we will define formula for determining the time at which the service begins for a
particular customer. In general, when there is no balking, the service-start time is given as
maximum of value between the arrival time of the customer and the service-end time of the
previous customers. However, in this case, the current customer balks if the service station is
occupied, i.e. if the service-end time of the previous customer is greater than the arrival time
of the current customer, the current customer balks. Therefore, if the customer has to be
served, his/her service-start time would be equal to the arrival time. It must be noted that to
cater to the instances of balking, we have considered that for the customers who have balked,
their service-start time and service-end time would be one and the same, precisely because
they did not avail of the repair service in the first place.

Now, let us consider the service-end time. We have to two types of customers: the one who
have balked, and the others who have not balked. For the customers who have availed of the
repair service, the service-end time would be equal to the sum of the service-start time and
the service time obtained from the formula discussed in the beginning paragraphs. For the
customers who have balked, the service-end time would be equal to the service-start time.
The condition that customer n will balk is that at the time he arrives, some previous
customer is already there in the system. Thus, mathematically, this condition translates to the
fact that if the arrival time of customer n is lesser than the max of service-end times of
previous customers, then he will balk. And if he balks, the service end time equals the service
start time. Writing this formula, say for customer no.7:
Service-end time (for customer no.7) =If (E8>MAX ($H$2:H7), E8+G8, E8)
The above formula is for customer no.7. This is illustrated in the snapshot below:

To display if the customer (say customer no.7) has balked or not, we have the following
formula:
Balking (Yes/No) =If (AND (H7-E7>0, D7<=960), "no", "yes")
The above formula illustrates two things. The first is that the fact that the service-end time
and service start time of a customer are the same, means that he has balked. The second is
that if the arrival time of a customer is more than 960 minutes, then also he has balked, since
in this case, the repair shop will not open for service; thus, the customer does not avail of the
service, which for mathematical counting purpose, is equivalent to balking only.
Subsequently, the formulae for time-in-queue is given by difference between service-start
time and arrival time. Also the formula for time-in-system is given by the difference between
service-end time and arrival time. The condition that no customer would be served of his/her
arrival time is greater than 960 minutes is taken care of by the Balking formula stated and
discussed above.
Further, the total customer served and total customer attended have been calculated using a
simple count-if formula, which is self-explanatory as given in excel sheet attached.
With this, the excel sheet simulates the operations for one day only. Now, to simulate the
operations for 100 days, we use data-table tool. In this, we simulate 100 days of operations to

calculate total customers encountered and total customers served. The total customers who
left without being served comes as the difference between the two. The total of such
customers over 100 days comes at around 1533, with an average of around 15.33 people. The
results are as given below: (The results shown in the table below might slightly change a bit
due to changes in random variables)
Results of simulation of 100 days
Avg customers encountered
Avg customers served
Avg customers left without service

24.12
8.86
15.26

b) If the garage space holds 1 car, then what proportion of customers will have
to wait and what proportion of customers will have to leave?
In this case, while the basic logic remains the same as previous question, the provision of
garage space holding 1 car warrants some modifications. These are discussed one-by-one
below:
i)

Formula for Number of cars already in the system:


We need to know that if the customer arrives at a particular time, then how many
cars are already there in the system (garage + server). This is given by a simple
count-if formula. This is given as below for customer no.7. Screen-shot is also
attached to illustrate the same.
Number of customers already in system =COUNTIF ($H$2:H7, "> "&D8)

Under this for customer-no. n, all the previous customers are counted whose
service-end time is greater than arrival time of the customer n. This would tell
the number of customers still awaiting the completion of their service.

ii)

Formula for balking:

To display if the customer (say customer no.7) has balked or not, we have the following
formula:

Balking (Yes/No) = IF (AND (I8<2, D8<960), "no", "yes")


Here, the cell no. I8 represents the number of cars in the system as derived from the formula
above. Since, we have one garage and one server, the maximum people in the system can be
2. Thus, when a customer arrives and encounters that 2 people are already there in the system
at the time of his arrival, then he would balk. This is precisely captured in the formula above.
Also, the condition that no customer would be served of his/her arrival time is greater than
960 minutes is taken care of by the Balking formula stated and discussed above.
iii)

Formula for Service-start time and Service-end time:

If the customer does not balk, the service-start time would be the max of the value between
his arrival time and the service-end time of customer already in the system. This is captured
by the following formula:
Service-start time for customer no.7 =IF (J8="no", MAX (D8, MAX ($H$2:H7)), D8)
The cell J8 represents if the customer has balked or not. This has been discussed before. For
the customers who have balked, the service-end time would be equal to the service-start time,
which in turn equals the arrival time. This is given by cell D8. For customers who have not
balked, the service-start time would be the max of the value between his arrival time and the
service-end time of customer already in the system. Extending this logic, we have formula for
service-end time as follows:
Service-end time for customer no.7 =IF (J8="no", G8+E8, D8)
Here, G8 denotes service time and E8 denotes service-start time. For customers who have not
balked, service-end time is equal to service-start time plus service time.
In a nutshell, the following chart gives the sequence of steps for this simulation.
Find number of cars (N)already in the system when a customer arrives
If N>=2, then balking. If N<2, then not balking
Accordingly find service-start time and service-end time

With this, the excel sheet simulates the operations for one day only. Now, to simulate the
operations for 100 days, we use data-table tool. In this, we simulate 100 days of operations to
calculate total customers encountered and total customers served. The total customers who
left without being served comes as the difference between the two. The results are as given
below: (The results shown in the table below might slightly change a bit due to changes in
random variables)
Results of simulation on 100 days
Avg customers encountered
Avg customers served
Avg of customers that wait for service

23.19
11.85
10.85

Avg customers left without service


Proportion of customers wait for service
Proportion of customers left without service

11.34
46.79%
48.90%

c) What will be the average waiting time for customer who will have to wait in
the single garage?
For one single day, this would equal to the total waiting time divided by the total number of
customers who actually waited. The waiting time is given by Time-in-queue, which equals
difference between service-start time and arrival time.
average waiting time=

Total timequeue
Total customers with(Timequeue)>0

Only those customers are considered to be waiting in garage whos Time-in-queue is greater
than zero. From the previous question, we have already found the number of customers who
wait for the service using a simple count-if formula as discussed in previous section. The
result for one day is then simulated for 100days using data table. This technique has been
already discussed in previous section. The following result obtained: (The results shown in
the table below might slightly change a bit due to changes in random variables)

Results of simulation on 100 days


average waiting time for customer who will
have to wait in the single garage (minutes)

74.4

Вам также может понравиться