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.

<strong>SIMSCRIPT</strong> <strong>II.5</strong> <strong>Programming</strong> <strong>Language</strong><br />

If a set is to be ranked only by entry time of entities into it, a short form can be used. Depending<br />

on whether the ranking gives highest priority to the earliest or latest arrival, the define statement<br />

is written as:<br />

or<br />

define ARMY as a fifo set<br />

define ARMY as a lifo set<br />

If the first form is used, entities are stored on a first-in, first-out basis. If the second form is used,<br />

entities are stored on a last-in, first-out basis.<br />

All the statements described thus far assume that every set has a full complement of ownership and<br />

membership attributes, that is, that both first and last, predecessor and successor pointers, and<br />

counter and membership attributes are defined. To perform all of the available set manipulations,<br />

they must all be present. When set needs are more modest, sets with fewer pointers can be designed<br />

with a gain in efficiency.<br />

In some cases, not all of the automatically defined set pointers are needed. This is true in FIFO- and<br />

LIFO-defined sets, where entities are never inserted in the middle of a set, but only at the beginning<br />

or end. A FIFO set need have only first, last, and successor pointers. A LIFO set need have only<br />

first and successor pointers. FIFO and LIFO set organizations are shown in figure 4-20.<br />

A clause can be appended to a set declaration statement to delete unused set attributes. Any or all<br />

of the three owner-entity and three member-entity attributes may be deleted. If the first-in-set attribute<br />

is deleted, the is empty logical expression cannot be used. If the membership attribute is<br />

deleted, the is in set logical expression cannot be used. Table 4-2 below defines the statements<br />

that cannot be used when certain set attributes are deleted.<br />

The deletion clause is of the form:<br />

without attribute list attributes<br />

The attribute list consists of one or more of the letters F, L, P, S, N, and M. The presence of a<br />

letter indicates that the attribute formed by prefixing it and a period to the set name is not automatically<br />

generated. For example, the following statement defines a LIFO set:<br />

define ARRIVALS as a LIFO set without L,P,N<br />

and M attributes<br />

Note that although it is possible to delete all attributes, doing so completely destroys the concept of<br />

a set. The programmer is cautioned against deleting set attributes without carefully considering the<br />

consequences.<br />

When required, two or more sets having the same properties can be declared in the same define<br />

statement. A list of set names can appear after the word define, and the word sets used instead<br />

of set.<br />

162

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

Saved successfully!

Ooh no, something went wrong!