Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 26

DISCRETE SIMULATION

DISCRETE EVENT SIMULATION (DES)


SIMULATION MODELS
DSICRETE EVENT SIMULATION

 Discrete event simulation utilizes a


mathematical/logical model of a physical system
that portrays state changes at precise points in
simulated time. Both the nature of the state
change and the time at which the change occurs
mandate precise description. Customers waiting for
service, the management of parts inventory or
military combat are typical domains of discrete
event simulation.
MONTE CARLO SIMULATION
 Monte Carlo simulation, the name given by John van
Neumann and Stanislaw M. Ulam to reflect its gambling
similarity, utilizes models of uncertainty where
representation of time is unnecessary. The term originally
attributed to "a situation in which a difficult non-probabilistic
problem is solved through the invention of a stochastic
process that satisfies the relations of the deterministic
problem". A more recent characterization is that Monte Carlo
is "the method of repetitive trials. Typical of Monte Carlo
simulation is the approximation of a definite integral by
circumscribing the region with a known geometric shape,
then generating random points to estimate the area of the
region through the proportion of points falling within the
region boundaries.
CONTINIOUS SIMULATION

 Continuous simulation uses equational models,


often of physical systems, which do not portray
precise time and state relationships that result in
discontinuities. The objective of studies using such
models do not require the explicit representation
of state and time relationships. Examples of such
systems are found in ecological modeling, ballistic
reentry, or large scale economic models.
DISCRETE-EVENT SIMULATION (DES)
 Discrete-Event Simulation: Modeling of a system as it
evolves over time by representation where the state
variables change instantaneously at a separated points
in time
 More precisely, state can change at only a countable
number of points in time
 This points in time are when events occur
 Event: Instantaneous occurrence that may change the
state of the system
 Sometimes get creative about what an “event” is..
e.g., end of simulation , make a decision about a
system’s operation
 Mostoperational models are dynamic, stochastic ,
and discrete – will be called DISCRETE-EVENT
SIMULATION MODEL
DISCRETE-EVENT SIMULATION (DES)

 A discrete-event simulation (DES) models the


operation of a system as a discrete 
sequence of events in time. Each event occurs at
a particular instant in time and marks a change
of state in the system. Between consecutive
events, no change in the system is assumed to
occur; thus the simulation can directly jump in
time from one event to the next.
EXAMPLE
SITUATION
A common exercise in learning how to build discrete-event simulations is to
model a QUEUE, such as customers arriving at a bank to be served by a
teller. In this example,
 the system entities are Customer-queue and Tellers.
 The system events are Customer-Arrival and Customer-
Departure. (The event of Teller-Begins-Service can be part of the
logic of the arrival and departure events.)
 The system states, which are changed by these events,
are Number-of-Customers-in-the-Queue (an integer from 0 to n)
and Teller-Status (busy or idle).
 The random variables that need to be characterized to model this
system stochastically are Customer-Interarrival-Time and Teller-
Service-Time.
 An agent-based framework for performance modeling of an
optimistic parallel discrete event simulator is another example for
a discrete event simulation.
COMPONENTS
COMPONENTS

In addition to the logic of what happens when system events


occur, discrete event simulations include the following:

 STATES
 CLOCK
 EVENTS LIST
 RANDOM-NUMBER GENERATORS
 STATISTICS
 ENDING CONDITION
STATE

A system state is a set of variables that captures


the salient properties of the system to be studied.
The state trajectory over time S(t) can be
mathematically represented by a step function
 whose value can change whenever an event
occurs.
CLOCK

 The simulation must keep track of the current


simulation time, in whatever measurement units
are suitable for the system being modeled. In
discrete-event simulations, as opposed to
continuous simulations, time 'hops' because events
are instantaneous – the clock skips to the next
event start time as the simulation proceeds.
EVENTS LIST

 The simulation maintains at least one list of simulation


events. This is sometimes called the pending event
set because it lists events that are pending as a result of
previously simulated event but have yet to be simulated
themselves. An event is described by the time at which
it occurs and a type, indicating the code that will be
used to simulate that event. It is common for the event
code to be parametrized, in which case, the event
description also contains parameters to the event code.
 When events are instantaneous, activities that
extend over time are modeled as sequences of
events. Some simulation frameworks allow the
time of an event to be specified as an interval,
giving the start time and the end time of each
event.
 The pending event set is typically organized as a 
priority queue, sorted by event time. That is, regardless
of the order in which events are added to the event set,
they are removed in strictly chronological order. Several
general-purpose priority queue algorithms have proven
effective for discrete-event simulation, most notably, the 
splay tree. More recent alternatives include skip lists
, calendar queues, and ladder queues.

 Typically, events are scheduled dynamically as the


simulation proceeds.
 Forexample, in the bank example noted above,
the event CUSTOMER-ARRIVAL at time t would, if
the CUSTOMER_QUEUE was empty and TELLER was
idle, include the creation of the subsequent event
CUSTOMER-DEPARTURE to occur at time t+s,
where s is a number generated from the SERVICE-
TIME distribution.
RANDOM-NUMBER GENERATOR

 The simulation needs to generate 


random variables of various kinds, depending on
the system model. This is accomplished by one or
more Pseudorandom number generators. The use
of pseudo-random numbers as opposed to true
random numbers is a benefit should a simulation
need a rerun with exactly the same behavior.
STATISTICS

 The simulation typically keeps track of the system's 


statistics, which quantify the aspects of interest. In the
bank example, it is of interest to track the mean waiting
times. In a simulation model, performance metrics are not
analytically derived from probability distributions, but
rather as averages over replications, that is different runs
of the model. Confidence intervals are usually constructed
to help assess the quality of the output.
ENDING CONDITION

 Because events are bootstrapped, theoretically a


discrete-event simulation could run forever. So
the simulation designer must decide when the
simulation will end. Typical choices are "at time t"
or "after processing n number of events" or, more
generally, "when statistical measure X reaches the
value x".
SIMULATION ENGINE
LOGIC
SIMULATION ENGINE LOGIC

The main loop of a discrete-event simulation is something


like this

Start
 Initialize Ending Condition to FALSE.
 Initialize system state variables.
 Initialize Clock (usually starts at simulation time zero).
 Schedule an initial event (i.e., put some initial event into
the Events List).
“Do loop” or “while loop”

While (Ending Condition is FALSE) then do the following:


Set clock to next event time.
Do next event and remove from the Events List.
Update statistics.

End
 Generate statistical report.
COMMON USES
COMMON USES

 Diagnosing process issues


 Hospital applications
 Lab test performance improvement ideas
 Evaluating capital investment decisions
 Network simulators
 Modelingprocedure and processes in
manufacturing

You might also like