Examples of BikeParkVertex


Examples of org.opentripplanner.routing.vertextype.BikeParkVertex

                bikePark.id = "" + node.getId();
                bikePark.name = creativeName;
                bikePark.x = node.lon;
                bikePark.y = node.lat;
                bikeRentalService.addBikePark(bikePark);
                BikeParkVertex parkVertex = new BikeParkVertex(graph, bikePark);
                new BikeParkEdge(parkVertex);
            }
            LOG.info("Created " + n + " bike P+R.");
        }
View Full Code Here

Examples of org.opentripplanner.routing.vertextype.BikeParkVertex

            bikePark.id = "" + osmId;
            bikePark.name = creativeName;
            bikePark.x = (envelope.getMinX() + envelope.getMaxX()) / 2;
            bikePark.y = (envelope.getMinY() + envelope.getMaxY()) / 2;
            bikeRentalService.addBikePark(bikePark);
            BikeParkVertex bikeParkVertex = new BikeParkVertex(graph, bikePark);
            new BikeParkEdge(bikeParkVertex);
            LOG.debug("Created area bike P+R '{}' ({})", creativeName, osmId);
        }
View Full Code Here

Examples of org.opentripplanner.routing.vertextype.BikeParkVertex

            Set<BikePark> bikeParkSet = new HashSet<BikePark>();
            /* Add any new park and update space available for existing parks */
            for (BikePark bikePark : bikeParks) {
                bikeService.addBikePark(bikePark);
                bikeParkSet.add(bikePark);
                BikeParkVertex bikeParkVertex = verticesByPark.get(bikePark);
                if (bikeParkVertex == null) {
                    bikeParkVertex = new BikeParkVertex(graph, bikePark);
                    LinkRequest request = networkLinkerLibrary
                            .connectVertexToStreets(bikeParkVertex);
                    for (Edge e : request.getEdgesAdded()) {
                        graph.addTemporaryEdge(e);
                    }
                    verticesByPark.put(bikePark, bikeParkVertex);
                    new BikeParkEdge(bikeParkVertex);
                } else {
                    bikeParkVertex.setSpacesAvailable(bikePark.spacesAvailable);
                }
            }
            /* Remove existing parks that were not present in the update */
            List<BikePark> toRemove = new ArrayList<BikePark>();
            for (Entry<BikePark, BikeParkVertex> entry : verticesByPark.entrySet()) {
                BikePark bikePark = entry.getKey();
                if (bikeParkSet.contains(bikePark))
                    continue;
                BikeParkVertex vertex = entry.getValue();
                if (graph.containsVertex(vertex)) {
                    graph.removeVertexAndEdges(vertex);
                }
                toRemove.add(bikePark);
                bikeService.removeBikePark(bikePark);
View Full Code Here

Examples of org.opentripplanner.routing.vertextype.BikeParkVertex

        bpc.id = "bpc";
        bpc.name = "Bike Park C";
        bpc.x = 0.002;
        bpc.y = 45.00001;
        bpc.spacesAvailable = 1;
        BikeParkVertex BPRC = new BikeParkVertex(graph, bpc);
        new BikeParkEdge(BPRC);
        new StreetBikeParkLink(BPRC, C);
        new StreetBikeParkLink(C, BPRC);

        // Still impossible from B to D by bike only (CD is WALK only).
View Full Code Here

Examples of org.opentripplanner.routing.vertextype.BikeParkVertex

         * it.
         */
        if (s0.getNonTransitMode() != TraverseMode.BICYCLE || !options.modes.getWalk()
                || s0.isBikeRenting() || s0.isBikeParked())
            return null;
        BikeParkVertex bikeParkVertex = (BikeParkVertex) tov;
        if (bikeParkVertex.getSpacesAvailable() == 0) {
            return null;
        }

        StateEditor s0e = s0.edit(this);
        s0e.incrementWeight(options.bikeParkCost);
View Full Code Here

Examples of org.opentripplanner.routing.vertextype.BikeParkVertex

        }
        Collection<BikePark> bikeParks = dataSource.getBikeParks();

        for (BikePark bikePark : bikeParks) {
            service.addBikePark(bikePark);
            BikeParkVertex bikeParkVertex = new BikeParkVertex(graph, bikePark);
            new BikeParkEdge(bikeParkVertex);
        }
        LOG.info("Created " + bikeParks.size() + " bike parks.");
    }
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.