Class RankingFunction<T>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<T,Integer>
org.tweetyproject.preferences.ranking.Functions<T>
org.tweetyproject.preferences.ranking.RankingFunction<T>
- Type Parameters:
T
- generic preference order type
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<T,
Integer>
This class is meant to provide ranking functions to given preference orders
and vice versa. To be implemented. A ranking function characterizes a
preference order uniquely as: 1.: rank: O -> N+ where O is the set of
elements in the preference order. 2.: the sum of all ranks for each element
in O is minimal
TODO exception handling for invalid preference orders (total preorder)
- Author:
- Bastian Wolf
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorDescriptionconstructs a new, empty ranking function caller can use Map-method putAll to fill this empty ranking functionthis constructor creates a ranking function using a given preference order -
Method Summary
Modifier and TypeMethodDescriptionthis method returns a preference order made out of an ranking functionreturns the ranking functionvoid
strengthenElement
(T element) strengthens the given element in the ranking functionvoid
weakenElement
(T element) weakens the given element in the ranking functionMethods inherited from class org.tweetyproject.preferences.ranking.Functions
containsKey, containsValue, get, getElementsByValue, getLevelingFunction, getPredecessors, getSuccessors, toString, values
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
Methods inherited from class java.util.AbstractMap
equals, hashCode
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
-
Constructor Details
-
RankingFunction
public RankingFunction()constructs a new, empty ranking function caller can use Map-method putAll to fill this empty ranking function -
RankingFunction
this constructor creates a ranking function using a given preference order- Parameters:
lf
- the given preference order
-
-
Method Details
-
getRankingFunction
returns the ranking function- Returns:
- ranking function
-
generatePreferenceOrder
this method returns a preference order made out of an ranking function- Specified by:
generatePreferenceOrder
in classFunctions<T>
- Returns:
- a preference order out of a given ranking function
-
weakenElement
weakens the given element in the ranking function- Specified by:
weakenElement
in classFunctions<T>
- Parameters:
element
- the element being weakened
-
strengthenElement
strengthens the given element in the ranking function- Specified by:
strengthenElement
in classFunctions<T>
- Parameters:
element
- the element being strengthened
-