|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uconn.mcb.lineageevolver.RandomSelection
Class used for weighted random selection of an element in a set, given discrete relative probabilities (weights) between elements in the set.
Field Summary | |
private float[] |
_probabilities
The probability of selection per element in the n-tuple. |
private float |
_total
The sum of all probabilities in the provided array. |
private static java.util.Random |
randomNumberGenerator
Random number generator shared amongst all RandomSelection classes. |
Constructor Summary | |
RandomSelection(float[] probabilities)
Default constructor for objects of type RandomSelection. |
Method Summary | |
int |
select()
Returns a random selection, weighted according to the probabilities. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private float _total
private float[] _probabilities
private static java.util.Random randomNumberGenerator
Constructor Detail |
public RandomSelection(float[] probabilities)
probabilities
- the discrete probabilities associated to each element in the n-tuple for weighted selection.Method Detail |
public int select()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |