Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method GetIsInUnitPeriod ( 
 | 
  UnitPeriods unitperiods 
 | 
) declarative remote as Boolean 
 | 
{ 
 | 
  Description: 'Return true if the trip arrives on the selected unit periods. Used in designer.' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // desmondt Jun-4-2015 (created) 
 | 
     
 | 
    isinunitperiod := false; 
 | 
     
 | 
    if( this.HasValidDeparture() and this.HasValidArrival() ) 
 | 
    { 
 | 
      arrivalperiod := this.ArrivalUnitPeriod().Period_MP(); 
 | 
     
 | 
      isinunitperiod := exists( unitperiods, Elements, up, 
 | 
                                up.Unit() = this.LaneLeg().AsProcess_MP() 
 | 
                                and arrivalperiod.IsInPeriod( up.Start(), up.End() ) ); 
 | 
     
 | 
     
 | 
     
 | 
    } 
 | 
     
 | 
     
 | 
     
 | 
     
 | 
     
 | 
     
 | 
    return isinunitperiod; 
 | 
  *] 
 | 
} 
 |