public class RandomSampler extends BeliefSetSampler<PropositionalFormula,PlBeliefSet>
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<PossibleWorld> |
allWorlds
All possible worlds
|
private java.util.Random |
rand
for generating random numbers
|
private double |
worldProb
Probability of selecting any world as a model of a formula
|
DEFAULT_MAXIMUM_BELIEFBASE_LENGTH, DEFAULT_MINIMUM_BELIEFBASE_LENGTH| Constructor and Description |
|---|
RandomSampler(Signature signature,
double worldProb)
Creates a new sampler for the given signature
|
RandomSampler(Signature signature,
double worldProb,
int minLength,
int maxLength)
Creates a new sampler for the given signature
|
| Modifier and Type | Method and Description |
|---|---|
PlBeliefSet |
next() |
private PropositionalFormula |
randomFormula()
Returns a random formula.
|
getMaxLength, getMinLength, getSignature, hasNextprivate java.util.List<PossibleWorld> allWorlds
private java.util.Random rand
private double worldProb
public RandomSampler(Signature signature, double worldProb)
signature - some signatureworldProb - Probability of selecting any world as a model of a formulapublic RandomSampler(Signature signature, double worldProb, int minLength, int maxLength)
signature - some signatureworldProb - Probability of selecting any world as a model of a formulaminLength - the minimum length of knowledge basesmaxLength - the maximum length of knowledge basespublic PlBeliefSet next()
next in interface java.util.Iterator<PlBeliefSet>next in interface BeliefSetIterator<PropositionalFormula,PlBeliefSet>next in class BeliefSetSampler<PropositionalFormula,PlBeliefSet>private PropositionalFormula randomFormula()