admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
StaticMethod GetOperationPeriodTaskPeriodsForPreprocessing (
  const Period_MP pispipperiod,
  const Process_MP process
) const as constcontent owning Period_MPs
{
  Description: 'Return the operation period task periods for the passed in dependent demand periods'
  TextBody:
  [*
    // To get the period of period tasks from dependent demands, it can be treated as "new supplies" of dependent demands.
    // Please read the optimizer solution design for more information.
    startofpt := Process_MP::GetNewSupplyEarliestStart( pispipperiod, process.LeadTime() )
    endofpt := Process_MP::GetOperationEnd( pispipperiod, startofpt );
    
    gp := pispipperiod.MacroPlan().GlobalParameters_MP();
    
    if( gp.IsOperationLeadTimeLogicFromEnd() ) 
    {
      startofpt := pispipperiod.Start() + process.LeadTime();
      endofpt := startofpt;
    }
    else if( gp.IsOperationLeadTimeLogicFromMiddle() ) 
    {
      startofpt := pispipperiod.Start() + 0.5 * pispipperiod.Duration() + process.LeadTime();
      endofpt := startofpt;
    }
    
    return selectset( pispipperiod, MacroPlan.PlanningPeriod, ptperiod,
                      ptperiod.IsInPeriod( startofpt, endofpt ) );
  *]
  InterfaceProperties { Accessibility: 'Module' }
}