GPSS-Plus DSL philosophy
The GPSS-Plus DSL is not intended as a general-purpose programming language, nor as an alternative notation for drawing blocks. It is designed as the operational language of the simulation engine.
When working with the DSL, the user does not “program”: they define behaviors, resources, and events that the engine executes over time. They model.
To understand it properly, it is useful to think of the DSL as a set of tools organized into four levels.
1. Visible or physical entities: behavior of the “dots”
The first level of the DSL is aimed at defining what the entities that move through the model do.
These entities:
- are born (
GENERATE), - advance in time (
ADVANCE), - interact with resources (
SEIZE,ENTER,REST…), - make decisions (
IF,SWITCH), - and eventually die (
TERMINATE).
All their behavior is described step by step, but that step-by-step is not real sequential execution: it is execution over an event queue.
At this level, the DSL provides:
- flow blocks,
- time control,
- conditional structures and loops,
- procedure calls.
This is the most visible level of the model and the one closest to user intuition.
2. Virtual entities (VE): parallel behavior
Not all behavior belongs to a visible “dot”.
GPSS-Plus introduces virtual entities (VE) to model logic that:
- has no graphical representation,
- does not traverse the circuit,
- but lives inside the simulation engine.
VEs make it possible to:
- react to events (
ON_SEIZE,ON_RELEASE,SIGNAL), - execute periodic logic (
TIMEOUT), - act as agents, controllers, or even components,
- coordinate other entities without blocking them.
From the DSL point of view, a VE is a complete entity, with its own life cycle, but oriented toward system control or entity coordination.
3. Resources: the environment entities interact with
The third level of the DSL defines the model environment.
Resources represent what entities use, occupy, wait for, or query. They can be:
- physical:
FACILITY,STORAGE,RESTROOM,STOCK - logical:
QUEUER,CONDITIONS,FSM - external:
BRIDGER,FILE,TABLE,PLOTTER
Each resource follows the same conceptual pattern:
- it is defined by a COMMAND,
- it is used via paired BLOCKS,
- it is observed through SNAs.
The DSL does not hide resource state: everything can be read, queried, and used in decisions.
4. The engine: time, events, and system
Beneath entities and resources lies a fourth, less visible but fundamental level: the simulation engine.
The DSL allows explicit interaction with it by:
- controlling simulated time,
- scheduling future events (
TIMEOUT), - configuring the system (
SYSTEM), - accessing the event queue and internal state via SNAs.
This enables models where behavior is not just “flow”, but reaction, synchronization, and planning.
Example
/* Season 3: DSL
Example of a simple model using the GPSS-Plus DSL.
*/
FACILITY {NAME:COUNTER, X:300, Y:300} ; Define the service counter in space.
POSITION {NAME:EXIT, X:500, Y:300} ; Define the exit in space.
START 100 ; Run until 100 entities have been served
;------------------------------------------------------------------------------------
GENERATE 60,10 {NAME:GEN1, X:100, Y:300} ; Position the entity generator.
ADVANCE 10 {TO:COUNTER} ; Move to the counter.
SEIZE COUNTER ; Seize the COUNTER resource.
ADVANCE 60,30 ; Service time: 60 to 90 seconds.
RELEASE COUNTER ; Release the resource.
ADVANCE 10 {TO:EXIT} ; Move to the exit.
TERMINATE 1 ; The entity finishes.