Package org.opentripplanner.routing.core

Examples of org.opentripplanner.routing.core.EdgeNarrative


  private State traverseReverse(State s0) {

    TraverseOptions options = s0.getOptions();

    EdgeNarrative narrative = createNarrative(s0);
    StateEditor edit = s0.edit(this, narrative);
    edit.incrementTimeInSeconds(options.minTransferTime);
    double w = options.minTransferTime * options.waitAtBeginningFactor;
    edit.incrementWeight(w);
    return edit.makeState();
View Full Code Here


  }

  private State traverseTransferPatterns(State s0, TraverseOptions options) {

    if (_isReverseEdge) {
      EdgeNarrative narrative = createNarrative(s0);
      return s0.edit(this, narrative).makeState();
    }

    TransferPatternService tpService = _context.getTransferPatternService();

    TPQueryData queryData = options.getExtension(TPQueryData.class);

    List<StopEntry> destStops = queryData.getDestStops();

    State results = null;

    TransferParent transfers = tpService.getTransferPatternsForStops(
        queryData.getTransferPatternData(), _stop, destStops);

    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);

      double w = options.minTransferTime * options.waitAtBeginningFactor;
 
View Full Code Here

    _instance = instance;
  }

  @Override
  public State traverse(State s0) {
    EdgeNarrative narrative = createNarrative(s0);
    return s0.edit(this, narrative).makeState();
  }
View Full Code Here

     * 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

      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);
    edit.setTime(time);
View Full Code Here

    TransferPatternService tpService = _context.getTransferPatternService();
    if (tpService.isEnabled())
      return traverseTransferPatterns(s0, options);

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

    // In addition to all the departures, we can just remain waiting at the stop
    DepartureVertex fromVertex = new DepartureVertex(_context, _stop,
        s0.getTime());
    DepartureVertex toVertex = new DepartureVertex(_context, _stop, toTime);
    EdgeNarrative narrative = narrative(s0, fromVertex, toVertex);

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

    int dwellTime = (int) ((toTime - time) / 1000);
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 departureTime = instance.getBestDepartureTime();

    DepartureVertex fromVertex = new DepartureVertex(_context, _stop, time);
    BlockDepartureVertex toVertex = new BlockDepartureVertex(_context, instance);
    EdgeNarrative narrative = narrative(s0, fromVertex, toVertex);

    OBAStateEditor edit = (OBAStateEditor) s0.edit(this, narrative);
    edit.setTime(departureTime);
    edit.incrementNumBoardings();
    edit.setEverBoarded(true);
View Full Code Here

  }

  @Override
  public State traverse(State s0) {

    EdgeNarrative narrative = createNarrative(s0);

    StateEditor edit = s0.edit(this, narrative);
    int runningTime = computeRunningTime();
    edit.incrementTimeInSeconds(runningTime);
    edit.incrementWeight(runningTime);
View Full Code Here

TOP

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

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.