Class BordaWeightVector
java.lang.Object
org.tweetyproject.preferences.aggregation.BordaWeightVector
- All Implemented Interfaces:
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
-
Method Summary
Modifier and TypeMethodDescriptionint
getWeight
(int n) returns the weight based on the rank in the ranking function.
-
Constructor Details
-
BordaWeightVector
public BordaWeightVector(int size) constructor for the borda weight vector- Parameters:
size
- the amount of domain elements in the preference order
-
-
Method Details
-
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 interfaceWeightVector
- Parameters:
n
- the given parameter to compare with- Returns:
- the weight for the given parameter
-