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 Details

    • GeneralComparator

      public GeneralComparator()
  • Method Details

    • compare

      public int compare(T arg0, T arg1)
      Specified by:
      compare in interface Comparator<T extends Formula>
    • isStrictlyMoreAcceptableThan

      public boolean isStrictlyMoreAcceptableThan(T a, T b)
      Returns "true" iff a is strictly more acceptable than b, i.e. a < b
      Parameters:
      a - some comparable element
      b - some comparable element
      Returns:
      "true" iff a is strictly more acceptable than b
    • isStrictlyLessAcceptableThan

      public boolean isStrictlyLessAcceptableThan(T a, T b)
      Returns "true" iff a is strictly less acceptable than b, i.e. a > b
      Parameters:
      a - some comparable element
      b - some comparable element
      Returns:
      "true" iff a is strictly less acceptable than b
    • isStrictlyMoreOrEquallyAcceptableThan

      public boolean isStrictlyMoreOrEquallyAcceptableThan(T a, T b)
      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 element
      b - 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

      public boolean isEquallyAcceptableThan(T a, T b)
      Returns "true" iff a is equally acceptable as b, i.e. a = b (or a ~ b)
      Parameters:
      a - some comparable element
      b - some comparable element
      Returns:
      "true" iff a is equally acceptable as b, "false" otherwise or if a and b are incomparable
    • getMaximallyAcceptedArguments

      public Collection<T> getMaximallyAcceptedArguments(Collection<T> args)
      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

      public Collection<T> getMinimallyAcceptedArguments(Collection<T> args)
      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

      public boolean isEquivalent(GeneralComparator<T,R> other, Collection<T> args)
      Checks whether this ranking is equivalent to the other one wrt. the given set of comparable elements.
      Parameters:
      other - some ranking
      args - some comparable elements
      Returns:
      "true" if both rankings are equivalent.
    • isStrictlyLessOrEquallyAcceptableThan

      public abstract boolean isStrictlyLessOrEquallyAcceptableThan(T a, T b)
      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 element
      b - some comparable element
      Returns:
      "true" iff a is strictly less acceptable than b or a is equally acceptable as b
    • isIncomparable

      public abstract boolean isIncomparable(T a, T b)
      Returns "true" iff a and b are incomparable (i.e. this ranking is a partial ranking).
      Parameters:
      a - comparable element
      b - 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