GPSS4

download GPSS4

of 5

Transcript of GPSS4

  • 7/31/2019 GPSS4

    1/5

    GPSS Module 4TEST Block

    A TEST block compares values of SNAs and controls thedestination of the entering transaction based on the result of

    comparison.

    Format TEST O A,B,C

    O: A relational operator. E, G, EG, L, LE, or NE.

    A: The test value

    B: The reference valueC: 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.

    TEST GE Q$CPU1Q,Q$CPU2Q,IO

    When a transaction enters here, compute the current queue

    lengths ofCPU1Q 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.

  • 7/31/2019 GPSS4

    2/5

    GATE Block

    A GATE block works like a valve affecting the flow basedon the state of an entity.

    Format: GATE 0 A,B

    O: Conditional operator. FNV, FV, I, LS, LR, M, NI, NM

    NU, SE, SF, SNE, SNF, SNV, SV, U

    A: Entity name to be tested

    B: Destination block if test fails.

    The meaning of conditional operators.

    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 stateM: The match block specified by A must have a related transaction

    waiting for a match condition.

    NM: No transaction waiting under match condition.

    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.SNV: Storage specified by A is unavailable

    U: The facility specified by A is in use.

  • 7/31/2019 GPSS4

    3/5

    e.g. GATE SNF HALL

    Transaction is accepted in this block if the storage HALL is

    not full. Otherwise, transaction stays where it is.

    GATE LR DBLOCK,THERE

    If the logic switch DBLOCK is reset (open lock), accept the

    transaction here. Otherwise, it goes to the block marked

    THERE.

    GATE blocks are extremely powerful, and they can chewup a lot of CPU time in unsuccessful tests. Design your

    code to reduce frequency of unwanted unsuccessful tests.

    The output from the simulation run

  • 7/31/2019 GPSS4

    4/5

    As we can gather, LOGIC Block changes the status of a

    logicswitch entity.

    Format LOGIC O A

    O: Logical operator S, RS

    A: Logical switch

    An example. Simulation of a traffic junction. East-West &

    North-South traffics hinged on an intersection they bothshare. First part is the traffic-light system, the second and

    the third part are the two traffic corridors.

  • 7/31/2019 GPSS4

    5/5

    The report looks like