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
ConstructorDescriptionLatticePartialOrder
(Collection<T> args) Creates a new argument ranking with the given comparable elements which are initially all incomparable. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getArgs()
getOrder()
boolean
isIncomparable
(T a, T b) Returns "true" iff a and b are incomparable (i.e.boolean
isSame
(LatticePartialOrder<T, R> ra) boolean
Returns "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.boolean
Checks whether this interpretation satisfies the given knowledge base.boolean
Checks whether this interpretation satisfies the given formula.void
Defines 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, isStrictlyMoreOrEquallyAcceptableThan
Methods inherited from class org.tweetyproject.commons.AbstractInterpretation
satisfies
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:GeneralComparator
Returns "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:
isStrictlyLessOrEquallyAcceptableThan
in 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:GeneralComparator
Returns "true" iff a and b are incomparable (i.e. this ranking is a partial ranking).- Specified by:
isIncomparable
in 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:
containsIncomparableArguments
in 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:Interpretation
Checks 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:Interpretation
Checks 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.
-