Package net.sf.tweety.commons.postulates
Class PostulateEvaluator<T extends Formula,U extends BeliefSet<T,?>>
- java.lang.Object
-
- net.sf.tweety.commons.postulates.PostulateEvaluator<T,U>
-
- Type Parameters:
T
- The type of formulas used in the evaluation.U
- The type of belief bases used in the evaluation.
public class PostulateEvaluator<T extends Formula,U extends BeliefSet<T,?>> extends java.lang.Object
Evaluates some approach (reasoner, measure, etc.) wrt. a series of rationality postulates on a given series of knowledge bases.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description private PostulateEvaluatable<T>
ev
The approach being evaluated.private BeliefSetIterator<T,U>
iterator
The belief base sampler used to test the rationality postulatesprivate java.util.List<Postulate<T>>
postulates
the list of postulates the approach is evaluated against
-
Constructor Summary
Constructors Constructor Description PostulateEvaluator(BeliefSetIterator<T,U> iterator, PostulateEvaluatable<T> ev)
Creates a new evaluator for the given evaluatable and belief base generator.PostulateEvaluator(BeliefSetIterator<T,U> iterator, PostulateEvaluatable<T> ev, java.util.Collection<Postulate<T>> postulates)
Creates a new evaluator for the given evaluatable and belief base generator.
-
Method Summary
Modifier and Type Method Description void
addPostulate(Postulate<T> p)
Adds the given postulatePostulateEvaluationReport<T>
evaluate(long num)
Evaluates all postulates of this evaluator on the given approach onnum
belief bases generated by the sampler of this evaluator.PostulateEvaluationReport<T>
evaluate(long num, boolean stopWhenFailed)
Evaluates all postulates of this evaluator on the given approach onnum
belief bases generated by the sampler of this evaluator.boolean
removePostulate(Postulate<T> p)
Removes the given postulate
-
-
-
Field Detail
-
iterator
private BeliefSetIterator<T extends Formula,U extends BeliefSet<T,?>> iterator
The belief base sampler used to test the rationality postulates
-
ev
private PostulateEvaluatable<T extends Formula> ev
The approach being evaluated.
-
-
Constructor Detail
-
PostulateEvaluator
public PostulateEvaluator(BeliefSetIterator<T,U> iterator, PostulateEvaluatable<T> ev, java.util.Collection<Postulate<T>> postulates)
Creates a new evaluator for the given evaluatable and belief base generator.- Parameters:
iterator
- some belief set iteratorev
- some evaluatablepostulates
- a set of postulates
-
PostulateEvaluator
public PostulateEvaluator(BeliefSetIterator<T,U> iterator, PostulateEvaluatable<T> ev)
Creates a new evaluator for the given evaluatable and belief base generator.- Parameters:
iterator
- some belief set iteratorev
- some evaluatable
-
-
Method Detail
-
addPostulate
public void addPostulate(Postulate<T> p)
Adds the given postulate- Parameters:
p
- some postulate
-
removePostulate
public boolean removePostulate(Postulate<T> p)
Removes the given postulate- Parameters:
p
- some postulate- Returns:
- true if this contained the specified postulate.
-
evaluate
public PostulateEvaluationReport<T> evaluate(long num, boolean stopWhenFailed)
Evaluates all postulates of this evaluator on the given approach onnum
belief bases generated by the sampler of this evaluator.- Parameters:
num
- the number of belief bases to be applied.stopWhenFailed
- if true the evaluation of one postulate will be stopped once a violation has been encountered.- Returns:
- a report on the evaluation
-
evaluate
public PostulateEvaluationReport<T> evaluate(long num)
Evaluates all postulates of this evaluator on the given approach onnum
belief bases generated by the sampler of this evaluator. The evaluation of any one postulate will be stopped once a violation has been encountered.- Parameters:
num
- the number of belief bases to be applied.- Returns:
- a report on the evaluation
-
-