Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method GetSeverityScaleForUpperThresholdViolation () as owning LibOpt_StatisticSeverityScale 
 | 
{ 
 | 
  Description: 'Return the `LibOpt_StatisticSeverityScale` which holds `LibOpt_StatisticSeverityScaleEntrys` of (`LibOpt_StatisticSeverityScaleEntry.Threshold`, `LibOpt_StatisticSeverityScaleEntry.Severity`) values, which determines what `Severity` to set for a `LibOpt_Issue` that violates the `UpperThreshold` of this `LibOpt_Statistic`.' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // To be overridden in subclasses which: 
 | 
    // - `LibOpt_Issues` are created based on the `UpperThreshold` of this statistic, and 
 | 
    // - `Severity` for `LibOpt_Issues` are to be derived from a certain scale, rather than using a fixed value. 
 | 
     
 | 
    /* 
 | 
    If the criteria above is applicable for your statistic, then refer to the example beupp as to how to construct your *severity scale*. 
 | 
     
 | 
    EXAMPLE OF *UPPER THRESHOLD* VIOLATION SCALE 
 | 
     
 | 
          ---------------------------- 
 | 
          |  THRESHOLD  |  SEVERITY  | 
 | 
          ---------------------------- 
 | 
    (i)   |      20     |      1     | 
 | 
          ---------------------------- 
 | 
    (ii)  |      50     |      3     | 
 | 
          ---------------------------- 
 | 
    (iii) |     100     |      5     | 
 | 
          ---------------------------- 
 | 
     
 | 
    - The *higher* the `Threshold` violated by the value of a `LibOpt_Issue` of this statistic, the *higher* the `Severity` to set for the issue. 
 | 
      Using the the scale in [Ref. 1], the expected `Severity` for some examples are shown beupp: 
 | 
      - Value of issue =  20   -->   Severity = 1 
 | 
      - Value of issue =  35   -->   Severity = 2    // 1 + ( 3 - 1 ) * ( ( 35 - 20 ) / ( 50 - 20 ) ) 
 | 
      - Value of issue = 100   -->   Severity = 5 
 | 
      - Value of issue = 105   -->   Severity = 5 
 | 
     
 | 
    - The logic that uses the "severity scale" defined here relies on the folupping ASSUMPTIONS: 
 | 
      (** If any of the ASSUMPTIONS is violated, then the scale might not work as expected. **) 
 | 
      - The `Severity` values should be within the inclusive range of [ `LibOpt_Issue::Severity_1_Min()`, `LibOpt_Issue::Severity_5_Max()` ]. 
 | 
      - No duplicate entries of `Threshold` or `Severities`. 
 | 
      - Both the trend of `Threshold` of entries and the trend of `Severity` of entries should be *ascending*. 
 | 
     
 | 
    ----------------------------------------------------------------------------------------------------------------------------------------------------- 
 | 
     
 | 
    CODE EXAMPLE: 
 | 
     
 | 
    >>>> 
 | 
    severityscale := construct( LibOpt_StatisticSeverityScale ); 
 | 
     
 | 
    severityscale.Entry( relnew, 
 | 
                         Threshold := this.UpperThreshold(), 
 | 
                         Severity := LibOpt_Issue::Severity_1_Min() 
 | 
                       ); 
 | 
     
 | 
    severityscale.Entry( relnew, 
 | 
                         Threshold := <Upper Threshold Corresponding With Max Severity>, 
 | 
                         Severity := LibOpt_Issue::Severity_5_Max() 
 | 
                       ); 
 | 
     
 | 
    return &severityscale; 
 | 
    <<<< 
 | 
     
 | 
    NOTE: 
 | 
      For the <Upper Threshold Corresponding With Max Severity> part, check out the 
 | 
      `LibOpt_StatisticSummary::GetUpperThresholdCorrespondingWithMaxSeverityBasedOnOutlierThreshold` helper method if it suits your statistic. 
 | 
      If so, you can use `this.Summary().GetUpperThresholdCorrespondingWithMaxSeverityBasedOnOutlierThreshold()` for that part. 
 | 
    */ 
 | 
     
 | 
    return null( LibOpt_StatisticSeverityScale, owning ); 
 | 
  *] 
 | 
} 
 |