Package net.sf.tweety.commons
Class BeliefSetSampler<T extends Formula,U extends BeliefSet<T,?>>
- java.lang.Object
-
- net.sf.tweety.commons.BeliefSetSampler<T,U>
-
- Type Parameters:
T
- The type of formulas belief sets are made ofU
- The type of belief sets sampled
- All Implemented Interfaces:
java.util.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 java.lang.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 Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAXIMUM_BELIEFBASE_LENGTH
This constant specifies the default maximum length for sampled belief bases.static int
DEFAULT_MINIMUM_BELIEFBASE_LENGTH
This constant specifies the default minimum length for sampled belief bases.
-
Constructor Summary
Constructors Constructor Description BeliefSetSampler(Signature signature)
Creates a new belief base sampler for the given signature.BeliefSetSampler(Signature signature, int minLength, int maxLength)
Creates a new belief base sampler for the given signature.
-
Method Summary
Modifier and Type Method Description int
getMaxLength()
Returns the max length of kbs of this sampler.int
getMinLength()
Returns the min length of kbs of this sampler.Signature
getSamplerSignature()
Returns the signature of this sampler.boolean
hasNext()
abstract U
next()
-
-
-
Field Detail
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
-
Constructor Detail
-
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 basesmaxLength
- the maximum length of knowledge bases
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
next
public abstract U next()
-
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.
-
-