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' } 
 | 
} 
 |