| Quintiq file version 2.0 | 
| #parent: #root | 
| Method AppendLastRunResultToLogFile ( | 
|   MathematicalProgram program | 
| ) | 
| { | 
|   Description: 'For debugging propose mainly for investigation of numerical issue' | 
|   TextBody: | 
|   [* | 
|     algorithmrun := this.MacroPlan().GetLastAlgorithmRun();  | 
|     level := this.CurrentSubOptimizerLevel().LevelNumber();  | 
|      | 
|     algorithmrunlevel := algorithmrun.GetAlgorithmRunLevel( level ); | 
|     if ( not isnull( algorithmrunlevel ) )  | 
|     {        | 
|       id := Translations::Algorithm_MP_RunIDWithoutFilename( [String]algorithmrun.TestInstanceID(), //test instance | 
|                                                             [String]level, //level | 
|                                                             ( algorithmrunlevel.End() - algorithmrunlevel.Start() ).AsQUILL(), // duration - algorithmrunlevel.Duration() is not propagated yet | 
|                                                             Duration::Seconds( algorithmrunlevel.TimeLimit() ).AsQUILL(), //time limit | 
|                                                             [String]algorithmrunlevel.HasOptimalSolution(), //optimal | 
|                                                             [String]algorithmrunlevel.RelativeGapResult(),  //RGap | 
|                                                             [String]algorithmrunlevel.AbsoluteGapResult(),  //AGap | 
|                                                             [String]algorithmrunlevel.ProgramGoalValue() ) //goal value | 
|             // + Any addition information required | 
|        | 
|       if( program.ProblemFileName() <> '' ) | 
|       { | 
|         id := Translations::Algorithm_MP_RunIDWithFilename( id, program.ProblemFileName() ); | 
|       } | 
|        | 
|       program.RunID( id ); | 
|     } | 
|     else | 
|     { | 
|       debuginfo( 'alg run level null', level );  | 
|     } | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |