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 Modifier and Type Field Description private intkThe length of each clauseprivate java.util.RandomrandFor randomisationprivate SetTools<Proposition>setToolsFor randomisation- 
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 PlBeliefSetnext()DisjunctionrandomClause()Generates a random clause with k literals.- 
Methods inherited from class net.sf.tweety.commons.BeliefSetSampler
getMaxLength, getMinLength, getSamplerSignature, hasNext 
 - 
 
 - 
 
- 
- 
Field Detail
- 
k
private int k
The length of each clause 
- 
setTools
private SetTools<Proposition> setTools
For randomisation 
- 
rand
private java.util.Random rand
For randomisation 
 - 
 
- 
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:
 nextin interfaceBeliefSetIterator<PlFormula,PlBeliefSet>- Specified by:
 nextin interfacejava.util.Iterator<PlBeliefSet>- Specified by:
 nextin classBeliefSetSampler<PlFormula,PlBeliefSet>
 
- 
randomClause
public Disjunction randomClause()
Generates a random clause with k literals.- Returns:
 - a disjunction of literals.
 
 
 - 
 
 -