}
if ( count == 1 ) // hubbus1
{
cost += (Double) relationship.getProperty( Connection.COST );
busList1.add( relationship.getEndNode() );
routes.add( new DirectionsRoute( deptTime, cost, busList1 ) );
}
if ( count == 3 ) // walk2
{
double distanceInMins = (Double) relationship.getProperty( Connection.COST );
cost +=distanceInMins;
walks.add( new DirectionsWalk( distanceInMins, relationship.getStartNode(), relationship.getEndNode() ) );
}
if ( count == 5 ) // hubbus1
{
busList2.add( relationship.getStartNode() );
double[] transferTimes =(double[]) relationship.getStartNode().getProperty( Hub.DEPTTIMES );
int insertionPoint = Arrays.binarySearch( transferTimes, ( deptTime + cost ) );
insertionPoint = ( insertionPoint < 0 ) ? ( ( insertionPoint * -1 ) - 1 ) : insertionPoint; // ( -( insertion point ) - 1)
if(insertionPoint != transferTimes.length)
deptTime = transferTimes[insertionPoint];
cost = 0.0;
cost += (Double) relationship.getProperty( Connection.COST );
}
if ( count == 6 ) // lat2lon2
{
Node stop = stopLayer.get( Stop.STOPID, (String) relationship.getProperty( Stop.STOPID ) ).getSingle();
cost += (Double) stop.getProperty( Stop.TIMEFROMHUB );
busList2.add( stop );
routes.add( new DirectionsRoute( deptTime, cost, busList2 ) );
double distanceInKm = (Double) relationship.getProperty( Connection.DISTANCE );
double distanceInMins = Math.round( 20 * distanceInKm * 1e2 ) / 1e2;
walks.add( new DirectionsWalk( distanceInMins, relationship, relationship.getEndNode() ) );
}
count++;