Package org.opentripplanner.routing.graph

Examples of org.opentripplanner.routing.graph.Edge


        assertNotNull(v1);
        assertNotNull(v2);
        assertNotNull(v3);
        assertNotNull(v4);

        Edge e1 = null, e2 = null, e3 = null;
        for (Edge e: v2.getOutgoing()) {
            if (e.getToVertex() == v1) {
                e1 = e;
            } else if (e.getToVertex() == v3) {
                e2 = e;
            } else if (e.getToVertex() == v4) {
                e3 = e;
            }
        }

        assertNotNull(e1);
        assertNotNull(e2);
        assertNotNull(e3);

        assertTrue("name of e1 must be like \"Kamiennog\u00F3rska\"; was " + e1.getName(), e1
                .getName().contains("Kamiennog\u00F3rska"));
        assertTrue("name of e2 must be like \"Mariana Smoluchowskiego\"; was " + e2.getName(), e2
                .getName().contains("Mariana Smoluchowskiego"));
    }
View Full Code Here


    /** return a StateEditor rather than a State so that we can make parking/mode switch modifications for kiss-and-ride. */
    private StateEditor doTraverse(State s0, RoutingRequest options, TraverseMode traverseMode) {
        boolean walkingBike = options.walkingBike;
        boolean backWalkingBike = s0.isBackWalkingBike();
        TraverseMode backMode = s0.getBackMode();
        Edge backEdge = s0.getBackEdge();
        if (backEdge != null) {
            // No illegal U-turns.
            // NOTE(flamholz): we check both directions because both edges get a chance to decide
            // if they are the reverse of the other. Also, because it doesn't matter which direction
            // we are searching in - these traversals are always disallowed (they are U-turns in one direction
            // or the other).
            // TODO profiling indicates that this is a hot spot.
            if (this.isReverseOf(backEdge) || backEdge.isReverseOf(this)) {
                return null;
            }
        }

        // Ensure we are actually walking, when walking a bike
View Full Code Here

            DFA = itinerary.toDFA().minimize();
        }

        @Override
        public int terminalFor(State state) {
            Edge edge = state.getBackEdge();

            if (edge instanceof StreetEdge)   return STREET;
            if (edge instanceof StreetTransitLink) return LINK;

            return OTHER;
View Full Code Here

        return routeGeometry.getFactory().createLineString(coords.toArray(coordArray));
    }

    private List<Edge> toEdgeList(MatchState next) {
        ArrayList<Edge> edges = new ArrayList<Edge>();
        Edge lastEdge = null;
        while (next != null) {
            Edge edge = next.getEdge();
            if (edge != lastEdge) {
                edges.add(edge);
                lastEdge = edge;
            }
            next = next.parent;
View Full Code Here

        return (e == this || e == parentEdge);
    }
   
    @Override
    public boolean isReverseOf(Edge e) {
        Edge other = e;
        if (e instanceof PartialStreetEdge) {
            other = ((PartialStreetEdge) e).parentEdge;
        }
       
        // TODO(flamholz): is there a case where a partial edge has a reverse of its own?
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.graph.Edge

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.