Skip to content

到着時間推定と乗換経路探索に線路の長さを使う変更を取り消し、経路検索とETAを#1712の前の挙動に戻した - #1713

Closed
TinyKitten wants to merge 1 commit into
devfrom
fix/revert-estimation-track-distance
Closed

TinyKitten wants to merge 1 commit into
devfrom
fix/revert-estimation-track-distance

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

概要

#1712 を取り消します。

#1712 は、到着時間推定の駅間距離に線路の長さを使い、速度の較正をその距離で求め直しました。目的は MobileApp の開発用 GPX を実際の運行に近づけることでしたが、変更は共有の推定のロジックに入っていました。そのため、estimateArrivalTimes(ETA)と connectedRoutes(経路検索)の結果も変わりました。

元々の設計では、経路検索の所要時間、legs を渡した estimateArrivalTimes、trainRoute の Estimated が同じ見積もりになることを、テストで保証しています(connected_route_eta_and_train_route_follow_the_legs、estimated_train_route_matches_a_single_leg_estimate)。このうち 1 つだけを変えることはできないので、#1712 をまるごと取り消し、元々の挙動に戻します。

変更の種類

  • バグ修正
  • 新機能
  • データの修正・追加
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

本番との比較

このブランチを make data && make dev で起動した Worker と本番に同じ問い合わせを送り、応答を比べました。本番には #1710・#1711 も入っていないので、この比較で 2 つが既存の出力を変えていないことも確かめています。

問い合わせ 本番と一致
trainRoute(lineGroupId あり、駅だけ、環状線の継ぎ目) 124 / 124
estimateArrivalTimes(方向あり、方向なし) 120 / 120
estimateArrivalTimes と trainRoute(legs あり) 2 / 2
connectedRoutes(75 組 × 並べ方 3 通り) 75 / 75

問い合わせは、無作為に選んだ 60 の種別グループと駅グループの組、および所要時間のベンチマークの区間から作りました。

テスト

  • make fmt が通ること
  • make clippy が通ること(wasm32 ターゲットを含む)
  • make test が通ること

cargo fmt --all -- --check、make clippy、make test を実行し、すべて成功しました(stationapi 438 件、stationapi-worker 28 件ほか、失敗なし)。make test は、generated/ がある状態と data/*.csv だけの状態の両方で通しています。

関連Issue

Reverts #1712

スクリーンショット(任意)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 推定の変更
    • 到着時間の推定では、駅間の線路距離ではなく、駅間の直線距離に路線ごとの迂回係数を適用するようになりました。
    • 経路の所要時間は、更新された速度較正値に基づいて算出されます。
  • 速度データの更新
    • 複数路線の路線別・駅間別速度較正値が更新され、列車の速度推定に反映されます。
  • ドキュメント
    • データソースの記載を更新しました。

@TinyKitten TinyKitten self-assigned this Sep 30, 2026
@github-actions github-actions Bot added fix 直した deploy-dev rust and removed fix 直した labels Sep 30, 2026
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 29a9936b-ef23-4b25-a9cf-fe1fb28a5b00

📥 Commits

Reviewing files that changed from the base of the PR and between 5f13885 and 1ff4e06.

⛔ Files ignored due to path filters (2)
  • travel_times/baseline.csv is excluded by !**/*.csv
  • travel_times/cases.csv is excluded by !**/*.csv
📒 Files selected for processing (14)
  • AGENTS.md
  • README.md
  • docs/architecture.md
  • scripts/README.md
  • scripts/compute_speed_table.py
  • src/repository.rs
  • stationapi/src/domain.rs
  • stationapi/src/domain/arrival_estimation.rs
  • stationapi/src/domain/legacy_speed_table.rs
  • stationapi/src/domain/route_search.rs
  • stationapi/src/domain/segment_speed_table.rs
  • stationapi/src/domain/speed_table.rs
  • stationapi/src/use_case/dto/simulation.rs
  • stationapi/src/use_case/interactor/query.rs
 _____________________________________________________________
< Oompa Loompa doompadee doo, I've got a code review for you. >
 -------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@TinyKitten

Copy link
Copy Markdown
Member Author

取り消しではなく、#1712 の新しい計算を trainRoute の Estimated だけに閉じ込め、estimateArrivalTimes と connectedRoutes を元の計算に戻す形で出し直すため、閉じます。

@TinyKitten TinyKitten closed this Sep 30, 2026
@TinyKitten
TinyKitten deleted the fix/revert-estimation-track-distance branch September 30, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant