public class WeightedRandomSampler extends PersistentObject
serialVersionUID
Constructor and Description |
---|
WeightedRandomSampler()
Calls BlockedRandomSampler(1,null).
|
WeightedRandomSampler(int weight,
RandomEngine randomGenerator)
Chooses exactly one random element from successive blocks of weight input elements each.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a deep copy of the receiver.
|
int |
getWeight()
Not yet commented.
|
boolean |
sampleNextElement()
Chooses exactly one random element from successive blocks of weight input elements each.
|
void |
setWeight(int weight)
Not yet commented.
|
static void |
test(int weight,
int size)
Not yet commented.
|
public WeightedRandomSampler()
public WeightedRandomSampler(int weight, RandomEngine randomGenerator)
weight
- the weight.randomGenerator
- a random number generator. Set this parameter to null to use the default random number generator.public Object clone()
clone
in class PersistentObject
public int getWeight()
weight
- intpublic boolean sampleNextElement()
public void setWeight(int weight)
weight
- intpublic static void test(int weight, int size)
Jas4pp 1.5 © Java Analysis Studio for Particle Physics