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

WORKER<br />

value of AGE<br />

value of DEPENDENTS<br />

value of SOCIAL.SECURITY.NUMBER<br />

Figure 4-2. Order of Storage of the Attributes of an Entity<br />

4.3 Sets<br />

Entities and their attributes allow some structuring of related data. Sets, in turn, provide a higher<br />

level of structuring of these data. Sets are organized collections of entities. Sets are like arrays in<br />

that each of the entity elements of which they are composed may be identified and manipulated, but<br />

in contrast with the static structuring imposed on array elements, the organization of entities in sets<br />

may be dynamic and changeable. The set concept and the underlying mechanism are introduced<br />

here by way of an example.<br />

Consider the following situation: Over the years, residents of a community join various clubs and<br />

societies. As residents are born, grow up, remain in or move out of the community, and die, the<br />

club memberships change. To model the relationships that exist between the members of the community,<br />

both over time and at particular instants of time, requires some way of grouping the individual<br />

society and club members together. Such groupings might be defined by the statements:<br />

every COMMUNITY owns a MASONS,<br />

and a BOY.SCOUTS<br />

every MAN may belong to the MASONS,<br />

and the BOY.SCOUTS<br />

The first statement declares that each entity of the class COMMUNITY owns a set called MASONS and<br />

a set called BOY.SCOUTS. Each of these sets corresponds to a logical grouping of residents in the<br />

community. This statement does not specify which residents belong to the particular sets; rather, it<br />

establishes a system of set pointers and set attributes for the owner entities that enable set memberships<br />

to be constructed. For each COMMUNITY entity, the attributes shown in figure 4-3 are automatically<br />

defined to exist.<br />

139

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

Saved successfully!

Ooh no, something went wrong!