GP SS ( G en er al Pu r p ose Simul at ion Sys- t em)
4.5 GP SS ( G en er al Pu r p ose Simul at ion Sys- t em)
GPSS , one of t he earliest discret e simulat ion languages, was developed by Geo¤rey Gordon and present ed in two papers in 1961 and 1962. The …rst release of t his language was implement ed on t he I BM 704, 709 and 7090 com- put ers. Since t hen improved and more powerful versions havebeen developed and implement ed.
GPSS is suit ed for modeling t ra¢ c and queueing syst ems well. A GPSS programmer does not writ e a program in t he same sense as a SI MSCRIPT programmer does. Inst ead , he const ruct s a block diagram- a network of in- t erconnect ed blocks, each perfor ming a special simulat ion -orient ed funct ion.
Moving t hrough t he syst em of blocks are ent it ies called t ransact ions. Ex- amples of t ransact ions are : cust omers, message, machine part s, vehicles, et c. Typical blocks are :
(a) GENERATE, creat es t ransact ions (b) QUEUE , creat es a queue of t ransact ions and maint ains cert ain
queueing st at ist ics; (c) TABULATE , t abulat es t he t ime it t ook t he t ransact ions t o reach
t hat point from t he t ime it ent ered t he simulat ed syst em (d) TERMI NATE , dest roys t ransact ions and removes t hem from t he
syst em. (e) ADVANCE , when t ransact ion ent ers t his block, an act ion t ime
is comput ed and added t o t he current t ime t o produce a block depart ure t ime.
Simple mat hemat ical calculat ions can be carried out wit h t he use of vari- able st at ement s. Unlike in SIM SCRI PT , t here are no element ary mat hemat - ical funct ions in GPSS, such as t he t rigonomet r ic or logarit hmic funct ions. GPSS can , however , generat e a number of basic random variat es.
The lat est release of GPSS/ H is version 2.0 . It added a ‡oat ing point clock, built - in mat h funct ions , and built in random variat e generat ors.
4.5.1 Si ngl e-Ser ver Queue Si m ul at i on i n G P SS/ H
I n t he following …g we can see t he GPSS block diagram for single server queue simulat ion and aft er t hat we can see t he GPSS pr ogram . Not e t hat
In …g , t he GENERATE block represent s t he arrival event , and also de- not es t he int er arrival t imes by t he speci…cat ion RVEXPO(1,&!AT ). RVEXPO indicat es ” random variable, exponent ially dist ribut ed ” , t he
1 indicat es t he random number st ream t o use, and &1AT indicat es t hat t he mean t ime for t he exponent ial dist ribut ion comes fr om an ampervariable &1AT. Ampervariable have an ” &” before t hem , t hese are de…ned as int eger or real by cont rol st at ement s I NTEGER and REAL.
The next block is a QUEUE wit h a dummy queue named SYSTI ME. It should be not ed t hat t he QUEUE block is not needed for queues t o form in GPSS/ H. This is just an anomaly of t he language. T he t rue purpose of t he QUEUE block is t hecommencement of dat a collect ion. By placing a QUEUE block at t he point t hat t ransact ions ent er t he syst em, and t he count er part of t he QUEUE block , t he DEPART block, at t he point t hat t he t ransact ions complet e t heir processing, t he response t imes will be aut omat ically collect ed. The measure will be associat ed wit h t he dummy SYST IME. T he purpose of t he DEPART block is t o signal t he end of dat a collect ion.
The next QUEUE block begins dat a collect ion for t he queue before t he cashier. This queue is given t he name LINE. The cust omers may or may not have t o wait for t he cashier. At some t ime , t he cust omer capt ures t he cashier as indicat ed by t he SEI ZE block wit h t he r esource given t he name CHECKOUT.( single unit resources called facilit ies are capt ured by a SEI ZE block, mult iple unit resources are capt ured by a STORE block). Once t his capt ure begins, t he dat a collect ion for t he queue ends as represent ed by t he DEPART block, wit h queue LI NE indicat ed. The t ransact ions delay at t he cashier is given by t he ADVANCE block. RVNORM indicat es ” r andom vari- able , normally dist ribut ed” . Again random number st ream 1 is being used, t he t ime for t he normal dist r ibut ion is given by t he ampervariable &MEAN , and it s st andard deviat ion is given by t he ampervariable & STDEV,
Next t he cust omer gives up t he use of t he facilit y CHECKOUT wit h
a RELEASE block.(for a mult iple unit resource , t he analogous block is t he RET URN block,) T he end of t he dat a collect ion for response t imes is indicat ed by t he DEPART block for t he dummy queue SYST IM E.
Next t here is a TEST block t hat checks t o see if t he t ime in t he syst em , M1 , is great er t han or equal t o 4 minut es.( Not e t hat M1 is a reserved wor d in GPSS/ H). Thus , if t he cust omer has been in t he syst em four minut es or longer , add one t o t he count er &COUNT in t he BLET ( for Block LET) block. I f not t rue , t he escape rout e is t o t he block wit h t he label T ER. T hat label appears before t he T ERMI NATE block whose purpose is t he removal of t he t ransact ion fr om t he syst em. T he TERM INAT E block has a value
Ther e are eleven blocks in t his program. T he cont rol st at ement s t hat begin wit h an ” *” arecomment s, someof which are used for spacing purposes. The cont rol st at ement SI MULATE t ells GPSS/ H t o conduct a simulat ion.
I f t his cont rol st at ement is omit t ed, t he model will be compiled only. T he ampervariables are de…ned asint eger or real by cont rol st at ement s INTEGER and REAL. The four LET st at ement s provide dat a for t he simulat ion .
To insure t hat t he model dat a is correct , and for t he purpose of managing di¤erent scenarios simulat ed , it is good pract ice t o echo t he input dat a. This isaccomplished wit h a PUTPIC( for ” put pict ure” ) cont rol st at ement . I t says t o put t he 5 lines t hat follow in a …le wit h t he name OUT and t hat t he dat a going in t o t hat …le is given by t he four ampervariables indicat ed. There are …ve lines , t he last of which is just a blank t o separat e it from addit ional informat ion t hat will be wr it t en t o t he … le OUT.
The … rst out put in t he parent hesized list is t he server ut ilizat ion. ² FR(CHECKOUT )/ 1000 Indicat es t hat t he fract ional ut ilizat ion of t he
facility CHECKOUT. ² QM (LI NE) is t he maximum value in t he queue LI NE during t he sim-
ulat ion. ² QT (SYSTI ME) is t he aver age t ime in t he queue SYSTIM E. ² &COUNT/ N(TER) is t he number t hat had a response t ime of four or
more minut es divided by t he number of cust omers t hat went t hrough t he block wit h label TER , or N(T ER) .
² AC1 is t he clock t ime, whose last value gives t he lengt h of t he simula- t ion.