Package net.sf.tweety.logics.pl.util
Class RandomSatSampler
- java.lang.Object
-
- net.sf.tweety.commons.BeliefSetSampler<PlFormula,PlBeliefSet>
-
- net.sf.tweety.logics.pl.util.RandomSatSampler
-
- All Implemented Interfaces:
java.util.Iterator<PlBeliefSet>
,BeliefSetIterator<PlFormula,PlBeliefSet>
public class RandomSatSampler extends BeliefSetSampler<PlFormula,PlBeliefSet>
A sampler for uniform random k-SAT instances.- Author:
- Matthias Thimm
-
-
Field Summary
-
Fields inherited from class net.sf.tweety.commons.BeliefSetSampler
DEFAULT_MAXIMUM_BELIEFBASE_LENGTH, DEFAULT_MINIMUM_BELIEFBASE_LENGTH
-
-
Constructor Summary
Constructors Constructor Description RandomSatSampler(Signature signature, int k)
Constructs a new samplerRandomSatSampler(Signature signature, int k, int minLength, int maxLength)
Constructs a new sampler
-
Method Summary
Modifier and Type Method Description PlBeliefSet
next()
Disjunction
randomClause()
Generates a random clause with k literals.-
Methods inherited from class net.sf.tweety.commons.BeliefSetSampler
getMaxLength, getMinLength, getSamplerSignature, hasNext
-
-
-
-
Constructor Detail
-
RandomSatSampler
public RandomSatSampler(Signature signature, int k)
Constructs a new sampler- Parameters:
signature
- some signaturek
- the length of each clause
-
RandomSatSampler
public RandomSatSampler(Signature signature, int k, int minLength, int maxLength)
Constructs a new sampler- Parameters:
signature
- some signaturek
- the length of each clauseminLength
- the minimum length of knowledge basesmaxLength
- the maximum length of knowledge bases
-
-
Method Detail
-
next
public PlBeliefSet next()
- Specified by:
next
in interfaceBeliefSetIterator<PlFormula,PlBeliefSet>
- Specified by:
next
in interfacejava.util.Iterator<PlBeliefSet>
- Specified by:
next
in classBeliefSetSampler<PlFormula,PlBeliefSet>
-
randomClause
public Disjunction randomClause()
Generates a random clause with k literals.- Returns:
- a disjunction of literals.
-
-