yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
Quintiq file version 2.0
#parent: #root
Method AddTermsToInventorySpecificationConstraints (
  CapacityPlanningSuboptimizer_CapacityPlanningAlgorithm program,
  const ProductInStockingPointInPeriodPlanning pispip,
  const LibOpt_Scope scope,
  Real scalefactor_demandfulfillmentinpispip_constr,
  Real scalefactor_rhs_constr
) const
{
  Description: 'If the inventory specification is in days, add terms for the min/max/target inventory based on the fulfilled sales demands and dependent demands of the next periods'
  TextBody:
  [*
    
    if( pispip.GetHasTargetInventory() and pispip.GetHasTargetInDays() )
    {
      targetconst := program.TargetInventoryLevelConstraints().Get( pispip );
      targetindays := pispip.TargetInDays();
      this.AddTermsToInventorySpecificationConstraint( program, targetconst, pispip, targetindays, scope, scalefactor_demandfulfillmentinpispip_constr, scalefactor_rhs_constr );
    }
    
    if( pispip.GetHasMinLevel() and pispip.GetHasMinLevelInDays() )
    {
      minconst := program.MinInventoryLevelConstraints().Get( pispip );
      minindays := pispip.MinLevelInDays();
      this.AddTermsToInventorySpecificationConstraint( program, minconst, pispip, minindays, scope, scalefactor_demandfulfillmentinpispip_constr, scalefactor_rhs_constr );
    }
    
    if( pispip.GetHasMaxLevel() and pispip.GetHasMaxLevelInDays() )
    {
      maxconst := program.MaxInventoryLevelConstraints().Get( pispip );
      maxindays := pispip.MaxLevelInDays();
      this.AddTermsToInventorySpecificationConstraint( program, maxconst, pispip, maxindays, scope, scalefactor_demandfulfillmentinpispip_constr, scalefactor_rhs_constr );  
    }
  *]
  InterfaceProperties { Accessibility: 'Module' }
}