18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Advanced Topics<br />

is executed, the routine INFLUENCE is called with the arguments JOB and MAN — two pointer values<br />

identifying temporary entities. The routine then might perform the following as:<br />

function INFLUENCE(I,J)<br />

define I and J as integer values<br />

if PRIORITY(I) > PM<br />

and STATUS(J) > 5M<br />

return with (STATUS((J)/5M) * (PRIORITY(I)/PM))<br />

otherwise<br />

return with 1<br />

end<br />

returning the apparent attribute value.<br />

6.7 Two Illustrations of Set Ranking by Function Attributes<br />

As described in paragraph 4.8, sets are normally ranked on either the order in which entities are filed<br />

in them (FIFO and LIFO) or on the values of some attributes of their member entities. In the latter<br />

case, although cascading can be used to resolve ties, only simple single-attribute ranking comparisons<br />

can be made. Complex ranking comparisons can be devised using function attributes as ranking<br />

variables. Program 6-1 illustrates how a function attribute can be used to define a ranking<br />

variable that is the weighted average of several attribute values.<br />

273

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

Saved successfully!

Ooh no, something went wrong!