GPSS PROGRAMMING (GENERAL PURPOSE SYSTEM

Download Report

Transcript GPSS PROGRAMMING (GENERAL PURPOSE SYSTEM

GPSS PROGRAMMING
(GENERAL PURPOSE SYSTEM
SIMULATION)
EBUBEKIR SIDDIK NERGIZ
1
Simulation with GPSS



GPSS is a programme had been improved for system simulation.
GPSS is a way to solve the Monte Carlo type of simulation problems.
Gpss uses random numbers and it has commands such as ENTER,
LEAVE, QUEUE and DEPART that are available for system simulation.
2
THE COMMANDS ON GPSS









GENERATE
It is a command that used for arriving to a transaction.
We need a time period that decided by the computer
As an illustration transactions can be interarrival times.
The programme use uniform distribution if it is not mentioned
If the arrival times are given with a function we use GENERATE FN$
COMMAND
ARRIV FUNCTION RN1, D6 ARRIVAL CUMULATIVE
DISTRIBUTION 0.19,0/0.50,1/0.77,2/0.88,3/0.96,4/1.0,5
GENERATE FN$ ARRIV
If a function is not used such as “GENERATE 5,2” then the programme
is gonna use uniform distribution with mean =5
3
THE COMMANDS ON GPSS









ADVANCE
This command is used to show the time expended during the service.
It has the same using prodecedure with Generate command.
If the service time is given with a function we use
ADVANCE FN$SERVE
Else we use the command without a function such as ADVANCE 5,4
Then we mean that the mean of the distribution is 5 and the values from
1 to 9 are chosen with the same chance.
TERMINATE
we use the command at the end of the all models constituted.
4
THE COMMANDS ON GPSS




ENTER-LEAVE AND SEIZE-RELEASE
These commands are uses together and tell about two function. Firstly
they control the entrance and exit from the advance command. If we use
Enter-Leave commands ; then the system does not allow to Advance
command to have more parts from the storage command lets.
If we use Seize and release then Advance has only one part.
The second function is that the commands have capacity and some
statistic about the operations.
5
THE COMMANDS ON GPSS



QUEUE AND DEPART
These commands constitutes statistics about the queues.

MODEL SEGMENT 1
GENERATE FN$ARRIV
QUEUE LINE
ENTER XEROX
DEPART LINE
ADVANCE FN$
LEAVE XEROX
TERMINATE

START :this commands give start to the simulation.






6
THE COMMANDS ON GPSS



SIMULATE : The command is at the beginning of the of the simulation.
It must be at least at the eighth line, else the programme fails.
END : The command says that the operation has finished then new
operations could be get start.
STORAGE: This command says that the system has one more segments.
7
THE COMMANDS ON GPSS




START: Give start to working the model constituted.
CLEAR:Deletes all the statistic.
JOB: by the command job we can hold two different Gpss algorithms,
job command deletes the results of the first transaction then set the
system agin for the new simulation and sets generating new random
numbers.
RESET: reset command makes zero the reletive clock and sets again the
resulted statistics but does not set generating new numbers.
8
FUNCTIONS AT GPSS






A function starts from second line.
The maximum number of the letters
that the name of the function has is
5.
The last two characters could be
number or letter but the first three
characters must be letter.
RN1,RN2,RN3,RN4,RN5,RN6,RN
7,RN8 ; the programme use these
commands for generating random
numbers.
Dn is the second operand and means
the distribution is discrete and has n
categories.
0.19,0/0.50,1/0.77,2/0.88,3/0.96,4/1.
0,5
The
time
betwee
n
arrivals
Arrivals
distributi
on
Cumulativ
e dist.
0
5
5/26=0.1
9
0.19
1
8
8/26=0.3
1
0.50
2
7
7/26=0.2
7
0.77
3
3
3/26=0.1
1
0.88
4
2
2/26=0.0
8
0.96
5
1
1/26=0.0
4
1.0
9
THE STATISTIC OF THE QUEUES





MAXIMUM CONTENTS: The number of the maximum entity at the system
during the simulation.
AVERAGE CONTENTS: The number of the average entities at the system during
the simulation.
TOTAL ENTRIES: The total number of the entities at the system.
ZERO ENTRIES: The number of the entities that had their service without being at
the queue.
AVERAGE TIME/TRANSACTION: The average time of the all entities at the
system.
zeroentrie s
percentzeros 
totalentries
10
THE STATISTIC OF THE SERVICE







STORAGE: Shows the name of the transaction.
CAPACITY: The number of the transactions that had the service at the
system.
AVERAGE CONTENTS: The avarage transaction used the service. If
the system works with the maximum capacity then the value of the
capacity and the value of the avarage contents are gonna be same.
ENTRIES: The number of the entities that gonna get the service.
AVERAGE TIME/UNIT: The avarage time for the number of the
entities get the service.
PERCENT AVAILABILITY: The percent of the productivity at the
system.
CURRENT CONTENTS: available transaction number at any time
when the simulation finished.
11
THE STATISTIC OF THE SERVICE



PERCENT AVAILABILITY: The percent of the productivity at the
system.
CURRENT CONTENTS: available transaction number at any time
when the simulation finished.
MAXIMUM CONTENTS: The active number of transactions during the
simulation.
12
AIRPORT SIMULATION ONE RUNWAY
SIMULATE
TIME FUNCTION RN1,D9
0.04,0/0.12,1/0.44,2/0.60,3/0.72,4/0.84,5/0.92,6/0.96,7/1.0,8/
SERVEFUNCTION RN2,D5
0.12,2/0.44,3/0.72,4/0.88,5/1.0,6/
GENERATE FN$TIME..,185
QUEUE LINE
SEIZE RUNWAY
DEPART LINE
ADVANCE FN$SERV
RELEASE RUNWAY
TERMINATE 1
START 185
13



At the first programme advance command includes serve function, but
at the second advance command the distribution is discrete uniform
distribution with mean = 2,
Seize and release commands are used for control the entrances and exits
to the system constituted.
After generate command we may use functions or another distributions.
14
THE RESULTS
FACILITIES
Facility
runway
Number
entries
Avarage
time/trans
185
3.843
0.993
Average total
time
Utilization
available
time
During
unavail time
Current
status
Percent
availability
100.0
QUEUES
Queues
Max.
cont.
Average
cont.
Total
entries
Utilization
time avail
During
unavailtime
Current
status
26
11.88
5
185
5
2.7
46.00
47.277
Percent
availabi
lit
15
THE RESULTS
Number entries
Average
time
Average total
time
Percent
availabililty
1.85
2.00
0.596
100.0
Max cont
Average
cont.
Total entries
Zero
entries
Percent
zeros
Averag
e time
$averag
e time
2
.095
185
147
75.4
0.3118
1.552
$average time: does not include the zero entries
16
A example given with the
programme


















; GPSS World Sample File - BARBER.GPS.
***********************************************************************
*
*
*
Barber Shop Simulation
*
*
*
***********************************************************************
Waittime QTABLE Barber,0,2,15 ;Histogram of Waiting times
GENERATE 3.34,1.7
;Create next customer.
TEST LE Q$Barber,1,Finis ;Wait if line 1 or less
*
else leave shop
SAVEVALUE Custnum+,1
;Total customers who stay
ASSIGN Custnum,X$Custnum ;Assign number to customer
QUEUE Barber
;Begin queue time.
SEIZE Barber
;Own or wait for barber.
DEPART Barber
;End queue time.
ADVANCE 6.66,1.7
;Haircut takes a few minutes.
RELEASE Barber
;Haircut done. Give up the barber.
Finis TERMINATE 1
;Customer leaves.

17
REFERENCES



1.GÜNES MUSTAFA, BENZETİM VE GPSS PROGRAMLAMA İZMİR,1996
2.HACIMENNİ EMEL,COURSE NOTES
3.www.minuteman.com
18