In GPSS-Plus, statistics are accumulated automatically if tables are defined with the appropriate parameters. There are several types of statistics, classified by what is being measured:
Entity-based statistics (E_BIN_*)
They measure how long each entity has remained in a resource.
-
Applicable to: All resources (
FACILITY,STORAGE,QUEUE, etc.) -
Example: An entity spends 40 time units → 1 is added to bin 40.
Resource-based statistics (R_BIN_*)
They measure how long a resource has had a specific number of active entities.
-
Applicable to: All resources
-
Example: The resource has 3 entities for 10 time units → 10 is added to bin 3.
Statistics per stored unit (EQ_BIN_*)
They measure how long each unit remains inside a STORAGE.
-
Applicable to: Only
STORAGE -
Example: A truck with 5 units stays 40 time units → 5 is added to bin 40.
Statistics by storage quantity (RQ_BIN_*)
They measure how long a STORAGE contains a certain total quantity of units.
-
Applicable to: Only
STORAGE -
Example: 3 units for 10 time units → 30 is added to bin 3.
Queues (QUEUER)
Queues have their own statistics table if a QUEUER is declared. To collect data:
queue Queue1 seize Resource1 depart Queue1 ADVANCE ... release Resource1
You can apply:
-
E_BIN_*: Time each entity spent in the queue. -
R_BIN_*: Time the queue had X entities waiting.
Full customization: TABLE + TABULATE
To record arbitrary data:
TABLE {name:TABLA1, E_BIN_START:0, E_BIN_SIZE:1, E_BIN_COUNT:100, EXPRESSION:(AC1$ - P$TIEMPOINICIO)}
TABULATE TABLA1
This allows you to measure anything defined by a mathematical expression.