Class MetroOptimizer
java.lang.Object
com.eqixiac.equinix.design.optimizer.MetroOptimizer
The Metro Optimizer: which set of Equinix metros best serves a
DesignSpec.
OptimizationResult result = MetroOptimizer.forSpec(fabric, spec).run();
result.getRecommended(); // the chosen metros, every objective, priced cost lines, constraint verdicts
result.getFrontier(); // every Pareto-optimal trade-off
result.getSensitivity(); // weight ranges, nearest alternative, binding constraints
result.toMarkdown();
The optimizer is an orchestrator. It gathers the facts once (FabricCatalogLoader: metros,
measured latencies, cloud reachability), prices with a RateCardCostModel, measures the
built-in objectives (BuiltInObjectives) plus any DesignPlugin objectives, applies the
built-in constraints (Constraints.forSpec(DesignSpec)) plus plug-in constraints, searches every admissible
set of metros with ExhaustiveSolver, analyses the answer's sensitivity, and places the
workloads on the chosen set. Every decision lives in those plug-ins.
Design size: constraints.minMetros (or the redundancy tier's minimum, or 1) to
constraints.maxMetros (default 3).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFluent convenience overDesignSpec: each call adds to the spec,MetroOptimizer.Builder.toSpec()returns it andMetroOptimizer.Builder.optimize()runsforSpec(FabricGateway, DesignSpec).static final classSetsDesignConstraintsand the budget.static final classAdds oneCloudIntent.static final classAdds oneSiteIntent.static final classAdds oneWorkloadIntent. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMost metros a design may use when the spec sets nomaxMetros. -
Method Summary
Modifier and TypeMethodDescriptionstatic MetroOptimizer.Builderbuilder(FabricGateway fabric) A fluent convenience that assembles aDesignSpecand runsforSpec(FabricGateway, DesignSpec).currencyConverter(CurrencyConverter converter) defaultRates(CurrencyConverter defaults) static MetroOptimizerforContext(CatalogDesignContext context) Optimises against prepared facts instead of live Fabric (offline what-ifs, tests, a cached catalogue).static MetroOptimizerforSpec(FabricGateway fabric, DesignSpec spec) Optimises a spec against live Fabric data (read-only).plugin(DesignPlugin plugin) run()Runs the optimisation.solver(ExhaustiveSolver exhaustiveSolver)
-
Field Details
-
DEFAULT_MAX_METROS
public static final int DEFAULT_MAX_METROSMost metros a design may use when the spec sets nomaxMetros.- See Also:
-
-
Method Details
-
forSpec
Optimises a spec against live Fabric data (read-only).- Parameters:
fabric- the Fabric APIspec- the design- Returns:
- a run to configure and
run()
-
forContext
Optimises against prepared facts instead of live Fabric (offline what-ifs, tests, a cached catalogue).- Parameters:
context- the facts; its spec is the design- Returns:
- a run to configure and
run()
-
builder
A fluent convenience that assembles aDesignSpecand runsforSpec(FabricGateway, DesignSpec).- Parameters:
fabric- the Fabric API- Returns:
- the builder
-
rateCard
- Parameters:
card- the rate card to price with; defaultRateCard.standardChain(fabric)(live Equinix, then reference figures)- Returns:
- this run
-
costModel
- Parameters:
model- a cost model replacing the defaultRateCardCostModel- Returns:
- this run
-
currencyConverter
- Parameters:
converter- a currency converter (for example a live FX feed) ranked below rates pinned in the spec and above the default sources; aDesignPlugin.currencyConverter()is used when this is unset- Returns:
- this run
-
defaultRates
- Parameters:
defaults- replaces the default rate sources (live ECB rates via Frankfurter, then the bundled table), for exampleCurrencyConverters.bundledOnly()for an offline run- Returns:
- this run
-
solver
- Parameters:
exhaustiveSolver- the solver (for example with another portfolio ceiling)- Returns:
- this run
-
plugin
- Parameters:
plugin- extra objectives and constraints;DesignPlugin.discover()finds classpath ones- Returns:
- this run
-
multicloudEnvironments
- Parameters:
catalog- the native multicloud environment catalogue (Beta) for the informational finding- Returns:
- this run
-
run
Runs the optimisation.- Returns:
- the result; never
null: when nothing is feasible the result says why - Throws:
IllegalArgumentException- when the spec has errors (DesignSpec.validate())
-