Package org.tweetyproject.logics.pl.util
Class RandomSatSampler
java.lang.Object
org.tweetyproject.commons.BeliefSetSampler<PlFormula,PlBeliefSet>
org.tweetyproject.logics.pl.util.RandomSatSampler
- All Implemented Interfaces:
Iterator<PlBeliefSet>,BeliefSetIterator<PlFormula,PlBeliefSet>
A sampler for uniform random k-SAT instances.
- Author:
- Matthias Thimm
-
Field Summary
Fields inherited from class org.tweetyproject.commons.BeliefSetSampler
DEFAULT_MAXIMUM_BELIEFBASE_LENGTH, DEFAULT_MINIMUM_BELIEFBASE_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionRandomSatSampler(Signature signature, int k) Constructs a new samplerRandomSatSampler(Signature signature, int k, int minLength, int maxLength) Constructs a new sampler -
Method Summary
Methods inherited from class org.tweetyproject.commons.BeliefSetSampler
getMaxLength, getMinLength, getSamplerSignature, hasNextMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
RandomSatSampler
Constructs a new sampler- Parameters:
signature- some signaturek- the length of each clause
-
RandomSatSampler
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 Details
-
next
- Specified by:
nextin interfaceBeliefSetIterator<PlFormula,PlBeliefSet> - Specified by:
nextin interfaceIterator<PlBeliefSet>- Specified by:
nextin classBeliefSetSampler<PlFormula,PlBeliefSet>
-
randomClause
Generates a random clause with k literals.- Returns:
- a disjunction of literals.
-