Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method SetPeriodTaskOperationRelationInScope ( 
 | 
  LibOpt_Scope scope 
 | 
) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    traverse( this, MacroPlan.Unit, unit )  
 | 
    { 
 | 
      unit.OperationForOptimizationInScope( relflush );  
 | 
      traverse( unit, PlanningUnitPeriod, up ) // this relation we use globally 
 | 
      { 
 | 
        up.PeriodTaskOperationInScope( relflush );  
 | 
      } 
 | 
    } 
 | 
     
 | 
    traverse( scope.GetOperationInOptimizerRun(), Elements, op ) // we only need this relation between operation and periodtaskoperation in the run (performance)  
 | 
    { 
 | 
      op.PeriodTaskOperationInScope( relflush );  
 | 
      op.AsOperationForOptimizationScope( relset, op.Unit() ); // subrelation of OperationForOptimization of those that are in scope valid within this component 
 | 
    } 
 | 
     
 | 
    traverse( scope.GetPeriodTaskOperationInOptimizerRun(), Elements, pto )  
 | 
    { 
 | 
      pto.OperationWhenInScope( relset, pto.Operation() );  
 | 
      pto.UnitPeriodWhenInScope( relset, pto.UnitPeriod() );  
 | 
    } 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |