-
Notifications
You must be signed in to change notification settings - Fork 4
Priority #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #385 +/- ##
==========================================
- Coverage 83.55% 83.36% -0.20%
==========================================
Files 53 53
Lines 5466 5505 +39
Branches 634 636 +2
==========================================
+ Hits 4567 4589 +22
- Misses 888 905 +17
Partials 11 11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| RoadNetwork graph{}; | ||
| // Node 1 is the intersection | ||
| // Edge 1: 0 -> 1 (HIGHWAY) | ||
| Street s1(1, std::make_pair(0, 1), 100., 30., 1); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule
| s1.setRoadType(RoadType::HIGHWAY); | ||
|
|
||
| // Edge 2: 2 -> 1 (HIGHWAY) | ||
| Street s2(2, std::make_pair(2, 1), 100., 30., 1); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule
| s2.setRoadType(RoadType::HIGHWAY); | ||
|
|
||
| // Edge 3: 3 -> 1 (SECONDARY) | ||
| Street s3(3, std::make_pair(3, 1), 100., 30., 1); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request refactors the road priority system from a numeric priority value (int m_priority) to a boolean flag (bool m_hasPriority) that indicates whether a road has priority or not. It also introduces a new method autoAssignRoadPriorities() that automatically assigns priorities based on road types at intersections.
Changes:
- Changed priority from a numeric value to a boolean flag indicating presence/absence of priority
- Updated
autoMapStreetLanes()to use estimated flow (maxSpeed × nLanes) instead of numeric priorities - Added
autoAssignRoadPriorities()method to automatically assign priorities based on road types
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dsf/mobility/Road.hpp | Changed m_priority from int to bool m_hasPriority, updated setPriority() to take no parameters and priority() to hasPriority() |
| src/dsf/mobility/Road.cpp | Removed the constructor initialization of m_priority and the setPriority(int) method implementation |
| src/dsf/mobility/Street.cpp | Updated equality operator to compare m_hasPriority instead of m_priority |
| src/dsf/mobility/RoadNetwork.hpp | Added declaration for autoAssignRoadPriorities() method |
| src/dsf/mobility/RoadNetwork.cpp | Updated autoMapStreetLanes() to use estimated flow calculations; added autoAssignRoadPriorities() implementation |
| test/mobility/Test_street.cpp | Updated tests to use hasPriority() and parameter-less setPriority() |
| test/mobility/Test_graph.cpp | Added test case for autoAssignRoadPriorities() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/dsf/mobility/RoadNetwork.hpp
Outdated
| /// @brief Automatically re-maps street lanes basing on network's topology | ||
| /// @details For example, if one street has the right turn forbidden, then the right lane becomes a straight one | ||
| void autoMapStreetLanes(); | ||
|
|
Copilot
AI
Jan 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new autoAssignRoadPriorities() method lacks documentation. Add a @brief comment explaining what this method does, such as '@brief Automatically assigns road priorities based on road types at intersections'.
| /// @brief Automatically assigns road priorities based on road types at intersections. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.