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
Quintiq file version 2.0
#parent: #root
Method GetIsFeasibleInAllLevels (
  output Strings feedback_o,
  output Strings feedbacklist
) declarative remote as Boolean
{
  Description: 'Check if optimizer run completes all levels in the optimizer strategy'
  TextBody:
  [*
    // desmondt Jul-15-2015 (created)
    isvalid := true;
    
    if( this.Feasibility() <> '' )
    {
      //checks for case where user has aborted the run, if so, do not show sanity check error
      isvalid := forall( this, AlgorithmRunLevel, arl, arl.IsFeasible() ) or this.IsAborted();
    
      if( not isnull( feedback_o ) and not isvalid )
      {
        instance := AlgorithmRun::GetInstanceText( this );
        message := ifexpr( this.ErrorDescription() = '', // If there is no error
                           this.OptimizerRemark(),
                           this.ErrorDescription() );
        msg := SanityCheckMessage::GetFormattedMessage( instance, message );
        feedback_o.Add( msg );
        if( not isnull( feedbacklist ) )
        {
          feedbacklist.Add( SanityCheckCategoryLevel::GetSanityCheckCategoryPlanningIssue() );
        }
      }
    }
    
    return isvalid;
  *]
}