Generalities

Updated: 2026-03-07

Types of resources available in GPSS-Plus:

  • Facility → Exclusive resource with capacity. Example: machine, server.
  • Storage → Accumulative resource. Example: warehouse, tank.
  • Restroom → Holding resource. Entities wait to be released.
  • Conditions → Conditional holding resource. Passage based on logic.
  • Stock → Intelligent warehouse of tagged products.
  • Stater → Finite state machine. Process control.
  • Queuer → Open resource. For counting, grouping or analysis.

They allow modeling shared capacities, physical spaces, warehouses, synchronization points, etc. Each resource type defines its own usage logic, but all can be connected to procedures through event hooks such as ON_SEIZE, ON_LEAVE, etc.

Automatic histograms:

All resources can generate automatic histograms of their usage by defining binning:

R_BIN_*: Tabulates resource occupancy.

R_BIN_START:0,R_BIN_SIZE:1,R_BIN_COUNT:40

E_BIN_*: Tabulates entity occupation times.

E_BIN_START:0,E_BIN_SIZE:1,E_BIN_COUNT:40

Associated SNA:

Using R$(resourceName,property) you can query in real time:

  • X, Y → Graphic position
  • LEFT, IN, QUEUE, ENTRIES, CAPACITY → Operational state
  • LOCK → 0 or 1 depending on whether entry is blocked
  • OCCUPIED → (STORAGE only) current occupied amount
R$(Fac1,LEFT)
R$(Fac1,QUEUE)
R$(Fac1,LOCK)

Hooks

Depending on the specific resource, certain hooks may be available and handled by procedures executed by virtual entities (VE). Virtual entities are created that traverse the trigger and are born with the ENTITYNUMBER assign.

Example

POSITION {NAME:Exit,X:615,Y:388}

initial posY,500
Graphic {NAME:Text1,Type:TEXT,X:324,Y:X$posY - 0}
Graphic {NAME:Text2,Type:TEXT,X:324,Y:X$posY - 20}
Graphic {NAME:Text3,Type:TEXT,X:324,Y:X$posY - 40}
Graphic {NAME:Text4,Type:TEXT,X:324,Y:X$posY - 60}
Graphic {NAME:Text5,Type:TEXT,X:324,Y:X$posY - 140}
Graphic {NAME:Text6,Type:TEXT,X:324,Y:X$posY - 160}
Graphic {NAME:Text7,Type:TEXT,X:324,Y:X$posY - 180}
Graphic {NAME:Text8,Type:TEXT,X:324,Y:X$posY - 200}

Facility {NAME:Facility1,X:324,Y:560
	,capacity:3
	,ON_ATTEMPT:FACILITY1_attempt
	,ON_SEIZE:FACILITY1_seize
	,ON_RELEASE:FACILITY1_release
	,ON_QUEUE:FACILITY1_queue
    }

Storage {NAME:Storage1,X:324,Y:235
	,capacity:30
	,ON_ATTEMPT:STORAGE1_attempt
	,ON_ENTER:STORAGE1_enter
	,ON_LEAVE:STORAGE1_leave
	,ON_QUEUE:STORAGE1_queue
    }



START 1000

;-------------------------------

GENERATE 10,0 {NAME:GEN1,X:62,Y:396}

if (D$N%2==1)

    advance 10 {to:Facility1}
    seize Facility1
    advance 55,10
    release Facility1
else
    advance 10 {to:Storage1}
    enter Storage1,random * 25 + 1
    advance 35,10
    leave Storage1
endif


advance 10 {to:Exit}

ENDGENERATE 1
;-------------------------------

PROCEDURE FACILITY1_release
	move {name:Text1,text:"AC1$ I am the VE [D$N] of ON_RELEASE for entity P$ENTITYNUMBER"}
    TERMINATE_VE
endprocedure 
PROCEDURE FACILITY1_queue
	move {name:Text2,text:"AC1$ I am the VE [D$N] of ON_QUEUE for entity P$ENTITYNUMBER"}
    TERMINATE_VE
endprocedure 
PROCEDURE FACILITY1_seize
	move {name:Text3,text:"AC1$ I am the VE [D$N] of ON_SEIZE for entity P$ENTITYNUMBER"}
    TERMINATE_VE
endprocedure 
PROCEDURE FACILITY1_attempt
	move {name:Text4,text:"AC1$ I am the VE [D$N] of ON_ATTEMPT for entity P$ENTITYNUMBER"}
    TERMINATE_VE
endprocedure 
;-------------------------------

PROCEDURE STORAGE1_leave
	move {name:Text5,text:"AC1$ I am the VE [D$N] of ON_LEAVE for entity P$ENTITYNUMBER"}
    TERMINATE_VE
endprocedure 
PROCEDURE STORAGE1_queue
	move {name:Text6,text:"AC1$ I am the VE [D$N] of ON_QUEUE for entity P$ENTITYNUMBER"}
    TERMINATE_VE
endprocedure 
PROCEDURE STORAGE1_enter
	move {name:Text7,text:"AC1$ I am the VE [D$N] of ON_ENTER for entity P$ENTITYNUMBER"}
    TERMINATE_VE
endprocedure 
PROCEDURE STORAGE1_attempt
	move {name:Text8,text:"AC1$ I am the VE [D$N] of ON_ATTEMPT for entity P$ENTITYNUMBER"}
    TERMINATE_VE
endprocedure