Class RiskBoundaries

java.lang.Object
be.kuleuven.cs.distrinet.sparta.analysis.util.RiskBoundaries

public final class RiskBoundaries extends Object
Pure computation of the {min, med, max} risk boundaries used to drive the colour scale of the threat list. Extracted to be unit testable and to make the empty-list / non-positive fallback explicit.
  • Method Details

    • compute

      public static double[] compute(double max)
      Computes the colour-scale boundaries for a given maximum potential risk.
      Parameters:
      max - the maximum potential risk over all threats (0 when the list is empty)
      Returns:
      a {min, med, max} array; a fixed {-1, 0, 1} fallback is returned when max <= 0 to keep the scale well defined