*** Welcome to piglix ***

GPSS


General Purpose Simulation System (GPSS) (originally Gordon's Programmable Simulation System after creator Geoffrey Gordon; the name was changed when it was decided to release it as a product) is a discrete time simulation general-purpose programming language, where a simulation clock advances in discrete steps. A system is modelled as transactions enter the system and are passed from one service (represented by blocs) to another. This is particularly well-suited for problems such as a factory. GPSS is less flexible than simulation languages such as Simula and SIMSCRIPT II.5 but it is easier to use and more popular.

The GPSS code may surprise many programmers with experience in procedural, object oriented or functional programming. The world is rather simulated with entities moving through the model. These entities, called Transactions, are envisioned as moving from Block to Block, where a Block is a line of code and represents unit actions that affects the Transaction itself or other entities. To a new programmer GPSS resembles a LEGO structure where blocks are chosen by the modeller for specific functions to imitate a particular system. Since Gordon's first design in 1960, its evolution went from mainframes such as IBM and VAC to portable computers keeping popularity. Blocks could 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 which brings in fixed form at the end of a simulation as standard 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.

The following example, taken from Simulation using GPSS, is the "Hello world!" of GPSS and will illustrate the main concepts.

The aim is to simulate one day of operation of a barber shop. Customers arrive in a random constant flow, enter the shop, queue if the barber is busy, get their hair cut on a first-come first-served basis, and then leave the shop. We wish to know the average and maximum waiting line, as well as the number of customers.


...
Wikipedia

...