wchoice
Weighted random choice selection
Syntax
Usage
wchoice picks a random element from an array (kchoices). A second array (kweights) specifies relative probability of selecting the values in kchoices at the same indices as the 'weights' values.
If kweights does not match the length of kchoices, kweights is truncated or extended through repetition.
Outputs and arguments
ichosen -- output
i/kchoices -- array of items to select from.
i/kweights -- relative probability of selecting the item in i/kchoices at each index position .
Example
See the example for wchoice.orc