public class SyntacticRandomSampler extends net.sf.tweety.commons.BeliefSetSampler<PropositionalFormula,PlBeliefSet>
This sampler implements a random generation algorithm for generating formulas, based on the syntax tree of propositional formulas. Consider the following BNF for a propositional logic formula:
F ::== !F | F && F | F || F | Awith propositions A. The algorithm for constructing formulas takes four parameters:
| Constructor and Description |
|---|
SyntacticRandomSampler(net.sf.tweety.commons.Signature signature,
net.sf.tweety.math.probability.Probability probneg,
net.sf.tweety.math.probability.Probability probconj,
net.sf.tweety.math.probability.Probability probdisj,
double recDecrease)
Creates a new sampler.
|
SyntacticRandomSampler(net.sf.tweety.commons.Signature signature,
net.sf.tweety.math.probability.Probability probneg,
net.sf.tweety.math.probability.Probability probconj,
net.sf.tweety.math.probability.Probability probdisj,
double recDecrease,
int minLength,
int maxLength)
Creates a new sampler.
|
| Modifier and Type | Method and Description |
|---|---|
PlBeliefSet |
next() |
PropositionalFormula |
sampleFormula(net.sf.tweety.math.probability.ProbabilityFunction<Byte> prob)
Samples a single formula.
|
getMaxLength, getMinLength, getSignature, hasNextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removepublic SyntacticRandomSampler(net.sf.tweety.commons.Signature signature,
net.sf.tweety.math.probability.Probability probneg,
net.sf.tweety.math.probability.Probability probconj,
net.sf.tweety.math.probability.Probability probdisj,
double recDecrease)
signature - some set of propositionsprobneg - the probability to generate a negationprobconj - the probability to generate a conjunctionprobdisj - the probability to generate a disjunctionrecDecrease - a value in (0,1) by which the above probabilities are multiplied in each recursive step to
increase likelihood of termination.public SyntacticRandomSampler(net.sf.tweety.commons.Signature signature,
net.sf.tweety.math.probability.Probability probneg,
net.sf.tweety.math.probability.Probability probconj,
net.sf.tweety.math.probability.Probability probdisj,
double recDecrease,
int minLength,
int maxLength)
signature - some set of propositionsprobneg - the probability to generate a negationprobconj - the probability to generate a conjunctionprobdisj - the probability to generate a disjunctionrecDecrease - a value in (0,1) by which the above probabilities are multiplied in each recursive step to
increase likelihood of termination.minLength - the minimum length of knowledge basesmaxLength - the maximum length of knowledge basespublic PropositionalFormula sampleFormula(net.sf.tweety.math.probability.ProbabilityFunction<Byte> prob)
public PlBeliefSet next()
next in interface Iterator<PlBeliefSet>next in interface net.sf.tweety.commons.BeliefSetIterator<PropositionalFormula,PlBeliefSet>next in class net.sf.tweety.commons.BeliefSetSampler<PropositionalFormula,PlBeliefSet>Copyright © 2019. All rights reserved.