Record Class N1Survival

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.resilience.N1Survival
Record Components:
known - false when there is nothing to protect (no placed workload, no site with a known latency)
worstSurvival - the lowest ScenarioOutcome.relativeSurvival() over the N-1 scenarios, 0..1 (1 when there is no N-1 scenario); NaN when unknown
worst - the scenario that gives it (the baseline when nothing is served even then), or null
scenarios - how many N-1 scenarios were simulated
zoneViolations - zone violations found at baseline or in any N-1 scenario
reason - 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 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 the WorkloadPlacer) and simulates every single-element failure.
      Parameters:
      portfolio - the metros
      context - the facts of the run
      options - options; null for the defaults
      Returns:
      the measurement
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • known

      public boolean known()
      Returns the value of the known record component.
      Returns:
      the value of the known record component
    • worstSurvival

      public double worstSurvival()
      Returns the value of the worstSurvival record component.
      Returns:
      the value of the worstSurvival record component
    • worst

      public ScenarioOutcome worst()
      Returns the value of the worst record component.
      Returns:
      the value of the worst record component
    • scenarios

      public int scenarios()
      Returns the value of the scenarios record component.
      Returns:
      the value of the scenarios record component
    • zoneViolations

      public List<String> zoneViolations()
      Returns the value of the zoneViolations record component.
      Returns:
      the value of the zoneViolations record component
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component