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:
Iterator<PlBeliefSet>,net.sf.tweety.commons.BeliefSetIterator<PlFormula,PlBeliefSet>
public class RandomSatSampler extends net.sf.tweety.commons.BeliefSetSampler<PlFormula,PlBeliefSet>
A sampler for uniform random k-SAT instances.- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description RandomSatSampler(net.sf.tweety.commons.Signature signature, int k)Constructs a new samplerRandomSatSampler(net.sf.tweety.commons.Signature signature, int k, int minLength, int maxLength)Constructs a new sampler
-
Method Summary
Modifier and Type Method Description PlBeliefSetnext()DisjunctionrandomClause()Generates a random clause with k literals.-
Methods inherited from class net.sf.tweety.commons.BeliefSetSampler
getMaxLength, getMinLength, getSamplerSignature, hasNext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
RandomSatSampler
public RandomSatSampler(net.sf.tweety.commons.Signature signature, int k)Constructs a new sampler- Parameters:
signature- some signaturek- the length of each clause
-
RandomSatSampler
public RandomSatSampler(net.sf.tweety.commons.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:
nextin interfacenet.sf.tweety.commons.BeliefSetIterator<PlFormula,PlBeliefSet>- Specified by:
nextin interfaceIterator<PlBeliefSet>- Specified by:
nextin classnet.sf.tweety.commons.BeliefSetSampler<PlFormula,PlBeliefSet>
-
randomClause
public Disjunction randomClause()
Generates a random clause with k literals.- Returns:
- a disjunction of literals.
-
-