randomlySelect

open fun randomlySelect(array: IntArray): Int(source)

Randomly select an element from the array

Return

the randomly selected value

Parameters

array

the array to select from, must not be empty


open fun randomlySelect(array: IntArray, cdf: DoubleArray): Int(source)

Randomly selects from the array using the supplied cdf

Return

the randomly selected value

Parameters

array

array to select from

cdf

the cumulative probability associated with each element of array