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
-
-
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
addAllPostulates(java.util.Collection<? extends Postulate<T>> postulates)
Adds all postulates in the given collection.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.void
removeAllPostulates(java.util.Collection<? extends Postulate<T>> postulates)
Removes all postulates in the given collection.boolean
removePostulate(Postulate<T> p)
Removes the given postulate
-
-
-
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
-
addAllPostulates
public void addAllPostulates(java.util.Collection<? extends Postulate<T>> postulates)
Adds all postulates in the given collection.- Parameters:
postulates
-
-
removePostulate
public boolean removePostulate(Postulate<T> p)
Removes the given postulate- Parameters:
p
- some postulate- Returns:
- true if this contained the specified postulate.
-
removeAllPostulates
public void removeAllPostulates(java.util.Collection<? extends Postulate<T>> postulates)
Removes all postulates in the given collection.- Parameters:
postulates
-
-
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
-
-