Lecture - 5
Lecture - 5
1
Introduction
❖ System: A collection of entities (e.g., people and machines) that interact together to accomplish one or
more goals
❖ Model: An abstract representation of a system, usually containing structural, logical, or mathematical
relationships that describes a system in terms of
❖ State
❖ Entities and their attributes
❖ Sets
❖ Processes
❖ Events
❖ Activities
❖ Delays
3
Concepts in DES
❖ State: A collection of variables that contain all the information necessary to describe
a system at a point in time
❖ Entity: Any object or component in the system which requires explicit
representation in the model (e.g., a server, a customer, a machine)
❖ Attributes: The properties of a given entity (e.g., the priority of a given customer,
the routing of a job through job-shop)
❖ List: A collection of associated entities, ordered in some logical fashion (e.g., all
customers currently waiting in line, FIFO or by priority fashion)
❖ Event: An instantaneous occurrence that change the system state (e.g., arrival or
departure of a customer)
4
Concepts in DES
❖ Event Notice: Record of an event to occur at the current or some future time, with any
associated data necessary to execute the event (at a minimum this includes event and
the event time)
❖ Future Event List: A list of event notices for future events, ordered by time of
occurrence also called future event list
❖ Activity: A duration of time of specified length (e.g., a service time or interarrival time)
❖ Delay: A duration of time of unspecified indefinite length, which is not known until it
ends (e.g., a customer’s waiting time in line depends on departure time of previous
customers)
❖ Clock: A variable representing simulated time
5
Concepts in DES
❖ Different simulation packages use different terminology for the same or similar
concepts
❖ An activity typically represents a service time, an interarrival time, or any other
processing time, whose duration is characterized by the modeler. It can be
specified as
❖ Deterministic, e.g., always exactly 5 minutes
❖ Statistical, e.g., as a random draw from among 2,5,7 with equal probabilities
❖ A function depending on system variables or entities, e.g., loading time for an
iron ore ship as a function of the ship’s cargo weight and loading rate in tons per
hour
6
Concepts in DES
❖ Activity can be characterized by from its specifications
❖ If the clock is 100 and an inspection that will take 5 minutes is starting then an event
notice can be created at 105 as end of an inspection
❖ In contrast to activity, a Delay’s duration is not specified by the modeler ahead of time
but rather is determined by system conditions.
❖ Delay ends when some logical conditions are met and typically is an output of the
simulation.
❖ A customer’s waiting time in line depends on the number and duration of service of
the customers ahead in line as well as the availability of servers and equipment
❖ A delay is also called a “conditional wait”, while an activity is called an
“unconditional wait”
7
Event Scheduling Algorithm
❖ A discrete event simulation proceeds by producing a sequence of system snapshots
which represents the evolution of system through time
❖ A system snapshot at time t, includes
❖ The system state at time t,
❖ List of all activities (future event list) currently in progress and when such an
event will end.
❖ The status of all current entities
❖ The current values of cumulative statistics
❖ Not all models will contain every element
8
Event Scheduling Algorithm
9
Event Scheduling Algorithm
❖ The mechanism for advancing the simulation time is based on Future Event
List (FEL)
❖ List contains all event notices for events that have been scheduled to occur at
a future time
❖ Events are ordered chronologically at the FEL
❖ The clock is advanced to the imminent event time at the FEL and the event is
executed to change system state
❖ If a new event notice needs to be created and added to the FEL, the event
notices may need to be reordered
10
Event Scheduling Algorithm
11
Grocery Store Example Revisited
❖ System State:
❖ =Number of customers waiting in line at time t
❖ = Number of customers being served at time t (0 or 1)
❖ Entities:
❖ Customers and servers
❖ Events
❖ Arrival
❖ Departure
❖ Event Notices
❖ , representing an arrival event to occur at a future time t by customer i
❖ representing a departure event to occur at a future time t by customer i
❖ Activities
❖ Interarrival time defined in lecture 4
❖ Service time defined in lecture 4
❖ Delay
❖ Customer time spent waiting in line
12
Grocery Store Example Revisited
13
Grocery Store Example Revisited
❖ Assume we only want to know maximum queue length and server
utilization
System State Cumulative Statistics
Clock (t) Future Event List Cumulative Server Busy Time Maximum Queue Length
14
Grocery Store Example Revisited
❖ Arrival event executed: system state updated next arrival scheduled
and added to event list (FEL always chronologically ordered)
System State Cumulative Statistics
Clock (t) Future Event List Cumulative Server Busy Time Maximum Queue Length
15
Grocery Store Example Revisited
❖ Arrival event executed: state updated, new arrival is scheduled and
added to the FEL
System State Cumulative Statistics
Clock (t) Future Event List Cumulative Server Busy Time Maximum Queue Length
16
Grocery Store Example Revisited
❖ Departure executed: state updated, new service time assigned hence
new departure event added to FEL
System State Cumulative Statistics
Clock (t) Future Event List Cumulative Server Busy Time Maximum Queue Length
17
Grocery Store Example Revisited
❖ Departure event executed: state updated, new service time assigned
and new departure event added to the FEL
System State Cumulative Statistics
Clock (t) Future Event List Cumulative Server Busy Time Maximum Queue Length
18
Grocery Store Example Revisited
❖ Arrival event executed: state updated (customer joined the queue) a
new arrival is scheduled and added to the FEL
System State Cumulative Statistics
Clock (t) Future Event List Cumulative Server Busy Time Maximum Queue Length
19
Grocery Store Example Revisited
❖ Departure and an arrival executed: state updated, new service time
assigned hence new departure event added to FEL, an arrival
scheduled and added to the FEL
Clock (t) Future Event List Cumulative Server Busy Time Maximum Queue Length
21
Able-Baker Call Center Problem
❖ There are two technical support people – Able and Baker. Able is more
experienced and can provide service faster than Baker. The
distributions of their service times are given as below. Able gets the call
if both are idle. One customer in line at time 0. Collect utilization
statistics of Able and Baker via simulation
22
Able-Baker Call Center Problem
❖ System State:
❖ = Number of customers waiting in line at time t
❖ Entities:
❖ Customers and Able and Baker
❖ Events
❖ Arrival, Service completion by Able, Service Completion by Baker
❖ Event Notices
❖ , representing an arrival event to occur at a future time t
❖ Delay
❖ Customer time spent waiting in line
23
Able-Baker Call Center Problem
❖ Next arrival scheduled and added to FEL, service completion of the
first call by Able scheduled (using Able’s service distribution) and
added to FEL
System State Cumulative Statistics
Clock (t) Future Event List Able Busy Time Baker Busy Time
0 0 1 0 (A, C2 , 2), (, C1 , ) 0 0
24
Able-Baker Call Center Problem
❖ System state updated (call got by Baker, Able still on call, no one in line). Next
arrival scheduled (4 mins) and added to FEL, service completion of the second
call by Baker scheduled (using Baker’s service distribution) and added to FEL
(service time generated is 3 mins)
System State Cumulative Statistics
Clock (t) Future Event List Able Busy Time Baker Busy Time
0 0 1 0 (A, C2 , 2), (, C1 , ) 0 0
25
Able-Baker Call Center Problem
❖ Two calls are completed, system state updated, nobody in line, no events to add
to FEL
26
Able-Baker Call Center Problem
❖ A call arrived Able got it, a service completion event (a service time drawn from
Able’s distribution (5 minutes)) is added to the FEL, a new arrival event is
scheduled and added to FEL ( 4 minutes)
27
Able-Baker Call Center Problem
❖ A call arrived Baker got it, a service completion event (a service time drawn
from Baker’s distribution (6 minutes)) is added to the FEL, a new arrival event is
scheduled and added to FEL (2 minutes)
28
Able-Baker Call Center Problem
❖ A call is completed by Able, no one in line system state is updated
29
Able-Baker Call Center Problem
❖ A call has arrived and got by Able. A service completion by Able event added to
the FEL (5 min) , a new arrival event is added to the FEL (an interarrival drawn
from interarrival distribution 2 min)
30
Able-Baker Call Center Problem
❖ A call has arrived Able and Baker is busy, hence started waiting in line. New
arrival scheduled (and added to the FEL 4 min)
31
Able-Baker Call Center Problem
❖ Utilization of Able= 12/14
❖ Utilization of Baker=7/14
❖ Of course needs a way longer simulation to obtain reasonable statistics
System State Cumulative Statistics
Clock (t) Future Event List Able Busy Time Baker Busy Time
0 0 1 0 (A, C2 , 2), (, C1 , ) 0 0
2 0 1 1 (, ), (,C2 , ), (A,C3,6) 2 0
5 0 0 0 (A,C3,6) 5 3
6 0 1 0 (A,C4 , 10), (,C3,11 ) 5 3
10 0 1 1 (, C3, 11 ), (A, C5, 12), (, C4, 16 ) 9 3
11 0 0 1 (A, C5, 12), (, C4, 16 ) 10 4
12 0 1 1 (A, C6, 14), (, C4, 16 ), (, C5, 17) 10 5
14 1 1 1 (, C4, 16 ), (, C5, 17), (A, C7, 18) 12 7
32