新幹線の速度プロファイルが種別上限130km/hに引き下げられる問題を修正 - #1587
Conversation
のぞみ等の新幹線種別は kind=LimitedExpress で登録されているため、 resolve_speed_profile が路線種別 BulletTrain の 320km/h ではなく 種別上限の 130km/h を返してしまい、TrainRoute の新幹線区間 (例: 新横浜→名古屋)の最高速度が大幅に過小になっていた。 種別上限は在来線の速達種別を底上げするための値なので、 路線種別の上限との max を取り、路線上限より遅くならないようにする。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SDYiyztD7z8FmDUCEqUHBt
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Changes速度プロファイル判定の変更
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@stationapi/src/use_case/dto/simulation.rs`:
- Around line 43-48: Update the naming in simulation.rs to reflect that
LIMITED_EXPRESS_KIND_MAX_SPEED is now used as a floor rather than a cap: rename
the constant and any related references in the max_speed logic and the test
named limited_express_kind_caps_speed_over_line_type so the symbols clearly
communicate “bottoming up” behavior. Keep the match in the simulation DTO
aligned with the new name and adjust the test description to match the actual
rule for TrainTypeKind::LimitedExpress and TrainTypeKind::HighSpeedRapid.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2033d44e-ee1e-4d2c-ba75-05fe01502e94
📒 Files selected for processing (1)
stationapi/src/use_case/dto/simulation.rs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SDYiyztD7z8FmDUCEqUHBt
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
概要
TrainRoute の新幹線区間(例: 東海道新幹線のぞみ 新横浜→名古屋)で最高速度が大幅に過小になる問題を修正しました。のぞみ等の新幹線種別は
kind=LimitedExpressで登録されているため、resolve_speed_profileが路線種別 BulletTrain の 320km/h ではなく種別上限の 130km/h を返してしまっていました。変更の種類
変更内容
resolve_speed_profileの種別上限(LimitedExpress / HighSpeedRapid → 130km/h)を、路線種別上限とのmaxに変更。種別上限は在来線の速達種別を底上げするための値であり、新幹線(320km/h)を引き下げないようにしたテスト
cargo fmt --all -- --checkが通ることcargo clippy -- -D warningsが通ることcargo test(SQLX_OFFLINE=true)が通ること関連Issue
スクリーンショット(任意)
🤖 Generated with Claude Code
https://claude.ai/code/session_01SDYiyztD7z8FmDUCEqUHBt
Generated by Claude Code
Summary by CodeRabbit