Package org.opentripplanner.routing.core

Examples of org.opentripplanner.routing.core.Vertex


    OBATraverseOptions options = createTraverseOptions();
    applyConstraintsToOptions(constraints.getConstraints(), options);

    Coordinate c = new Coordinate(location.getLon(), location.getLat());
    Vertex origin = _streetVertexIndexService.getClosestVertex(c, options);

    State originState = new OBAState(time, origin, options);
    BasicShortestPathTree tree = _transitShedPathService.getTransitShed(origin,
        originState, options);

    Map<StopEntry, Long> results = new HashMap<StopEntry, Long>();

    for (State state : tree.getAllStates()) {

      OBAState obaState = (OBAState) state;
      Vertex v = state.getVertex();

      if (v instanceof AbstractStopVertex) {
        AbstractStopVertex stopVertex = (AbstractStopVertex) v;
        StopEntry stop = stopVertex.getStop();
        long initialWaitTime = obaState.getInitialWaitTime();
View Full Code Here


      TraverseMode mode = narrative.getMode();

      if (!mode.isTransit())
        break;

      Vertex vFrom = narrative.getFromVertex();
      Vertex vTo = narrative.getToVertex();

      if (vFrom instanceof BlockDepartureVertex) {

        builder = extendTransitLegWithDepartureAndArrival(legs, builder,
            (BlockDepartureVertex) vFrom, (BlockArrivalVertex) vTo);
View Full Code Here

  private State traverseReverse(State s0) {

    DepartureVertex fromVertex = new DepartureVertex(_context, _stop,
        s0.getTime());
    Vertex toVertex = null;
    EdgeNarrative narrative = narrative(s0, fromVertex, toVertex);

    return s0.edit(this, narrative).makeState();
  }
View Full Code Here

    long arrival = _to.getBestArrivalTime();
    return (int) ((arrival - departure) / 1000);
  }

  private EdgeNarrative createNarrative(State s0) {
    Vertex fromVertex = new BlockDepartureVertex(_context, _from);
    Vertex toVertex = new BlockArrivalVertex(_context, _to);
    return narrative(s0, fromVertex, toVertex);
  }
View Full Code Here

    int runningTime = (int) ((arrival - departure) / 1000);
    return runningTime;
  }

  private EdgeNarrative createNarrative(State s0) {
    Vertex fromVertex = new TPOfflineBlockDepartureVertex(_context, _from);
    Vertex toVertex = new TPOfflineBlockArrivalVertex(_context, _to);
    return narrative(s0, fromVertex, toVertex);
  }
View Full Code Here

    State prev = null;

    for (State state : path.states) {
      if (prev != null) {
        Vertex vFrom = prev.getVertex();
        Vertex vTo = state.getVertex();
        double d = vFrom.distance(vTo);
        totalDistance += d;
      }
      prev = state;
    }
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.core.Vertex

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.