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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Quintiq file version 2.0
#parent: #root
Method ApplyNoiseThreshold (
  LibOpt_Task task
)
{
  TextBody:
  [*
    // mjn3 Jan-29-2020 (created)
    
    //  pispip.OptimizerFulfilledTargetInventoryQuantity( this.GetOptimalValue( program.TargetInvQtyVariables().Get( pispip ) ) ); 
    
    //pt.SetOptimizerQuantity( quantity );  
    
    //ptct.Quantity( this.GetOptimalValue( program.PTCampaignQtyVariables().Get( ptct.OperationInCampaign(), period ) ) );
    
    /*
    traverse( periodtaskoperation, 
              DependentDemandInputGroup, 
              dd, 
              dd.HasRegularProductForOptimizer() or dd.OperationInput().GetIsProductInOptimizerRun( runcontext.IsPostProcessing() ) )
    {
      fulfilledqty := this.GetOptimalValue( program.OperationDemandQtyVariables().Get( dd.OperationInput(), ptperiod ) );
    
      if( operation.HasLeadTime() )     // Get the dependent demands that is located at different period from the period of period task.
      {
        pispipperiods := construct( Period_MPs); 
        CapacityPlanningSuboptimizer::GetOperationDependentDemandPeriods( ptperiod, operation, pispipperiods );
    
        fulfilledqty := sum( pispipperiods, Elements, pispipperiod,
                             this.GetOptimalValue( program.PartialOperationDemandQtyVariables().Get( dd.OperationInput(), pispipperiod, ptperiod ) ) );
      }
    
      dd.OptimizerFulfilledQuantity( fulfilledqty );
    */
    
    /*
    traverse( scope.GetLeafSalesDemandInPeriodInRun(), Elements, sd, isnull( sd.OriginalSalesDemand() ) )
    {
      qty := this.GetOptimalValue( program.SalesDemandQtyVariables().Get( sd ) );
      sd.UpdateOptimizerFulfillment( true, qty );
      
      this.HandleFeasibleDelayedSalesDemand( sd, program, runcontext, scope );
    }
    */
    
    
    /*
    traverse( scope.GetAggregatedSalesDemandInPeriodInRun(), Elements, asdip ) // Aggregated does not have pisp asdip.ProductInStockingPoint_MP().GetIsInOptimizerRun()
    { 
      // No optimizer variables for AggregatedSalesDemandInPeriod
      // Traverse the children ( Disaggregated Sales demands )
      // skip postponed sales demand. Instead of using IsPostponed which requires a transaction propagate, we will just check for null OriginalSalesDemand
      traverse ( asdip, DisaggregatedSalesDemandInPeriod, dasdip, 
                 isnull( dasdip.OriginalSalesDemand() )
                 and scope.Contains( dasdip.AsPlanningBaseSalesDemandInPeriod().PISPIPInOptimizerRun() ) ) 
      {
        // Type    : DisaggregatedSalesDemandInPeriod
        // Variable: 'DisaggregatedSalesDemandQty' UoM: PISP
        var := this.GetOptimalValue( program.DisaggregatedSalesDemandQtyVariables().Get( dasdip ) );
        dasdip.UpdateOptimizerFulfillment( true, var );*/
    
    
    //postponed sales demand -- see handle feasible sales demand
    
    
    // product in trips
  *]
  InterfaceProperties { Accessibility: 'Module' }
}