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

sioned as N.CITY BY N.COUNTY BY N.STATE. The third defines a four-dimensional array<br />

dimensioned in a similar way. Compound entities are defined by statements of the form:<br />

every compound entity name list has attribute name list<br />

and owns set name list.<br />

As in the case of individual entity definitions, has and owns clauses can appear in the same or different<br />

statements. The word have can be used for has and own for owns. By definition, the individual<br />

entities of which compound entities are composed must exist. If a compound entity MAN AND<br />

WOMAN is declared, there must be an entity type MAN and an entity type WOMAN.<br />

A compound entity name list consists of entity names that have either been declared previously in<br />

every or include statements, or, by their presence in a compound entity declaration, are declared<br />

as entities of the type specified in the current background condition, that is, by the last permanent<br />

entities or temporary entities statement. Three kinds of compound entities are possible:<br />

those composed exclusively of permanent entities; those composed exclusively of temporary<br />

entities; and those composed of both permanent and temporary entities.<br />

Members of sets owned by compound entities can be either permanent or temporary entities. Set<br />

membership is declared as usual. Moreover, "compound sets" can have any of their six set attributes<br />

deleted and be defined as FIFO, LIFO, or ranked. The following statements might appear in a<br />

program in conjunction with the first declaration above:<br />

temporary entities<br />

every CHILD belongs to a FAMILY and has an AGE<br />

define FAMILY as a set ranked by AGE<br />

without N and M attributes<br />

Attributes of compound entities and sets owned by compound entities are subscripted. Subscripting<br />

takes place in the order in which compound entities are defined. Thus, in the statements:<br />

let BANK.ACCOUNT(I,J) = 1000<br />

file this CHILD in FAMILY(MAN,WOMAN)<br />

the variables I and MAN can range from 1 to N.MAN, and the variables J and WOMAN can range from<br />

1 to N.WOMAN. Compound entities cannot belong to sets. In fact, compound entities have no independent<br />

existence, but rather define the existence of compound attributes, subscripted by the<br />

named component entities.<br />

Arrays are allocated to "permanent" compound entities when their individual entities are created.<br />

They need not be created together, although they usually are. Given the declarations:<br />

permanent entities<br />

every MAN has a JOB and a SALARY<br />

every WOMAN owns some INVESTMENTS<br />

171

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

Saved successfully!

Ooh no, something went wrong!