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.

Discrete Simulation Concepts<br />

1. if random.f(1) less than TRANSITION.PROBABILITY<br />

let COUNT = COUNT + 1<br />

always<br />

2. for each CONTESTANT,<br />

do<br />

if random.f(CONTESTANT) greater than FINISH,<br />

file CONTESTANT in POSSIBLE.WINNER<br />

always<br />

add 1 to STEPS(CONTESTANTS)<br />

loop<br />

Random.f can be viewed in two ways — as generating uniformly distributed pseudorandom variables<br />

between 0 and 1 or as generating probabilities. The above examples illustrate the use of the<br />

function in the probability sense.<br />

<strong>SIMSCRIPT</strong> <strong>II.5</strong> provides twelve functions for generating independent, pseudorandom samples<br />

from commonly encountered statistical distributions. Each of these functions has as its arguments<br />

the parameters that describe the distribution and a pseudorandom number stream index. Each time<br />

one of these functions is invoked, one or more pseudorandom numbers are generated from the indicated<br />

stream, using random.f, and an appropriate transformation is made to produce the correct<br />

sampling distribution. The functions, the arguments, and their properties are described in table 5-5.<br />

If the stream number, i, is negative in any of these function calls, a quantity called an antithetic variate,<br />

1 - random.f(abs.f(i)), is generated. Antithetic variates are used in simulation experiments<br />

to reduce the variance of estimates of simulation-generated data. Discussions of their use can<br />

be found in most simulation texts.<br />

These statistical functions are often used with simulation models to generate event times and activity<br />

durations. Some examples illustrate their use.<br />

1. An activity generator process schedules task processes, assuming that the time between<br />

successive task initiations is an exponentially distributed quantity with mean time of MEAN<br />

days. For example:<br />

process GENERATOR<br />

until time.v gt TIME.LIMIT<br />

do<br />

activate a TASK now<br />

wait exponential.f(MEAN, 1) days<br />

loop<br />

return<br />

end<br />

215

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

Saved successfully!

Ooh no, something went wrong!