Class BeliefSetSampler<T extends Formula,U extends BeliefSet<T,?>>

java.lang.Object
org.tweetyproject.commons.BeliefSetSampler<T,U>
Type Parameters:
T - The type of formulas belief sets are made of
U - The type of belief sets sampled
All Implemented Interfaces:
Iterator<U>, BeliefSetIterator<T,U>
Direct Known Subclasses:
CnfSampler, ContensionSampler, HsSampler, MiSampler, RandomSampler, RandomSatSampler, SimpleSafSampler, SyntacticRandomSampler

public abstract class BeliefSetSampler<T extends Formula,U extends BeliefSet<T,?>> extends Object implements BeliefSetIterator<T,U>
This abstract class models a random sampler for belief sets. It comprises of a set of sample methods which generates some random belief sets wrt. to a given signature.
Author:
Matthias Thimm
  • Field Details

    • DEFAULT_MAXIMUM_BELIEFBASE_LENGTH

      public static final int DEFAULT_MAXIMUM_BELIEFBASE_LENGTH
      This constant specifies the default maximum length for sampled belief bases. The interpretation of this int depends on the actual type of knowledge representation but should resemble the maximum number of formulas in the belief base;
      See Also:
    • DEFAULT_MINIMUM_BELIEFBASE_LENGTH

      public static final int DEFAULT_MINIMUM_BELIEFBASE_LENGTH
      This constant specifies the default minimum length for sampled belief bases. The interpretation of this int depends on the actual type of knowledge representation but should resemble the minimum number of formulas in the belief base;
      See Also:
  • Constructor Details

    • BeliefSetSampler

      public BeliefSetSampler(Signature signature)
      Creates a new belief base sampler for the given signature.
      Parameters:
      signature - a signature.
    • BeliefSetSampler

      public BeliefSetSampler(Signature signature, int minLength, int maxLength)
      Creates a new belief base sampler for the given signature.
      Parameters:
      signature - a signature.
      minLength - the minimum length of knowledge bases
      maxLength - the maximum length of knowledge bases
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface BeliefSetIterator<T extends Formula,U extends BeliefSet<T,?>>
      Specified by:
      hasNext in interface Iterator<T extends Formula>
    • next

      public abstract U next()
      Specified by:
      next in interface BeliefSetIterator<T extends Formula,U extends BeliefSet<T,?>>
      Specified by:
      next in interface Iterator<T extends Formula>
    • getSamplerSignature

      public Signature getSamplerSignature()
      Returns the signature of this sampler.
      Returns:
      the signature of this sampler.
    • getMinLength

      public int getMinLength()
      Returns the min length of kbs of this sampler.
      Returns:
      the min length of kbs of this sampler.
    • getMaxLength

      public int getMaxLength()
      Returns the max length of kbs of this sampler.
      Returns:
      the max length of kbs of this sampler.