Library "FunctionProbabilityDistributionSampling" Methods for probability distribution sampling selection.
sample(probabilities) Computes a random selected index from a probability distribution. Parameters: probabilities: float array, probabilities of sample. Returns: int.