You are on page 1of 59

INTRODUCTION TO GPSS/H

Week 05
System Simulation Analysis &
Design

1
THE GPSS/H WORLD VIEW
• The system is modeled from the viewpoint of
entities moving through the system.
• These dynamic moving entities are called
Transactions.
• Envisioned as moving through the system by
moving from Block to Block.
• Collection of Blocks representing the whole
system is called a Block Diagram
2
Example
TRANSACTION REPRESENTATION IN
GPPS/H Block
arrival of a customer at the GENERATE
checkout counter
checkout time of a customer ADVANCE

departure of a customer TERMINATE

3
4
BASIC ELEMENTS OF GPSS/H
• Transaction
• Resources and other entities
• Blocks
• Control Statements
• Compiler Directives
• Standard Numerical Attributes

5
TRANSACTIONS
• Transactions is abbreviated as XACTs
• Created to perform certain task in the model
• After completing their task, Transaction leave
the system and are destroyed.
• These Transactions are temporary entities
(Note: Transactions may never leave the
system, called permanent entities)

6
RESOURCES
• Static, permanent entities in a GPSS/H model.
• They do not leave the system and cannot be
destroyed.
• Used to perform a certain task (e.g., to serve
a customer at the checkout counter)
• Resources may be people or objects (e.g., the
clerk in the checkout line, assembly stations,
machine, etc)

7
RESOURCES
• Two types of resources: Facilities and
Storages
– Facilities are used to model single unit
resources
– Storages are used to model multiple, parallel
resources

8
GPSS/H BLOCKS
• Describe how a Transaction moves through a
system
• A Block represents a specific action or event
• A combination of Blocks represent the
processing of a Transaction as it moves
through the system (called “logic” of a
simulation model)

9
Example : Joe Barbershop
Konsumen datang untuk mendapatkan layanan atas
rambutnya dengan interval waktu antara 12 – 24
menit (distribusi uniform).
Melepas jaket dan meletakkan pada gantungan 0.5
menit
Jika tukang potong rambut JOE sedang sibuk ,
konsumen menunggu. Jika tidak, konsumen akan
dilayani dalam waktu 12 – 18 menit (distribusi
uniform).
Setekah selesai dipotong konsomen akan
meninggalkan tempat barbershop.

10
PENGEMBANGAN DIAGRAM BLOK GPSS/H : JOE’S BARBERSHOP

GENERATE
18,6
Kedatangan konsumen U(18,6) menit

ADVANCE
Waktu melepas dan megantung jaket 0.5 menit
0.5

SEIZE Konsumen berusaha mendapatkan layanan


JOE (“capture”) dari JOE

ADVANCE
15,3 Waktu pelayanan merapikan rambut U(15,3)

RELEASE JOE Konsumen melepaskan layanan


(“freeing”) dari JOE

TERMINATE
Konsumen meninggalkan sistem 1 orang
1

11
12
Input Format
• Fixed format
• Free format
• For better readability, we recommend that you
use fixed format
• A statement is divided into 4 fields –the line
label; the operation code; the operands; for
comments –See Fig. 3.4

13
Input Format

14
CONTROL STATEMENTS
SIMULATE
START 100
END
• SIMULATE control statement indicates to GPSS/H
that the model is to be executed after successful
compilation.
• START control statement defines simulation run
length and initiates the execution of the Block
diagram
• END control statement indicates the end of the source
file.

15
STANDARD OUT REPORT
• The standard out put report is divided into two
parts
– The GPSS/H model listing and information about
the GPSS/H model in general
– The simulation results

16
A Recommended Organization of A
GPSS/H Model

17
BASIC GPSS/H BLOCKS AND
CONTROL STATEMENTS
Lecture Notes - Chapter 3

18
Introduction
• A GPSS/H source file consists of
– Blocks
– Control Statements
– Compiler Directives

19
Introduction
The most commonly used GPSS/H Blocks and
Control Statements
– GENERATE and TERMINATE, for creating and
destroying Transaction
– ADVANCE for holding a Transaction for a
specified period of time
– SEIZE and RELEASE, for capturing and freeing a
Facility
– SIMULATE, START and END
20
EXAMPLE 3-1
• One bundle of cloth material is needed to make one
dozen T=shirts. Bundles are delivered to the dock
between 3 and 5 minutes apart.
• It takes 2 minutes for the line feeder to transport a
bundle from the dock to the staging area.
• In the staging area, one line server arranges the cloth
into separate T-shirt components and loads them onto
a cart –takes between 2.75 and 4.75 minutes.

