GENERATE BLOCK:
This block will produce a flow of transactions with inter-arrival times determined by the attribute values. The label is optional. The distribution of inter-arrival times follows a uniform probability distribution.
SYNTAX:
- line number label GENERATE A,B,C,D,E
ATTRIBUTES:
- A = average value of uniform distribution
- B = half-width of uniform distribution
- C = time delay before first transaction is generated
- D = maximum number of transactions generated
- E = priority allocated to transactions
QUEUE BLOCK:
This block will instruct GPSS to start gathering queuing statistics on the queue named in its attribute value.
The label is optional but may be necessary if you have to refer to this line from somewhere else in the program
SYNTAX:
- line number label QUEUE A
ATTRIBUTES:
- A = name of queue (for example: garage)
If a transaction arriving at the queue block cannot proceed because it is blocked by the next stage, then it will stay in the queue block until it can gain entry to the next stage.
DEPART BLOCK:
This block instructs GPSS that a transaction is leaving the queue named in it’s attribute value. This is necessary in order to compile the statistics on the queue. The label is optional.
SYNTAX:
- line number label DEPART A
ATTRIBUTES:
- A = name of the queue (for example: checkout)
SEIZE BLOCK:
This blocks allows the transaction to seize a facility if it is free. Thus it may be a car “seizing” a “facility” such as a petrol pump or a customer in a supermarket “seizing” a “facility” such as the checkout assistant. When the car or customer is being serviced by the facility, then it is said to “own the facility”. The label is optional.
SYNTAX:
- line number label SIZE A
ATTRIBUTES:
- A = name of facility (for example: pump)
* A transaction can only seize a facility if it is free or else wait until the owning transaction releases it.
RELEASE BLOCK:
A transaction entering this block informs GPSS that it is giving up ownership of the facility named in its attribute value. The label is optional.
SYNTAX:
- line number label RELEASE A
ATTRIBUTES:
- A = name of facility (for example: runaway)
* By giving up ownership of the facility, the transaction makes it available for another transaction that may be waiting to use it.
ENTER BLOCK:
This Block instructs GPSS that a transaction has entered STORAGE. The name of storage is given by the first attribute value. The second attribute value gives the amount the storage will be incremented by, when the transaction enters the ENTER block. A STORAGE must be declared at the beginning of a program. For example:
100 Warehouse STORAGE 25
In the 'label' section you must give the STORAGE a name so that the ENTER block can refer to it. The "verb" is STORAGE and the attribute value A, which is 25 in this example, states the maximum capacity of the Warehouse.
SYNTAX:
- line number label ENTER A,B
ATTRIBUTES:
- A = name of the storage (for example: warehouse)
- B = increment storage by this value
LEAVE BLOCK:
This block instructs GPSS that a transaction is leaving a STORAGE. The first attribute gives the name of the STORAGE and the second attribute decrements the storage by the value of the attribute.
SYNTAX:
- line number label LEAVE A,B
ATTRIBUTES:
- A = name of the storage (for example: warehouse)
- B = Decrement storage by the value
ADVANCE BLOCK:
This block represents the servicing of a transaction. The servicing times follow a uniform probability distribution. The label is optional.
SYNTAX:
- line number label ADVANCE A,B
ATTRIBUTES:
- A = average value of uniform distribution
- B = half-width of uniform distribution
* A transaction entering this block will be delayed by a time interval chosen at random from the specified probability distribution.
TERMINATE BLOCK:
This block destroys any transaction entering it and removes it from computer memory. Each time a transaction enters this block it decrements a counter by an amount equal to its attribute value. The counter is set by the user upon starting the simulation.
SYNTAX:
- line number label TERMINATE A
ATTRIBUTES:
- A = decrements simulation counter by this amount
* When the counter, set at the beginning of the simulation, reaches zero then the simulation is complete and a statistical report is produced on the outcome of the simulation
TEST BLOCK:
This block can test the logical condition of a queue or storage according to a particular reference value. If a transaction enters the TEST block, the block will check this condition and if it is true, it will send the transaction to one destination in the program and if the condition is false, it will send it to another. For example:
158 TEST LE S$ONHAND, 20, OK
In this example, the STORAGE names ONHAND is checked to see if the amount in storage is less than or equal to (LE) 20. If it is, then the transaction proceeds to the next block in the program. If the condition is false, then the transaction is sent to the program line which has the label "OK" attached to it. The LE part of the verb can be replaced by GE, G, L, E and NE with the usual logical meaning (for example: greater than or equal to, greater than, less than, equal to and not equal to).
SYNTAX:
- line number label TEST O A,B,C
ATTRIBUTES:
- A = value and name of the block being referenced
- B = reference value
- C = destination for the transaction if the logical condition is not satisfied
TRANSFER BLOCK:
This block will take transactions entering it and transfer them to each of two different destinations according to laid down proportions. For example:
200 TRANSFER 0.95, EXIT, REPAIR
In this case 95% of all transactions entering the TRANSFER block will go to the program line labelled REPAIR and 5% will go to the program line labelled EXIT. If the second attribute "EXIT" is replaced by a "comma", then the 5% will go to the next block in the program.
SYNTAX:
- line number label TRANSFER A,B,C
ATTRIBUTES:
- A = probability value (0 to 1)
- B = proportion of (1-A) transactions transferred to this labelled location
- C = proportion A transactions transferred to this labelled location
System Numeric Attributes (SNA's)
GPSS automatically collects certain statistics when a simulation is running. Some of these statistics appear in the final report but others do not. These statistics are referred to as System Numeric Attributes (SNA's). The values of these SNA's may be checked at any time during a program run and can be used to specify conditional statements in the program. For example:
S$WAREHOUSE, returns the amount of the storage named WAREHOUSE that is occupied at the time a transaction enters the block that contains that statement.
Q$GARAGE, will return the size of the queue named GARAGE at the time that a transaction enters the block that contains that statement. There are many others!
Controlling the Length of a Simulation Run
- The terminate block can contain an attribute value that will make the simulation stop when the number of transactions entering the TERMINATE block equals the attribute value.
- In a GENERATE statement it is possible to specify the maximum number of transactions that the GENERATE block will produce. Clearly the model will cease to function once this limit has been reached and the last transaction has been terminated.
- It is possible to have a separate timing section in your program that will determine the exact time of a simulation. For example:
500 TIMER GENERATE 2000 600 TERMINATE 1
This will cause the GENERATE block in line 500 to produce a single transaction at 2000 time units after the simulation starts and decrement the termination counter to zero. This will immediately stop the simulation run. You must ensure there is no attribute value in any other TERMINATE block in the simulation model.
Example of Program in GPSS: Joe's Barbershop
Suppose we want to simulate a typical day of nine hours’ work. Since we have decided that one time unit is equal to one minute then we must convert nine hours into minutes. That is 9 x 60 minutes = 540 minutes.
We now modify the program given earlier by modifying line 800 and adding lines 900 and 1000 as follows:
100 | MEN | GENERATE | 18,6 |
200 | ADVANCE | 1 | |
300 | QUEUE | SEAT | |
400 | SEIZE | JOE | |
500 | DEPART | SEAT | |
600 | ADVANCE | 15,3 | |
700 | RELEASE | JOE | |
800 | TERMINATE | ||
900 | TIMER | GENERATE | 540 |
1000 | TERMINATE | 1 |
To run the simulation, we simply use the command START 1.
Note: the first TERMINATE block at line 800 does not have an attribute.
In the program above, after the command START 1 is issued, the simulation begins to run. Due to the fact that the TERMINATE block at line 800 does not have an attribute, the termination counter is not decremented and the simulation continues. At 540 time units after the simulation starts, however, a single transaction will be generated by line 900 which will decrement the termination counter to zero and stop the program.
Reference(s) | |||
Book | Anderson, D. R., Sweeney, D. & Williams, T. (2002) An Introduction to Management Science: A Quantitative Approach to Decision Making. 10th Edition. South-Western College Publishing: United States of America (USA), California (CA), San Diego. [ISBN: 9780324145632]. [Available on: Amazon: https://amzn.to/3DrQjUY]. | ||
Web | Minuteman Software. (2009) GPSS World Reference Manual [Online]. Minuteman Software: United States of America (USA), Mississippi (MS), Marshall, Holly Springs. [Accessed on: 2013-02-10]. [Available on: Minuteman: http://www.minutemansoftware.com/reference/reference_manual.htm]. | ||
Book | Pfaffenberger, B. (2002) Computers in Your Future 2003. 5th Edition. Prentice Hall: United States of America (USA), New Jersey (NJ), Bergen, Upper Saddle River. [ISBN: 9780139227820]. [Available on: Amazon: https://amzn.to/3gv8n7D]. | ||
Book | Thesen, A. & Travis, L. (1992) Simulation for Decision Making. Thomson Reuters - West: United States of America (USA), Minnesota (MN), Dakota, Eagan. [ISBN: 9780314835499]. [Available on: Amazon: https://amzn.to/3Sqcv6g]. |
Reference (or cite) Article | ||
Kahlon, R. S. (2013) Explanation of some GPSS Blocks [Online]. dkode: United Kingdom, England, London. [Published on: 2013-02-10]. [Article ID: RSK666-0000106]. [Available on: dkode | Ravi - https://ravi.dkode.co/2013/02/explanation-of-some-gpss-blocks.html]. |
The explanations provided are very helpful. Each & every block is explained in a very lucid manner which gives a detailed idea about them.
ReplyDelete