| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod HasCapacityForMaximumNumberofConcurrentRuns ( | 
|   ScenarioManager scenariomanager, | 
|   Scenario activescenario, | 
|   Boolean isactivescenariocounted, | 
|   output String feedback_o | 
| ) declarative remote as Boolean | 
| { | 
|   TextBody: | 
|   [* | 
|     // edz1 Mar-22-2017 (created) | 
|     feedback_o := ''; | 
|     result := true; | 
|      | 
|     if( scenariomanager.IsSizingParameterOn() ) | 
|     {   | 
|       runcounter := counter( scenariomanager, ScenarioMP , scenario, MacroPlan::GetIsStatusRunning( scenario.OptimizerStatus() ) ); | 
|       activescenariorunningoptimizer := ifexpr( isnull( activescenario ), false , ifexpr( MacroPlan::GetIsStatusRunning( activescenario.astype( ScenarioMP ).OptimizerStatus() ), true, false ) );  | 
|       if(  activescenariorunningoptimizer and not isactivescenariocounted ) | 
|       { | 
|         runcounter := runcounter - 1 ; | 
|       } | 
|      | 
|       result := runcounter < scenariomanager.ResourceManager_SM().MaxConcurrentOptimizerRun(); | 
|       if ( not result ) | 
|       { | 
|         feedback_o := Translations::MP_ScenarioManager_MaxNumberOfConcurrentRunReached( scenariomanager.ResourceManager_SM().MaxConcurrentOptimizerRun() ); | 
|       }   | 
|     } | 
|     return result; | 
|   *] | 
| } |