Interface Objective

All Known Implementing Classes:
CarbonObjective, ComplianceObjective, CostObjective, LatencyObjective, ProviderCoverageObjective, ResilienceObjective, SimulatedResilienceObjective

public interface Objective
One measurable quality of a portfolio, in its own unit. Implementations must be pure functions of their arguments (no I/O, no clock): everything they need is on the DesignContext.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Share of the stated compliance and sovereignty zones the portfolio satisfies, 0 to 100.
    static final String
    Total monthly cost of the portfolio in the spec's currency.
    static final String
    Site-weighted round-trip latency from the sites to their nearest metro in the portfolio, in ms.
    static final String
    Share of the required clouds and service providers reachable from the portfolio, 0 to 100.
    static final String
    How well the portfolio survives losing a metro or a region, 0 to 100.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    evaluate(MetroPortfolio portfolio, DesignContext context)
    Measures a portfolio.
    id()
     
    default ValueScale
    How this objective's values become 0..100 scores for the weighted ranking.
     
  • Field Details

    • LATENCY

      static final String LATENCY
      Site-weighted round-trip latency from the sites to their nearest metro in the portfolio, in ms.
      See Also:
    • COST

      static final String COST
      Total monthly cost of the portfolio in the spec's currency.
      See Also:
    • PROVIDER_COVERAGE

      static final String PROVIDER_COVERAGE
      Share of the required clouds and service providers reachable from the portfolio, 0 to 100.
      See Also:
    • RESILIENCE

      static final String RESILIENCE
      How well the portfolio survives losing a metro or a region, 0 to 100.
      See Also:
    • COMPLIANCE

      static final String COMPLIANCE
      Share of the stated compliance and sovereignty zones the portfolio satisfies, 0 to 100.
      See Also:
  • Method Details

    • id

      String id()
      Returns:
      the id weights refer to (for example LATENCY); stable, lower_snake_case
    • direction

      Direction direction()
      Returns:
      whether smaller or larger values are better
    • unit

      String unit()
      Returns:
      the unit of ObjectiveValue.value(), for display (for example ms, USD/month, score)
    • evaluate

      ObjectiveValue evaluate(MetroPortfolio portfolio, DesignContext context)
      Measures a portfolio.
      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
    • scale

      default ValueScale scale(DesignContext context)
      How this objective's values become 0..100 scores for the weighted ranking. The default is the spread of the options being compared (ValueScale.range()); an objective that knows what a good value is should return a fixed scale instead, so a small difference stays small.
      Parameters:
      context - the facts of this run
      Returns:
      the scale