18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>SIMSCRIPT</strong> <strong>II.5</strong> <strong>Programming</strong> <strong>Language</strong><br />

(b) An additional attribute named TOTAL for the temporary entity JOB.<br />

The tally variables may be used in statements such as:<br />

for each JOB in QUEUE(MACHINE),<br />

do<br />

if TOTAL(JOB) le MAX.ALLOWED,<br />

remove the JOB from QUEUE(MACHINE)<br />

perform NEXT.JOB given JOB<br />

always<br />

loop<br />

Statistical computations of a different sort are made when the word accumulate replaces tally.<br />

These calculations introduce simulation time into the average, variance, and standard deviation calculations,<br />

weighting the collected observations by the apparent length of simulation time for which<br />

these values have held. Table 5-8 compares the tally and accumulate computations. To be concise,<br />

some additional notation must be defined:<br />

T L<br />

The simulated time at which an accumulated variable was set to its current value<br />

T 0<br />

The simulated time at which accumulation starts<br />

Accumulate and tally statements cannot both be declared for the same variable. A programmer<br />

must decide whether a variable is time-dependent or not, normally a simple task, and specify one<br />

or the other. An illustration of the use of the accumulate statement is given in the following example.<br />

preamble<br />

permanent entities<br />

every MACHINE has a STATUS, a<br />

PROCESSING.SPEED and owns a QUEUE<br />

temporary entities<br />

every JOB has a VALUE and belongs to a QUEUE<br />

accumulate AVG.QUEUE as the mean<br />

and MAX.QUEUE as the maximum of N.QUEUE<br />

accumulate MACHINE.STATE as the mean of STATUS<br />

end<br />

226

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!