Simulation 2 Chapter Two
Simulation 2 Chapter Two
DBU Page 2
Chapter two Queuing System & Discrete- Event Simulation
DBU Page 3
Chapter two Queuing System & Discrete- Event Simulation
The arrival event occurs when a unit enters the system. The flow diagram
for the arrival event is shown in figure 3. The unit may find the server
either idle or busy; therefore, either the unit begins service immediately,
or it enters the queue for the server. The unit follows the course of action
shown in fig 4.
DBU Page 4
Chapter two Queuing System & Discrete- Event Simulation
If the server is busy, the unit enters the queue. If the server is idle and the
queue is empty, the unit begins service. It is not possible for the server to
be idle and the queue to be nonempty
After the completion of a service the service may become idle or remain
busy with the next unit. The relationship of these two outcomes to the
status of the queue is shown in fig 5. If the queue is not empty, another
unit will enter the server and it will be busy. If the queue is empty, the
server will be idle after a service is completed. These two possibilities are
shown as the shaded portions of fig 5. It is impossible for the server to
become busy if the queue is empty when a service is completed.
Similarly, it is impossible for the server to be idle after a service is
completed when the queue is not empty.
DBU Page 5
Chapter two Queuing System & Discrete- Event Simulation
Simulation clock times for arrivals and departures are computed in a simulation
table customized for each problem. In simulation, events usually occur at
random times. In these cases, a statistical model of the data is developed from
either data collected and analyzed, or subjective estimates and assumptions.
Random numbers are distributed uniformly and independently on the
interval (0, 1). Random digits are uniformly distributed on the set {0, 1,
2… 9}. Random digits can be used to form random numbers by selecting
the proper number of digits for each random number and placing a
decimal point to the left of the value selected. The proper number of
digits is dictated by the accuracy of the data being used for input
purposes. If the input distribution has values with two decimal places, two
digits are taken from a random-digits table and the decimal point is
placed to the left to form a random number.
When numbers are generated using a procedure, they are often referred
to as pseudorandom numbers. Since the method is known, it is always
possible to know the sequence of numbers that will be generated prior to
the simulation.
In a single-channel queuing system, interarrival times and service times
are generated from the distributions of these random variables. The
examples that follow show how such times are generated. For simplicity,
assume that the times between arrivals were generated by rolling a die
five times and recording the up face. Table 1 contains a set of five
interarrival times are used to compute the arrival times of six customers
at the queuing system
DBU Page 6
Chapter two Queuing System & Discrete- Event Simulation
The first customer is assumed to arrive at clock time 0. This starts the
clock in operation. The second customer arrives two time units later, at a
click time of 2. The third customer arrives four time units later, at a clock
time of 6; and so on.
The second time of interest is the service time. The only possible service
times are one, two, three, and four time units. Assuming that all four
values are equally likely to occur, these values could have been
generated by placing the numbers one through four on chips and drawing
the chips from a hat with replacement, being sure to record the numbers
selected
Now, the interarrival times and service times must be meshed to simulate
the single channel queuing system. As shown in table 2, the first
DBU Page 7
Chapter two Queuing System & Discrete- Event Simulation
probability of occurrence. The service times vary from 1 to 6 minutes with the
probabilities shown in table 5. The problem is to analyze the system by
simulating the arrival and service of 20 customers
DBU Page 9
Chapter two Queuing System & Discrete- Event Simulation
Service times for all 20 customers are shown in table 7. These service times
were generated based on the methodology described above, together with the
aid of table 5. The first customer’s service time is 4 minutes because the
random digits 84 fall in the bracket 61-85, or alternatively because the derived
random number 0.84 falls between the cumulative probabilities 0.61 and 0.85 .
DBU Page 10
Chapter two Queuing System & Discrete- Event Simulation
on the random numbers for interarrival time and service time and the
completion time of the previous customer. For example, the second
customer arrives at time 8. Thus, the server was idle for 4 minutes.
Skipping down to the fourth customer, it is seen that this customer
arrived at time 15 but could not be served until time 18. This customer
had to wait in the queue for 3 minutes. This process continues for all 20
customers
DBU Page 11
Chapter two Queuing System & Discrete- Event Simulation
DBU Page 12
Chapter two Queuing System & Discrete- Event Simulation
DBU Page 13
Chapter two Queuing System & Discrete- Event Simulation
A decision maker would be interested in results of this type, but a longer simulation
would increase the accuracy of the findings. However, some subjective inference can
be drawn at this point. Most customers have to wait; however, the average waiting
time is not excessive. The server does not have an undue amount of idle time.
DBU Page 14