admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
40
41
42
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' }
}