21
EXAMPLE 3-1
Questions:
• How much time does it take for the line server
to prepare 100 bundles?
• How busy is the line server during this period
of time?

22
TRANSCTION IDENTIFICATION
TRANSCATION BLOCK REPRESENTATION

Kedatangan budle kain dengan interval GENERATE 4,1


waktu 3 s/d 5 menit

23
24
25
GPSS/H Blocks
• The GENERATE block models the arrival of a
Transaction into the system
• The TERMINATE Block models the exit of a
Transaction from the system
• The GENERATE block has 8 operands –we
will discuss only the first four and please see
the others in the later Chapter.

26
GENERATE block

27
GENERATE block
• A: specifies the mean inter arrival time for
Transactions to be created
• B: is numeric value (in a uniform distribution),
that specifies the spread
• C: specifies the time at which the first
Transactions arrives
• D: specifies the limit count of the number of
Transactions to be created
28
GENERATE block
• Examples:
• GENERATE 4.1
• GENERATE 4.1, ,3
• GENERATE4.1,2.1, ,10
• GENERATE , , ,1
• GENERATE RVEXPO (2,8.5)

29
TERMINATE block
• TERMINATE block has one operand
• TERMINATE 1
– Whenever a Transaction enters this block, the
Transaction is destroyed and the value of the
termination counter will be decremented by 1
• TERMINATE
– The operand is 0, so that the termination counter
will not decrease even though a Transaction is
destroyed.
30
TERMINATE block

31
ADVANCE block
• ADVANCE block holds a Transaction for a specified
length of time –commonly used to represent the
processing time or the traveling time
• The block has two operands, A and B
• In a Uniform Distribution:
– A: specifies the mean time for a Transactions to be held
in this block
– B: specifies the spread above and below the mean
holding time

32
ADVANCE block

33
ADVANCE block
• ADVANCE 2.1
• ADVANCE 3.75,1
• ADVANCE RVTRI(4,6.0,7.5,15.0)

34
SEIZE and RELEASE Blocks
• SEIZE and RELEASE Blocks model the capture and
release of a Facility, respectively.
• SEIZE Block has one operand, specifying the name
of Facility or the Facility number
• RELEASE Block frees the specified Facility from
capture.
• The block has one operand, specifying the name of
Facility or the Facility number to be released

35
SEIZE and RELEASE Blocks

36
SEIZE and RELEASE Blocks

37
SEIZE and RELEASE Blocks
• SEIZE SERVER
• SEIZE 1
• RELEASE SERVER
• RELEASE 1

38
CONTROL STATEMENT
• SIMULATE control statement indicates to
GPSS/H that the model is to be executed after
successful compilation.
• START control statement defines simulation
run length and initiates the execution of the
Block diagram
• END control statement indicates the end of the
source file.
39
START control statement
• The START control statement has four operands
• A-operand, (A>0), establishes an initial value of the
simulation termination counter, TG1
• Operands B, C & D will not be used in this text.
• EX-1.3:
– START 100, (TG1=100)
– TERMINATE 1, (TG1 is decremented by 1, and as soon
as TG1 =0 or <1, GPSS/H stops the simulation)

40
GPSS/H Model Listing of EX-1.3

41
RUNNING A GPSS/H Model
• The GPSS/H model for Example 3-1 (EX3-1), The
Filename of the source code: EX3-1.GPS
• Two ways to run a GPSS/H model:
• Type GPSSH and press RETURN, GPSS/H will
prompt you to enter the name of the model
• Or Type GPSSH filename (e.g., GPSSH EX3-1.GPS
or GPSSH EX3-1) and press RETURN.

42
RUNNING A GPSS/H Model
• If compilation is successful, GPSS/H will
automatically execute the model.
• The standard simulation output will be written
to a file with the same filename, except it has
the “.LIS” (e.g., EX3-1.LIS).

43
The Standard Simulation Output
File
• Divided into two parts:
• The GPSS/H model summary
• The Simulation results.

44
Simulation results

45
Simulation Results
Can be separated into four sections:
• Clock section
• Block count section
• Entity summary
• Random number stream section

46
Simulation Results

