Package org.onebusaway.transit_data_federation.services.transit_graph

Examples of org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry


      Set<AgencyAndId> shapeIdsForIndex = new HashSet<AgencyAndId>();

      for (BlockSequence sequence : index.getSequences()) {
        for (BlockStopTimeEntry bst : sequence.getStopTimes()) {
          BlockTripEntry blockTrip = bst.getTrip();
          TripEntry trip = blockTrip.getTrip();
          AgencyAndId shapeId = trip.getShapeId();
          if (shapeId != null)
            shapeIdsForIndex.add(shapeId);
        }
      }
View Full Code Here


      if (!activeBlock.isScheduleDeviationSet())
        continue;

      // No matter what our active trip is, we let our current trip be the the
      // trip of our next stop
      BlockTripEntry activeBlockTrip = nextBlockStop.getTrip();
      TripEntry activeTrip = activeBlockTrip.getTrip();
      StopTimeEntry nextStopTime = nextBlockStop.getStopTime();
      StopEntry stop = nextStopTime.getStop();

      TripUpdate.Builder tripUpdate = TripUpdate.newBuilder();
View Full Code Here

    if (previousLocation.getDistanceAlongBlock() > distanceAlongBlock)
      throw new IllegalStateException(
          "previousLocation's distanceAlongBlock must be before the requested distanceAlongBlock");

    BlockTripEntry trip = previousLocation.getActiveTrip();
    BlockConfigurationEntry blockConfig = trip.getBlockConfiguration();

    List<BlockStopTimeEntry> stopTimes = blockConfig.getStopTimes();

    int indexFrom = previousLocation.getStopTimeIndex();
    int indexTo = indexFrom + 1;
View Full Code Here

    if (previousLocation.getScheduledTime() > scheduleTime)
      throw new IllegalStateException(
          "previousLocation's scheduledTime must be before the requested scheduleTime");

    BlockTripEntry trip = previousLocation.getActiveTrip();
    BlockConfigurationEntry blockConfig = trip.getBlockConfiguration();

    List<BlockStopTimeEntry> stopTimes = blockConfig.getStopTimes();

    int index = previousLocation.getStopTimeIndex();
View Full Code Here

      result.setActiveTrip(blockBefore.getTrip());
      shapePointIndexFrom = before.getShapePointIndex();
      shapePointIndexTo = nextShapePointIndex(after);
    }

    BlockTripEntry activeTrip = result.getActiveTrip();

    PointAndOrientation po = getLocationAlongShape(activeTrip,
        distanceAlongBlock, shapePointIndexFrom, shapePointIndexTo);

    if (po != null) {
View Full Code Here

        * (to.getArrivalTime() - from.getDepartureTime()) + from.getDepartureTime());

    if (r > 1)
      scheduledTime += to.getSlackTime();

    BlockTripEntry activeTrip = distanceAlongBlock < blockTo.getDistanceAlongBlock()
        ? blockFrom.getTrip() : blockTo.getTrip();

    BlockStopTimeEntry closestStop = r < 0.5 ? blockFrom : blockTo;

    BlockStopTimeEntry previousStop = null;
View Full Code Here

      }
    }

    for (FrequencyBlockTripIndex index : _frequencyBlockTripIndices) {

      BlockTripEntry trip = index.getTrips().get(0);

      int offset = 0;

      for (BlockStopTimeEntry bst : trip.getStopTimes()) {

        StopTimeEntry stopTime = bst.getStopTime();
        StopEntryImpl stop = (StopEntryImpl) stopTime.getStop();

        FrequencyStopTripIndex stopTripIndex = new FrequencyStopTripIndex(
View Full Code Here

      String groupId = stopSequenceGroupIds.get(sequence);

      for (BlockTripEntry trip : sequence.getTrips()) {

        BlockTripEntry prevTrip = trip.getPreviousTrip();

        if (prevTrip == null)
          continue;

        StopSequence prevSequence = stopSequencesByTrip.get(prevTrip);
View Full Code Here

  }

  @Override
  public TripStopTimesBean getStopTimesForBlockTrip(BlockTripInstance blockTripInstance) {

    BlockTripEntry blockTrip = blockTripInstance.getBlockTrip();
    TripStopTimesBean bean = getStopTimesForTrip(blockTrip.getTrip());

    if (blockTrip.getPreviousTrip() != null) {
      BlockTripEntry previous = blockTrip.getPreviousTrip();
      TripBean previousTrip = _tripBeanService.getTripForId(previous.getTrip().getId());
      bean.setPreviousTrip(previousTrip);
    }

    if (blockTrip.getNextTrip() != null) {
      BlockTripEntry next = blockTrip.getNextTrip();
      TripBean nextTrip = _tripBeanService.getTripForId(next.getTrip().getId());
      bean.setNextTrip(nextTrip);
    }
   
    FrequencyEntry frequencyLabel = blockTripInstance.getFrequencyLabel();
   
View Full Code Here

    BlockLocationRecord.Builder builder = BlockLocationRecord.builder();

    if (scheduledBlockLocation != null) {

      BlockTripEntry activeTrip = scheduledBlockLocation.getActiveTrip();
      builder.setTripId(activeTrip.getTrip().getId());
      builder.setBlockId(activeTrip.getBlockConfiguration().getBlock().getId());

      double distanceAlongBlock = scheduledBlockLocation.getDistanceAlongBlock();
      builder.setDistanceAlongBlock(distanceAlongBlock);

      double distanceAlongTrip = distanceAlongBlock
          - activeTrip.getDistanceAlongBlock();
      builder.setDistanceAlongTrip(distanceAlongTrip);
    }

    if (record.getBlockId() != null)
      builder.setBlockId(record.getBlockId());
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry

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.