Package org.opentripplanner.routing.core

Examples of org.opentripplanner.routing.core.State


    GraphPath path = paths.get(0);

    double totalDistance = 0;

    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


    long time = s0.getTime() + (transferTime + options.minTransferTime) * 1000;

    List<StopTimeInstance> instances = stopTimeService.getNextBlockSequenceDeparturesForStop(
        _transfer.getStop(), time, false);

    State results = null;

    for (StopTimeInstance instance : instances) {
      State r = getDepartureAsTraverseResult(instance, s0, transferWeight);
      results = r.addToExistingResultChain(results);
    }

    return results;
  }
View Full Code Here

    TraverseOptions options = s0.getOptions();

    if (options.isArriveBy())
      return null;

    State results = null;

    for (StopTimeInstance instance : _instances) {

      TPOfflineTransferVertex vTransfer = new TPOfflineTransferVertex(_context,
          instance);
      EdgeNarrative nTransfer = narrative(s0, _vFrom, vTransfer);
      StateEditor edit = s0.edit(this, nTransfer);

      long t = instance.getDepartureTime();
      edit.setTime(t);

      long startTime = t - _transferTime * 1000;
      edit.setStartTime(startTime);

      double w = _transferTime * options.walkReluctance;
      edit.incrementWeight(w);

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

    return results;
  }
View Full Code Here

TOP

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

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.