47
Entity Summary:[the Facilities Report]
• The FACILITY column gives the name or number of a Facility.
• The ‑AVG‑UTIL‑DURING‑ TOTAL TIME column shows the
fraction of the total time that the Facility was in a state of capture.
• A Facility is always in one of two states, available or unavailable.
These two states (and their corresponding Blocks, FAVAIL and
FUNAVAIL) will be discussed briefly in Chapter 16. If the
FUNAVAIL Block is never used, then a Facility is available 100%
of the time. The ‑AVG‑UTTL‑DURING‑ AVAIL TIME and
UNAVL TRAE columns refer to the fraction of the time the Facility
was held in a state of capture while the Facility was available and
unavailable, respectively. If the Facility was always available, these
columns will be blank.
• The ENTRIES column shows the total number of instances the
Facility was captured.

48
Entity Summary:[the Facilities Report]
• The AVERAGE TIME/XACT column shows the average holding time per
capture.
• The CURRENT STATUS column shows whether the Facility is currently
available or unavailable. For the simple models used in this book, the
status is always AVAIL. Note that AVAIL is independent of a Facility's
busy or idle status.
• The PERCENT AVAIL column shows the fraction of the total time the
Facility was available. Blank means 100%.
• The SEIZING XACT column shows the Transaction number that is
currently in control of the Facility. If the Facility is free, this column
remains blank.
• A Facility can be preempted. Preemption will be discussed briefly in
Chapter 16. The PREEMPTING XACT column shows the number of the
PREEMPTing Transaction.

49
Random number stream section
• Shows information about the random number
streams used in the model.
• In Example 3.1, 202 random number were
used to simulate the arrival and processing of
100 bundles of cloth.
• Why not 200?

50
Answers to Questions in EX-3.1
• (1) Look at the value of the relative clock at
the end of the simulation (399.2730 minutes)
• (2) The line server was utilized 0.956 of the
total time

51
Setting Up A Program File

• Create a model file


– using the DOS editor (Type EDIT at the
command prompt in the GPSSH directory).
– Notepad
– Use capitals for all code

52
Create a model file
– Recommended that the following fixed column
format be used.
– Col. 1 * (only used for a comment line)
– Col. 2‑9 Label
– Col. 10 blank
– Col.11‑20 Operation (Control Statement or Block
Statement)
– Col. 21 blank
– Col. 22‑72 Operands

53
Running A program File
• Running a program file
– GPSSH> gpssh fn.gps (return) or
– GPSSH> gpssh fn (return)

54
Exercises using the GENERATE, TERMINATE and
ADVANCE blocks

• Objective :
– to use an editor or word processor to create a GPSSH
model file,
– to run the simulation,
– to answer questions on the automatically produced post
simulation report.
• Procedure: Type in the file listed below and run it.
– New Blocks: GENERATE, TERMINATE
– New Control statements: SIMULATE, START, END
– Additional statement type : Comment statement *
55
Model File:
SIMULATE
* The SIMULATE control statement indicates to the compiler to
* compile and run the support system to run the simulation model
GENERATE 2
* Create an arrival every two time units beginning at time 2 units
TERMINATE 1
* Remove each arrival,one by one
*
START 5
*
* Simulate until 5 arrivals have been removed
* END indicates to the compiler the end of model file
*
END

56
Questions

• At what simulated time was the post simulation report


produced?
• What is the number of the GENERATE BLOCK ?
• What is the number of the TERMINATE BLOCK ?
• What is the total number of arrivals? Hint: Look at the
TOTAL count at the GENERATE BLOCK.
• What is the CURRENT number of arrivals at each
BLOCK ?
• Modify and execute a model to determine the time of the 13th
arrival.

57
Model File:

SIMULATE
* The SIMULATE control statement indicates to the support system
* compiler to compile and run the simulation model
GENERATE RVEXPO(1,12), ,0
* Create arrivals randomly with mean time between arrivals 12
* units using random number generator 1 beginning at time 0 units
*
TERMINATE 1
* Remove each arrival, one by one
*
START 1000
*
* Simulate until 1000 arrivals have been removed
*
* END indicates to the compiler the end of model file
*
END

58
Questions
• At what simulated time was the post simulation report
produced?
• What is the number of the GENERATE BLOCK ?
• What is the number of the TERMINATE BLOCK ?
• What is the total number of arrivals? Hint: Look at the
TOTAL count at the GENERATE BLOCK.
• What is the CURRENT number of arrivals at each BLOCK ?
• Repeat the simulation using random number generator 2 and
answer questions 1‑5. (Hint: use RVEXPO (2, 12)). What are
the differences if any between the two simulations ?

59

You might also like