Package org.tweetyproject.commons
Class FormulaSampler<T extends Formula>
java.lang.Object
org.tweetyproject.commons.FormulaSampler<T>
- Type Parameters:
- T- the class of the formulas.
- Direct Known Subclasses:
- BasicArgumentSampler
This abstract class models a sampler for formulas. It comprises
 of a set of sample methods which generates some random formulas
 wrt. to a given signature.
- Author:
- Matthias Thimm
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThis constant specifies the default length for sampled formulas.
- 
Constructor SummaryConstructorsConstructorDescriptionFormulaSampler(Signature signature) Creates a new formula sampler for the given signature.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the signature of this sampler.This method randomly samples a single formula of the given signature with the default maximal formula length.abstract TrandomSample(int formula_length) This method randomly samples a single formula of the given signature with the given maximal formula length.randomSample(int formula_length, int numFormulas) This method randomly samples a total of "numFormulas" of the given signature and maximal formula length.
- 
Field Details- 
DEFAULT_MAXIMAL_FORMULA_LENGTHpublic static final int DEFAULT_MAXIMAL_FORMULA_LENGTHThis constant specifies the default length for sampled formulas. The interpretation of this int depends on the actual type of knowledge representation but should resemble the number of atomic expressions and connectives used.- See Also:
 
 
- 
- 
Constructor Details- 
FormulaSamplerCreates a new formula sampler for the given signature.- Parameters:
- signature- a signature.
 
 
- 
- 
Method Details- 
randomSampleThis method randomly samples a single formula of the given signature with the given maximal formula length.- Parameters:
- formula_length- the maximal length of the formula to be sampled.
- Returns:
- a single formula.
 
- 
randomSampleThis method randomly samples a single formula of the given signature with the default maximal formula length.- Returns:
- a single formula.
 
- 
randomSampleThis method randomly samples a total of "numFormulas" of the given signature and maximal formula length.- Parameters:
- formula_length- the maximal length of the formulas to be sampled.
- numFormulas- the number of formulas to be sampled.
- Returns:
- a set of formulas.
 
- 
getSignatureReturns the signature of this sampler.- Returns:
- the signature of this sampler.
 
 
-