![]() The Weighted Random in this case will be the function that will randomly return you the item from the list, and it will take each item's weight into account, so that items with the higher weight will be picked more often. Every component in a study has direct access this utility through its random property. Multiply it by the array length to get the numbers between(0-arrayLength). All random data generation is handled by the util.Random() class. ![]() If we speak in terms of probabilities than the weights list might be an array of floats that sum up to 1 (i.e. Use Math.random() function to get the random number between(0-1, 1 exclusive).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |