Package org.opentripplanner.routing.vertextype

Examples of org.opentripplanner.routing.vertextype.IntersectionVertex


    }

    public void setUp() {
        graph = new Graph();
        // a 0.1 degree x 0.1 degree square
        tl = new IntersectionVertex(graph, "tl", -74.01, 40.01);
        tr = new IntersectionVertex(graph, "tr", -74.0, 40.01);
        bl = new IntersectionVertex(graph, "bl", -74.01, 40.0);
        br = new IntersectionVertex(graph, "br", -74.00, 40.0);

        top = new StreetEdge(tl, tr,
                GeometryUtils.makeLineString(-74.01, 40.01, -74.0, 40.01), "top", 1500,
                StreetTraversalPermission.ALL, false);
        bottom = new StreetEdge(br, bl,
View Full Code Here


    /****
     * Private Methods
     ****/

    private StreetVertex vertex(String label, double lat, double lon) {
        IntersectionVertex v = new IntersectionVertex(_graph, label, lat, lon);
        return v;
    }
View Full Code Here

        service.addBikeRentalStation(station);
    }

    private Graph makeSimpleGraph() {
        Graph graph = new Graph();
        StreetVertex tl = new IntersectionVertex(graph, "tl", -80.01, 40.01, "top and left");
        StreetVertex tr = new IntersectionVertex(graph, "tr", -80.0, 40.01, "top and right");
        StreetVertex bl = new IntersectionVertex(graph, "bl", -80.01, 40.0, "bottom and left");
        StreetVertex br = new IntersectionVertex(graph, "br", -80.0, 40.0, "bottom and right");

        makeEdges(tl, tr, "top");
        makeEdges(tl, bl, "left");
        makeEdges(br, tr, "right");
        makeEdges(bl, br, "bottom");
View Full Code Here

    @Before
    public void before() {
        graph = new Graph();
        // a 0.1 degree x 0.1 degree square
        tl = new IntersectionVertex(graph, "tl", -74.01, 40.01);
        tr = new IntersectionVertex(graph, "tr", -74.0, 40.01);
        bl = new IntersectionVertex(graph, "bl", -74.01, 40.0);
        br = new IntersectionVertex(graph, "br", -74.00, 40.0);

        top = new StreetEdge(tl, tr,
                GeometryUtils.makeLineString(-74.01, 40.01, -74.0, 40.01), "top", 1500,
                StreetTraversalPermission.CAR, false);
        bottom = new StreetEdge(br, bl,
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        graph = new Graph();

        // Generate a very simple graph
        A = new IntersectionVertex(graph, "A", 0.000, 45, "A");
        B = new IntersectionVertex(graph, "B", 0.001, 45, "B");
        C = new IntersectionVertex(graph, "C", 0.002, 45, "C");
        D = new IntersectionVertex(graph, "D", 0.003, 45, "D");

        @SuppressWarnings("unused")
        Edge driveOnly = new StreetEdge(A, B, GeometryUtils.makeLineString(0.000, 45, 0.001, 45),
                "AB street", 87, StreetTraversalPermission.CAR, false);
View Full Code Here

    @Test
    public void testEdgeRemoval() {

        Graph graph = new Graph();
        StreetVertex va = new IntersectionVertex(graph, "A", 10.0, 10.0);
        StreetVertex vb = new IntersectionVertex(graph, "B", 10.1, 10.1);
        StreetVertex vc = new IntersectionVertex(graph, "C", 10.2, 10.2);
        StreetVertex vd = new IntersectionVertex(graph, "D", 10.3, 10.3);
        Edge eab = new StreetEdge(va, vb, null, "AB", 10, StreetTraversalPermission.ALL, false);
        Edge ebc = new StreetEdge(vb, vc, null, "BC", 10, StreetTraversalPermission.ALL, false);
        Edge ecd = new StreetEdge(vc, vd, null, "CD", 10, StreetTraversalPermission.ALL, false);

        // remove an edge that is not connected to this vertex
        va.removeOutgoing(ecd);
        assertEquals(va.getDegreeOut(), 1);

        // remove an edge from an edgelist that is empty
        vd.removeOutgoing(eab);
        assertEquals(vd.getDegreeOut(), 0);

        // remove an edge that is actually connected
        assertEquals(va.getDegreeOut(), 1);
        va.removeOutgoing(eab);
        assertEquals(va.getDegreeOut(), 0);
View Full Code Here

public class TestBikeRental extends TestCase {
    public void testBasic() throws Exception {
        // generate a very simple graph
        Graph graph = new Graph();
        StreetVertex v1 = new IntersectionVertex(graph, "v1", -77.0492, 38.856, "v1");
        StreetVertex v2 = new IntersectionVertex(graph, "v2", -77.0492, 38.857, "v2");
        StreetVertex v3 = new IntersectionVertex(graph, "v3", -77.0492, 38.858, "v3");

        @SuppressWarnings("unused")
        Edge walk = new StreetEdge(v1, v2, GeometryUtils.makeLineString(-77.0492, 38.856,
                -77.0492, 38.857), "S. Crystal Dr", 87, StreetTraversalPermission.PEDESTRIAN, false);
View Full Code Here

    /****
     * Private Methods
     ****/

    private IntersectionVertex vertex(String label, double x, double y) {
        IntersectionVertex v = new IntersectionVertex(_graph, label, x, y);
        return v;
    }
View Full Code Here

    /****
     * Private Methods
     ****/

    private IntersectionVertex vertex(String label, double lat, double lon) {
        IntersectionVertex v = new IntersectionVertex(_graph, label, lat, lon);
        return v;
    }
View Full Code Here

    for (Vertex v : visibleVertices) {
      if (drawTransitStopVertices && closeEnough && v instanceof TransitStationStop) {
            drawVertex(v, 5);
      }
      if (drawStreetVertices && v instanceof IntersectionVertex) {
            IntersectionVertex iv = (IntersectionVertex) v;
            if (iv.trafficLight) {
                drawVertex(v, 7);
            }
        }
      if (drawMultistateVertices && spt!=null){
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.vertextype.IntersectionVertex

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.