Class CostObjective

java.lang.Object
com.eqixiac.equinix.design.objective.CostObjective
All Implemented Interfaces:
Objective

public final class CostObjective extends Object implements Objective
Expected monthly total of the portfolio from the run's CostModel: the same figure the result reports. Unknown when anything is unpriced (the total would understate the cost, and comparing understated totals rewards missing data), when any line is in a currency other than the spec's commercial.currency (comparing an all-EUR total with an all-USD one would rank by currency), or when there is no cost model; the explanation names the missing items or exchange rates.
  • Constructor Details

    • CostObjective

      public CostObjective()
  • Method Details

    • id

      public String id()
      Specified by:
      id in interface Objective
      Returns:
      the id weights refer to (for example Objective.LATENCY); stable, lower_snake_case
    • direction

      public Direction direction()
      Specified by:
      direction in interface Objective
      Returns:
      whether smaller or larger values are better
    • scale

      public ValueScale scale(DesignContext context)
      Scored by ratio to the cheapest feasible design: 7% dearer scores about 93, twice as dear 50. (A spread-based scale turned a 7% difference into 60 points and let a far-away metro win on a trivial saving; found live on 2026-11-12.)
      Specified by:
      scale in interface Objective
      Parameters:
      context - the facts of this run
      Returns:
      the scale
    • unit

      public String unit()
      Specified by:
      unit in interface Objective
      Returns:
      the unit of ObjectiveValue.value(), for display (for example ms, USD/month, score)
    • evaluate

      public ObjectiveValue evaluate(MetroPortfolio portfolio, DesignContext context)
      Description copied from interface: Objective
      Measures a portfolio.
      Specified by:
      evaluate in interface Objective
      Parameters:
      portfolio - the metros of one candidate design
      context - the facts of this run
      Returns:
      the measurement, or ObjectiveValue.unknown(String) when it cannot be made