0% found this document useful (0 votes)
22 views

02-Simulation Examples

Uploaded by

micheleortiz899
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

02-Simulation Examples

Uploaded by

micheleortiz899
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 16

Simulation Examples

The simulations throughout this lecture entails three steps:

1.Determine the characteristics of each of the inputs to the


simulation. Quite often, these may be modeled as
probability distributions, either continuous or discrete.

2.Construct a simulation table. Each simulation table is


different, for each is developed for the problem at hand.
(Next slide).

3.For each repetition i, generate a value for each of the p


inputs, and evaluate the function, calculating a value of
the response yi. The input values may be computed by
sampling values from the distributions determined in step
1. A response typically depends on the inputs and one or
more previous responses.

Simulation Examples 1
Simulation table

The simulation table provides a systematic method for


tracking system state over time.

Input Respons
s e
Repetitio Xi1 Xi2 … Xij … Xip yi
ns
1

·
·

Simulation Examples 2
Simulation Examples

Therefore, we shall investigate a


number
of simulation examples in queueing,
inventory and reliability.

Simulation Examples 3
Simulation of Queueing Systems

Serve
Waiting Line r
Calling
population
Fig: Queueing System

A queueing system is described by its calling population,


the nature of the arrivals, the service mechanism, the
system capacity, and the queueing discipline.

Simulation Examples 4
Simulation of Queueing Systems

In the single-channel queue, the calling population is infinite.


If a unit leaves the calling population and joins the waiting line
or enters service, there is no change in the arrival rate of
other units that may need service.
Arrivals for service occur one at a time in a random fashion.
Once they join the waiting line, they are eventually served.
Service times are of some random length according to a
probability distribution which does not change over time.
The system capacity has no limit, meaning that any number
of units can wait in line.
Finally, units are served in the order of their arrival (often
called FIFO: First In, First out) by a single server or
channel.

Simulation Examples 5
Simulation of Queueing Systems

Arrivals and services are defined by the distribution of the


time between arrivals and the distribution of service
times, respectively.

For any simple single- or multi-channel queue, the overall


effective arrival rate must be less than the total service
rate, or the waiting line will grow without bound.

In some systems, the condition about arrival rate being less


than service rate may not guarantee stability

Simulation Examples 6
Simulation of Queueing Systems

System state : the number of units in the system and the


status of the server(busy or idle).

Event : a set of circumstances that cause an instantaneous


change in the state of the system.

In a single-channel queueing system there are only two


possible events that can affect the state of the system.

the arrival event : the entry of a unit into the system


the departure event : the completion of service on a
unit.

Simulation clock : used to track simulated time.

Simulation Examples 7
Simulation of Queueing Systems

If a unit has just completed service, the simulation


proceeds in the manner shown in the flow diagram
below:
Note that the server has only two possible states : it is either
busy or idle.

Departure
Event

Begin No Another Yes Remove the waiting


server idle unit unit from the queue
time waiting?
Begin servicing the
unit
Fig: Service-just-completed flow
diagram

Simulation Examples 8
Simulation of Queueing Systems

The arrival event occurs when a unit enters the system.


The unit may find the server either idle or busy.
Idle : the unit begins service immediately
Busy : the unit enters the queue for the server.

Arrival
Event

Unit enters No Server Yes Unit enters


service busy? queue for
service

Fig: Unit-entering-system flow diagram

Simulation Examples 9
Simulation of Queueing Systems

Fig: Potential unit actions upon arrival

Fig:Server outcomes after service


completion

Simulation Examples 10
Simulation of Queueing Systems

Simulations of queueing systems generally require the


maintenance of an event list for determining what
happens next.
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, the
randomness imitating uncertainty in real life.
Random numbers are distributed uniformly and
independently on the interval (0, 1).
Random digits are uniformly distributed on the set {0, 1, 2,
… , 9}.
The proper number of digits is dictated by the accuracy of
the data being used for input purposes.

Simulation Examples 11
Simulation of Queueing Systems

Pseudo-random numbers : the numbers are generated


using a procedure  We shall tackle this later.
Table 2.2. Interarrival and Clock Times
Assume that the times between arrivals were generated by
rolling a die five times and recording the up face.

Simulation Examples 12
2.1 Simulation of Queueing Systems (10)

Table 2.3. Service Times


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.
The only possible service
times are one, two,
three, and four time
units.

Simulation Examples 13
Simulation of Queueing Systems

The interarrival times and service times must be meshed to


simulate the single-channel queueing system.
Table 2.4 was designed specifically for a single-channel queue
which serves customers on a first-in, first-out (FIFO) basis.

Simulation Examples 14
Simulation of Queueing Systems

Table 2.4 keeps track of the clock


time at which each event occurs.
The occurrence of the two types of
events(arrival and departure
event) in chronological order is
shown in Table 2.5 and Figure
2.6.
Figure 2.6 is a visual image of the
event listing of Table 2.5.
The chronological ordering of events
is the basis of the approach to
discrete-event simulation
described in Chapter 3.

Simulation Examples 15
Simulation of Queueing Systems

Figure 2.6 depicts the number of customers in the system


at the various clock times.

Simulation Examples 16

You might also like