Examples of FreeEdge


Examples of org.opentripplanner.routing.edgetype.FreeEdge

                        calculatedName = resources.getString("unnamedStreet");
                    }
                }
                StreetLocation closest = new StreetLocation(graph, "corner " + Math.random(), coord,
                        calculatedName);
                FreeEdge e = new FreeEdge(closest, intersection);
                closest.getExtra().add(e);
                e = new FreeEdge(intersection, closest);
                closest.getExtra().add(e);
                return closest;
            }
        }
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.FreeEdge

    public void testAddEdge() throws Exception {
        Graph g = new Graph();
        Vertex a = new IntersectionVertex(g, "A", 5, 5);
        Vertex b = new IntersectionVertex(g, "B", 6, 6);
        FreeEdge ee = new FreeEdge(a, b);
        assertNotNull(ee);
    }
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.FreeEdge

    public void testGetEdgesOneEdge() {
        Graph g = new Graph();
        Vertex a = new IntersectionVertex(g, "A", 5, 5);
        Vertex b = new IntersectionVertex(g, "B", 6, 6);
        FreeEdge ee = new FreeEdge(a, b);

        List<Edge> edges = new ArrayList<Edge>(g.getEdges());
        assertEquals(1, edges.size());
        assertEquals(ee, edges.get(0));
    }
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.FreeEdge

        Vertex a = new IntersectionVertex(g, "A", 5, 5);
        Vertex b = new IntersectionVertex(g, "B", 6, 6);
        Vertex c = new IntersectionVertex(g, "C", 3, 2);

        Set<Edge> expectedEdges = new HashSet<Edge>(4);
        expectedEdges.add(new FreeEdge(a, b));
        expectedEdges.add(new FreeEdge(b, c));
        expectedEdges.add(new FreeEdge(c, b));
        expectedEdges.add(new FreeEdge(c, a));

        Set<Edge> edges = new HashSet<Edge>(g.getEdges());
        assertEquals(4, edges.size());
        assertEquals(expectedEdges, edges);
    }
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.FreeEdge

        Vertex a = new IntersectionVertex(g, "A", 5, 5);
        Vertex b = new IntersectionVertex(g, "B", 6, 6);
        Vertex c = new IntersectionVertex(g, "C", 3, 2);

        Set<Edge> allEdges = new HashSet<Edge>(4);
        allEdges.add(new FreeEdge(a, b));
        allEdges.add(new FreeEdge(b, c));
        allEdges.add(new FreeEdge(c, b));
        allEdges.add(new FreeEdge(c, a));

        Set<StreetEdge> edges = new HashSet<StreetEdge>(g.getStreetEdges());
        assertEquals(0, edges.size());
    }
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.FreeEdge

        }
        assertTrue(og.getIncoming(a).size() == 0);
        assertTrue(og.getOutgoing(d).size() == 0);
       
        // add an edge that is not in the overlay
        Edge ad = new FreeEdge(a, d);
        assertTrue(d.getIncoming().size() == 4);
        assertTrue(og.getIncoming(d).size() == 3);
        assertTrue(a.getOutgoing().size() == 2);
        assertTrue(og.getOutgoing(a).size() == 1);
       
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.FreeEdge

                AgencyAndId parentStationId = new AgencyAndId(agencyId, parentStation);

                Stop parentStop = _dao.getStopForId(parentStationId);
                Vertex parentStopVertex = context.stationStopNodes.get(parentStop);

                new FreeEdge(parentStopVertex, stopVertex);
                new FreeEdge(stopVertex, parentStopVertex);

                // Stops with location_type=2 (entrances as defined in the pathways.txt
                // proposal) have no arrive/depart vertices, hence the null checks.
                Vertex stopArriveVertex = context.stopArriveNodes.get(stop);
                Vertex parentStopArriveVertex = context.stopArriveNodes.get(parentStop);
                if (stopArriveVertex != null && parentStopArriveVertex != null) {
                    new FreeEdge(parentStopArriveVertex, stopArriveVertex);
                    new FreeEdge(stopArriveVertex, parentStopArriveVertex);
                }

                Vertex stopDepartVertex = context.stopDepartNodes.get(stop);
                Vertex parentStopDepartVertex = context.stopDepartNodes.get(parentStop);
                if (stopDepartVertex != null && parentStopDepartVertex != null) {
                    new FreeEdge(parentStopDepartVertex, stopDepartVertex);
                    new FreeEdge(stopDepartVertex, parentStopDepartVertex);
                }

                // TODO: provide a cost for these edges when stations and
                // stops have different locations
            }
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.FreeEdge

                    ElevatorOffboardVertex offboardVertex = new ElevatorOffboardVertex(graph,
                            sourceVertexLabel + "_offboard", sourceVertex.getX(),
                            sourceVertex.getY(), levelName);

                    new FreeEdge(sourceVertex, offboardVertex);
                    new FreeEdge(offboardVertex, sourceVertex);

                    ElevatorOnboardVertex onboardVertex = new ElevatorOnboardVertex(graph,
                            sourceVertexLabel + "_onboard", sourceVertex.getX(),
                            sourceVertex.getY(), levelName);
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.FreeEdge

                            continue;
                        }
                        StreetLocation areaSplitter = createStreetLocation(graph, label, name,
                                Arrays.asList(e), ce.nearestPointOnEdge);
                        location.extra.addAll(areaSplitter.getExtra());
                        location.extra.add(new FreeEdge(location, areaSplitter));
                        location.extra.add(new FreeEdge(areaSplitter, location));
                        allEdges.add(e);
                    }
                }
            }
        }
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.FreeEdge

            /* forward edges and vertices */
            Vertex edgeLocation;
            if (distanceLibrary.distance(nearestPoint, fromv.getCoordinate()) < 1) {
                // no need to link to area edges caught on-end
                edgeLocation = fromv;
                new FreeEdge(location, edgeLocation);
                new FreeEdge(edgeLocation, location);
            } else if (distanceLibrary.distance(nearestPoint, tov.getCoordinate()) < 1) {
                // no need to link to area edges caught on-end
                edgeLocation = tov;
                new FreeEdge(location, edgeLocation);
                new FreeEdge(edgeLocation, location);
            } else {
                // location is somewhere in the middle of the edge.
                edgeLocation = location;
               
                // creates links from street head -> location -> street tail.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.