Package org.onebusaway.transit_data_federation.services.transit_graph

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


        scheduledTimeTo));
   
    InstanceState state = new InstanceState(serviceDate.getTime());

    for (int in = indexFrom; in < indexTo; in++) {
      BlockTripEntry trip = trips.get(in);
      BlockConfigurationEntry block = trip.getBlockConfiguration();
      BlockInstance instance = new BlockInstance(block, state);
      instances.add(instance);
    }
  }
View Full Code Here


        scheduledTimeTo));
   
    InstanceState state = new InstanceState(serviceDate.getTime());

    for (int in = indexFrom; in < indexTo; in++) {
      BlockTripEntry trip = trips.get(in);
      BlockConfigurationEntry block = trip.getBlockConfiguration();
      BlockInstance instance = new BlockInstance(block, state);
      instances.add(instance);
    }
  }
View Full Code Here

        serviceIntervalIndex.getEndTimes(), scheduledTimeFrom));
    int indexTo = index(Arrays.binarySearch(
        serviceIntervalIndex.getStartTimes(), scheduledTimeTo));

    for (int in = indexFrom; in < indexTo; in++) {
      BlockTripEntry trip = trips.get(in);
      BlockConfigurationEntry block = trip.getBlockConfiguration();
      FrequencyEntry frequency = frequencies.get(in);
      InstanceState state = new InstanceState(serviceDate.getTime(), frequency);
      BlockInstance instance = new BlockInstance(block, state);
      instances.add(instance);
    }
View Full Code Here

      List<StopTimeInstance> stopTimesForRoute = stopTimesByRouteCollectionId.get(routeId);

      for (StopTimeInstance sti : stopTimesForRoute) {

        BlockStopTimeEntry bst = sti.getStopTime();
        BlockTripEntry blockTrip = sti.getTrip();
        BlockConfigurationEntry blockConfig = blockTrip.getBlockConfiguration();
        TripEntry trip = blockTrip.getTrip();

        AgencyAndId tripId = trip.getId();
        AgencyAndId serviceId = trip.getServiceId().getId();

        TripNarrative narrative = _narrativeService.getTripForId(tripId);

        StopTimeInstanceBean stiBean = new StopTimeInstanceBean();
        stiBean.setTripId(AgencyAndIdLibrary.convertToString(tripId));
        stiBean.setServiceDate(sti.getServiceDate());
        stiBean.setArrivalTime(sti.getArrivalTime());
        stiBean.setDepartureTime(sti.getDepartureTime());
        stiBean.setServiceId(AgencyAndIdLibrary.convertToString(serviceId));

        stiBean.setArrivalEnabled(bst.getBlockSequence() > 0);
        stiBean.setDepartureEnabled(bst.getBlockSequence() + 1 < blockConfig.getStopTimes().size());

        String directionId = trip.getDirectionId();
        if (directionId == null)
          directionId = "0";

        String tripHeadsign = narrative.getTripHeadsign();

        TripHeadsignStopTimeGroupKey groupKey = new TripHeadsignStopTimeGroupKey(
            tripHeadsign);
        ContinuesAsStopTimeGroupKey continuesAsGroupKey = getContinuesAsGroupKeyForStopTimeInstance(sti);

        StopTimeByDirectionEntry stopTimesForDirection = stopTimesByDirection.get(directionId);

        stopTimesForDirection.addEntry(stiBean, tripHeadsign, groupKey,
            continuesAsGroupKey);
      }

      List<StopTimeInstance> frequenciesForRoute = frequenciesByRouteCollectionId.get(routeId);

      for (StopTimeInstance sti : frequenciesForRoute) {

        BlockStopTimeEntry blockStopTime = sti.getStopTime();
        BlockTripEntry blockTrip = blockStopTime.getTrip();
        TripEntry trip = blockTrip.getTrip();
        BlockConfigurationEntry blockConfig = blockTrip.getBlockConfiguration();

        AgencyAndId tripId = trip.getId();
        AgencyAndId serviceId = trip.getServiceId().getId();

        TripNarrative narrative = _narrativeService.getTripForId(tripId);
View Full Code Here

      Date serviceDate = date.getAsDate(serviceIds.getTimeZone());

      for (BlockStopTimeEntry stopTime : index.getStopTimes()) {

        BlockTripEntry blockTrip = stopTime.getTrip();
        TripEntry trip = blockTrip.getTrip();
        AgencyAndId routeCollectionId = trip.getRouteCollection().getId();

        FrequencyEntry frequencyLabel = trip.getFrequencyLabel();
        InstanceState state = new InstanceState(serviceDate.getTime(),
            frequencyLabel);
View Full Code Here

      for (FrequencyBlockStopTimeEntry entry : index.getFrequencyStopTimes()) {

        BlockStopTimeEntry stopTime = entry.getStopTime();

        BlockTripEntry blockTrip = stopTime.getTrip();
        TripEntry trip = blockTrip.getTrip();
        AgencyAndId routeCollectionId = trip.getRouteCollection().getId();
        InstanceState state = new InstanceState(serviceDate.getTime(),
            entry.getFrequency());

        StopTimeInstance sti = new StopTimeInstance(stopTime, state);
View Full Code Here

  }

  private ContinuesAsStopTimeGroupKey getContinuesAsGroupKeyForStopTimeInstance(
      StopTimeInstance instance) {

    BlockTripEntry blockTrip = instance.getTrip();
    AgencyAndId lineId = getContinuesAsLineId(blockTrip);
    return new ContinuesAsStopTimeGroupKey(lineId);
  }
View Full Code Here

    return new ContinuesAsStopTimeGroupKey(lineId);
  }

  private AgencyAndId getContinuesAsLineId(BlockTripEntry blockTrip) {

    BlockTripEntry nextTrip = blockTrip.getNextTrip();
    if (nextTrip == null)
      return null;

    TripEntry prevTrip = blockTrip.getTrip();
    AgencyAndId prevLineId = prevTrip.getRouteCollection().getId();
    AgencyAndId nextLineId = nextTrip.getTrip().getRouteCollection().getId();
    if (prevLineId.equals(nextLineId))
      return null;

    List<BlockStopTimeEntry> stopTimes = blockTrip.getStopTimes();
    BlockStopTimeEntry prevStopTime = stopTimes.get(stopTimes.size() - 1);

    List<BlockStopTimeEntry> nextStopTimes = nextTrip.getStopTimes();
    BlockStopTimeEntry nextStopTime = nextStopTimes.get(0);

    int prevTime = prevStopTime.getStopTime().getDepartureTime();
    int nextTime = nextStopTime.getStopTime().getArrivalTime();
View Full Code Here

  @Override
  public ScheduleDeviationHistogram getScheduleDeviationHistogramForArrivalAndDepartureInstance(
      ArrivalAndDepartureInstance instance, int stepSizeInSeconds) {

    BlockTripEntry blockTrip = instance.getBlockTrip();
    TripEntry trip = blockTrip.getTrip();
    AgencyAndId tripId = trip.getId();

    ScheduleDeviationHistory history = _scheduleDeviationHistoryDao.getScheduleDeviationHistoryForTripId(tripId);
   
    if( history == null)
View Full Code Here

      ScheduledBlockLocation scheduledBlockLocation) {
   
    if( true )
      return null;

    BlockTripEntry blockTrip = scheduledBlockLocation.getActiveTrip();
    TripEntry trip = blockTrip.getTrip();

    ScheduleDeviationHistory history = _scheduleDeviationHistoryDao.getScheduleDeviationHistoryForTripId(trip.getId());

    if (history == null)
      return null;
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.