Class ExhaustiveSolver

java.lang.Object
com.eqixiac.equinix.design.solve.ExhaustiveSolver
All Implemented Interfaces:
Solver

public final class ExhaustiveSolver extends Object implements Solver
Examines every portfolio in the allowed size range and returns the exact trade-off frontier.

Equinix has on the order of 70 metros, so a design of up to three metros is at most about 50,000 portfolios and one of four about 800,000: small enough to enumerate. When the count would exceed maxPortfolios the solver narrows the candidate field to the metros that score best alone until the count fits, says so in DesignSolution.notes() and reports DesignSolution.exact() as false.

Scoring: each objective is scored 0..100 (100 = best) on the scale it declares (Objective.scale(DesignContext)): fixed scales for the built-in objectives, the spread of the feasible portfolios for an objective that declares none. The weighted score is the weight-averaged normalised score over the objectives that could be measured for that portfolio; an objective that is unknown for a portfolio contributes nothing and its weight is not redistributed, so missing data never raises a score. Ties are broken by Pareto-optimality (a dominated option never wins a tie), then fewer metros, then portfolio key; see Ranking. solveDetailed(SolveProblem) also keeps the evidence SensitivityAnalysis re-ranks.

  • Field Details

    • DEFAULT_MAX_PORTFOLIOS

      public static final long DEFAULT_MAX_PORTFOLIOS
      The default ceiling on portfolios examined in one run.
      See Also:
  • Constructor Details

    • ExhaustiveSolver

      public ExhaustiveSolver()
      Creates a solver with DEFAULT_MAX_PORTFOLIOS.
    • ExhaustiveSolver

      public ExhaustiveSolver(long maxPortfolios)
      Parameters:
      maxPortfolios - the most portfolios to examine before narrowing the candidate field; at least 1
  • Method Details

    • solve

      public DesignSolution solve(SolveProblem problem)
      Specified by:
      solve in interface Solver
      Parameters:
      problem - the candidates, objectives, constraints, weights and size limits
      Returns:
      the solution; never null, and DesignSolution.isFeasible() is false when nothing satisfies the constraints
    • solveDetailed

      public SolveRun solveDetailed(SolveProblem problem)
      Solves and keeps the evidence SensitivityAnalysis needs: the feasible set with raw values and, per constraint, the portfolios that failed only that constraint. To find those for a constraint that prunes metros (Constraint.admits(MetroFacts, DesignContext)), metros pruned by exactly one constraint are also enumerated when the widened field still fits the portfolio ceiling; such portfolios never count as feasible and are not included in DesignSolution.evaluated().
      Parameters:
      problem - the problem
      Returns:
      the solution and its evidence