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.

Modelling Concepts<br />

define entity name as an integer variable<br />

4.6 System Attributes<br />

To provide consistency in usage, it is convenient to be able to declare attributes as belonging to the<br />

system, rather than to a particular entity. These attributes appear much like global variables, but<br />

with some differences. Attributes of the system are declared by statements of the form:<br />

the system has attribute name list<br />

For most purposes, the statements:<br />

and:<br />

the system has an X and a Y<br />

define X and Y as variables<br />

are equivalent. Because there is only one "system," references to system attributes are not indexed<br />

or subscripted, as are references to attributes of permanent and temporary entities. A value of 1 is<br />

assigned to the variable X by the statement let X = 1, whether X is defined as in the first or second<br />

example above. System attributes will be subscripted if the background dimensionality condition<br />

at the time of their declaration is greater than zero. X is declared to be a two-dimensional system<br />

attribute by the statements:<br />

normally, dimension is 2<br />

the system has an X<br />

The convenience of system attributes derives mainly from their use as pointers that enable a program<br />

as a whole to own sets. The statement:<br />

the system owns a QUEUE<br />

specifies that a program contains two system attributes named F.QUEUE and L.QUEUE that point to<br />

the first and last entities belonging to a set named QUEUE. Several system-owned sets can be defined<br />

at one time by the statement:<br />

the system owns set name list<br />

If a background dimensionality, other than zero, is declared, the effect is to define any system-defined<br />

attributes, including any set pointers, as arrays rather than as unsubscripted variables, as in:<br />

normally dimension is 2<br />

the system owns a TABLE and has a MATRIX<br />

Subscripted system attributes, both explicitly declared and any implicitly defined set pointers, must<br />

be reserved before they can be used. To use the system set TABLE and the system array MATRIX,<br />

defined above, a statement such as:<br />

149

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

Saved successfully!

Ooh no, something went wrong!