weightedRandomIndex
Returns a random index of this list chosen with probability proportional to weights.
The probability of index i equals weights[i] / weights.sum(). Indices whose weight is 0.0 are never chosen.
Parameters
weights
one non-negative finite weight per element of this list.
random
the source of randomness, Random.Default by default.
Throws
if the list is empty, if weights and the list differ in size, if any weight is negative, NaN, or infinite, or if the total weight is not strictly positive.