和顺 / 明行 返回所属 Agent
MX-04.03

运行时间核对

原能力

检查公布班次、预约窗口和当地时间,标出计划中仍缺实时确认的段落。(细化版 p.10–11)

首选项目

GTFS Realtime Bindings(Apache-2.0(绑定库))。 GTFS Realtime Bindings

接入说明

首选 GTFS Realtime 核对 TripUpdate 和 Alert,OTP 用于接入。

匹配范围

静态校验及实时 TripUpdate/Alert 核时刻与变更。

源码

GTFS Realtime Bindings · message TripUpdate

gtfs-realtime.proto · 156–169 行。 在 GitHub 查看规范模型 · 许可证与声明

源码片段
message TripUpdate {
  // The Trip that this message applies to. There can be at most one
  // TripUpdate entity for each actual trip instance.
  // If there is none, that means there is no prediction information available.
  // It does *not* mean that the trip is progressing according to schedule.
  required TripDescriptor trip = 1;

  // Additional information on the vehicle that is serving this trip.
  optional VehicleDescriptor vehicle = 3;

  // Timing information for a single predicted event (either arrival or
  // departure).
  // Timing consists of delay and/or estimated time, and uncertainty.
  // - delay should be used when the prediction is given relative to some
  • // Copyright 2015 The GTFS Specifications Authors.

GTFS Realtime Bindings · message Alert

gtfs-realtime.proto · 624–637 行。 在 GitHub 查看规范模型 · 许可证与声明

源码片段
message Alert {
  // Time when the alert should be shown to the user. If missing, the
  // alert will be shown as long as it appears in the feed.
  // If multiple ranges are given, the alert will be shown during all of them.
  // Should not be used - for backwards-compatibility only.
  repeated TimeRange active_period = 1 [deprecated = true];

  // Time when the alert should be shown to the user strictly for informative reasons.
  // If missing, the consuming application can decide when it's appropriate to be shown.
  // If multiple ranges are given, the alert will be shown during all of them.
  repeated TimeRange communication_period = 2;

  // Time when the services are affected by the alert. If communication_period is specified,
  // every time interval in impact_period must be fully contained within at least
  • // Copyright 2015 The GTFS Specifications Authors.

OpenTripPlanner · class PollingTripUpdater

application/src/main/java/org/opentripplanner/updater/trip/gtfs/updater/http/PollingTripUpdater.java · 23–36 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
public class PollingTripUpdater extends PollingGraphUpdater<TransitRealTimeUpdateContext> {

  private static final Logger LOG = LoggerFactory.getLogger(PollingTripUpdater.class);

  private final HttpTripUpdateSource updateSource;
  private final GtfsRealTimeTripUpdateAdapter adapter;

  /**
   * Feed id that is used for the trip ids in the TripUpdates
   */
  private final String feedId;

  /**
   * Defines when delays are propagated to next stops.

实现与验收要点

预约、当地规则、服务覆盖和实际回执缺口。