Skip to content

Conversation

@Grufoony
Copy link
Collaborator

@Grufoony Grufoony commented Apr 3, 2025

No description provided.

@Grufoony Grufoony requested a review from Copilot April 3, 2025 12:37
Copy link
Contributor

Copilot AI left a 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 implements changes to support the new SINGLE TAIL optimization algorithm for traffic lights. Key changes include updates to test cases reflecting new parameters, additions to utility type definitions, modifications to traffic light cycle reset logic, and a version bump.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/Test_dynamics.cpp Updated test cases to call optimizeTrafficLights with a new numeric parameter value.
src/dsm/utility/Typedef.hpp Added header includes and introduced a new constexpr array mapping directions to text.
src/dsm/sources/TrafficLight.cpp Modified the resetCycles() logic to use a ternary operator for cycle resetting.
src/dsm/headers/TrafficLight.hpp Added a new member variable (m_defaultCycles) to hold default traffic light cycle values.
src/dsm/dsm.hpp Updated the DSM version patch to reflect the new version.
Comments suppressed due to low confidence (2)

test/Test_dynamics.cpp:802

  • [nitpick] Consider using a named constant instead of the literal '1' for the first parameter of optimizeTrafficLights to improve code clarity.
dynamics.optimizeTrafficLights(1, dsm::TrafficLightOptimization::SINGLE_TAIL);

src/dsm/sources/TrafficLight.cpp:231

  • [nitpick] The use of the ternary operator for executing assignments reduces readability; consider refactoring this logic using an if-else statement for clarity and maintainability.
m_defaultCycles.empty() ? m_defaultCycles = m_cycles : m_cycles = m_defaultCycles;

@codecov
Copy link

codecov bot commented Apr 3, 2025

Codecov Report

Attention: Patch coverage is 51.02740% with 143 lines in your changes missing coverage. Please review.

Project coverage is 87.65%. Comparing base (4c909f2) to head (bf4d7f5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/dsm/headers/RoadDynamics.hpp 50.51% 143 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
- Coverage   89.99%   87.65%   -2.35%     
==========================================
  Files          38       38              
  Lines        5536     5790     +254     
  Branches      520      572      +52     
==========================================
+ Hits         4982     5075      +93     
- Misses        554      715     +161     
Flag Coverage Δ
unittests 87.65% <51.02%> (-2.35%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@Grufoony Grufoony merged commit 2e9c8ed into main Apr 3, 2025
29 of 31 checks passed
@Grufoony Grufoony deleted the improveOptimizationAlgorithm branch April 3, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants