Class BudgetConstraint
java.lang.Object
com.eqixiac.equinix.design.constraint.BudgetConstraint
- All Implemented Interfaces:
Constraint
The expected monthly cost must not exceed
commercial.budgetMaxMonthly. Compared in ONE
currency only: when the priced lines are in another currency, or span several, the budget is
reported as not evaluable and the design is not rejected; amounts are never converted or compared
across currencies. When items are unpriced the priced part is a lower bound: a design is rejected
only if that lower bound already exceeds the budget.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheck(MetroPortfolio portfolio, DesignContext context) Checks a whole portfolio.id()booleanusesCost()WhetherConstraint.check(MetroPortfolio, DesignContext)prices the portfolio throughDesignContext.costModel().Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Constraint
admitsModifier and TypeMethodDescriptiondefault booleanadmits(MetroFacts metro, DesignContext context) Cheap per-metro pruning before portfolios are formed.
-
Field Details
-
ID
-
-
Constructor Details
-
BudgetConstraint
public BudgetConstraint()
-
-
Method Details
-
id
- Specified by:
idin interfaceConstraint- Returns:
- a stable id, lower_snake_case (for example
max_latency)
-
usesCost
public boolean usesCost()Description copied from interface:ConstraintWhetherConstraint.check(MetroPortfolio, DesignContext)prices the portfolio throughDesignContext.costModel(). A solver uses it to price ahead, in one batch, the portfolios that reach a pricing constraint (CostModel.prepare(Collection, DesignContext)); the verdicts are the same either way. The default isfalse: a pricing constraint that says so is only slower, never wrong.- Specified by:
usesCostin interfaceConstraint- Returns:
true: the budget is checked against the priced portfolio
-
check
Description copied from interface:ConstraintChecks a whole portfolio.- Specified by:
checkin interfaceConstraint- Parameters:
portfolio- the candidate designcontext- the facts of this run- Returns:
- the verdict with its reason
-