Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method InitVariablesForOperationPeriodTask_AddDemandVar ( 
 | 
  CapacityPlanningSuboptimizer_CapacityPlanningAlgorithm program, 
 | 
  const RunContextForCapacityPlanning runcontext, 
 | 
  const LibOpt_Scope scope, 
 | 
  const OperationInput input, 
 | 
  const Period_MP period 
 | 
) const 
 | 
{ 
 | 
  Description: 'Initialize all variables related to period task operation, including lot sizes, campaign, etc' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // OperationDemandQty variable UoM: Input PISP 
 | 
     
 | 
    program.OperationDemandQtyVariables().New( input, period );     // Total fulfilled demand quantity for operation input on that period 
 | 
     
 | 
    // Input lot size 
 | 
    if( ( runcontext.UseLotSize() or runcontext.UseLotCost() ) 
 | 
        and input.ProductInStockingPoint_MP().HasInputLotSize() 
 | 
        and period.IsWithinLotSizeHorizon() ) 
 | 
    { 
 | 
      // OperationInputNrOfLots variable UoM: Number 
 | 
      operationinputnroflotsvar := program.OperationInputNrOfLotsVariables().New( input, period ); 
 | 
      this.SetStartSolutionOperationInputNrOfLotsVar( operationinputnroflotsvar, input, period );  
 | 
       
 | 
      // If this is a sliding windows run and the period is not in the sliding window, 
 | 
      // then relax the integer variable. 
 | 
      if( runcontext.IsSlidingWindowsRun() 
 | 
          and not period.GetIsInSlidingWindow( scope ) ) 
 | 
      { 
 | 
        operationinputnroflotsvar.VariableType( 'Continuous' ); 
 | 
      } 
 | 
           
 | 
      // OperationInputLotSizeUnder variable UoM: Unit 
 | 
      // Additional quantity required to reach a multiple of the input lot size 
 | 
      program.OperationInputLotSizeUnderVariables().New( input, period ); 
 | 
      program.OperationInputLotSizeOverVariables().New( input, period );    
 | 
    } 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |