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

枢纽换乘

原能力

核对跨站、过关、重新托运行李和办理时限,把用时不确定的环节单列。(细化版 p.10–11)

首选项目

OpenTripPlanner(LGPL-3.0,局部按许可头)。 OpenTripPlanner

匹配范围

站点换乘、步行边和配置化 transfer slack。

源码

OpenTripPlanner · class RouteRequest

application/src/main/java/org/opentripplanner/routing/api/request/RouteRequest.java · 41–54 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
public class RouteRequest implements Serializable {

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

  private static final int DEFAULT_NUM_ITINERARIES = 50;
  private static final long NOW_THRESHOLD_SEC = durationInSeconds("15h");

  private static final RouteRequest DEFAULT = new RouteRequest();

  private final GenericLocation from;
  private final GenericLocation to;
  private final List<ViaLocation> via;
  private final Instant dateTime;
  private final boolean arriveBy;

OpenTripPlanner · public RoutingResponse route()

application/src/main/java/org/opentripplanner/routing/algorithm/RoutingWorker.java · 193–206 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
  public RoutingResponse route() {
    OTPRequestTimeoutException.checkForTimeout();
    this.debugTimingAggregator.finishedPrecalculating();
    var result = RoutingResult.empty();

    try (var temporaryVerticesContainer = new TemporaryVerticesContainer()) {
      this.currentLinkingContext = createLinkingContext(temporaryVerticesContainer);

      if (OTPFeature.ParallelRouting.isOn()) {
        // TODO: This is not using {@link OtpRequestThreadFactory} which means we do not get
        //       log-trace-parameters-propagation and graceful timeout handling here.
        try {
          var r1 = CompletableFuture.supplyAsync(() -> routeDirectStreet());
          var r2 = CompletableFuture.supplyAsync(() -> routeDirectFlex());

实现与验收要点

跨站、过关、重托运行李及个人可用性核实。