GEN42
Prev | Score Statements and GEN Routines | Next

## GEN42

GEN42 — Generates a random distribution of discrete ranges of values.

## Description

Generates a random distribution function of discrete ranges of values by giving a list of groups of three numbers.

## Syntax

    f # time size -42  min1 max1 prob1 min2 max2 prob2 min3 max3 prob3 ...  minN maxN probN

## Performance

The first number of each group is a the minimum value of the range, the second is the maximum value and the third is the probability of that an element belonging to that range of values can be chosen by a random algorithm. Probabilities for a range should be a fraction of 1, and the sum of the probabilities for all the ranges should total 1.0.

This subroutine is designed to be used together with duserrnd and urd opcodes (see duserrnd for more information). Since both duserrnd and urd do not use any interpolation, it is suggested to give a size reasonably big.

## Credits

Author: Gabriel Maldonado

Prev | Up | Next
GEN41 | Home | GEN43