public class WeightedRandomSampler extends PersistentObject
Modifier and Type | Field and Description |
---|---|
protected Uniform |
generator |
protected int |
nextSkip |
protected int |
nextTriggerPos |
protected int |
skip |
protected int |
weight |
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.
|
protected int skip
protected int nextTriggerPos
protected int nextSkip
protected int weight
protected Uniform generator
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)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.