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
Quintiq file version 2.0
#parent: #root
Method ResetDependentDemandInputGroupOptimizerFulfillment (
  LibOpt_Scope scope
)
{
  Description: 'Reset the optimizer fulfillment of dependent deamand in group for this period task, also the optimizer fulfillment of downstream dependent demands of all its new supplies'
  TextBody:
  [*
    // soh yee Feb-14-2015 (created)
    
    // Example we have the following operations and we're going to set the supply qty for C to 0 (also means PT1 qty = 0).
    // A & B -> PT1 -> C
    // C & D -> PT2 -> E
    
    // Step 1: Reset the fulfilled qty of A & B. Since supply of C = 0, DD A & B qty will be 0, optimizer fulfilled qty shoud also be reset.
    traverse( this, DependentDemandInputGroup, ddig )
    {
      ddig.OptimizerFulfilledQuantity( 0.0 );
    }
    
    traverse( this, NewSupply.ProductInStockingPointInPeriodPlanningLeaf, pispip )
    {
      // Step 2 & 3: Optimizer fulfillment and Optimizer reserved qty is reset to 0 for greedy dependent demand fulfillment.
      pispip.ResetQuantitySetByOptimizer( scope );
    }
  *]
  InterfaceProperties { Accessibility: 'Module' }
}