Class RankingFunction<T>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<T,java.lang.Integer>
-
- net.sf.tweety.preferences.ranking.Functions<T>
-
- net.sf.tweety.preferences.ranking.RankingFunction<T>
-
- Type Parameters:
T- generic preference order type
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<T,java.lang.Integer>
public class RankingFunction<T> extends Functions<T>
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description RankingFunction()constructs a new, empty ranking function caller can use Map-method putAll to fill this empty ranking functionRankingFunction(LevelingFunction<T> lf)this constructor creates a ranking function using a given preference order
-
Method Summary
Modifier and Type Method Description PreferenceOrder<T>generatePreferenceOrder()this method returns a preference order made out of an ranking functionjava.util.Map<T,java.lang.Integer>getRankingFunction()returns the ranking functionvoidstrengthenElement(T element)strengthens the given element in the ranking functionvoidweakenElement(T element)weakens the given element in the ranking function-
Methods inherited from class net.sf.tweety.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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RankingFunction
public RankingFunction()
constructs a new, empty ranking function caller can use Map-method putAll to fill this empty ranking function
-
RankingFunction
public RankingFunction(LevelingFunction<T> lf)
this constructor creates a ranking function using a given preference order- Parameters:
lf- the given preference order
-
-
Method Detail
-
getRankingFunction
public java.util.Map<T,java.lang.Integer> getRankingFunction()
returns the ranking function- Returns:
- ranking function
-
generatePreferenceOrder
public PreferenceOrder<T> generatePreferenceOrder()
this method returns a preference order made out of an ranking function- Specified by:
generatePreferenceOrderin classFunctions<T>- Returns:
- a preference order out of a given ranking function
-
weakenElement
public void weakenElement(T element)
weakens the given element in the ranking function- Specified by:
weakenElementin classFunctions<T>- Parameters:
element- the element being weakened
-
strengthenElement
public void strengthenElement(T element)
strengthens the given element in the ranking function- Specified by:
strengthenElementin classFunctions<T>- Parameters:
element- the element being strengthened
-
-