GPSS Simulator Design Document

Operation

Syntax

ADVANCE

AddBlock(Advance(mean, modifier))

GENERATE

AddBlock(Generate(mean, modifier))

LABEL(BLOCK NO)

AddBlock(Label(name))

RELEASE

AddBlock(Release(self.facilityList[facility No]))

SEIZE

AddBlock(Seize(self.facilityList[facility No]))

TERMINATE

AddBlock(Terminate(units))

TRANSFER

AddBlock(Transfer(Select factor, Next block A, Next block B))

Facility

AddFacility(Facility(resource))

START

Start(terminate No)

turnonVerbose

TurnoffVerbose()

turnoffVerbose

TurnoffVerbose()



Class Name

Inherit from

Method

comments

Model


TurnonVerbose()/turnoffVerbose()

start(termCount)

AddBlock(blk)/AddFacility(f)

resolveName()

InsertFutureEvent(index)

IsAllBlock()

Simulation()

Report()

Turn on Verbose to get debug information

set termination count and start simulation

Add block/facility into block list and facility list

translate name into block No. and facility No.

insert future event and sort future event list

To know whether all blocks in current event chain is blocked

output average simulation time, average utility and average transit time of each facility

Block


Init()

setTimeAdvance()

getTimeAdvance()

getNext()

isBlock()

isTerminate()

Set time advance in init method

set time advance

get time advance

get next block No.

to know whether this block is blocked

to know whether this block is terminate block

Facility


Increase()

Decrease()

RecordTransit()

isBlock()

Increase free resource and record utility and transit time

Decrease free resource and record utility and transit time

record transit time

to know whether the facility is blocked

Generate

Block



Advance

Block



Transfer

Block



Label

Block



Seize

Block



Release

Block



Terminate

Block



Simulation()

{

resolve name;

generate first xact and insert it into current event chain;

while count < termCount

{

while current event chain is not empty and not all blocks in the current event chain are blocked

{

get first xact from current event chain

if xact is in GENERATE block and it can go into next block

generate a new xact and insert into future event chain

if xact is in SEIZE or RELEASE block

record utility and transit time of each facility

let xact go as far as it can until it is blocked or terminated

if xact is terminated

record its finish time to computer average simulation time

}

while future event chain is not empty

{

get first xact from future event chain;

update clock = xact.movetime

insert xact into current event chain

}

}