Examples of NetworkLinkerLibrary


Examples of org.opentripplanner.routing.edgetype.loader.NetworkLinkerLibrary

    }

    @Override
    public void setup() throws InterruptedException, ExecutionException {
        // Creation of network linker library will not modify the graph
        networkLinkerLibrary = new NetworkLinkerLibrary(graph,
                Collections.<Class<?>, Object> emptyMap());

        // Adding a bike rental station service needs a graph writer runnable
        updaterManager.executeBlocking(new GraphWriterRunnable() {
            @Override
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.loader.NetworkLinkerLibrary

    }

    @Override
    public void setup() throws InterruptedException, ExecutionException {
        // Creation of network linker library will not modify the graph
        networkLinkerLibrary = new NetworkLinkerLibrary(graph,
                Collections.<Class<?>, Object> emptyMap());

        // Adding a bike park station service needs a graph writer runnable
        updaterManager.executeBlocking(new GraphWriterRunnable() {
            @Override
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.loader.NetworkLinkerLibrary

    if (graph.getVertices().isEmpty()) {
      _log.info("OTP graph is empty, so skipping street-to-stop linking step");
      return;
    }

    NetworkLinkerLibrary linker = new NetworkLinkerLibrary(graph);

    int index = 0;

    for (StopEntry stop : _transitGraphDao.getAllStops()) {

      if (index % 100 == 0)
        _log.info("linked stops: " + index);
      index++;

      /***
       * Add street-to-stop edges
       ****/

      WalkToStopVertex walkToStopVertex = new WalkToStopVertex(context, stop);

      if (linker.determineIncomingEdgesForVertex(walkToStopVertex, true)) {
        GraphVertex gv = graph.getGraphVertex(walkToStopVertex.getLabel());
        WaitingBeginsAtStopEdge edge = new WaitingBeginsAtStopEdge(context,
            stop, false);
        edge.setFromVertex(walkToStopVertex);
        gv.addOutgoing(edge);
      } else {
        _log.warn("error linking stop: " + stop.getId() + " to street network");
      }

      /****
       * Add stop-to-street edges
       ****/

      WalkFromStopVertex walkFromStopVertex = new WalkFromStopVertex(context,
          stop);

      if (linker.determineOutgoingEdgesForVertex(walkFromStopVertex, true)) {
        GraphVertex gv = graph.getGraphVertex(walkFromStopVertex.getLabel());
        WaitingEndsAtStopEdge edge = new WaitingEndsAtStopEdge(context, stop,
            true);
        edge.setToVertex(walkFromStopVertex);
        gv.addIncoming(edge);
      } else {
        _log.warn("error linking stop: " + stop.getId() + " to street network");
      }
    }

    linker.addAllReplacementEdgesToGraph();
  }
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.