-
Notifications
You must be signed in to change notification settings - Fork 4
Enhance right of way management #298
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
Conversation
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.
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #298 +/- ##
==========================================
- Coverage 86.92% 86.62% -0.30%
==========================================
Files 38 38
Lines 5844 5938 +94
Branches 581 597 +16
==========================================
+ Hits 5080 5144 +64
- Misses 764 794 +30
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:
|
Co-authored-by: Copilot <[email protected]>
| if (pStreetTemp->nExitingAgents() == 0) { | ||
| continue; | ||
| } | ||
| if (intersection.streetPriorities().contains(streetId)) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 14.4 rule Note
| // The problem arises only when you have to turn left | ||
| for (auto i{0}; i < pStreetTemp->nLanes(); ++i) { | ||
| // check queue is not empty and take the top agent | ||
| if (pStreetTemp->queue(i).empty()) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 14.4 rule Note
| auto const& pStreetTemp{this->graph().edge(streetId)}; | ||
| for (auto i{0}; i < pStreetTemp->nLanes(); ++i) { | ||
| // check queue is not empty and take the top agent | ||
| if (pStreetTemp->queue(i).empty()) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 14.4 rule Note
| for (auto const& sourceId : | ||
| this->graph().adjacencyMatrix().getCol(pNode->id())) { | ||
| auto const streetId = sourceId * N + pNode->id(); | ||
| auto const streetId{sourceId * N + pNode->id()}; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.1 rule Note
| case Direction::LEFT: | ||
| pStreet->enqueue(nLanes - 1); | ||
| break; | ||
| case Direction::RIGHT: |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 16.2 rule Note
| Direction Road::turnDirection(double const& previousStreetAngle) const { | ||
| auto const deltaAngle{this->deltaAngle(previousStreetAngle)}; | ||
| if (std::abs(deltaAngle) >= std::numbers::pi) { | ||
| return Direction::UTURN; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
| if (std::abs(deltaAngle) >= std::numbers::pi) { | ||
| return Direction::UTURN; | ||
| } | ||
| if (std::abs(deltaAngle) < std::numbers::pi / 8) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.1 rule Note
| return Direction::UTURN; | ||
| } | ||
| if (std::abs(deltaAngle) < std::numbers::pi / 8) { | ||
| return Direction::STRAIGHT; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
| return Direction::STRAIGHT; | ||
| } | ||
| if (deltaAngle < 0.) { | ||
| return Direction::RIGHT; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
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.
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
test/Test_dynamics.cpp:1028
- Ensure that the updated expected value (1 agent) accurately reflects the intended right of way behavior and that the removal of a previously expected agent is deliberate in the simulation logic.
CHECK_EQ(nodeO.agents().size(), 1);
src/dsm/headers/RoadDynamics.hpp:669
- Ensure that comparisons between Direction enums using >= and < accurately reflect their intended ordering; consider clarifying the enum definitions to support these comparisons.
else if (thisDirection >= Direction::LEFT) {
Close #297