Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method DoInitializeNonConst ( 
 | 
  LibOpt_Task task 
 | 
) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    start := OS::PrecisionCounter();  
 | 
    this.CheckScalingFactors(); // Prevent badly initialized zero or negative scaling factors 
 | 
     
 | 
    this.BaseForActualTime( DateTime::ActualTime() );  
 | 
    this.DebugStoreScopeInfo( task.Scope() );  
 | 
    this.DetailsCPLEX( '' );  
 | 
    this.AllLevelsOptimal( true );  
 | 
     
 | 
    scope := task.Scope();  
 | 
    this.SetPeriodTaskOperationRelationInScope( scope ); // set relation so we can go from Operation in scope directly to its period tasks in scope 
 | 
     
 | 
    runcontext := this.GetRunContextConst();  
 | 
     
 | 
    this.CreateSubOptimizerLevels( runcontext, task );  
 | 
     
 | 
    if ( runcontext.IsMetaIteration() and this.Optimization().astype( Optimization ).DebugMode() )  
 | 
    { 
 | 
      valuesmodel := this.MPVarValuesModel();  
 | 
      valuesmodel.KPIStockingPointCapacity( this.MacroPlan().GetKPIStockingPointCapacity( scope.GetStockingPointInPeriodInOptimizerRunConst() ) );  
 | 
      valuesmodel.KPIMaxInventoryLevel( this.MacroPlan().GetKPIMaximumInventoryLevel(  scope.GetPISPIPInOptimizerRunConst() ) );  
 | 
      unitperiods := scope.GetUnitPeriodInOptimizerRunConst();  
 | 
      valuesmodel.KPIUnitCapacity( this.MacroPlan().GetKPIUnitCapacity( unitperiods ) );   
 | 
      valuesmodel.KPILotSizeTripContinuous( this.MacroPlan().GetKPILotSizeTripContinuous( unitperiods ) );  
 | 
    } 
 | 
     
 | 
    this.SynchronizeTools( scope ); 
 | 
     
 | 
    // Initialize the scaling types instances (used in the auto-scaling) 
 | 
    if( this.IsAutoScalingEnabled() ) 
 | 
    { 
 | 
      this.InitScalingTypes(); 
 | 
    } 
 | 
     
 | 
    SelectorMeta::ComputeFirstLastPISPIPInScope( scope ); // we need to ensure the relation pisp.LatestLeafPISPIPInScope has been set. We don't want to rely on the fact it has been  
 | 
                                                                 // computed in the selector already, so we recompute not to break componentized-structure. 
 | 
    end := OS::PrecisionCounter();  
 | 
    durationinit_nc := (end - start)/ OS::PrecisionCounterFrequency();  
 | 
    debuginfo(  'Duration non const init =', durationinit_nc );  
 | 
    task.Log( 'Duration init non const = ' + [String] durationinit_nc ); 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |