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.

Modelling Concepts<br />

1. Declaration:<br />

Use:<br />

permanent entities<br />

every PERSON has an AGE<br />

let AGE = 1<br />

is interpreted as:<br />

let AGE(PERSON) = 1<br />

Whenever the attribute AGE appears without an entity reference, the variable PERSON is used as the<br />

index value. There is always a global variable associated with each entity class, PERSON in this<br />

case. It is possible, within a routine, to define a of the same name, in which case the current value<br />

of this local variable is used as the implicit subscript. That is, any unsubscripted use is interpreted<br />

as shown above. If a local variable exists, then, consistently, it takes precedence over the global<br />

name. The practice of declaring such local variables allows implicit subscripting to be used while<br />

minimizing the danger of side effects.<br />

2. Declaration:<br />

Use:<br />

temporary entities<br />

every SHIP owns some CARGO<br />

every CONSIGNMENT belongs to a CARGO<br />

create a SHIP<br />

.<br />

.<br />

create a CONSIGNMENT<br />

file CONSIGNMENT in CARGO<br />

.<br />

.<br />

which is interpreted as:<br />

create a CONSIGNMENT called CONSIGNMENT<br />

file CONSIGNMENT in CARGO(SHIP)<br />

3. Declaration:<br />

Use:<br />

permanent entities<br />

every CITY,STATE has a POPULATION<br />

let POPULATION = 400000<br />

interpreted as:<br />

173

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

Saved successfully!

Ooh no, something went wrong!