Package ie.transportdublin.server.plugin.json

Examples of ie.transportdublin.server.plugin.json.DirectionsRoute


            if ( count == 2 )// lat2lon2
            {
                Node stop = stopLayer.get( Stop.STOPID, (String) relationship.getProperty( Stop.STOPID ) ).getSingle();
                cost += (Double) stop.getProperty( Stop.TIMEFROMHUB );
                busList.add( stop );
                routes.add( new DirectionsRoute( deptTime, cost, busList ) );             
                double distanceInKm = (Double) relationship.getProperty( Connection.DISTANCE );
                double distanceInMins = Math.round( 20 * distanceInKm * 1e2 ) / 1e2;
                walks.add( new DirectionsWalk( distanceInMins, relationship, relationship.getEndNode() ) );
            }
            count++;
View Full Code Here


            }
            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++;
View Full Code Here

TOP

Related Classes of ie.transportdublin.server.plugin.json.DirectionsRoute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.