Examples of StopEntry


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

    }

    public synchronized AlarmForBlockInstance registerAlarm(AlarmAction action,
        int effectiveScheduleTime, ArrivalAndDepartureInstance instance) {

      StopEntry stop = instance.getStop();
      AgencyAndId stopId = stop.getId();
      AgencyAndId alarmId = new AgencyAndId(stopId.getAgencyId(),
          UUID.randomUUID().toString());

      AlarmForBlockInstance alarm = new AlarmForBlockInstance(alarmId, action,
          effectiveScheduleTime);
View Full Code Here

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

    return stops.length;
  }

  @Override
  public StopHop get(int index) {
    StopEntry stop = stops[index];
    int minTravelTime = minTravelTimes[index];
    return new StopHop(stop, minTravelTime);
  }
View Full Code Here

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

    TripEntry trip = blockTrip.getTrip();
    AgencyAndId tripId = trip.getId();
    AgencyAndId lineId = trip.getRouteCollection().getId();
    String directionId = trip.getDirectionId();
    StopTimeEntry stopTime = blockStopTime.getStopTime();
    StopEntry stop = stopTime.getStop();
    AgencyAndId stopId = stop.getId();

    Set<AgencyAndId> serviceAlertIds = new HashSet<AgencyAndId>();
    /*
     * TODO: Temporarily disable
     */
 
View Full Code Here

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

      OBAState obaState = (OBAState) state;
      Vertex v = state.getVertex();

      if (v instanceof AbstractStopVertex) {
        AbstractStopVertex stopVertex = (AbstractStopVertex) v;
        StopEntry stop = stopVertex.getStop();
        long initialWaitTime = obaState.getInitialWaitTime();
        long duration = Math.abs(state.getTime() - time) - initialWaitTime;
        if (!results.containsKey(stop) || results.get(stop) > duration)
          results.put(stop, duration);
      } else if (v instanceof AbstractBlockVertex) {
        AbstractBlockVertex blockVertex = (AbstractBlockVertex) v;
        ArrivalAndDepartureInstance instance = blockVertex.getInstance();
        StopEntry stop = instance.getStop();
        long initialWaitTime = obaState.getInitialWaitTime();
        long duration = Math.abs(state.getTime() - time) - initialWaitTime;
        if (!results.containsKey(stop) || results.get(stop) > duration)
          results.put(stop, duration);
      }
View Full Code Here

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

      } else {

        _stopLocationTree = new STRtree(_stops.size());

        for (int i = 0; i < _stops.size(); i++) {
          StopEntry stop = _stops.get(i);
          double x = stop.getStopLon();
          double y = stop.getStopLat();
          Envelope r = new Envelope(x, x, y, y);
          _stopLocationTree.insert(r, stop);
        }

        _stopLocationTree.build();
      }

      System.out.println("  stops=" + _stops.size());
      System.out.println("  trips= " + _trips.size());
    }

    if (_agencyEntriesById == null
        || _agencyEntriesById.size() < _agencies.size()) {
      refreshAgencyMapping();
    }

    if (_tripEntriesById == null || _tripEntriesById.size() < _trips.size()) {
      refreshTripMapping();
    }

    if (_blockEntriesById == null || _blockEntriesById.size() < _blocks.size()) {
      refreshBlockMapping();
    }

    if (_stopEntriesById == null || _stopEntriesById.size() < _stops.size())
      refreshStopMapping();

    if (_routeCollectionEntriesById == null
        || _routeCollectionEntriesById.size() < _routeCollections.size())
      refreshRouteCollectionMapping();

    if (_routeEntriesById == null || _routeEntriesById.size() < _routes.size())
      refreshRouteMapping();

    int i = 0;
    for (StopEntryImpl stop : _stops)
      stop.setIndex(i++);
  }
View Full Code Here

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

           * This vertex combination occurs when we are doing an "arrive by"
           * trip and we need to do a transfer between two stops.
           */

          ArrivalVertex fromStopVertex = (ArrivalVertex) vFrom;
          StopEntry fromStop = fromStopVertex.getStop();

          BlockDepartureVertex toStopVertex = (BlockDepartureVertex) vTo;
          ArrivalAndDepartureInstance departureInstance = toStopVertex.getInstance();
          StopEntry toStop = departureInstance.getStop();

          addTransferLegIfNeeded(state, fromStop, toStop, options, legs);
        }
      } else if (edge instanceof TPTransferEdge) {

        TPTransferEdge transferEdge = (TPTransferEdge) edge;
        StopEntry fromStop = transferEdge.getFromStop();
        StopEntry toStop = transferEdge.getToStop();

        addTransferLegIfNeeded(state, fromStop, toStop, options, legs);
      }

      currentIndex++;
View Full Code Here

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

  @Override
  public Collection<Edge> getIncoming() {

    List<Edge> edges = new ArrayList<Edge>();
    StopEntry stop = _instance.getStop();

    /**
     * We can stay on the bus if applicable
     */
    BlockStopTimeEntry bst = _instance.getBlockStopTime();
View Full Code Here

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

      /**
       * We've possibly transfered to another stop, so we need to insert the
       * walk leg
       */
      ArrivalAndDepartureInstance fromStopTimeInstance = arrival.getInstance();
      StopEntry fromStop = fromStopTimeInstance.getStop();

      DepartureVertex toStopVertex = (DepartureVertex) vTo;
      StopEntry toStop = toStopVertex.getStop();

      addTransferLegIfNeeded(state, fromStop, toStop, options, legs);
    }

    return builder;
View Full Code Here

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

    StopTimeEntry fromStopTime = bstFrom.getStopTime();
    StopTimeNarrative stopTimeNarrative = _narrativeService.getStopTimeForEntry(fromStopTime);
    transitLeg.setRouteShortName(stopTimeNarrative.getRouteShortName());
    transitLeg.setTripHeadsign(stopTimeNarrative.getStopHeadsign());

    StopEntry fromStop = fromStopTimeInstance.getStop();
    StopBean fromStopBean = _stopBeanService.getStopForId(fromStop.getId());
    transitLeg.setFromStop(fromStopBean);

    transitLeg.setFromStopSequence(fromStopTime.getSequence());

    leg.setFrom(fromStop.getStopLocation());

    BlockLocation blockLocation = fromStopTimeInstance.getBlockLocation();
    if (blockLocation != null) {
      AgencyAndId vehicleId = blockLocation.getVehicleId();
      transitLeg.setVehicleId(AgencyAndIdLibrary.convertToString(vehicleId));
View Full Code Here

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

    ArrivalAndDepartureInstance toStopTimeInstance = builder.getToStop();

    if (toStopTimeInstance == null)
      return;

    StopEntry toStop = toStopTimeInstance.getStop();
    StopBean toStopBean = _stopBeanService.getStopForId(toStop.getId());
    transitLeg.setToStop(toStopBean);

    BlockStopTimeEntry blockStopTime = toStopTimeInstance.getBlockStopTime();
    StopTimeEntry stopTime = blockStopTime.getStopTime();
    transitLeg.setToStopSequence(stopTime.getSequence());

    leg.setTo(toStop.getStopLocation());

    BlockLocation blockLocation = toStopTimeInstance.getBlockLocation();
    if (blockLocation != null) {
      AgencyAndId vehicleId = blockLocation.getVehicleId();
      transitLeg.setVehicleId(AgencyAndIdLibrary.convertToString(vehicleId));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.