Package org.opentripplanner.routing.core

Examples of org.opentripplanner.routing.core.Vertex


    return edit.makeState();
  }

  private State traverseReverse(State s0) {

    Vertex fromVertex = new BlockDepartureVertex(_context, _from);
    Vertex toVertex = null;
    EdgeNarrative narrative = narrative(s0, fromVertex, toVertex);

    StateEditor edit = s0.edit(this, narrative);
    int runningTime = (int) ((s0.getTime() - _from.getBestDepartureTime()) / 1000);
    edit.setTime(_from.getBestDepartureTime());
View Full Code Here


  @Override
  public double computeForwardWeight(State s, Vertex target) {

    EdgeNarrative narrative = s.getBackEdgeNarrative();
    Vertex v = narrative.getToVertex();

    return computeWeight(s, target, v);
  }
View Full Code Here

  @Override
  public double computeReverseWeight(State s, Vertex target) {

    EdgeNarrative narrative = s.getBackEdgeNarrative();
    Vertex v = narrative.getFromVertex();

    return computeWeight(s, target, v);
  }
View Full Code Here

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

  private EdgeNarrative createNarrative(State s0) {
    Vertex fromVertex = new BlockArrivalVertex(_context, _instance);
    Vertex toVertex = new ArrivalVertex(_context, _instance.getStop(),
        s0.getTime());
    return narrative(s0, fromVertex, toVertex);
  }
View Full Code Here

    for (TransferNode tree : transfers.getTransfers()) {

      TPState pathState = TPState.start(queryData, tree);

      Vertex fromVertex = new WalkToStopVertex(_context, _stop);
      Vertex toVertex = new TPDepartureVertex(_context, pathState);
      EdgeNarrative narrative = narrative(s0, fromVertex, toVertex);

      StateEditor edit = s0.edit(this, narrative);
      edit.incrementTimeInSeconds(options.minTransferTime);
View Full Code Here

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

  private EdgeNarrative createNarrative(State s0) {
    Vertex fromVertex = new DepartureVertex(_context, _instance.getStop(),
        s0.getTime());
    Vertex toVertex = new BlockDepartureVertex(_context, _instance);
    return narrative(s0, fromVertex, toVertex);
  }
View Full Code Here

     * We alight from our current vehicle to the stop. However, we don't
     * actually know which vehicle. Hopefully this method will only ever be
     * called in the GraphPath.optimize(), where the traverseBack() method has
     * previously been called.
     */
    Vertex fromVertex = null;
    Vertex toVertex = new ArrivalVertex(_context, _stop, s0.getTime());
    EdgeNarrative narrative = narrative(s0, fromVertex, toVertex);
    return s0.edit(this, narrative).makeState();
  }
View Full Code Here

      // since the stopTimeService method will also return instances that depart
      // in the target interval as well
      if (arrivalTime < timeFrom || time <= arrivalTime)
        continue;

      Vertex fromVertex = new BlockArrivalVertex(_context, instance);
      Vertex toVertex = new ArrivalVertex(_context, _stop, s0.getTime());
      EdgeNarrative narrative = narrative(s0, fromVertex, toVertex);

      OBAStateEditor edit = (OBAStateEditor) s0.edit(this, narrative);

      int dwellTime = (int) ((time - arrivalTime) / 1000);

      edit.setTime(arrivalTime);
      edit.incrementNumBoardings();
      edit.setEverBoarded(true);

      if (s0.getNumBoardings() == 0)
        edit.incrementInitialWaitTime(dwellTime * 1000);

      double w = ItineraryWeightingLibrary.computeWeightForWait(s0, dwellTime);
      edit.incrementWeight(w);

      State r = edit.makeState();
      results = r.addToExistingResultChain(results);
    }

    // In addition to all the departures, we can just remain waiting at the stop
    int dwellTime = (int) ((time - timeFrom) / 1000);
    double w = ItineraryWeightingLibrary.computeWeightForWait(s0, dwellTime);

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

    OBAStateEditor edit = (OBAStateEditor) s0.edit(this, narrative);

    edit.incrementWeight(w);
View Full Code Here

  public boolean shouldSearchContinue(Vertex origin, Vertex target,
      State current, ShortestPathTree spt, TraverseOptions traverseOptions) {

    OBATraverseOptions opts = (OBATraverseOptions) traverseOptions;

    Vertex currentVertex = current.getVertex();

    if (target == currentVertex) {

      // return false;
View Full Code Here

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

  private EdgeNarrative createNarrative(State s0, long time) {
    Vertex fromVertex = new ArrivalVertex(_context, _transfer.getStop(), time);
    Vertex toVertex = new BlockDepartureVertex(_context, _instance);
    return narrative(s0, fromVertex, toVertex);
  }
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.