private void computeStatistics(ProfileRequest req,int accessTime,int egressTime){
  int count=0;
  int sum=0;
  this.min=Integer.MAX_VALUE;
  this.max=0;
  for (int start=req.fromTime; start < req.toTime; start+=60) {
    int timeAtOriginStop=start + accessTime + RaptorWorker.BOARD_SLACK_SECONDS;
    int bestTimeAtDestinationStop=Integer.MAX_VALUE;
    for (    Itinerary itin : this.itineraries) {
      if (itin.boardTimes[0] < timeAtOriginStop)       continue;
      if (itin.alightTimes[this.length - 1] < bestTimeAtDestinationStop)       bestTimeAtDestinationStop=itin.alightTimes[this.length - 1];
    }
    if (bestTimeAtDestinationStop == Integer.MAX_VALUE)     continue;
    int bestTimeAtDestination=bestTimeAtDestinationStop + egressTime;
    int travelTime=bestTimeAtDestination - start;
    count++;
    sum+=travelTime;
    min=Math.min(min,travelTime);
    max=Math.max(max,travelTime);
  }
  if (count == 0)   throw new IllegalStateException("No valid itineraries found for path computed in RaptorWorker");
  avg=sum / count;
}

private void computeStatistics ( ProfileRequest req , int accessTime , int egressTime ) { int count = 0 ; int sum = 0 ; this . min = Integer . MAX_VALUE ; this . max = 0 ; for ( int start = req . fromTime ; start < req . toTime ; start += 60 ) { int timeAtOriginStop = start + accessTime + RaptorWorker . BOARD_SLACK_SECONDS ; int bestTimeAtDestinationStop = Integer . MAX_VALUE ; for ( Itinerary itin : this . itineraries ) { if ( itin . boardTimes [ 0 ] < timeAtOriginStop ) continue ; if ( itin . alightTimes [ this . length - 1 ] < bestTimeAtDestinationStop ) bestTimeAtDestinationStop = itin . alightTimes [ this . length - 1 ] ; } if ( bestTimeAtDestinationStop == Integer . MAX_VALUE ) continue ; int bestTimeAtDestination = bestTimeAtDestinationStop + egressTime ; int travelTime = bestTimeAtDestination - start ; count ++ ; sum += travelTime ; min = Math . min ( min , travelTime ) ; max = Math . max ( max , travelTime ) ; } if ( count == 0 ) throw new IllegalStateException ( "No valid itineraries found for path computed in RaptorWorker" ) ; avg = sum / count ; }
compute statistics for this particular path over the time window . this is super simple , we just compute how long the path takes at every possible departure minute . there ' s probably an elegant theoretical way to do this , but i prefer pragmatism over theory .
