Download SIMSCRIPT III Language Manual

Transcript
begin class TELLER
every TELLER
is a RESOURCE and
has an ENGAGE method
define ENGAGE as a method
yielding 1 real value ''waiting time in minutes
accumulate DAILY.AVG.BUSY as the DAILY mean,
AVG.BUSY as the mean
of ACQUIRED.UNITS
accumulate DAILY.AVG.QLEN as the DAILY mean,
DAILY.MAX.QLEN as the DAILY maximum,
AVG.QLEN as the mean,
MAX.QLEN as the maximum,
QLEN.HISTOGRAM(0 to 20 by 1) as the histogram
of N.QUEUE
the class
has a MEAN.SERVICE.TIME ''in minutes
define MEAN.SERVICE.TIME as a real variable
end
define SIMULATE.BANK as a routine
given 4 integer values ''no. of tellers, no. of replications,
''stream 1 seed, stream 2 seed,
and 3 real values
''mean interarrival time in minutes,
''mean service time in minutes,
''day length in hours
end
process method CUSTOMER'BANK.VISIT
call ENGAGE(TELLER) yielding WAITING.TIME
end
process method CUSTOMER'GENERATOR(DAY.LENGTH, MEAN.INTERARRIVAL.TIME)
define TIME.TO.CLOSE as a real variable
TIME.TO.CLOSE = TIME.V + DAY.LENGTH / HOURS.V
until TIME.V >= TIME.TO.CLOSE
do
schedule a BANK.VISIT now
wait EXPONENTIAL.F(MEAN.INTERARRIVAL.TIME, 1) minutes
loop
end
93