Package org.tweetyproject.comparator
Class LatticePartialOrder<T extends Formula,R extends BeliefBase>
java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<R,T>
org.tweetyproject.comparator.GeneralComparator<T,R>
org.tweetyproject.comparator.LatticePartialOrder<T,R>
- Type Parameters:
T- some formula
- All Implemented Interfaces:
Comparator<T>,Interpretation<R,T>
public class LatticePartialOrder<T extends Formula,R extends BeliefBase>
extends GeneralComparator<T,R>
This class models comparable element ranking by representing the acceptability of
comparable elements in a graph-based structure.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorsConstructorDescriptionLatticePartialOrder(Collection<T> args) Creates a new argument ranking with the given comparable elements which are initially all incomparable. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetArgs()getOrder()booleanisIncomparable(T a, T b) Returns "true" iff a and b are incomparable (i.e.booleanisSame(LatticePartialOrder<T, R> ra) booleanReturns "true" iff a is strictly less acceptable than b or a is equally acceptable as b or a and b are not comparable, i.e.booleanChecks whether this interpretation satisfies the given knowledge base.booleanChecks whether this interpretation satisfies the given formula.voidDefines comparable element "a" to be strictly less or equally acceptable than comparable element "b".toString()Methods inherited from class org.tweetyproject.comparator.GeneralComparator
compare, getMaximallyAcceptedArguments, getMinimallyAcceptedArguments, isEquallyAcceptableThan, isEquivalent, isStrictlyLessAcceptableThan, isStrictlyMoreAcceptableThan, isStrictlyMoreOrEquallyAcceptableThanMethods inherited from class org.tweetyproject.commons.AbstractInterpretation
satisfiesMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
LatticePartialOrder
Creates a new argument ranking with the given comparable elements which are initially all incomparable.- Parameters:
args- a set of arguments
-
-
Method Details
-
getOrder
- Returns:
- the order
-
getArgs
- Returns:
- the arguments
-
setStrictlyLessOrEquallyAcceptableThan
Defines comparable element "a" to be strictly less or equally acceptable than comparable element "b".- Parameters:
a- some comparable elementb- some comparable element
-
isStrictlyLessOrEquallyAcceptableThan
Description copied from class:GeneralComparatorReturns "true" iff a is strictly less acceptable than b or a is equally acceptable as b or a and b are not comparable, i.e. a >= b (or a ~ b)- Specified by:
isStrictlyLessOrEquallyAcceptableThanin classGeneralComparator<T extends Formula,R extends BeliefBase> - Parameters:
a- some comparable elementb- some comparable element- Returns:
- "true" iff a is strictly less acceptable than b or a is equally acceptable as b
-
isIncomparable
Description copied from class:GeneralComparatorReturns "true" iff a and b are incomparable (i.e. this ranking is a partial ranking).- Specified by:
isIncomparablein classGeneralComparator<T extends Formula,R extends BeliefBase> - Parameters:
a- comparable elementb- comparable element- Returns:
- "true" iff a and b are incomparable
-
containsIncomparableArguments
public boolean containsIncomparableArguments()- Specified by:
containsIncomparableArgumentsin classGeneralComparator<T extends Formula,R extends BeliefBase> - Returns:
- true if this ranking contains incomparable arguments, false otherwise
-
isSame
- Parameters:
ra- some artial order- Returns:
- if they are the same
-
toString
-
satisfies
Description copied from interface:InterpretationChecks whether this interpretation satisfies the given formula.- Parameters:
formula- a formula .- Returns:
- "true" if this interpretation satisfies the given formula.
- Throws:
IllegalArgumentException- if the formula does not correspond to the expected language.
-
satisfies
Description copied from interface:InterpretationChecks whether this interpretation satisfies the given knowledge base.- Parameters:
beliefBase- a knowledge base.- Returns:
- "true" if this interpretation satisfies the given knowledge base.
- Throws:
IllegalArgumentException- IllegalArgumentException if the knowledgebase does not correspond to the expected language.
-