Package org.tweetyproject.comparator
Class GeneralComparator<T extends Formula,R extends BeliefBase>
java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<R,T>
org.tweetyproject.comparator.GeneralComparator<T,R>
- All Implemented Interfaces:
Comparator<T>
,Interpretation<R,
T>
- Direct Known Subclasses:
LastLinkOrder
,LatticePartialOrder
,NumericalPartialOrder
,RuleComparator
,SimpleAspicOrder
,WeakestLinkOrder
public abstract class GeneralComparator<T extends Formula,R extends BeliefBase>
extends AbstractInterpretation<R,T>
implements Comparator<T>
This abstract class is the common ancestor for semantical approaches to
ranking, i.e. relations that allow a more fine-grained comparison by
e.g. utilizing numerical values for arguments.
- Author:
- Matthias Thimm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
abstract boolean
Returns the set of all comparable elements a from the given set that are maximally accepted, i.e.Returns the set of all comparable elements a from the given set that are minimally accepted, i.e.boolean
isEquallyAcceptableThan
(T a, T b) Returns "true" iff a is equally acceptable as b, i.e.boolean
isEquivalent
(GeneralComparator<T, R> other, Collection<T> args) Checks whether this ranking is equivalent to the other one wrt.abstract boolean
isIncomparable
(T a, T b) Returns "true" iff a and b are incomparable (i.e.boolean
isStrictlyLessAcceptableThan
(T a, T b) Returns "true" iff a is strictly less acceptable than b, i.e.abstract 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
isStrictlyMoreAcceptableThan
(T a, T b) Returns "true" iff a is strictly more acceptable than b, i.e.boolean
Returns "true" iff a is strictly more acceptable than b or a is equally acceptable as b, i.e.Methods inherited from class org.tweetyproject.commons.AbstractInterpretation
satisfies
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface org.tweetyproject.commons.Interpretation
satisfies, satisfies
-
Constructor Details
-
GeneralComparator
public GeneralComparator()
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<T extends Formula>
-
isStrictlyMoreAcceptableThan
Returns "true" iff a is strictly more acceptable than b, i.e. a < b- Parameters:
a
- some comparable elementb
- some comparable element- Returns:
- "true" iff a is strictly more acceptable than b
-
isStrictlyLessAcceptableThan
Returns "true" iff a is strictly less acceptable than b, i.e. a > b- Parameters:
a
- some comparable elementb
- some comparable element- Returns:
- "true" iff a is strictly less acceptable than b
-
isStrictlyMoreOrEquallyAcceptableThan
Returns "true" iff a is strictly more acceptable than b or a is equally acceptable as b, i.e. a <= b (or a ~ b)- Parameters:
a
- some comparable elementb
- some comparable element- Returns:
- "true" iff a is strictly more acceptable than b or a is equally acceptable as b, "false" otherwise or if a and b are incomparable
-
isEquallyAcceptableThan
Returns "true" iff a is equally acceptable as b, i.e. a = b (or a ~ b)- Parameters:
a
- some comparable elementb
- some comparable element- Returns:
- "true" iff a is equally acceptable as b, "false" otherwise or if a and b are incomparable
-
getMaximallyAcceptedArguments
Returns the set of all comparable elements a from the given set that are maximally accepted, i.e. where there is no other comparable element that is strictly more acceptable.- Parameters:
args
- a set of comparable element- Returns:
- the set of all comparable element a that are maximally accepted
-
getMinimallyAcceptedArguments
Returns the set of all comparable elements a from the given set that are minimally accepted, i.e. where there is no other comparable element that is strictly less acceptable.- Parameters:
args
- a set of comparable elements- Returns:
- the set of all comparable elements a that are minimally accepted
-
isEquivalent
Checks whether this ranking is equivalent to the other one wrt. the given set of comparable elements.- Parameters:
other
- some rankingargs
- some comparable elements- Returns:
- "true" if both rankings are equivalent.
-
isStrictlyLessOrEquallyAcceptableThan
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)- 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
Returns "true" iff a and b are incomparable (i.e. this ranking is a partial ranking).- Parameters:
a
- comparable elementb
- comparable element- Returns:
- "true" iff a and b are incomparable
-
containsIncomparableArguments
public abstract boolean containsIncomparableArguments()- Returns:
- true if this ranking contains incomparable arguments, false otherwise
-