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
Quintiq file version 2.0
#parent: #root
Function CalcIsPruningCandidate
{
  TextBody:
  [*
    eis := this.MacroPlan().OptimizerMetaEIS(); 
    value := false; 
    if ( guard( eis.IsNeedEstimatedImprovementScores(), false ) // only compute when meta optimizer is active
         and not this.ProductInStockingPoint_MP().HasPostponableSalesDemand() ) // don't prune if possible some sales demand can be postponed, making arriving trips relevant
    {
      has_salesdemand := this.SalesDemandQuantity() > 0; 
      has_targetinventory := this.GetHasTargetInventory();
      has_mininventory := this.GetHasMinLevel();  
      
      hasnolocaldemand := not has_salesdemand and not has_targetinventory and not has_mininventory; 
      value :=   hasnolocaldemand 
                 and guard( this.NextPlanningPISPIP().IsPruningCandidate(), true ) // don't prune if future as some local demand
                 and guard( this.ParentOfProductDimension().astype( ProductInStockingPointInPeriodPlanning ).IsPruningCandidate(), true ); // don't prube if there is higher level sales demand
    }
    
    this.IsPruningCandidate( value );
  *]
  InterfaceProperties { Accessibility: 'Module' }
}