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.

Discrete Simulation Concepts<br />

reset the daily totals of N.QUEUE<br />

reset the weekly totals of N.QUEUE<br />

or<br />

reset the daily and weekly totals of N.QUEUE<br />

If a reset statement does not specify one of the declared qualifying names, all counters associated<br />

with the relevant variable are reinitialized. Where variables are used in histogram range specifications,<br />

they should be only altered following a reset statement, and before any subsequent reference<br />

to the monitored variable.<br />

It should be noted that the compiler can only generate the necessary statistics-gathering logic in<br />

those cases where values are referenced using their globally known names. If a variable is passed<br />

to a routine as an argument, where it is referenced by another name, the appropriate actions cannot<br />

be taken. If it is returned as a yielded argument, of course, the changes will be noted upon return<br />

from the routine. An exception, however, is the case where an array base pointer is passed as an<br />

argument. As such pointers effectively pass the array values by reference, the actual elements of a<br />

monitored array may be referenced under a different name, that of the local argument of the called<br />

routine. Such usage cannot be detected by the compiler and, hence, no statistics can be maintained<br />

for these references.<br />

A final note on statistics-gathering concerns the minimization of storage requirements for computations<br />

of statistical quantities. It may happen that the statistics of changes to a program variable is<br />

required, but the actual value of the variable is not needed for any other purpose. Consider the following<br />

example:<br />

preamble<br />

.<br />

.<br />

temporary entities<br />

every JOB belongs to a QUEUE,<br />

has a DUE.DATE and an OVERRUN<br />

.<br />

.<br />

tally AVG.LATE as the mean of OVERRUN<br />

end<br />

process JOB.STATS<br />

.<br />

.<br />

for each JOB in QUEUE<br />

let OVERRUN = DUE.DATE(JOB) - time.v<br />

.<br />

.<br />

If the logic of the program does not require the value of OVERRUN for any other purpose than to<br />

compute the average, it is possible to perform these tally computations on OVERRUN without its<br />

231

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

Saved successfully!

Ooh no, something went wrong!