Lecture-3-Discrete-event-simulation
Lecture-3-Discrete-event-simulation
Simulation
IE 411 ELECTIVE 2
2.1 Discrete-event Simulation
Discrete-event simulation is the modeling
of systems in which the state variable
changes only at a discrete set of point in
time. The simulation models are analyzed
by numerical rather than analytical
methods.
2.1 Discrete-event Simulation
Analytical methods employ the deductive
reasoning of mathematics to “solve” the
model.
Real-world simulation models are rather large, and the amount of data
stored and manipulated is vast, so such runs are usually conducted
with aid of a computer
2.1 Discrete-event Simulation
The concept of a system and a model of a system discussed in the previous chapter.
This chapter deals exclusively with dynamic, stochastic systems (i.e., involving time
and containing random elements) that change in a discrete manner. This section
expands on these concepts and proposes a framework for the development of a
discrete-event model of a system. The major concept are briefly defined and then
illustrated by examples:
System: A collection of entities (e.g., people and machine) that interact together over
time to accomplish one or more goals.
Model: An abstract representation of a system, usually containing structural, logical ,
or mathematical relationship that describes a system in terms of state, entities and
their attributes, sets, processes, events, activities and delays.
System rate: A collection of variables that contain all the information necessary to
describe the system at any time.
Entity: Any object or component in the system that requires explicit representation in
the model (e.g., a server, a customer, a machine).
2.1 Discrete-event Simulation
Attributes: The properties of a given entity (e.g., the priority of a waiting customer,
the routing of a job through job shop).
List: A collection of (permanently or temporarily) associated entities, ordered in some
logical fashion. (such as calling customers currently in a waiting line)
Event: An instantaneous occurrence that changes the state of a system (such as an
arrival of a new customer)
Event notice: A record of an event to occur at the current or some future time, along
with any associated data necessary to execute the event; at a minimum, the record
includes the event type and the event time.
Event list: A list of event notices for future events, ordered by time of occurrence;
also known as future event list (FEL)
Activity: A duration of time specified length (e.g., a service time or interarrival time),
which is known when it begins
Delay: A duration of time of unspecified indefinite length, which is not known until it
ends (e.g., a customer’s delay in a last-in-first-out waiting line which, when it begins,
depends on future arrivals)
Clock: A variable representing simulated time, called clock in the example to follow.
2.1 Discrete-event Simulation
Different simulation packages use different terminology for the same or similar
concepts – for example, lists are sometimes called sets, queues, or chains. Sets or
lists are used to hold both entities and event notices.
A discrete-event simulation is the modeling over time of a system all of whose state
changes occur at discrete point in time – those points when an event occurs. A
discrete event simulation proceeds by producing a sequence of system snapshots
that represent the evolution of the system through time.
2.2 The event scheduling/Time advance
algorithm
The mechanism for advancing simulation time and guaranteeing that all event occur
in correct chronological order is based on the future event list (FEL). This list
contains all event notices for events that have been scheduled to occur at a future
time. Scheduling a future event mean that, at the instant an activity begins, its
duration is computed or drawn as a sample from a statistical distribution; and that
the end-activity event, together with its event time, is placed on the future-event list.
In the real world, most future events are not scheduled but merely happen- such as
random breakdowns or random arrivals. In the model, such random events are
represented by the end of some activity, which in turn is represented by a statistical
distribution.
At any given time t, the FEL contains all previously scheduled future events and their
associated event times (called t1, t2 … ). The FEL is ordered by event time,
meaning that the events are arranged chronologically-that is event times satisfy.
3.1 Random-number generation
Random numbers are a necessary basic ingredient in the simulation of almost all
discrete systems. Most computer languages have a subroutine, object, or function
that will generate a random number.
Random numbers are used to generate event times and other random variables in
simulation languages. In this chapter, the generation of random numbers and their
subsequent testing for randomness is described.
3.2 Properties of Random Number
A sequence of random number R1, R2 …., must have two important statistical
properties: uniformity and independence.
1. If the interval [0, 1] is divided into n classes, or subinterval is N/n, where N is the
total number of observations.
3. The method should have a sufficiently long cycle. The cycle length, or period,
represents the length of the random number sequence before previous number
begin to repeat themselves in an earlier order. Thus, if 10,000 events are to be
generated, the period should be many times that long.
3.2 Generation of Pseudo-Random Numbers
4. The random numbers should be repeatable. Given the starting point (or
conditions) it should be possible to generate the same set of random numbers,
completely independent of the system that is being simulated. This is helpful for
debugging purposes and facilitates comparisons between systems.
For the same reasons, it should be possible to easily specify different starting points,
widely separated, within the sequence.
5. Most important, the generated random numbers should closely approximate the
ideal statistical properties of uniformity and independence.
3.2 Generation of Pseudo-Random Numbers
Inventing techniques that seem to generate random numbers is easy; inventing
techniques that really produce sequences that appear to be independent, uniformly
distributed random numbers is incredibly difficult. There is now a vast literature and
rich theory on the topic, and many hours of testing have been devoted to
establishing the properties of various generators.
Even when a technique is known to be theoretically sound, it is seldom easy to
implement it in a way that will be fast and portable. The goal of this chapter is to
make the reader aware of the central issues in random-number generation, to
enhance understanding, and to show some of the techniques that are used by those
working in this area.
3.2 Generation of Pseudo-Random Numbers
Example of a generated Pseudo-Random Number
3.3 Test for random numbers
The desirable properties of random numbers- uniformity and independence- were
discussed previously. To check on whether these desirable properties have been
achieved, a number of tests can be performed. (Fortunately, the appropriate tests
have already been conducted for most commercial simulation software). The tests
can be placed in two categories, according to the properties of interest: uniformity
and independence. A brief description of two types of tests is given in this section:
From a visual inspection, these numbers appear random, and they would probably
pass all the tests presented to this point.
However, an examination of the 5th , 10th , 15th, (Every five numbers beginning with
the fifth), and so on, indicates a very large number in that position.
Now, 30 numbers is rather a small sample size on which to reject a random number
generator, but the notion is that the numbers in the sequence might be related.
1. it arrives at a warehouse;
2. it enters a loading gate;
3. it unloads its supplies;
4. and then it leaves the warehouse.
In the example above, you will see that each step is
a separate — i.e., discrete — event. In order to
simulate this process, you will typically use a
discrete event simulation model.
END