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

When a sampling distribution cannot be characterized by one of the statistical sampling functions,<br />

declarations can be given that define table look-up sampling variables. A table look-up sampling<br />

variable has a list of possible numeric values together with their associated probabilities. It selects<br />

a sample value by generating a random number and matching it against the possible probability values.<br />

Table look-up variables, hereafter called random variables, are declared in statements of the<br />

form:<br />

or<br />

the system has a name random step variable<br />

every entity has a name random linear variable<br />

Such random variables must be declared as attributes, either of some entity or of the system.<br />

The first form states that sampling is done from a real- or integer-valued sampling distribution<br />

in a steplike manner. The second states that sampling is performed with linear interpolation done<br />

between real sample values. The following illustrations describe how this is done.<br />

Assume that a random variable, or attribute, has the sampling distribution in table 5-6 associated<br />

with it. Note that the cumulative probabilities in the left-hand column range from 0.0 to 1.0. Sampling<br />

is performed by generating a probability value using random.f(1), matching it with a value<br />

in column 1, and selecting an appropriate value from column 2. Since samples from random.f are<br />

always between 0.0 and 1.0, and are uniformly distributed between these extremes, the samples<br />

drawn from column 2 will be chosen randomly.<br />

Table 5-6. Sampling Distribution (Example)<br />

Cummulative Probability<br />

0.00<br />

0.10<br />

0.20<br />

0.25<br />

0.38<br />

0.45<br />

0.60<br />

0.77<br />

0.90<br />

0.99<br />

1.00<br />

Sample Value<br />

0.0<br />

1.0<br />

2.5<br />

3.0<br />

9.0<br />

11.8<br />

20.9<br />

30.0<br />

33.3<br />

50.0<br />

66.7<br />

219

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

Saved successfully!

Ooh no, something went wrong!