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
-
-
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 functionvoid
strengthenElement(T element)
strengthens the given element in the ranking functionvoid
weakenElement(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
-
-
-
-
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:
generatePreferenceOrder
in 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:
weakenElement
in classFunctions<T>
- Parameters:
element
- the element being weakened
-
strengthenElement
public void strengthenElement(T element)
strengthens the given element in the ranking function- Specified by:
strengthenElement
in classFunctions<T>
- Parameters:
element
- the element being strengthened
-
-