Beruflich Dokumente
Kultur Dokumente
GPSS
Mathematical Modeling and Simulation
Tribhuvan University Kathmandu
14 pag.
TERMINATE Block:
• This block destroys any transaction entering it and removes it from computer memory. It is death block.
Each time a transaction enters this block it decrements a counter by an amount equal to its attribute value.
The counter is set by the user upon starting the simulation.
• SYNTAX:
line number label TERMINATE A
• ATTRIBUTES:
A = Termination count decrement
• The Termination Count of the simulation is set by a prior START Command.When the counter, set at the
beginning of the simulation, reaches zero then the simulation is complete and a statistical report is
produced on the outcome of the simulation.
• EXAMPLE: TERMINATE;
• SYMBOL:
ADVANCE BLOCK
• This block represents the servicing of a transaction.
• The servicing times follow a uniform probability distribution.
• A transaction entering this block will be delayed by a time interval chosen at random from the specified
probability distribution.
• The label is optional.
• SYNTAX:
line number label ADVANCE A, B
• ATTRIBUTES:
A = average value of uniform distribution
B = half-width of uniform distribution
SEIZE BLOCK
• This blocks allows the transaction to seize a facility if it is free.
• A facility is a resource that can be used by only one transaction at a time.
• Thus it may be a car “seizing” a “facility” such as a petrol pump or a customer in a supermarket “seizing”
a “facility” such as the checkout assistant. When the car or customer is being serviced by the facility, then
it is said to “own the facility”.
• SYNTAX:
line number label SEIZE A
• ATTRIBUTES:
A = name of facility (for example: pump)
• A transaction can only seize a facility if it is free or else wait until the owning transaction releases it. This
is called blocking.
• EXAMPLE:
SEIZE Barber; //Own or wait for barber.
• SYMBOL:
RELEASE BLOCK
• A transaction entering this block informs GPSS that it is giving up ownership of the facility named in its
attribute value.
• The label is optional.
• SYNTAX:
line number label RELEASE A
• ATTRIBUTES:
A = name of facility (for example: runway)
• By giving up ownership of the facility, the transaction makes it available for another transaction that may
be waiting to use it.
• EXAMPLE:
RELEASE Barber; // Haircut done. Give up the barber.
• SYMBOL:
DEPART BLOCK
• This block instructs GPSS that a transaction is leaving the queue named in it’s attribute value.
• This is necessary in order to compile the statistics on the queue.
• The label is optional.
• DEPART decreases queue.
• SYNTAX:
line number label DEPART A
• ATTRIBUTES:
A = name of the queue (for example: checkout)
• EXAMPLE:
DEPART Barber; //Begin queue time.
• SYMBOL:
TRANSFER BLOCK
• This block will take transactions entering it and transfer them to each of two different destinations
according to laid down proportions.
• SYNTAX:
line number label TRANSFER A, B, C
• ATTRIBUTES:
A = probability value (0 to 1)
LAB 14:
A machine tool in a manufacturing shop is turning out parts at the rate of every 5 minutes. As they are
finished, the parts are turned over to an inspector who takes 4±3 minutes to examine each one and rejects
about 10% of the parts as faulty. Each part will be represented by a transaction and the base time unit for
the system is chosen as 1 minute. Simulate for 100 parts to leave the system.
Answer:
GENERATE 5
ADVANCE 4,3
TRANSFER 0.1, ACC, REJ
ACC TERMINATE 1
REJ TERMINATE 1
Output:
Output:
Output:
Spectators arrive at a turnstile of a football stadium every 7±7 seconds and queue for admittance. The time
to pass through is evenly distributed at 5±3 seconds. A model is required to determine the time taken by 300
people to pass through the turnstile.
Answer:
GENERATE 7, 7
QUEUE Turn
SEIZE Turn
DEPART Turn
ADVANCE 5, 3
RELEASE Turn
TERMINATE 1
Output: