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
Quintiq file version 2.0
#parent: #root
Method InitConstraintsForOperationDependentDemandInPeriod_AddConstraint (
  CapacityPlanningSuboptimizer_CapacityPlanningAlgorithm program,
  const Period_MP ptperiod,
  const Period_MP ddperiod,
  const OperationInput input,
  Real scalefactor_operationdemandqty_constddperiod,
  Real scalefactor_partialoperationdemandqty_constddperiod,
  Real scalefactor_rhs_constddperiod
) const
{
  Description:
  [*
    A constraint to calculate the dependent demand quantity of an input per bucket.
    Specially for dependent demand belonging to operation with pre-processing duration.
  *]
  TextBody:
  [*
    // constddperiod constraint UoM: input PISP UoM
    constddperiod := program.OperationDependentDemandPeriodQtyConstraints().Find( input, ddperiod );
    if( isnull( constddperiod ) )
    {
      constddperiod := program.OperationDependentDemandPeriodQtyConstraints().New( input, ddperiod );
      constddperiod.Sense( '=' );
      constddperiod.RHSValue( 0.0 * scalefactor_rhs_constddperiod );
        
      // Term UoM: input PISP UoM
      
      constddperiod.NewTerm( -1.0 * scalefactor_operationdemandqty_constddperiod, program.OperationDemandQtyVariables().Get( input, ddperiod ) );
    }
    
    constddperiod.NewTerm( 1.0 * scalefactor_partialoperationdemandqty_constddperiod, program.PartialOperationDemandQtyVariables().Get( input, ddperiod, ptperiod ) );
  *]
  InterfaceProperties { Accessibility: 'Module' }
}