Class ExhaustiveSolver
- All Implemented Interfaces:
Solver
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe default ceiling on portfolios examined in one run. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a solver withDEFAULT_MAX_PORTFOLIOS.ExhaustiveSolver(long maxPortfolios) -
Method Summary
Modifier and TypeMethodDescriptionsolve(SolveProblem problem) solveDetailed(SolveProblem problem) Solves and keeps the evidenceSensitivityAnalysisneeds: the feasible set with raw values and, per constraint, the portfolios that failed only that constraint.
-
Field Details
-
DEFAULT_MAX_PORTFOLIOS
public static final long DEFAULT_MAX_PORTFOLIOSThe default ceiling on portfolios examined in one run.- See Also:
-
-
Constructor Details
-
ExhaustiveSolver
public ExhaustiveSolver()Creates a solver withDEFAULT_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
- Specified by:
solvein interfaceSolver- Parameters:
problem- the candidates, objectives, constraints, weights and size limits- Returns:
- the solution; never
null, andDesignSolution.isFeasible()is false when nothing satisfies the constraints
-
solveDetailed
Solves and keeps the evidenceSensitivityAnalysisneeds: 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 inDesignSolution.evaluated().- Parameters:
problem- the problem- Returns:
- the solution and its evidence
-