Class NumericalPartialOrder<T extends Formula,R extends BeliefBase>
java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<R,T>
org.tweetyproject.comparator.GeneralComparator<T,R>
org.tweetyproject.comparator.NumericalPartialOrder<T,R>
- Type Parameters:
T- Some FormularR- Some Beliefbase
- All Implemented Interfaces:
Comparator<T>,Map<T,,Double> Interpretation<R,T>
public class NumericalPartialOrder<T extends Formula,R extends BeliefBase>
extends GeneralComparator<T,R>
implements Map<T,Double>
This class provides an acceptability interpretation of arguments by assigning
them real values. Often larger values indicate more acceptability, but some
semantics use other ways of ranking the values.
- Author:
- Matthias Thimm, Anna Gessler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPossible sorting types for the numerical values. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic doublePrecision for comparing values.The method used for ordering the numerical values according to acceptability. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty numerical argument ranking.NumericalPartialOrder(Collection<T> args, double initialvalue) Creates a new ranking with the given set of arguments and the given initial ranking value. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleanReturn true if this ranking contains incomparable arguments, false otherwisebooleancontainsKey(Object arg0) booleancontainsValue(Object arg0) entrySet()Return the sorting type that is used for ranking values (descending, ascending or sorted lexicographically)booleanisEmpty()booleanisIncomparable(T a, T b) Returns "true" iff a and b are incomparable (i.e.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.keySet()voidbooleanChecks whether this interpretation satisfies the given knowledge base.booleanChecks whether this interpretation satisfies the given formula.voidsetSortingType(NumericalPartialOrder.SortingType sortingType) Set the sorting type for ranking values.intsize()toString()values()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, thenComparingLongMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
PRECISION
public static double PRECISIONPrecision for comparing values. -
sortingType
The method used for ordering the numerical values according to acceptability.
-
-
Constructor Details
-
NumericalPartialOrder
public NumericalPartialOrder()Creates a new empty numerical argument ranking. -
NumericalPartialOrder
Creates a new ranking with the given set of arguments and the given initial ranking value.- Parameters:
args- some set of comparable elementsinitialvalue- an initial value that will be assigned to all comparable elements
-
-
Method Details
-
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
-
toString
-
clear
-
containsKey
- Specified by:
containsKeyin interfaceMap<T extends Formula,R extends BeliefBase>
-
containsValue
- Specified by:
containsValuein interfaceMap<T extends Formula,R extends BeliefBase>
-
entrySet
-
get
-
isEmpty
-
keySet
-
put
-
putAll
-
remove
-
size
-
values
-
getSortingType
Return the sorting type that is used for ranking values (descending, ascending or sorted lexicographically)- Returns:
- the sorting type that is used for ranking values (descending, ascending or sorted lexicographically)
-
setSortingType
Set the sorting type for ranking values. For example, the "ascending" type means that smaller values signify a higher ranking than bigger values.- Parameters:
sortingType- seesortingTypefor a description of the available sorting methods
-
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()Description copied from class:GeneralComparatorReturn true if this ranking contains incomparable arguments, false otherwise- Specified by:
containsIncomparableArgumentsin classGeneralComparator<T extends Formula,R extends BeliefBase> - Returns:
- true if this ranking contains incomparable arguments, false otherwise
-
satisfies
Description copied from interface:InterpretationChecks whether this interpretation satisfies the given formula.- Specified by:
satisfiesin interfaceInterpretation<T extends Formula,R extends BeliefBase> - 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.- Specified by:
satisfiesin interfaceInterpretation<T extends Formula,R extends BeliefBase> - 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.
-