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

In general, all set owner and member attributes are treated as integer-valued and have names<br />

formed by prefixing a letter and a period to the set name. The declarations:<br />

permanent entities<br />

every CITY owns a CLUB<br />

temporary entities<br />

every RESIDENT may belong to the CLUB<br />

define three attributes for the owner entity of CLUB and three attributes for its member entities. Because<br />

CITY is a permanent entity, its owner attributes are stored as three arrays, with base pointers<br />

F.CLUB(*), L.CLUB(*), and N.CLUB(*). RESIDENT, being a temporary entity, has its member<br />

attributes, P.CLUB, S.CLUB, and M.CLUB, stored in locations within each individual entity.<br />

Every program commences execution with empty sets. As a program proceeds, statements are executed<br />

that file entities in sets, examine sets, and remove entities from sets. Set memberships<br />

change dynamically when file and remove statements alter set pointers, changing relationships<br />

that affect set membership and set ranking. The file statement has two basic forms:<br />

1a. file arithmetic expression first in set<br />

1b. file arithmetic expression last in set<br />

2a. file arithmetic expression<br />

before arithmetic expression in set<br />

2b. file arithmetic expression<br />

after arithmetic expression in set<br />

The words first or last are optional. When both are omitted, file last is implied; the statements:<br />

and<br />

file arithmetic expression last in set<br />

file arithmetic expression in set<br />

are equivalent.<br />

In each of the forms, the words the or this are optional before the expression or the set name, as<br />

in:<br />

file the BIRD in the NEST<br />

file this JOB first in this QUEUE<br />

file MYDOG after YOURDOG in the KENNEL<br />

Used in this context, each arithmetic expression must evaluate to an entity identifying value. It must<br />

be either the pointer value addressing a temporary entity, obtained from a previous create statement,<br />

or an integer number indexing one of the N.entity permanent entities of a specific type.<br />

153

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

Saved successfully!

Ooh no, something went wrong!