Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method GetDecendentsInOptimizerSubset ( 
 | 
  OptimizerPuzzle optimizerPuzzle, 
 | 
  Boolean isParentIncluded 
 | 
) as owning Units 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    units := construct( Units ); 
 | 
     
 | 
    traverse( this, Child, unit ) 
 | 
    { 
 | 
      subSet := optimizerPuzzle.GetSubsetUnit( unit ); 
 | 
      localIsIncluded := ( not isnull( subSet ) and subSet.IsIncluded() ) // Include, when unit have subset is included 
 | 
                         or ( isnull( subSet ) and isParentIncluded )  // Include when no subset and parent is included 
 | 
     
 | 
      if( localIsIncluded ) 
 | 
      { 
 | 
        units.Add( unit ); 
 | 
      } 
 | 
      
 | 
      local := unit.GetDecendentsInOptimizerSubset( optimizerPuzzle, 
 | 
                                                    localIsIncluded );  
 | 
       
 | 
      units := units.Union( local );                                     
 | 
    } 
 | 
     
 | 
    return &units; 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |