GPSS – Module 4 TEST Block A TEST block compares values of SNAs and controls the destination of the entering

transaction based on the result of comparison. Format
O: A: B: C: TEST O A,B,C

A relational operator. E, G, EG, L, LE, or NE. The test value The reference value The destination value

If C operand is missing, then it works in a refuse mode. That is, the entering transaction would not be allowed to enter here if the test proves unsuccessful. e.g.
TEST G C1,1000

If the entering transaction finds the system clock value greater than 1000, it would be allowed to proceed to the next block. Otherwise, it would be blocked to enter here. Blocking will continue until the condition changes.

When a transaction enters here, compute the current queue lengths of CPU1Q and CPU2Q. If the former is greater than or equal to the latter, it proceeds to the next sequential block. Otherwise, it goes to the block labeled IO.

The meaning of conditional operators. SNV. SV. NM NU. M. SNE. SF. . FV. SNF.GATE Block A GATE block works like a valve affecting the flow based on the state of an entity. NM: No transaction waiting under match condition. U A: Entity name to be tested B: Destination block if test fails. NU: Facility in A is not in use SE: Storage specified by A is empty SF: Storage specified by A is full SNE: Storage specified by A has at least one transaction SNF: Storage specified by A has at least one available storage unit. I. Format: GATE 0 A. SNV: Storage specified by A is “unavailable” U: The facility specified by A is in “use”. FNV: The facility in operand A must be unavailable FV: The facility in A must be available I: The facility in A must be currently interrupted LS: The logicswitch in A must be in a “set” state LR: The logicswitch in A must be in a “reset” state M: The match block specified by A must have a related transaction waiting for a match condition. LS. NI. LR. FNV.B O: Conditional operator. SE.

and they can chew up a lot of CPU time in unsuccessful tests.e. Design your code to reduce frequency of unwanted unsuccessful tests. Otherwise. The output from the simulation run .THERE If the logic switch DBLOCK is reset (open lock). it goes to the block marked THERE.g. transaction stays where it is. GATE SNF HALL Transaction is accepted in this block if the storage HALL is not full. accept the transaction here. GATE LR DBLOCK. GATE blocks are extremely powerful. Otherwise.

First part is the traffic-light system. LOGIC Block changes the status of a logicswitch entity. Format LOGIC O A O: Logical operator S. the second and the third part are the two traffic corridors. .As we can gather. East-West & North-South traffics hinged on an intersection they both share. RS A: Logical switch An example. Simulation of a traffic junction.

The report looks like .