Record Class N1Survival
java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.resilience.N1Survival
- Record Components:
known-falsewhen there is nothing to protect (no placed workload, no site with a known latency)worstSurvival- the lowestScenarioOutcome.relativeSurvival()over the N-1 scenarios, 0..1 (1 when there is no N-1 scenario);NaNwhen unknownworst- the scenario that gives it (the baseline when nothing is served even then), ornullscenarios- how many N-1 scenarios were simulatedzoneViolations- zone violations found at baseline or in any N-1 scenarioreason- why it is unknown, or a description of the worst scenario
public record N1Survival(boolean known, double worstSurvival, ScenarioOutcome worst, int scenarios, List<String> zoneViolations, String reason)
extends Record
How much of a portfolio's baseline service survives its worst single-element failure, measured by
simulation: the shared core of
SimulatedResilienceObjective and MinSurvivalConstraint.-
Constructor Summary
ConstructorsConstructorDescriptionN1Survival(boolean known, double worstSurvival, ScenarioOutcome worst, int scenarios, List<String> zoneViolations, String reason) Makes the list immutable. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanknown()Returns the value of theknownrecord component.static N1Survivalof(MetroPortfolio portfolio, DesignContext context, ResilienceOptions options) Builds the portfolio's graph (placing workloads with theWorkloadPlacer) and simulates every single-element failure.reason()Returns the value of thereasonrecord component.intReturns the value of thescenariosrecord component.final StringtoString()Returns a string representation of this record class.worst()Returns the value of theworstrecord component.doubleReturns the value of theworstSurvivalrecord component.Returns the value of thezoneViolationsrecord component.
-
Constructor Details
-
N1Survival
public N1Survival(boolean known, double worstSurvival, ScenarioOutcome worst, int scenarios, List<String> zoneViolations, String reason) Makes the list immutable.
-
-
Method Details
-
of
public static N1Survival of(MetroPortfolio portfolio, DesignContext context, ResilienceOptions options) Builds the portfolio's graph (placing workloads with theWorkloadPlacer) and simulates every single-element failure.- Parameters:
portfolio- the metroscontext- the facts of the runoptions- options;nullfor the defaults- Returns:
- the measurement
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
known
-
worstSurvival
public double worstSurvival()Returns the value of theworstSurvivalrecord component.- Returns:
- the value of the
worstSurvivalrecord component
-
worst
-
scenarios
-
zoneViolations
Returns the value of thezoneViolationsrecord component.- Returns:
- the value of the
zoneViolationsrecord component
-
reason
-