General Purpose Simulation System (GPSS) is a simulation language used for discrete-event simulations. It is especially useful in the modelling of queuing systems, with many statistics being collected automatically. The typical simulation consists of Transactions being generated in the system (usually at a certain interval), performing a defined set of rules (like use a resource, wait, transfer), and being removed from the simulation.
History GPSS was developed in the 1960s by Geoffrey Gordon, an employee of IBM's Advanced Systems Development Division (ASDD). This division was heavily involved with research into the design of teleprocessing systems, trying to achieve an economic balance of the use of computer resources and shared lines between server terminals. The simulation system, then known as the Gordon Simulator, became very popular in the study of teleprocessing systems within ASDD. It subsequently was fixed and documented on October 25, 1960 in an internal IBM memorandum. Between the winter and summer of 1961, a group of three programmers (including Gordon) rewrote the simulation system with a new algorithm and new block types. It was officially released as a supported IBM-label program on September 27, 1961 with 25 block types. At this point, Gordon stopped working on the simulation system. In 1963, GPSS II was released with 32 block types. It introduced system numerical attributes, which allowed tracking the current content of a Storage, the length of a Queue, or the current clock time. In 1965, GPSS III was released. It was made available for IBM Systems 7090/94 and 7040/44. In 1967, GPSS/360 was released to run on the newly released System 360. In 1970, GPSS V was released with 49 block types. In the 1980s, GPSS/VAC and GPSS/PC were released. These appear to be the last official IBM-label releases before the language became unlicensed. Subsequently, there were releases for IBM 360, Univac 1108, and CDC.
Over time, other implementations were developed for systems including DEC's VAX, a specialized APL version for large-scale Univac systems, and Macintosh. In 2001, the Windows program GPSS World was released with new features to GPSS. It includes scripting with PLUS (a Pascal-like language), graphical system state displays, graphing, and optimization experiments. In 2009, a graphical Java-based tool called JGPSS (Java General Purpose Simulation System) was developed to teach the GPSS simulation language.
Description A GPSS simulation is written in an Assembly-style "block diagram language" with many different single-purpose commands ("Blocks") to control the flow of a Transaction, statistics collection, and variables. Simulations have Transaction entry points through the GENERATE command, such as a customer walking into a store. Then, actions are performed through claiming Facilities/Storage (like a cashier), waiting, saving statistics, etc. Finally, the simulated transaction exits the simulation through the TERMINATE command. Each command verb is referred to as a "control". Blocks can be facility-oriented (such as machines in a job shop) or transaction-oriented (such parts of work-in-process, signals in electronic components or documents in a bureaucratic procedure). GPSS automatically keep track of statistics for display on a report. Entities can be broadly classified in Resources, Computational entities and Statistical entities. Resources, like Facilities and Storages represent limited capacity resources. Computational entities, like Ampervariables (variables), Functions and random generators are used to represent the state of Transactions or elements of their environment. Statistical entities, like Queues or Tables (histograms) collect statistical information of interest.
Basic transaction commands Transactions can:
Automatically enter the simulation (GENERATE) Use a facility or storage (SEIZE/ENTER respectively) Stop using a facility or storage (RELEASE/LEAVE respectively) Wait (ADVANCE) Transfer to another section of code (TRANSFER) Exit the simulation (TERMINATE) Along with these main tasks, they can also hold parameters with the ASSIGN command. Transactions are implicitly sectioned off in the code. There can be multiple transactions in the code that happen at once. A transaction starts with GENERATE and ends with TERMINATE. The code inbetween could potentially be shared between multiple transactions by means of the TRANSFER command, but besides that your transaction lifecycles will be separated. It helps to add whitespace between lines of action of one transaction versus another.
GENERATE GENERATE 0.1
Transaction generated every 0.1 time unit.
GENERATE 15,4
Transaction is generation every 15 time units, plus or minus 4 time units. GENERATE
ADVANCE To have a transaction wait, use the ADVANCE command. It has similar arguments to GENERATE.
ADVANCE 10,6
Transaction waits 10±6 seconds. ADVANCE
SEIZE, RELEASE (Facilities) To use a Facility, which only allows one use at a time, use the SEIZE command. To stop using it, use the RELEASE command.
GENERATE 30,5 ; Generate a customer every 30±5 time units SEIZE Barber ; Use a facility ADVANCE 15,4 ; Wait 15±4 time units RELEASE Barber ; Stop using the facility TERMINATE 1 ; Leave the barber shop
If you want more than one use at a time, use Storage. SEIZE RELEASE
ENTER, LEAVE (Storages) Seating STORAGE 100 ; 100 people allowed in lounge seating
GENERATE 10,5 ; Generate a person every 10±5 time units ENTER Seating,1 ; Person sits down ADVANCE 15,4 ; Wait 15±4 time units LEAVE Barber,1 ; Person stops sitting TERMINATE 1 ; Exit the seating area
This way, multiple people can sit in the Seating at once. If this was a Facility (using SEIZE/RELEASE), it would block others who tried to use the resource. The ENTER command takes the storage reference as Argument A and the amount to reserve with Argument B. The LEAVE command's arguments are the same. ENTER LEAVE
… excerpt ends here. Continue reading the full article.


