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
Quintiq file version 2.0
#parent: #root
Method PISPGapFill (
  LibOpt_Scope scope,
  RunContextForCapacityPlanning runcontext
)
{
  TextBody:
  [*
    this.ProductInStockingPointInPeriodPlanningHelper( relflush ); 
    this.ProductInStockingPoint_MPHelper( relflush ); 
    traverse( scope.GetPISPIPInOptimizerRun(), Elements, pispip ) 
    {
      pispip.SelectorMetaHelper( relset, this ); 
      pispip.ProductInStockingPoint_MP().SelectorMetaHelper( relset, this ); 
    }
    
    traverse( this, ProductInStockingPoint_MPHelper, pisp ) 
    {
      pisp.EarliestPISPIPInScope( relflush );
      pisp.LatestPISPIPInScope( relflush ); 
    }
    
    traverse( this, ProductInStockingPointInPeriodPlanningHelper, pispip ) 
    {
      pisp := pispip.ProductInStockingPoint_MP(); 
      
      if ( guard( pispip.Start() > pisp.LatestPISPIPInScope().Start(), true ) )
      {
        pisp.LatestPISPIPInScope( relset, pispip ); 
      }
      if ( guard( pispip.Start() < pisp.EarliestPISPIPInScope().Start(), true ) )
      {
        pisp.EarliestPISPIPInScope( relset, pispip ); 
      }
    }
    
    traverse( this, ProductInStockingPoint_MPHelper, pisp, pisp.IsLeaf() )
    {
      firstpispip := pisp.EarliestPISPIPInScope(); 
      lastpispip := pisp.LatestPISPIPInScope(); 
    
      currentpispip := firstpispip; 
      while( not isnull( currentpispip ) 
             and currentpispip.Start() < lastpispip.Start() ) 
      {
        if ( not currentpispip.SelectorMetaHelper() = this ) 
        {
          scope.Add( currentpispip ); // we want to avoid calling this if the pispip is already in scope for performance
        } 
        currentpispip := currentpispip.NextPlanningPISPIP();
      }
    }
    
    this.AddClosureForPISPIPInventorySpecificationAsDays( scope, runcontext ); // requires pisp.EarliestPISPIPInScope & ProductInStockingPoint_MPHelper
    
    // clear dont want to spend database access
    this.ProductInStockingPointInPeriodPlanningHelper( relflush ); 
    this.ProductInStockingPoint_MPHelper( relflush );
  *]
  InterfaceProperties { Accessibility: 'Module' }
}