Package org.onebusaway.transit_data_federation.services.tripplanner

Examples of org.onebusaway.transit_data_federation.services.tripplanner.TransferParent


  @Override
  public TransferParent getTransferPatternsForStops(
      TransferPatternData transferPatternData, StopEntry stopFrom,
      List<StopEntry> stopsTo) {

    TransferParent root = getTransferPatternsForStopsInternal(
        transferPatternData, stopFrom, stopsTo);
    transferPatternData.clearMinRemainingWeights();
    return root;
  }
View Full Code Here


      TransferPatternData transferPatternData, Iterable<StopEntry> stopsFrom,
      StopEntry stopTo) {

    List<StopEntry> stopToAsList = Arrays.asList(stopTo);

    TransferParent root = new TransferParent(transferPatternData);

    TransferPatternData forwardData = new TransferPatternData();

    for (StopEntry stopFrom : stopsFrom) {

      TransferParent trees = getTransferPatternsForStopsInternal(forwardData,
          stopFrom, stopToAsList);
      Set<TransferNode> visited = new HashSet<TransferNode>();
      for (TransferNode tree : trees.getTransfers())
        reverseTree(tree, root, true, visited);
    }

    transferPatternData.clearMinRemainingWeights();
View Full Code Here

  private TransferParent getTransferPatternsForStopsInternal(
      TransferPatternData transferPatternData, StopEntry stopFrom,
      List<StopEntry> stopsTo) {

    TransferParent root = new TransferParent(transferPatternData);

    TransferPattern pattern = _transferPatternsByStop.get(stopFrom);
    if (pattern == null)
      return root;

    pattern.getTransfersForStops(root, stopsTo);

    Map<StopEntry, List<TransferParent>> hubParentsByStop = pattern.getTransfersForHubStops(root);

    for (Map.Entry<StopEntry, List<TransferParent>> entry : hubParentsByStop.entrySet()) {

      StopEntry hubStop = entry.getKey();
      List<TransferParent> parents = entry.getValue();

      TransferParent nodes = transferPatternData.getNodesForHubStop(hubStop);

      if (nodes == null) {
        nodes = getTransferPatternsForStopsInternal(transferPatternData,
            hubStop, stopsTo);
        transferPatternData.setNodesForHubStop(hubStop, nodes);
      }

      for (TransferParent parent : parents) {
        for (TransferNode node : nodes.getTransfers()) {
          parent.addTransferNode(node);
        }
      }
    }
View Full Code Here

    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);
View Full Code Here

    Entry a = node.parent;
    if (a == null)
      throw new IllegalStateException();
    node = a.parent;

    TransferParent parent = getTransferForEntry(node, false, root);
    return parent.extendTree(a.stop, b.stop, exitAllowed);
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.tripplanner.TransferParent

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.