chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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' }
}