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
FieldsModifier and TypeFieldDescriptionstatic final StringShare of the stated compliance and sovereignty zones the portfolio satisfies, 0 to 100.static final StringTotal monthly cost of the portfolio in the spec's currency.static final StringSite-weighted round-trip latency from the sites to their nearest metro in the portfolio, in ms.static final StringShare of the required clouds and service providers reachable from the portfolio, 0 to 100.static final StringHow well the portfolio survives losing a metro or a region, 0 to 100. -
Method Summary
Modifier and TypeMethodDescriptionevaluate(MetroPortfolio portfolio, DesignContext context) Measures a portfolio.id()default ValueScalescale(DesignContext context) How this objective's values become 0..100 scores for the weighted ranking.unit()
-
Field Details
-
LATENCY
Site-weighted round-trip latency from the sites to their nearest metro in the portfolio, in ms.- See Also:
-
COST
-
PROVIDER_COVERAGE
Share of the required clouds and service providers reachable from the portfolio, 0 to 100.- See Also:
-
RESILIENCE
How well the portfolio survives losing a metro or a region, 0 to 100.- See Also:
-
COMPLIANCE
Share of the stated compliance and sovereignty zones the portfolio satisfies, 0 to 100.- See Also:
-
-
Method Details
-
id
-
direction
Direction direction()- Returns:
- whether smaller or larger values are better
-
unit
String unit()- Returns:
- the unit of
ObjectiveValue.value(), for display (for examplems,USD/month,score)
-
evaluate
Measures a portfolio.- Parameters:
portfolio- the metros of one candidate designcontext- the facts of this run- Returns:
- the measurement, or
ObjectiveValue.unknown(String)when it cannot be made
-
scale
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
-