Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Function CalcBenchmarkForDuration 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    // desmondt Oct-1-2014 (created) 
 | 
     
 | 
    value := ''; 
 | 
     
 | 
     
 | 
    if( this.IsForBenchmarking() 
 | 
        and this.Feasibility() = Translations::MP_GlobalParameters_GetOptimizerFeasibleStatus() ) 
 | 
    { 
 | 
      testinstancefromkt := this.GetTestInstanceFromKT(); 
 | 
      if( not isnull( testinstancefromkt ) ) 
 | 
      { 
 | 
        expectedduration := Duration::Seconds( testinstancefromkt.ExpectedDurationSeconds() ); 
 | 
     
 | 
        if( this.GetHasResultWithinAcceptableRange( expectedduration ) ) 
 | 
        { 
 | 
          value := Translations::LibOBT_Benchmarker_RunResultMatched(); 
 | 
        } 
 | 
        else if( this.Duration() < expectedduration ) 
 | 
        { 
 | 
          value := Translations::LibOBT_Benchmarker_RunResultImproved(); 
 | 
        } 
 | 
        else 
 | 
        { 
 | 
          value := Translations::LibOBT_Benchmarker_RunResultWorse(); 
 | 
        } 
 | 
      } 
 | 
    } 
 | 
    this.BenchmarkForDuration( value ); 
 | 
  *] 
 | 
} 
 |