System Simulation: General Principles
System Simulation: General Principles
General Principles
Section – I
Chapter 3
Experimentation Manager
Module Module
Components of a DES System - 1
• User Interface: allows the Input and output
configuration and initial data entry. It also
allows the selection of stopping condition
• Event Processor: Manages the events in the
system through a FEL: Future Event List.
• Action Processor: determines the next action
to be taken through maturing events and
other logical conditions available and INVOKES
the correct unit or module within the
simulator.
Components of a DES System - 2
• Queue Processor: Manages the queues within
the system. It en-queues and de-queues
customers (or units).
• Stochastic Processor: Generates all the
stochastic variates used within the simulation
system.
• Experimentation Manager: Controls the
initialization of variables necessary for each
run of the simulation and runs the experiment
based on run-length and replication counts.
e.g. 100,000 packet or customer COMPLETIONs. For Replicating the statistical experiment
Concepts in Discrete-Event Simulation -1
• This chapter introduces and explains the fundamental
concepts and methodologies underlying all discrete-
event simulation packages (simulation languages and
software) using a package independent approach.
• Basic building blocks of all discrete-event simulation
models are covered:
– entities - attributes
– activities - events
• In discrete-event simulation, a system is modelled in
terms of its state at each point in time;
Concepts in DES -2
• Important issues are: the entities that pass
through the system, the entities that
represent system resources, and the activities
and events that cause the system state to
change.
• Discrete-event models are appropriate for
those systems for which changes in system
state occur only at discrete points in time.
Concepts in Discrete-Event Simulation -3
• 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 concepts are briefly defined and
then illustrated by examples:
Concepts in DES -4
• System: A collection of entities (e.g., people and machines)
that interact together over time to accomplish one or more
goals.
• Model: An abstract representation of a system, usually
containing structural, logical, or mathematical relationships
that describe a system in terms of state, entities and their
attributes, sets, processes, events, activities, and delays.
• System state: 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).
Concepts in Discrete-Event Simulation -5
• Attributes: The properties of a given entity (e.g., the priority
of a waiting customer, the routing of a job through a job
shop).
• List: A collection of (permanently or temporarily) associated
entities, ordered in some logical fashion (such as all customers
currently in a waiting line, ordered by "first come, first
served," or by priority).
• 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.
Concepts in DES -6
• Event list: A list of event notices for future events, ordered by
time of occurrence; also known as the future event list (FEL).
• Activity: A duration of time of specified length (e.g., a service
time or interarrival time), which is known when it begins
(although it may be defined in terms of a statistical
distribution).
• 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 examples to follow.
Refer to QSIM --> 09.11.21
Concepts in DES -7
• Different simulation packages use different
terminology for the same or similar concepts – e.g.,
lists are sometimes called sets, queues, or chains.
Sets or lists are used to hold both entities and event
notices.
• The entities on a list are always ordered by some
rule, such as first-in-first-out or last-in-first-out, or
are ranked by some entity attribute, such as priority
or due date.
• The future event list (FEL) is always ranked by the
event time recorded in the event notice.
Concepts in DES -8
• An activity typically represents a service time, an
interarrival time, or any other processing time whose
duration has been characterized and defined by the
modeller. An activity's duration may be specified in a
number of ways:
a. Deterministic-for example, always exactly 5 minutes;
b. Statistical-for example, as a random draw from the set {2,
5, 7} with equal probabilities;
c. A function depending on system variables and/or entity
attributes-for example, loading time for an iron ore ship as
a function of the ship's allowed cargo weight and the
loading rate in tons per hour.
Concepts in DES -9
• The duration of an activity is computable from its specification
at the instant it begins.
• Its duration is not affected by the occurrence of other events
(unless, as is allowed by some simulation packages, the model
contains logic to cancel or postpone an activity in progress).
To keep track of activities and their expected completion time,
at the simulated instant that an activity duration begins, an
event notice is created having an event time equal to the
activity's completion time. For example, if the current
simulated time is CLOCK = 100 minutes and an inspection time
of exactly 5 minutes is just beginning, then an event notice is
created that specifies the type of event (an end-of-inspection
event), and the event time (100 + 5 = 105 minutes).
Concepts in DES -10
• A delay's duration is not specified by the modeller ahead of
time, but rather is determined by system conditions. Quite
often, a delay's duration is measured and is one of the
desired outputs of a model run.
• Typically, a delay ends when some set of logical conditions
becomes true or one or more other events occur. For
example, a customer's delay in a waiting line may be
dependent on the number and duration of service of other
customers ahead in line as well as the availability of servers
and equipment.
Concepts in DES -11
• A delay is sometimes called a conditional wait, an activity an
unconditional wait. The completion of an activity is an event,
often called a primary event, that is managed by placing an
event notice on the FEL.
• In contrast, delays are managed by placing the associated
entity on another list, perhaps representing a waiting line,
until such time as system conditions permit the processing of
the entity. The completion of a delay is sometimes called a
conditional or secondary event, but such events are not
represented by event notices, nor do they appear on the PEL.
The systems considered here are dynamic, that is, changing
over time.
Concepts in DES -12
• Therefore, system state, entity attributes and the number of
active entities, the contents of sets, and the activities and
delays currently in progress are all functions of time and are
constantly changing over time. Time itself is represented by a
variable called CLOCK.
Concepts in DES -13
• Example 3.1: Call Center, Revisited
Consider the Able-Baker call centre system of Example 2.6. A
discrete-event model has the following components:
• System state
LQ(t), the number of callers waiting to be served at time t;
LA(t), 0 or 1 to indicate Able as being idle or busy at time t;
LB(t), 0 or 1 to indicate Baker as being idle or busy at time t.
• Entities
Neither the callers nor the servers need to be explicitly represented,
except in terms of the state variables, unless certain caller averages are
desired (compare Examples 3.4 and 3.5).
Concepts in DES -14
• Events:
Arrival event;
Service completion by Able;
Service completion by Baker.
• Activities:
Interarrival time, defined in Table 2.12;
Service time by Able, defined in Table 2.13;
Service time by Baker, defined in Table 2.14.
• Delay
A caller's wait in queue until Able or Baker becomes free.
Concepts in DES -15
• The definition of the model components provides a static
description of the model. In addition, a description of the
dynamic relationships and interactions between the
components is also needed. Some questions that need
answers include:
• 1. How does each event affect system state, entity attributes,
and set contents?
• 2. How are activities defined (i.e.·, deterministic, probabilistic,
or some other mathematical equation)? What event marks
the beginning or end of each activity? Can the activity begin
regardless of system state, or is its beginning conditioned on
the system being in a certain state? (For example, a machining
"activity" cannot begin unless the machine is idle, not broken,
and not in maintenance.)
Concepts in DES -16
• 3. Which events trigger the beginning (and end) of each type
of delay? Under what conditions does a delay begin or end?
• 4. What is the system state at time O? What events should be
generated at time 0 to "prime" the model-that is, to get the
simulation started?
• A discrete-event simulation is the modelling over time of a
system all of whose state changes occur at discrete points in
time-those points when an event occurs. A discrete-event
simulation (hereafter called a simulation) proceeds by
producing a sequence of system snapshots (or system images)
that represent the evolution of the system through time.
Concepts in DES -17
• A given snapshot at a given time (CLOCK = t) includes not only
the system state at time t, but also a list (the FEL) of all
activities currently in progress and when each such activity
will end, the status of all entities and current membership of
all sets, plus the current values of cumulative statistics and
counters that will be used to calculate summary statistics at
the end of the simulation. A prototype system snapshot is
shown in Figure 3.1.
• Mechanism for advancing simulation time and guaranteeing
that all events 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.
The Event Scheduling/Time
Advance Algorithm
t < t1 ≤ t2 ≤ t3 ≤ … ≤ tn.
• Time t is the value of CLOCK, the current value
of simulated time. The event associated with
time t1 is called the imminent event; that is, it
is the next event that will occur. t1 is tie when event-1 will occur
FEL
CLOCK t t1 Event-Type
t2
The Event Scheduling/Time
Advance Algorithm -4
• The sequence of actions that a simulator (or
simulation language) must perform to advance the
clock and build a new system snapshot is called the
event-scheduling/time-advance algorithm, whose
steps are listed in Figure 3.2.
Assume EVENT with occurence time t* has arrived!. What to do?:
Updating Simulation Time and System Image
EV-TYP Time
(1)
EXECUTE EV_TYPE=3
(2)
(FEL
)
TIME SHOULD NEVER go BACK in a SIMULATION system...!!!! Otherwise wrong coding or implementation must have occured...!!!
Updating Simulation Time and System Image
0 + iat1 = iat1 = 3.7s t1 = t + iat1
Generated Randomly t2 = t1 + iat2
by the PGEN t = t (now) + iat
t3 = t2 + iat3
IATs
iat1 = 3.7s Bootstrapping!
iat2 = 0.4s
iat3 = 3.3s
Customer
Ending Simulations
• Every simulation must have a stopping event. In
this example it can be called E, and it defines the
duration of the simulation. There are two ways to
stop a simulation:
1. At t=0, schedule a “stop simulation” event for a
specified future time TE.
2. Run length TE is determined by the simulation;
i.e. it is the time of occurrence of a specified
event. E.g. TE could be the time of the 10,000th
service completion.
16.11.2021
World Views
• When using a simulation package (or when
doing a manual simulation), a modeller adopts
a world view or orientation for developing a
model. The most prevalent world views are:
• The event scheduling world view,
• The process-interaction world view, and
• The activity-scanning world view.
World Views - 2
• Event-scheduling approach: the simulation analyst
concentrates on events and their effect on system
state.
• Process-interaction approach: the simulation analyst
thinks in terms of processes. The analyst defines the
simulation model in terms of entities or objects and
their life cycle as they flow through the system,
demanding resources and queuing to wait for
resources. More precisely, a process is the life cycle of
one entity.
World Views - 3
• A process is a time-sequenced list of events,
activities, and delays, including demands for
resources, that define the life cycle of one entity as it
moves through a system (see Fig.3.4).
• Both the event-scheduling and the process-
interaction approach use a variable time advance
mechanism;
• I.e. when all events and system state changes have
occurred at one instant of simulated time, the
simulation clock is advanced to the time of the next
imminent event on the FEL.
World Views Ts(2) = Service Time for Customer 2
Waiting time in
= Ts (c-2)
queue for C-2
t2
Server RETURNS
to pick up customer
n+1
= Ts (c-3)
t3