Class Ranking
java.lang.Object
com.eqixiac.equinix.design.solve.Ranking
The scoring rules shared by
ExhaustiveSolver and SensitivityAnalysis, so a re-ranking
under other weights or over a relaxed set uses exactly the arithmetic the solver used.
- Normalisation: per objective, 0..100 (100 = best) on the objective's own
ValueScale: a fixed scale where the objective declares one (a percentage, a ratio to the best cost, an anchored latency), otherwise the spread of the set being ranked; an unknown value has no score (NaN). - Weighted score:
sum(weight x score) / sum(weight)over the objectives with a positive weight; an unknown score contributes nothing and its weight is not redistributed, so missing data never raises a score. - Order: higher weighted score; then Pareto-optimal before dominated (so the recommendation is never a dominated option that merely ties); then fewer metros; then portfolio key.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intbest(List<double[]> rows, Direction[] directions, double[] weights, List<MetroPortfolio> portfolios) static intbest(List<double[]> rows, Direction[] directions, ValueScale[] scales, double[] weights, List<MetroPortfolio> portfolios) static double[][]static double[][]normalise(List<double[]> rows, Direction[] directions, ValueScale[] scales) static Comparator<Integer> order(double[] weighted, boolean[] pareto, List<MetroPortfolio> portfolios) static boolean[]paretoFlags(List<double[]> rows, Direction[] directions) static double[]weighted(double[][] scores, double[] weights)
-
Method Details
-
normalise
-
normalise
public static double[][] normalise(List<double[]> rows, Direction[] directions, ValueScale[] scales) - Parameters:
rows- raw values, one row per option, NaN = unknowndirections- per objectivescales- per objective;null(or anullentry) means the spread of the set- Returns:
- normalised scores, same shape, NaN where the value is unknown
-
weighted
public static double[] weighted(double[][] scores, double[] weights) - Parameters:
scores- normalised scoresweights- per objective, non-negative- Returns:
- the weighted score of each option (0 for all when every weight is 0)
-
order
public static Comparator<Integer> order(double[] weighted, boolean[] pareto, List<MetroPortfolio> portfolios) - Parameters:
weighted- weighted scorespareto- whether each option is Pareto-optimal in the setportfolios- the options' portfolios- Returns:
- the ranking order as a comparator over option indexes, best first
-
best
public static int best(List<double[]> rows, Direction[] directions, double[] weights, List<MetroPortfolio> portfolios) - Parameters:
rows- raw valuesdirections- per objectiveweights- per objectiveportfolios- the options- Returns:
- the index of the option the rules recommend, or -1 for an empty set
-
best
public static int best(List<double[]> rows, Direction[] directions, ValueScale[] scales, double[] weights, List<MetroPortfolio> portfolios) - Parameters:
rows- raw valuesdirections- per objectivescales- per objective;nullmeans the spread of the setweights- per objectiveportfolios- the options- Returns:
- the index of the option the rules recommend, or -1 for an empty set
-
paretoFlags
-