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>

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:
  • Constructor Details

    • 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 Details

    • getRankingFunction

      public Map<T,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 class Functions<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 class Functions<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 class Functions<T>
      Parameters:
      element - the element being strengthened