Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      RankingFunction()
      constructs a new, empty ranking function caller can use Map-method putAll to fill this empty ranking function
      RankingFunction​(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 function
      java.util.Map<T,​java.lang.Integer> getRankingFunction()
      returns the ranking function
      void strengthenElement​(T element)
      strengthens the given element in the ranking function
      void weakenElement​(T element)
      weakens the given element in the ranking function
      • 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 class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • 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 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 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