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.

4. Modelling Concepts<br />

4.1 Introduction<br />

In Chapter 1, a programming language was presented as a means of describing both instructions and<br />

the data on which they operate. The description of data items has been limited to naming the data<br />

items, specifying modes, and, in the case of arrays, describing some simple data structuring. This<br />

chapter describes the additional data-structuring facilities and commands provided by <strong>SIMSCRIPT</strong><br />

<strong>II.5</strong> and illustrates their potential use. These data structures are designed to aid in problem definition,<br />

particularly in the areas of simulation and modelling.<br />

The provision of enhanced data-structuring facilities is necessary for two reasons: (1) the need for<br />

more organizational structure than simple arrays afford, and (2) the lack of clarity of programs<br />

written within the descriptive limits of variable name and subscript expression conventions.<br />

<strong>SIMSCRIPT</strong> <strong>II.5</strong> provides needed structure and narrative clarity through statements that define and<br />

manipulate entities, attributes, and sets.<br />

This chapter is organized into three parts: definition, organization, and manipulation. First, definitions<br />

are provided for the three constituents of the <strong>SIMSCRIPT</strong> <strong>II.5</strong> world view: entities, attributes,<br />

and sets. Next the relationships between these constituents are discussed, with special<br />

attention to how they are organized. Finally, statements that use these constituents to perform useful<br />

functions are presented.<br />

4.2 Entities and Attributes<br />

An entity is a structured data item that represents some element of a modelled system. Similar to a<br />

subscripted variable. It may have more than a single value to define a particular configuration or<br />

state of the entity. Unlike subscripted variables, the attributes of entities are referenced by name<br />

rather than by a subscript number, enhancing readability and model description. Using subscripted<br />

variables, a collection of ten workers having the attributes of age, number of dependents, and social<br />

security number might be represented in <strong>SIMSCRIPT</strong> <strong>II.5</strong> by a two-dimensional array reserved as<br />

follows:<br />

reserve WORKER as 3 by 10<br />

with the understanding that WORKER(1,4) represents the age of the fourth worker, WORKER(3,6)<br />

the social security number of the sixth worker, etc., according to the layout shown in figure 4-1.<br />

137

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

Saved successfully!

Ooh no, something went wrong!