-
Notifications
You must be signed in to change notification settings - Fork 6
Description
We currently use a simple weighted random algorithm with a static linear spread of weights. One issue with this system is that it requires us to potentially draw more times to actually pick an item in cases where repeats cannot happen, which may mess with the distribution a bit.
It would be nice if we had a somewhat efficient way to pick a random item that has not already been picked. One such way would be to track the weights of each index, so that a picker function could subtract them from the total, and then skip that amount if the random happens to land on it. This could be inefficient in some cases, esp. if a large number of random choices need to be picked out of a large pool, but it should work well for the use case of picking a few items out of a large set. For such cases where we need to pick every item out of a pool, another weighted randomizer optimized for that task could be employed instead.