Class BordaWeightVector

  • All Implemented Interfaces:
    WeightVector

    public class BordaWeightVector
    extends java.lang.Object
    implements WeightVector
    Implementation of the borda weight vector N elements are weighted from 0 to n-1 depending on their ranking function rank
    Author:
    Bastian Wolf
    • Constructor Summary

      Constructors 
      Constructor Description
      BordaWeightVector​(int size)
      constructor for the borda weight vector
    • Method Summary

      Modifier and Type Method Description
      int getWeight​(int n)
      returns the weight based on the rank in the ranking function.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BordaWeightVector

        public BordaWeightVector​(int size)
        constructor for the borda weight vector
        Parameters:
        size - the amount of domain elements in the preference order
    • Method Detail

      • getWeight

        public int getWeight​(int n)
        returns the weight based on the rank in the ranking function. e.g. the second-highest ranked element of five will get the weight (size=5)-1-(rank=1) = 5-1-1 = 3, where the highest will get weight 4 (5-1-0) and the last element will get weight 0, (5-1-4)
        Specified by:
        getWeight in interface WeightVector
        Parameters:
        n - the given parameter to compare with
        Returns:
        the weight for the given parameter