gpss_manual
.pdfRMULT
An RMULT Command sets the seeds for random number generators.
RMULT A,B,C,D,E,F,G
Operands
A - Seed for random number generator number 1. Optional.
The operand must be Null, or PosInteger.
B - Seed for random number generator number 2. Optional.
The operand must be Null, or PosInteger.
C - Seed for random number generator number 3. Optional. The operand must be Null, or PosInteger.
D - Seed for random number generator number 4. Optional. The operand must be Null, or PosInteger.
E - Seed for random number generator number 5. Optional. The operand must be Null, or PosInteger.
F - Seed for random number generator number 6. Optional. The operand must be Null, or PosInteger.
G - Seed for random number generator number 7. Optional. The operand must be Null, or PosInteger.
Example
RMULT ,,111
In this example, random number generator 3 is initialized with a seed of 111.
Action
The RMULT Command is a Queued Command. When the
Simulation Object receives one, it places it at the end of the simulation’s Command Queue.
The RMULT Command initializes up to 7 random number generators with new seeds. Only random number generators
numbered 7 or below can be controlled by an RMULT
Command. However, since the default seed of a random number generator is its entity number, you can in fact have any number of random number generators, and you can choose the initial seed of each. After the first simulation run the seeds can only be controlled easily with the RMULT Command on generators 1-7.
You can select which random number stream GPSS World uses it to calculate random time increments in ADVANCE and GENERATE Blocks, in Fractional Mode TRANSFER and
TRANSFER PICK Blocks and to resolve the scheduling of time ties. This is set in the "Random" page of the Model Settings
Notebook.
CHOOSE View / Settings / Model
then select the Random page. Then fill in the desired
Random Number Stream Entity number in the corresponding entry boxes. The installation default is to use Random Number
Stream number 1 in each case.
Since GPSS World uses multiplicative congruential random number generators, it is possible to control pairs of random number streams for variance reduction purposes. This is done by matching the seeds of the random number generators. If s is the seed for the first random number generator, then a choice of 2147483647-s for the seed of the second random number generator will generate a stream of random numbers with antithetic properties.
Special Restriction
∙ Random number seeds must be positive integers.
Related SNA
∙ RNEntnum - Random number. RNEntnum returns a random integer 0-999 from the random number generator Entnum.
Related Window
∙ The ANOVA Window can perform Analysis of Variance and calculate confidence intervals.
SHOW
A SHOW Command sends an Expression for evaluation by the Simulation Object, and writes the result in the Status Line.
SHOW X
Operand
X - Expression.
Example
SHOW 2#LOG(Q$Barber)
This Command finds the natural logarithm of the SNA Q$Barber, doubles it, and writes the result in the Status Line of the Model Window.
Action
The SHOW Command is an Immediate Command. It is performed when received by the Simulation Object.
The SHOW Command evaluates an Expression in the context of the simulation, and writes the result in the Status Line of the Model Window. Additional messages are sent to any open Journal Windows.
The rules for evaluating Expressions may be found in Section 3.4. Expressions must be well-formed according to the rules of elementary algebra. You may used any of the arithmetic and logic operators listed in Section 3.4.
If SNAs are used in the Expression field, they are evaluated with respect to the Active Transaction. If there is no Active
Transaction because no simulation has been started, an error message will be written. Names which have not been explicitly assigned values cannot be used in Expressions. To do so you must assign a value by an EQU Command before the
Expression is evaluated.
Examples
SHOW C1
shows the system clock in the Status Line.
SHOW 4#(SQR(2)+SIN(C1))
shows the result of 4 times the sum of the square root of 2 and the sine of the system clock.
SHOW N1^W$Chair
shows the result of raising the number of Transactions to have entered Block 1 to the power of the number of Transactions waiting at the Block named Chair.
Special Restrictions
∙Some SNAs cannot be evaluated unless there is an Active Transaction.
∙SHOW displays up to 38 characters or digits.
Related Windows
∙ Any valid Expression can be viewed in an
Expressions or Plot Window.
START
A START Command begins a simulation.
START A,B,C,D
Operands
A - Termination count. Required. The operand must be
PosInteger.
B - Printout operand. NP for "no printout". Default is to print a standard report. Optional. The operand must be NP or Null.
C - Not used. Kept for compatibility with older dialects of
GPSS.
D - Chain printout. 1 to include the CEC and FEC in the standard report. Optional. The operand must be Null, or
PosInteger.
Action
The START Command is a Queued Command. When the
Simulation Object receives one, it places it at the end of the simulation’s Command Queue.
The START Command is used to set up and begin the actual simulation. The simulation does not end until the termination count, which is set by Operand A, reaches zero or becomes negative. TERMINATE Blocks are used to reduce the termination count.
The simulation may stop short if a HALT Command is issued, or if a Stop Condition is detected.
Operands B and D are used to control automatic report generation. If Operand B is not used, an standard report is written. If Operand B is NP, which stands for "no printout", no standard report is written. If Operand D is nonzero, the Current
Events Chain (CEC) and the Future Events Chain (FEC) are reported. Otherwise they are not reported. A further discussion of the control and contents of the standard report may be found in Chapters 11 and 12.
Operand C is kept for compatibility with older versions of GPSS. It was used as a "snap" count to put out a report periodically. This Function is available by using more than one START and REPORT Command.
When a START Command is performed:
∙The Termination Count is set.
∙Any generate Blocks marked "not started" are primed with a single Transaction.
∙Random number generators are not reset.
∙If time is 0, a RESET of the statistics accumulators is performed. See the discussion of the RESET Command in this chapter.
Example
START 1000,,,1
In this example, the Termination Count is set to 1000 and the
simulation is started. When the Termination Count reaches zero or becomes negative (by reduction due to TERMINATE
Blocks in the simulation), a standard report is written which includes information on the Current Events Chain (CEC) and the Future Events Chain (FEC).
Related SNA
∙ TG1 - Termination count.
Related Blocks
∙ TERMINATE - destroy Transaction and optionally reduce the termination count.
STEP
A STEP Command causes the simulation to proceed a specified number of Block entries.
STEP A
Operand
A - Block entry count. Required. A must be a positive integer, more formally, PosInteger.
Example
STEP 1
This Command causes the simulation to proceed exactly one
Block entry and then to stop. The simulation is then said to be in the "Halted" state.
Action
The STEP Command is a Queued Command. When the
Simulation Object receives one, it places it at the end of the simulation’s Command Queue.
The STEP Command causes the Simulation Object to simulate the specified number of Block entries. When a simulation reaches the required number of Block entries, the Simulation
Object sends a message to the Status Line, and any Journal
Windows that are open. The message gives the time, the
Active Transaction number, the current Block of the Active
Transaction, and the next scheduled Block of the Active
Transaction.
A simulation started by a STEP Command does not end when the termination count goes to zero, it ends when the required number of Block entries have occurred.
When a STEP Command is performed:
∙The termination count is not set.
∙Any generate Blocks marked "not started" are primed.
∙Random number generators are not reset.
Hot Key
A STEP 1 Command can be sent to the simulation by pressing
the b + a + 1 key combination. A GPSS World window must have the input focus.
Related Windows
∙ The stepping of simulations can be viewed dynamically in the Blocks Window.
STOP
A STOP Command sets or removes a Stop Condition.
STOP A,B,C
Operands
A - Transaction number. A must be a positive integer. If the A
Operand is omitted, any Transaction number will satisfy the condition. Optional. The operand must be Null, or PosInteger.
B - Block number. If the B Operand is omitted, any Block will satisfy the condition. Optional. The operand must be Null,
Name, or PosInteger.
C - ON or OFF. If the C Operand is omitted, ON is assumed.
Optional. The operand must be ON, OFF or Null.
Example
STOP 100,52
This Command inserts a Stop Condition which will cause a running simulation to stop when Transaction number 100 attempts to enter Block number 52.
Action
The STOP Command is a Queued Command. When the Simulation Object receives one, it places it at the end of the simulation’s Command Queue.
The STOP Command with the ON option inserts a Stop
Condition into the simulation but does not cause the simulation to start. A subsequent START, STEP, or CONTINUE must be entered.
When a simulation reaches a Stop Condition, the Simulation
Object sends a message to the Status Line, and any Journal Windows that are open. The message gives the time, the Active Transaction number, the current Block of the Active
Transaction, and the next scheduled Block of the Active
Transaction.
When a Stop Condition is detected, established Stop Conditions remain in force. If a CONTINUE Command is issued, the CONTINUE Command skips the original Stop Condition but does not remove it. If the same condition occurs again, the simulation will stop again. Stop Conditions must be removed explicitly by entering a new STOP Command
containing the OFF option. They are also removed when a model is Translated.
STOP Commands can be sent by using mousing operations in the Blocks Window. This is discussed in more detail in Chapter
5.
If you skip the A Operand, any Transaction will satisfy the Stop Condition. If you skip the B Operand, any Block will satisfy the
Stop Condition. A STOP Command with no operands will cause the simulation to stop immediately.
Any number of Stop Conditions may be established.
The STOP Command with the OFF option removes any existing Stop Conditions that satisfy the Transaction and Block conditions specified by operands A and B.
Examples
STOP
With no operands, the STOP Command will cause any subsequent simulation to stop immediately.
STOP ,,OFF
This Command removes all Stop Conditions from the simulation.
STOP 2
This Command will cause the simulation to stop when
Transaction 2 becomes the Active Transaction.
STOP ,Chair
This Command will cause the simulation to stop when any
Transaction attempts to enter the Block at location CHAIR.
STOP ,Chair,OFF
This Command will remove all Stop Conditions that specify
Chair as the Block name.
Related Windows
∙ Mouse operations can be used in the Blocks
Window to place and remove Stop Conditions.
STORAGE
A STORAGE Command defines a Storage Entity.
NAME STORAGE A Label / Operand
NAME - Entity Label for this entity. Required. The field must be
Name.
A - Total storage capacity. Required. The operand must be
PosInteger.
Example
MotorPool STORAGE 20
This Command defines a Storage Entity named MotorPool with a total capacity of 20 units.
Action
The STORAGE Command is a Queued Command. When the Simulation Object receives one, it places it at the end of the simulation’s Command Queue.
A STORAGE Command defines a Storage Entity in the simulation. When a Transaction attempts to enter an ENTER
Block, its storage demand is compared with the available storage at the Storage Entity. If the demand can be granted, the Transaction is allowed to enter the ENTER Block and the available storage capacity of the Storage Entity is reduced. If the Transaction’s demand cannot be satisfied, the Transaction comes to rest in the simulation on the Delay Chain of the
Storage Entity. Storage Entities are explained in more detail in