Class SyntacticEnumeratingIterator

    • Field Summary

      Fields 
      Modifier and Type Field 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 PlSignature signature
      The used signature.
    • Constructor Summary

      Constructors 
      Constructor Description
      SyntacticEnumeratingIterator​(PlSignature signature, int formulaLength, java.io.File pathToTmp, boolean deleteTmp)
      Creates a new sampler.
    • Method Summary

      Modifier and Type Method Description
      private void generateFormulasOfLength​(int length)
      Generates all formulas of the given length and stores them in "pathToTemp/length/"
      boolean hasNext()  
      PlBeliefSet next()  
      • 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
    • Field Detail

      • formulaLength

        private int formulaLength
        the maximal length of each formula (each proposition, negation, conjunction, and disjunction counts one).
      • pathToTmp

        private java.io.File pathToTmp
        the path to a folder where intermediate results (all formulas up to the required length) are stored
      • deleteTmp

        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)
      • formulasGenerated

        private boolean formulasGenerated
        Whether the formulas have already been generated.
      • signature

        private PlSignature signature
        The used signature.
    • Constructor Detail

      • SyntacticEnumeratingIterator

        public SyntacticEnumeratingIterator​(PlSignature signature,
                                            int formulaLength,
                                            java.io.File pathToTmp,
                                            boolean deleteTmp)
        Creates a new sampler.
        Parameters:
        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 stored
        deleteTmp - if "true" then the temporary folder is cleaned after each sample (it is recommended to set this to "false" to speed up sampling)
    • Method Detail

      • generateFormulasOfLength

        private void generateFormulasOfLength​(int length)
                                       throws java.io.IOException
        Generates all formulas of the given length and stores them in "pathToTemp/length/"
        Parameters:
        length - the length of the formula
        Throws:
        java.io.IOException - if some IO issue occurs.