Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

GPss simulation and modeling, Lecture notes of Mathematical Modeling and Simulation

this is a hoand out of GPSS simulatiom modeling ans some basic methods which is very useful to modeling techniques

Typology: Lecture notes

2018/2019

Uploaded on 12/16/2019

muyesser-ehet
muyesser-ehet 🇹🇷

1 document

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
GPSS
(Part III)
Discrete Event Simulation
2005- 2006 Fall Term
Prof. Dr. Nadir Yücel, Asst. Prof. Dr. A. Şima Uyar
Example
Patients arrive at the emergency room of a hospital with arrivals
distributed according to the Poisson distribution. On the average, 30
minutes pass between the patients’ arrivals. There is only one nurse
in the emergency room. The patients are first examined by this nurse,
whose service time is an exponentially distributed random variable
with a mean of 10 minutes. The nurse groups 45% of the patients as
CW (can wait) and the remaining 55% as NIA (need immediate
attention). There are two doctors in the emergency room. The
priority of the patients grouped as NIA are higher. The examination
time of the doctors for the NIA patients is an exponentially
distributed random variable with mean 45 minutes. 75% of these
NIA patients are sent to the lab to get some tests done. The
remaining 25% is treated and sent home. The time it takes for the
test results to be ready is an exponentially distributed random
variable with mean 30 minutes.
Example (
cntd.
)
When the test results are ready, the patients have to be re-
examined by any one of the doctors, however their priority
is now less than that of a patient who was originally labeled
as CW and has not yet seen a doctor. The time it takes for
a doctor to read the test results and treat the patient
accordingly is an exponentially distributed random variable
with mean 15 minutes. After this treatment, the patient is
sent home. The time it takes for a doctor to treat a CW
patient is an exponentially distributed random variable with
mean 30 minutes. After treatment, they are sent home.
Simulate the emergency room for 8 hours (assuming no
breaks) and measure the queues for service at the four
waiting points.
DRS STORAGE 2
*
GENERATE (EXPONENTIAL(1,30,1)),,,,10
QUEUE NURSEQ
SEIZE NURSE
DEPART NURSEQ
ADVANCE (EXPONENTIAL(1,10,1))
RELEASE NURSE
TRANSFER .45,,CW
*
NIA PRIORITY 15
QUEUE NIAQ1
ENTER DRS,1
DEPART NIAQ1
ADVANCE (EXPONENTIAL(1,45,1))
LEAVE DRS,1
TRANSFER 0.25,,HOME
*
PRIORITY 5
ADVANCE (EXPONENTIAL(1,30,1))
QUEUE NIAQ2
ENTER DRS,1
DEPART NIAQ2
ADVANCE (EXPONENTIAL(1,15,1))
LEAVE DRS,1
HOME TERMINATE 0
CW QUEUE CWQ
ENTER DRS,1
DEPART CWQ
ADVANCE (EXPONENTIAL(1,30,1))
LEAVE DRS,1
TERMINATE 0
*
GENERATE 480
TERMINATE 1
Functions
two types of functions:
discrete functions
continuous functions
function definition consists of:
function control statement
function follower statement
Functions
function control statement
label FUNCTION argument,type_count
type: D for discrete, C for continuous
count: number of paired points
function follower statement
paired function points
pf2

Partial preview of the text

Download GPss simulation and modeling and more Lecture notes Mathematical Modeling and Simulation in PDF only on Docsity!

GPSS

(Part III)

Discrete Event Simulation

2005 - 2 006 Fall Term

Prof. Dr. Nadir Yücel, Asst. Prof. Dr. A. Şima Uyar

Example

Patients arrive at the emergency room of a hospital with arrivals

distributed according to the Poisson distribution. On the average, 30

minutes pass between the patients’ arrivals. There is only one nurse

in the emergency room. The patients are first examined by this nurse,

whose service time is an exponentially distributed random variable

