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.

Discrete Simulation Concepts<br />

may be specified in the optional include phrase. As resources are maintained in <strong>SIMSCRIPT</strong><br />

<strong>II.5</strong> as permanent entities, they must be created before they can be used.<br />

The simplest form of a resource consists of a single unit of a single resource type. An example is a<br />

single-runway airport representation. This may be declared and created by the statements:<br />

Preamble:<br />

Program:<br />

resources include RUNWAY<br />

create every RUNWAY(1)<br />

let U.RUNWAY(1) = 1<br />

There is only one valid index value, 1, for the entity. The "units" attribute for this index is also 1.<br />

There is only one type of runway, and there is only one of them. To expand to multiple resources,<br />

there are two alternatives. The choice depends on the structure of the model:<br />

1. Add more identical units of the resource. These are identical. They all serve from a single<br />

queue.<br />

2. Add more resource elements. These may each have different properties, they must be specifically<br />

requested, and there may be different numbers of each available.<br />

The first case may be illustrated by the example of a bank with three tellers:<br />

create every TELLER(1)<br />

let U.TELLER(1) = 3<br />

To a bank customer, there is only one type of resource, TELLER(1). There are, however, three of<br />

them and any one will satisfy a request for service. To illustrate the second case, suppose the airport<br />

expands to three runways, only one of which may take jet aircraft. In this case, the resource may<br />

be created as:<br />

create every RUNWAY(2)<br />

let U.RUNWAY(1) = 1<br />

let U.RUNWAY(2) = 2<br />

'' FOR ANY AIRCRAFT<br />

'' LIGHT AIRCRAFT ONLY<br />

Now, aircraft requesting a runway resource must be specific as to the runway type. Light aircraft<br />

may request either, basing their choice, perhaps, on examination of both U.RUNWAY(i) values. Jet<br />

aircraft may request only RUNWAY(1).<br />

5.3.6 Requesting and Relinquishing Resources<br />

A process requests a quantity of any given resource using a request statement. The effect is as<br />

follows. If the requested quantity of the resource is available, it is given to the process, and the process<br />

continues execution at the statement following the request statement. If the requested quan-<br />

203

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

Saved successfully!

Ooh no, something went wrong!