getWeightedRandom

fun <T> Map<T, Double>.getWeightedRandom(rand: Random): T

Randomly selects item with respect to the current weight distribution.

Sources

Katlib source
Link copied to clipboard