Professional Documents
Culture Documents
Discrete event simulation is the imitation of a dynamic system using computer model in order to
evaluate and improve system performance. Simulation provides a virtual method for doing
system experimentation.
Simulation procedure
Step 1: Define objective, scope, and requirements
Step 2: Collect and analyze system data
Step 3: Build and validate model
Step 4: Conduct experiments
Step 5: Analyze results and develop recommendations
Simulation system elements
Entities, activities, resources, and controls.
Entities Items processed through the Human/animate (customers, patients,
system passenger, etc.)
Inanimate (Parts, documents, etc.)
Intangible (calls, e-mail, etc.)
Activities Tasks performed in the system Entity processing (check-in, treatment,
either directly or indirectly on inspection, fabrication, etc.)
the entities. Activities consume Entity/resource movement (ride elevator,
time and use resources forklift travel, etc.)
Resource adjustment (Machine setups)
Maintenance & repair
Resources May be required for performing Human/animate (operator, doctors, etc.)
activities. Have characteristics Inanimate (equipment, tooling, etc.)
such as, capacity, speed, cycle Intangible (information, power, etc.)
time, reliability, etc.
Controls Controls how, when, and where Production routing sequence
activities are performed Work schedules
Task prioritization
System variability
Type of variability Examples
Activity times Service time, repair time
Event arrivals Time between customer arrivals, time between failure
Quantities Order quantity, batch size, number of workers absent
Decisions Customer routing, accept/reject part, join queue
Random behavior
Discrete distribution Finite number of possible values (number of items in a lot, number of
members in a group, etc.
Continuous distribution A range of values such as a time between arrivals, service time, travel
distance, etc.
System variables
Decision variables Controllable variables, such as number of machines, number of
windows
Independent variable Service time, processing time
Response variables Variables that measure the system performance (metrics)
Flowchart
Arrival
Entity = Customer Routing Exit
Teller Waiting Line Teller Window
Frequency = e(2) min First 1
Units = 1, Capacity = 1
FIFO, Capacity = 7
Service time: N(2.4,.5) min
Entity record:
Location records
If the location is a queue, change “Queuing for output” to FIFO under the “Rules” tab.
Arrival record
********************************************************************************
* Entities *
********************************************************************************
Name Speed (fpm) Stats Cost
---------- ------------ ----------- ------------
Customer 150 Time Series
********************************************************************************
* Processing *
********************************************************************************
Process Routing
********************************************************************************
* Arrivals *
********************************************************************************
Simulation options
Results: Locations
Scheduled Total Avg Time Per Avg Maximum Current %
Name Time (HR) Capacity Entries Entry (MIN) Contents Contents Contents Utilization
Teller Waiting Line 2 7 54.23 10.43 4.72 7 5.03 67.49
Teller Window 2 1 50.20 2.35 0.98 1 0.97 98.30
Service Level
Total customer arrivals = Total entries at the waiting line + Failed arrivals = 54.23 + 9.60 = 63.83
Service level = Total entries at the waiting line /Total customer arrivals = (54.23/63.83) x 100 = 84.96%
Example 2: Same bank as before, but with two tellers and 40% of arriving customers first sit at
a desk and fill out forms. Time to fill forms takes between 2.5 and 5.5 minutes. Assume total
customers in the bank cannot exceed 13.
Flowchart
Desk
Arrival Capacity = 3
p = .4 Service time: U(4,1.5)
Entity = Customer
Frequency = e(2) min min
Door Routing
Capacity =1 First 1
p = .6 Teller_Waiting_Line
FIFO, Capacity = 7
Routing
First 1
Teller_Window
Units = 2, Capacity = 1
Service time: N(2.4,.5)
Exit
********************************************************************************
* Locations *
********************************************************************************
Name Cap Units Stats Rules Cost
------------------- --- ----- ----------- --------------- ------------
Door 1 1 Time Series Oldest, ,
Desks 3 1 Time Series Oldest, , First
Teller_Waiting_Line 7 1 Time Series Oldest, FIFO,
Teller_Window 1 2 Time Series Oldest, , First
Teller_Window.1 1 1 Time Series Oldest, ,
Teller_Window.2 1 1 Time Series Oldest, ,
********************************************************************************
* Entities *
********************************************************************************
Name Speed (fpm) Stats Cost
---------- ------------ ----------- ------------
Customer 150 Time Series
********************************************************************************
* Processing *
********************************************************************************
Process Routing
Results: Locations
Scheduled Total Avg Time Per Avg Maximum Current %
Name Time (HR) Capacity Entries Entry (MIN) Contents Contents Contents Utilization
Door 2 1 61.43 0.02 0.01 1.00 0.00 0.86
Desks 2 3 26.50 3.85 0.85 3.00 0.93 28.32
Teller Waiting Line 2 7 61.50 0.70 0.38 3.53 0.20 5.38
Teller Window.1 2 1 34.90 2.34 0.68 1.00 0.70 68.00
Teller Window.2 2 1 27.47 2.36 0.54 1.00 0.47 54.04
Teller Window 4 2 62.37 2.35 0.61 2.00 1.17 61.02
Service Level
Total customer arrivals = Total entries at the door + Failed arrivals = 61.43 + 0.60 = 62.03
Service level = Total entries at the door/Total customer arrivals = (61.43/62.03) x 100 = 99.0%
Example 3: Same bank as in example 2, but with an ATM and a drive-thru window. The
waiting line for ATM is limited to 3 customers. For customers arriving at the lobby, assume
40%-40%-20% for customer directly joining the queue, sit down to fill forms and joining the
ATM waiting line, respectively. The time to complete the ATM transaction follows normal
distribution with mean = 2 minutes, and standard deviation =.5 minutes.
For the drive-through line, cars arrive according to exponential distribution with a mean of 5
minutes. Service time for drive-thru window is triangular with minimum of 1 minutes, mode of
2 minutes and maximum of 5 minutes. There are only two tellers serving the two teller windows
inside the lobby of the bank and the drive-through window. Also, assume only three cars can
wait in line for drive-thru service.
In addition to other statistics, track the number of customers in the bank also.
Flowchart
Desk
Arrival 1 Capacity = 3
p = .4 Service time: U(4,1.5)
Entity = Customer
Frequency = e(2) min min
Door Routing
Increment Capacity =1 First 1
Customers_in_bank
p = .4
p = .2 Teller_Waiting_Line
FIFO, Capacity = 7
ATM_Line Routing
FIFO, Capacity = 3 First 1
Teller_Window Exit
ATM Units = 2, Capacity = 1
Exit Service time: N(2.4,.5) min Decrement
Units=1, Capacity =1
Decrement Service time: N(2,.5) min Customers_in_bank
Customers_in_bank Resources
Shared_Teller = 2 units
Arrival 2
Entity = Car
Frequency = e(5) min DriveThru_Line DriveThru_Window Exit
FIFO, Capacity =3 Units = 1, Capacity = 1
Service time: T(1,2,5) min
********************************************************************************
* Locations *
********************************************************************************
********************************************************************************
* Resources *
********************************************************************************
Res Ent
Name Units Stats Search Search Path Motion Cost
------------- ----- -------- ------ ------ ---------- -------------- ------------
Shared_Teller 2 By Unit None Oldest Empty: 150 fpm
Full: 150 fpm
********************************************************************************
* Processing *
********************************************************************************
Process Routing
********************************************************************************
* Arrivals *
********************************************************************************
Entity Location Qty Each First Time Occurrences Frequency Logic
-------- -------------- ---------- ---------- ----------- ---------- ------------
Customer Door 1 0 INF e(2) min
Car DriveThru_Line 1 0 INF e(5) min
********************************************************************************
* Variables (global) *
********************************************************************************
ID Type Initial value Stats
---------------- ------------ ------------- -----------
Customers_In_Bank Integer 0 Time Series
Results: Locations
Scheduled Total Avg Time Per Avg Maximum Current %
Name Time (HR) Capacity Entries Entry (MIN) Contents Contents Contents Utilization
Door 2 1 60.03 0.01 0.01 1.00 0.03 0.63
Desk 2 3 24.53 3.84 0.78 2.93 1.10 26.14
Teller Waiting Line 2 7 48.53 1.09 0.47 3.60 0.20 6.69
Teller window.1 2 1 27.97 2.77 0.64 1.00 0.57 64.46
Teller window.2 2 1 21.40 2.90 0.52 1.00 0.43 51.99
Teller window 4 2 49.37 2.82 0.58 2.00 1.00 58.22
ATM Line 2 3 11.50 0.22 0.03 1.23 0.00 0.87
ATM 2 1 11.70 2.00 0.19 1.00 0.10 19.40
DriveThru Line 2 3 23.37 2.07 0.44 2.47 0.43 14.80
DriveThru Window 2 1 23.57 3.00 0.59 1.00 0.70 59.23
Results: Resources
Scheduled Number Avg Time Per %
Name Units Time (HR) Times Used Usage (MIN) Utilization
Shared Teller.1 1 2 36.03 2.46 73.76
Shared Teller.2 1 2 36.57 2.44 74.00
Shared Teller 2 4 72.60 2.44 73.88
Results: Variables
Avg Time Per Minimum Maximum Current
Name Total Changes Change (MIN) Value Value Value Avg Value
Customers In Bank 120 1.00 0.00 7.27 2.43 2.64
Average wait time for exited customers (minutes) = 0.83 + 0.52 = 1.35 - 1.15 + 1.40 = 2.55
Average wait time for all customers including ones still .01 + 1.09 = 1.10 .01 + .22 = .23 2.07
in the bank (minutes) =
% of time waiting line is empty = 76.46% 97.80% 71.30%
Teller 1 73.76%
Teller 2 74.00%
Service level:
Total customer arrivals = Total entries at the door + Failed arrivals = i.e. = 60.03 + 0.40 = 60.43
Service level = Total entries at the door /Total customer arrivals = (60.03/60.43) x 100 = 99.3%
Total car arrivals = Total entries at the drive-through line + failed car arrivals = 23.37 + 1.00 = 24.37
Service level for car arrivals = (23.37/24.37) x 100 = 95.90%
Lobby operation comparison
Average wait time for exited customers (minutes) = 11.41 0.71 1.35
Average wait time for all customers including ones still 10.43 0.72 1.10
in the bank (minutes) =
% of time waiting line is empty = 4.66% 77.33% 76.46%
Service level (% customer able to enter) 84.96% 99% 99.3% (walk-in) &
95.90% (cars)
Example 4: Consider the same bank as in example 3. Suppose that 20% of the arriving customers are
business customers, and the remaining 80% are regular customers. Also, assume that the service time for
business customers will be according to exponential distribution with a mean of 20 minutes and no change in
service time for the regular customers.
Changes needed:
1. Define an entity “Attribute” for Customer Type
2. Define a “User-defined distribution” for the probability of customer type
3. Stamp each customer arrival with the Customer type attribute
4. Code the service time at teller window using Customer Type attribute
3. Stamp each customer arrival with the Customer type attribute in the Arrival Table
4. Code the service time in the Process Table at the Teller window location using Customer Type attribute
Start new block Check this box to signal the beginning of a new routing block. Checking this box will place a
number in the Blk field for that record.
First Available Routing is to the first available location in the order they are listed.
By turn Routing rotates through the locations in the list.
Until full Routing is to a single location until it is full; then it is switched to the
next location, and so on.
Probability Routing is according to the given probabilities.
User condition Routing is based on the condition provided.
Most available Routing is to the location with most available capacity.
Random Routing is at random.
Longest Unoccupied Routing is to the location that was unoccupied the longest.
If Send Routed based on a SEND request from a location to the destination
location.
If Join Request Selects a location whenever a JOIN request is issued at that location.
Entities routed with the JOIN routing rule are not actually sent to their
destination until a JOIN statement is encountered at the destination
location.
Advanced commands
Get/Free
Syntax samples
GET {<quantity>} <resource> {,<priority>} {AND or OR {quantity} <resource> {,<priority>}...}
GET Res1
GET 3 Res1, 5
GET 2 Res1OR 3 Res2
GET Res1, 3 AND (Res2 OR Res3)
Description: Captures a specified number of resources as they become available. A resource captured with the GET
statement is released with a FREE statement. Every GET must have a corresponding FREE or an error occurs when
the entity exits the system.
Use
Syntax samples
USE {<quantity>} <resource> {,<priority>} FOR <time> {AND or OR {<quantity>}
<resource> {,<priority>} FOR <time>... }