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 />

To use before or after tracing, routines having the same number of input arguments as are transmitted<br />

for the operation being monitored are written and included with the program. These arguments<br />

will be used to pass entity pointers or index values, and any required subscripts, to the usersupplied<br />

checking routines.<br />

Suppose, for example, during the validation of a simulation model, it is desired to display the simulation<br />

times at which any SHIP entities are filed in a BERTH.SET. The statements to do this might<br />

be:<br />

Preamble:<br />

Routine:<br />

permanent entities<br />

every HARBOR may own a BERTH.SET<br />

.<br />

.<br />

temporary entities<br />

every SHIP has a TONNAGE<br />

and may belong to a BERTH.SET<br />

.<br />

.<br />

before filing in BERTH.SET call CHECK<br />

.<br />

.<br />

routine CHECK given SHIP, SUB1<br />

define SHIP and SUB1 as integer variables<br />

list time.v, attributes of SHIP, SUB1<br />

return<br />

end<br />

As shown, the routine must be written to accept the correct number of set subscripts. BERTH.SET,<br />

here, is one-dimensional and the dimension identifies the owning HARBOR. As in the case of monitored<br />

variables, these calls may be added to or removed from a program, with minimal effort, and<br />

require no modification to any existing program routines.<br />

Table 5-10 lists the variations of the before and after statements, with the arguments passed to<br />

the routines called.<br />

235

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

Saved successfully!

Ooh no, something went wrong!