## 8.10 Using the distribution functions

ARENA provides a wide range of distribution functions for modelling arrival times, process times etc. To use any of the functions it is only necessary to enter the name (or its shortened form) and then provide the required parameters. ARENA then generates a uniformly distributed random number in the range 0 to 1 which, in turn, is used to select a value from the specified distribution. ARENA provides 10 random number streams to select from or you can, if you wish, accept the default stream (10). To use, for example, the exponential distribution with a mean value of 4 you can enter the full name and parameter, UNIFORM(4) , or the shortened name (first four letters) and parameter, UNIF(4). You can select a particular random number stream by adding an extra parameter to the ARENA statement and this will automatically be understood by the compiler. For example to use an exponential distribution with a mean of 4 but selecting from random number stream 8 modify the above statement to UNIF(4,8). Appendix B has the full details on the available functions.

All of ARENA's distributions are based on a multiplicative congruential generator for uniformly distributed numbers between 0 & 1. The multiplicative constant is 16,807 and the modulo value is 231 - 1 This gives a cycle length of approximately 2.109 and we are not aware of any problems with this generator.

If, for any reason, the 10 random number streams are not sufficient for your needs it is possible to extend the range using the `SEEDS' element. The SEEDS' element lets you specify the the initial seed value for each stream or to define a new stream which can be referred to by name or number. You can also decide when replicating multiple runs of a simulation to reset the seed between runs or allow the stream of numbers to continue between runs (the default). Resetting will of course generate exactly the same sequence for each run which can sometimes be useful if, for example, you change a parameter between runs.

### Example 8.5

A uniform distribution is required for a processing time with a minimum of 12 and a maximum of 23 time units using the default random number stream.

UNIF(12,23)

A second process is to be modelled using a normal distribution with a mean of 15 and a standard deviation of 4. It has been decided to use random number stream 7.

NORMAL(15,4,7)

Two functions `CONTINUOUS' and `DISCRETE' (which can be shortened to CONT & DISC) allow you to sample experimental data expressed as either a continuous or discrete cumulative distribution function.

The `DISCRETE' function is very useful, for example, for assigning job types with a particular probability distribution. Fig. 8.X shows an example where there is a probability of 0.2 of job type 1, 0.2 of job type 2, 0.4 of job type 3 and 0.2 of job type 4. As shown in detail in appendix A the function requires the cumulative probability values. The CONTINUOUS' function operates in an analogous manner.

To program the above example in ARENA use the following statement :

DISC(0.2,1,0.4,2,0.8,3,1,4)