with a mean of 10 minutes. The nurse groups 45% of the patients as

CW (can wait) and the remaining 55% as NIA (need immediate

attention). There are two doctors in the emergency room. The

priority of the patients grouped as NIA are higher. The examination

time of the doctors for the NIA patients is an exponentially

distributed random variable with mean 45 minutes. 75% of these

NIA patients are sent to the lab to get some tests done. The

remaining 25% is treated and sent home. The time it takes for the

test results to be ready is an exponentially distributed random

variable with mean 30 minutes.

Example ( cntd.)

When the test results are ready, the patients have to be re-

examined by any one of the doctors, however their priority

is now less than that of a patient who was originally labeled

as CW and has not yet seen a doctor. The time it takes for

a doctor to read the test results and treat the patient

accordingly is an exponentially distributed random variable

with mean 15 minutes. After this treatment, the patient is

sent home. The time it takes for a doctor to treat a CW

patient is an exponentially distributed random variable with

mean 30 minutes. After treatment, they are sent home.

Simulate the emergency room for 8 hours (assuming no

breaks) and measure the queues for service at the four

waiting points.

DRS STORAGE 2

GENERATE (EXPONENTIAL(1,30,1)),,,, QUEUE NURSEQ SEIZE NURSE DEPART NURSEQ ADVANCE (EXPONENTIAL(1,10,1)) RELEASE NURSE TRANSFER .45,,CW

NIA PRIORITY 15 QUEUE NIAQ ENTER DRS, DEPART NIAQ ADVANCE (EXPONENTIAL(1,45,1)) LEAVE DRS, TRANSFER 0.25,,HOME

PRIORITY 5 ADVANCE (EXPONENTIAL(1,30,1)) QUEUE NIAQ ENTER DRS, DEPART NIAQ ADVANCE (EXPONENTIAL(1,15,1)) LEAVE DRS, HOME TERMINATE 0

CW QUEUE CWQ ENTER DRS, DEPART CWQ ADVANCE (EXPONENTIAL(1,30,1)) LEAVE DRS, TERMINATE 0

GENERATE 480 TERMINATE 1

Functions

 two types of functions:

 discrete functions

 continuous functions

 function definition consists of:

 function control statement

 function follower statement

Functions

 function control statement

label FUNCTION argument,type_count

type: D for discrete, C for continuous

count: number of paired points

 function follower statement

 paired function points

2

Sampling from Discrete

Distributions: D-Functions

Example: The time it takes

to complete drilling holes

on a machine part

depends on the number

of holes needed which is

different for different

parts. The drilling times

for 5 different parts is

given in the table. The

relative arrival

frequencies for each type

of part is also given in the

table.

holes time rel. freq. cum. freq. 1 4 0.2 0. 2 7.5 0.35 0. 3 10.5 0.15 0. 4 13.5 0.1 0. 5 16.5 0.2 1.

DTIME FUNCTION RN7,D

ADVANCE FN$DTIME

Sampling from Discrete

Distributions: D-Functions

0.2 0.55 0.7 0.8 1.0 cum. freq.

time

Sampling from Discrete

Distributions: D-Functions

 using discrete functions to determine the next

block attempted

Example:

BRN FUNCTION RN2,D

.2,D1/.8,D2/1,D

TRANSFER ,FN$BRN

Sampling from Continuous

Distributions: C-Functions

Example: The

observed service

times for a bank

tellar are given in

the table.

service time relative freq. cum. freq. interval [sn]

BSRV FUNCTION RN4,C

ADVANCE FN$BSRV

Sampling from Continuous

Distributions: C-Functions

0.07 0.23 0.73 0.92 1.0 cum. freq.

time

for service times, use interpolation

USING FUNCTIONS

 GENERATE FN$IAT,

 sampling from the “exponential distribution”

ADVANCE (EXPONENTIAL(3,0.5,1)

rng no μ for expo. distr. scaling factor