Class Ranking

java.lang.Object
com.eqixiac.equinix.design.solve.Ranking

public final class Ranking extends Object
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 Details

    • normalise

      public static double[][] normalise(List<double[]> rows, Direction[] directions)
      Parameters:
      rows - raw values, one row per option, NaN = unknown
      directions - per objective
      Returns:
      normalised scores, same shape, NaN where the value is unknown
    • normalise

      public static double[][] normalise(List<double[]> rows, Direction[] directions, ValueScale[] scales)
      Parameters:
      rows - raw values, one row per option, NaN = unknown
      directions - per objective
      scales - per objective; null (or a null entry) 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 scores
      weights - 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 scores
      pareto - whether each option is Pareto-optimal in the set
      portfolios - 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 values
      directions - per objective
      weights - per objective
      portfolios - 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 values
      directions - per objective
      scales - per objective; null means the spread of the set
      weights - per objective
      portfolios - the options
      Returns:
      the index of the option the rules recommend, or -1 for an empty set
    • paretoFlags

      public static boolean[] paretoFlags(List<double[]> rows, Direction[] directions)
      Parameters:
      rows - raw values
      directions - per objective
      Returns:
      for each row, whether no other row dominates it