In a simulation, there are two main elements at play:
1. ENTITIES, or transactions, are the elements that change their state during the simulation. They can represent people, boxes, or any kind of item. In GPSS-Plus, they are represented as colored dots. These entities interact with the environment. For example, they enter the system through the GENERATE block, move through a circuit using ADVANCE, and terminate at a TERMINATE block.
2. RESOURCES, which make up the environment and are used by entities, such as a service counter or a container larger than the entity itself.
For example, a person (entity) approaches a service counter (resource). This counter is defined by a COMMAND, and a set of BLOCKS describe what the person does in relation to that counter.
An example of defining a resource as a service counter is the COMMAND:
FACILITY {name:Ventanilla1, x:100, y:100}
An example of an instruction for an entity to occupy that counter is the BLOCK:
SEIZE Ventanilla1
In summary, the language is based on two main elements: blocks and commands.
1. Blocks bound to entities
Blocks are instructions that ENTITIES execute directly during the simulation. Each block defines a specific action that affects the flow or state of that entity.
General syntax:
BLOCK [PARAMETERS A,B,C..] {JSON-LIKE OPTIONS}
Block examples:
ASSIGN variableName,10 TERMINATE 1
Parameters are named by letters (A, B, C, ...). Depending on the block, they may also include parameters in a JSON-like format, usually defining graphical or advanced aspects.
Example:
MOD {COLOR:#FF0000} ; sets an entity to red color.
Another example:
ADVANCE 10,5 {TO:Ventanilla1} ; the entity advances in time towards "Ventanilla1"
2. Commands bound to resources and the engine environment
Commands configure the simulation environment. Unlike blocks, they are not executed directly by entities. Instead, they define resources, graphical positions, and system rules.
General syntax:
COMMAND {NAME:theName, JSON-LIKE OPTIONS}
Example of defining a storage resource:
STORAGE {NAME:ALMACEN1, CAPACITY:10, X:270, Y:200}
This format allows adding additional information such as position (X, Y).