Class LevelingFunction<T>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<T,Integer>
org.tweetyproject.preferences.ranking.Functions<T>
org.tweetyproject.preferences.ranking.LevelingFunction<T>
- Type Parameters:
T
- the generic type used for this leveling function
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<T,
Integer>
This class is meant to provide leveling functions to given preference orders
and vice versa.
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
ConstructorsConstructorDescriptionconstructs a new, empty leveling function caller can use Map-method putAll to fill this empty leveling functionthis constructor creates a leveling function using a given preference order -
Method Summary
Modifier and TypeMethodDescriptionthis method returns a preference order made out of this leveling functionreturns this leveling functionvoid
strengthenElement
(T element) strengthens the given element in the leveling functionvoid
weakenElement
(T element) weakens the given element in the leveling functionMethods inherited from class org.tweetyproject.preferences.ranking.Functions
containsKey, containsValue, get, getElementsByValue, 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
-
LevelingFunction
public LevelingFunction()constructs a new, empty leveling function caller can use Map-method putAll to fill this empty leveling function -
LevelingFunction
this constructor creates a leveling function using a given preference order- Parameters:
po
- the given preference order
-
-
Method Details
-
getLevelingFunction
returns this leveling function- Overrides:
getLevelingFunction
in classFunctions<T>
- Returns:
- this leveling function
-
getRankingFunction
-
generatePreferenceOrder
this method returns a preference order made out of this leveling function- Specified by:
generatePreferenceOrder
in classFunctions<T>
- Returns:
- a preference order out of a given leveling function
-
weakenElement
weakens the given element in the leveling function- Specified by:
weakenElement
in classFunctions<T>
- Parameters:
element
- the element being weakened
-
strengthenElement
strengthens the given element in the leveling function- Specified by:
strengthenElement
in classFunctions<T>
- Parameters:
element
- the element being strengthened
-