I want to randomly select an item from a list with some sort of preference that will increase the probability of some items to be picked over others in Java. I have done the normal random selection but now I want to include this. I was thinking of increasing the number of a particular item, like duplicating it multiple times in the list, but I don't feel it's the right way to go. Any ideas are welcome.
Aucun commentaire:
Enregistrer un commentaire