public class SyntacticEnumeratingIterator extends java.lang.Object implements BeliefSetIterator<PropositionalFormula,PlBeliefSet>
Modifier and Type | Field and Description |
---|---|
private boolean |
deleteTmp
if "true" then the temporary folder is cleaned after each sample (it is recommended to set this
to "false" to speed up sampling)
|
private int |
formulaLength
the maximal length of each formula (each proposition, negation, conjunction, and
disjunction counts one).
|
private boolean |
formulasGenerated
Whether the formulas have already been generated.
|
private IncreasingSubsetIterator<java.io.File> |
it
Used for iterating over all possible kbs
|
private java.io.File |
pathToTmp
the path to a folder where intermediate results (all formulas up to the required length)
are stored
|
private PropositionalSignature |
signature
The used signature.
|
Constructor and Description |
---|
SyntacticEnumeratingIterator(PropositionalSignature signature,
int formulaLength,
java.io.File pathToTmp,
boolean deleteTmp)
Creates a new sampler.
|
Modifier and Type | Method and Description |
---|---|
private void |
generateFormulasOfLength(int length)
Generates all formulas of the given length and stores them
in "pathToTemp/length/"
|
boolean |
hasNext() |
PlBeliefSet |
next() |
private int formulaLength
private java.io.File pathToTmp
private boolean deleteTmp
private boolean formulasGenerated
private IncreasingSubsetIterator<java.io.File> it
private PropositionalSignature signature
public SyntacticEnumeratingIterator(PropositionalSignature signature, int formulaLength, java.io.File pathToTmp, boolean deleteTmp)
signature
- the signature for formulas of the generated belief set.formulaLength
- the maximal length of each formula (each proposition, negation, conjunction, and
disjunction counts one).pathToTmp
- the path to a folder where intermediate results (all formulas up to the required length)
are storeddeleteTmp
- if "true" then the temporary folder is cleaned after each sample (it is recommended to set this
to "false" to speed up sampling)private void generateFormulasOfLength(int length) throws java.io.IOException
length
- the length of the formulajava.io.IOException
public boolean hasNext()
hasNext
in interface java.util.Iterator<PlBeliefSet>
hasNext
in interface BeliefSetIterator<PropositionalFormula,PlBeliefSet>
public PlBeliefSet next()
next
in interface java.util.Iterator<PlBeliefSet>
next
in interface BeliefSetIterator<PropositionalFormula,PlBeliefSet>