GPSS.MOD

From Support

Jump to: navigation, search

Back to Model Library

See also: How to read .MOD pages

Contents

Description

Many popular simulation packages are based on what is known as a process worldview. (The process approach is also sometimes called network modeling.) Process-oriented simulation languages provide a series of pre-programmed blocks that represent some of the typical processing stages in a queuing system. Examples of such blocks include a block to represent the entity waiting (i.e., a QUEUE block) and another to represent the start of service (i.e., a SEIZE block).

A schematic diagram of the blocks in a GPSS model that represents a single server queue is shown in the figure below:

Block Diagram for a GPSS Model of a Single Server Queue
Block Diagram for a GPSS Model of a Single Server Queue

Here the customer enters the system in the GENERATE block and joins QUEUE number 1. If server (number 1) is idle, it is SEIZEd and the customer DEPARTs from the line. After the clock ADVANCEs for the service time, the server is RELEASEd and the customer exits the system at the TERMINATE block.

Event graphs, while much simpler than most process languages to learn and use, are more general. In fact, you can build versions of these process languages using SIGMA. GPSS.MOD is an event graph of the GPSS single server queue pictured above. This model uses the SIGMA PUT and GET functions for queue management.

State Variables

State Variables in GPSS.MOD
Variable Name Abbreviation Variable Description Size Type
QUEUE Q Queue size 1 Integer
SERVER S Server available/busy = 1/0 1 Integer
NEXTGEN NEXTGEN Next generation time 1 Integer
NTERM NTERM Number of terminations 1 Integer
NEXTADV NEXTADV Next advance time 1 Integer
ENT ENT Transaction data 15 Integer
WAIT WAIT Waiting time 1 Integer
RNK RNK Ranking attribute for queue 5 Integer
TIME TIME Integer clock time 1 Integer

Vertices

Vertices in GPSS.MOD
Vertex Name Vertex Description State Changes
SIM Setting the number of terminations and running S=1, NEXTGEN=0, NEXTADV=10000
TIMER The future events algorithm TIME=MIN{NEXTADV;NEXTGEN}
GEN Setting the next generation time NEXTGEN=TIME+15*ERL{1}
QUEUE Customer joining the queue ENT[0]=TIME, Q=Q+PUT{FIF;1}
SEIZE Customer going into service S=0
DEPART Customer departing the queue and starting service Q=Q-GET{FST;1}, WAIT=TIME-ENT[0]
ADVANCE Setting the time to release the server NEXTADV=TIME+10*ERL{1}
RELEASE Free server, reset advance time S=1, NEXTADV=10000
TERM Decrement the termination counter NTERM=NTERM-1
END End None

Initialization Conditions

Initialization Conditions in GPSS.MOD
Variable Description
NTERM Number of terminations

Event Relationship Graph

GPSS.MOD
GPSS.MOD

English Translation

An English translation is a verbal description of a model, automatically generated by SIGMA.

The SIGMA Model, GPSS.MOD, is a discrete event simulation. 
It models GPSS MODEL IN LAW/KELTON TEXT.
I. STATE VARIABLE DEFINITIONS.
For this simulation, the following state variables are defined:
S: SERVER 0/1=BUSY/IDLE   (integer valued)
Q: QUEUE SIZE   (integer valued)
TIME: INTEGER CLOCK TIME   (integer valued)
NEXTGEN: NEXT GENERATION TIME   (integer valued)
NEXTADV: NEXT ADVANCE TIME   (integer valued)
NTERM: NUMBER OF TERMINATIONS   (integer valued)
ENT[15]: TRANSACTION DATA   (integer valued)
WAIT: WAITING TIME   (integer valued)
RNK[5]: RANKING ATTRIBUTE FOR QUEUE   (integer valued)
II. EVENT DEFINITIONS.
Simulation state changes are represented by event vertices (nodes or balls) in a SIGMA graph.  
Event vertex parameters, if any, are given in parentheses. Logical and dynamic relationships 
between pairs of events are represented in a SIGMA graph by edges (arrows) between event vertices.  
Unless otherwise stated, vertex execution priorities, to break time ties, are equal to 5.
1. The SIM(NTERM) event occurs when SETTING THE NUMBER OF TERMINATIONS AND RUNNING.
   Initial values for, NTERM, are needed for each run.
   This event causes the following state change(s):
   S=1
   NEXTGEN=0
   NEXTADV=10000
   After every occurrence of the SIM event:
   Unconditionally, schedule the TIMER() event to occur without delay.
2. The TIMER() event occurs when THE FUTURE EVENTS ALGORITHM.
   This event causes the following state change(s):
   TIME=MIN{NEXTADV;NEXTGEN}
   After every occurrence of the TIMER event:
   Unconditionally, schedule the TIMER() event to occur in 1 time units.
   If TIME==NEXTGEN, then IF A GENERATION, EXECUTE GEN BLOCK;
   that is, schedule the GEN() event to occur without delay.
   If TIME==NEXTADV, then IF A RELEASE, EXECUTE RELEASE BLOCK;
   that is, schedule the AD() event to occur without delay.
3. The GEN() event occurs when SETTING THE NEXT GENERATION TIME.
   This event causes the following state change(s):
   NEXTGEN=TIME+15*ERL{1}
   After every occurrence of the GEN event:
   Unconditionally, immediately execute the QUEUE() event.
4. The QUEUE() event occurs when CUSTOMER JOINING THE QUEUE.
   This event causes the following state change(s):
   ENT[0]=TIME
   Q=Q+PUT{FIF;1}
   After every occurrence of the QUEUE event:
   If S==1, then schedule the SEIZE() event to occur without delay.
5. The SEIZE() event occurs when CUSTOMER GOING INTO SERVICE.
   This event causes the following state change(s):
   S=0
   After every occurrence of the SEIZE event:
   Unconditionally, CUSTOMER DEPARTING THE QUEUE;
   that is, schedule the DEPART() event to occur without delay.
   (Time ties are broken by an execution priority of 4.)
6. The DEPART() event occurs when CUSTOMER DEPARTING THE QUEUE AND STARTING SERVICE.
   This event causes the following state change(s):
   Q=Q-GET{FST;1}
   WAIT=TIME-ENT[0]
   After every occurrence of the DEPART event:
   Unconditionally, schedule the ADV() event to occur without delay.
7. The ADV() event occurs when SETTING THE TIME TO RELEASE THE SERVER.
   This event causes the following state change(s):
   NEXTADV=TIME+10*ERL{1}
   No additional events are scheduled here.
8. The REL() event occurs when FREE SERVER, RESET ADVANCE TIME.
   This event causes the following state change(s):
   S=1
   NEXTADV=10000
   After every occurrence of the REL event:
   Unconditionally, schedule the TERM() event to occur without delay.
   (Time ties are broken by an execution priority of 3.)
   If Q>0, then schedule the SEIZE() event to occur without delay.
   (Time ties are broken by an execution priority of 3.)
9. The TERM() event occurs when DECREMENT THE TERMINATION COUNTER.
   This event causes the following state change(s):
   NTERM=NTERM-1
   After every occurrence of the TERM event:
   If NTERM==0, then schedule the END() event to occur without delay.
10. The END() event:
    After every occurrence of the END event:
    Unconditionally, SHUT OF THE TIMING ROUTING;
    that is, immediately cancel the next scheduled occurrence of the TIMER event.

Comments

Back to top

Back to Model Library

Personal tools
Navigation