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

Table 5-5. Statistical Distribution Functions - Continued<br />

Name<br />

Arguments<br />

Function<br />

Mode<br />

Function Value<br />

weibull.f<br />

e 1 , e 2 , i<br />

REAL,REAL,<br />

INTEGER<br />

REAL<br />

Generates a Weibull-distributed REAL number<br />

with shape parameter = e 1 and scale parameter =<br />

e 2 using stream i.<br />

2. Although similar to the previous example, the TASK process now has a given argument assumed<br />

to have a Poisson distribution with a mean of 5. Note that two separate random number<br />

streams are to be used in sampling the distributions:<br />

process GENERATOR<br />

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

do<br />

let NUMBER = poisson.f(5.0, 1)<br />

activate a TASK giving NUMBER now<br />

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

loop<br />

return<br />

end<br />

3. Evaluation of PI (π):<br />

In a rectangular coordinate system (figure 5-7), the equation of a circle is:<br />

i 2 + j 2 = r 2<br />

that is, any point (i,j) with i ≤ r and j ≤ r and i 2 + j 2 ≤ r 2 lies inside a circle of radius r. The<br />

area of the circle is πr 2 . A square of side 2r has an area = 4r 2 . The ratio of the area of the<br />

circle to the area of the square is πr 2 /4r 2 = π/4.<br />

217

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

Saved successfully!

Ooh no, something went wrong!