public class SyntacticEnumeratingPlBeliefSetSampler extends BeliefBaseSampler<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 int |
previousMaxLength |
private int |
previousMinLength |
DEFAULT_MAXIMUM_BELIEFBASE_LENGTH, DEFAULT_MINIMUM_BELIEFBASE_LENGTH
Constructor and Description |
---|
SyntacticEnumeratingPlBeliefSetSampler(Signature signature,
int formulaLength,
java.io.File pathToTmp,
boolean deleteTmp)
Creates a new sampler.
|
Modifier and Type | Method and Description |
---|---|
void |
generateFormulasOfLength(int length)
Generates all formulas of the given length and stores them
in "pathToTemp/length/"
|
PlBeliefSet |
randomSample(int minLength,
int maxLength)
This method randomly samples a single belief base of the given signature
with the given belief base length.
|
getSignature, randomSample, randomSample
private int formulaLength
private java.io.File pathToTmp
private boolean deleteTmp
private boolean formulasGenerated
private IncreasingSubsetIterator<java.io.File> it
private int previousMinLength
private int previousMaxLength
public SyntacticEnumeratingPlBeliefSetSampler(Signature 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)public void generateFormulasOfLength(int length) throws java.io.IOException
length
- the length of the formulajava.io.IOException
public PlBeliefSet randomSample(int minLength, int maxLength)
BeliefBaseSampler
randomSample
in class BeliefBaseSampler<PlBeliefSet>
minLength
- the minimum length of the belief base.maxLength
- the maximum length of the belief base.