Skip to content

Conversation

@Grufoony
Copy link
Collaborator

@Grufoony Grufoony commented Oct 9, 2024

No description provided.

@codecov
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 78.63248% with 25 lines in your changes missing coverage. Please review.

Project coverage is 94.32%. Comparing base (ef69f61) to head (fb0700b).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/dsm/headers/Dynamics.hpp 57.62% 25 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #195      +/-   ##
==========================================
- Coverage   94.77%   94.32%   -0.45%     
==========================================
  Files          17       17              
  Lines        3004     3472     +468     
  Branches      294      315      +21     
==========================================
+ Hits         2847     3275     +428     
- Misses        157      197      +40     
Flag Coverage Δ
unittests 94.32% <78.63%> (-0.45%) ⬇️

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.

@Grufoony
Copy link
Collaborator Author

I have moved changes to Node.hpp to another PR (see #199).
Next week with @filippodll we'll try to write a test for the optimization algorithm in order to make codecov happy and finally merge this PR.
By now, I consider the algorithm implementation as completed. Only tests are missing.

@Grufoony Grufoony changed the title Improved algorithm for traffic lights (2) Improved algorithm for traffic lights Oct 26, 2024
}
SUBCASE("Traffic Lights optimization algorithm") {
GIVEN("A dynamics object with a traffic light intersection") {
TrafficLight tl{1};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
GIVEN("A dynamics object with a traffic light intersection") {
TrafficLight tl{1};
tl.setDelay(4);
double length{90.}, max_speed{15.};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
TrafficLight tl{1};
tl.setDelay(4);
double length{90.}, max_speed{15.};
Street s_01{1, 10, length, max_speed, std::make_pair(0, 1)};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
Street s_41{21, 10, length, max_speed, std::make_pair(4, 1)};
tl.addStreetPriority(1);
tl.addStreetPriority(7);
Graph graph2;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
tl.addStreetPriority(1);
tl.addStreetPriority(7);
Graph graph2;
graph2.addNode(std::make_unique<TrafficLight>(tl));

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
graph2.addNode(std::make_unique<TrafficLight>(tl));
graph2.addStreets(s_01, s_10, s_12, s_21, s_13, s_31, s_14, s_41);
graph2.buildAdj();
Dynamics dynamics{graph2};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
graph2.addStreets(s_01, s_10, s_12, s_21, s_13, s_31, s_14, s_41);
graph2.buildAdj();
Dynamics dynamics{graph2};
Itinerary it_0{0, 0}, it_1{1, 2}, it_2{2, 3}, it_3{3, 4};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
dynamics.optimizeTrafficLights(2, 0.1, 1.);
THEN("Green and red time are different") {
const auto timing =
dynamic_cast<TrafficLight&>(*dynamics.graph().nodeSet().at(1))

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
tl.setPhase(3);
double length{90.}, max_speed{15.};
Street s_01{1, 10, length, max_speed, std::make_pair(0, 1)};
Street s_10{5, 10, length, max_speed, std::make_pair(1, 0)};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
double length{90.}, max_speed{15.};
Street s_01{1, 10, length, max_speed, std::make_pair(0, 1)};
Street s_10{5, 10, length, max_speed, std::make_pair(1, 0)};
Street s_12{7, 10, length, max_speed, std::make_pair(1, 2)};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
Street s_10{5, 10, length, max_speed, std::make_pair(1, 0)};
Street s_12{7, 10, length, max_speed, std::make_pair(1, 2)};
Street s_21{11, 10, length, max_speed, std::make_pair(2, 1)};
Street s_13{8, 10, length, max_speed, std::make_pair(1, 3)};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
Street s_21{11, 10, length, max_speed, std::make_pair(2, 1)};
Street s_13{8, 10, length, max_speed, std::make_pair(1, 3)};
Street s_31{16, 10, length, max_speed, std::make_pair(3, 1)};
Street s_14{9, 10, length, max_speed, std::make_pair(1, 4)};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
Street s_41{21, 10, length, max_speed, std::make_pair(4, 1)};
tl.addStreetPriority(1);
tl.addStreetPriority(11);
Graph graph2;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
graph2.addNode(std::make_unique<TrafficLight>(tl));
graph2.addStreets(s_01, s_10, s_12, s_21, s_13, s_31, s_14, s_41);
graph2.buildAdj();
Dynamics dynamics{graph2};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
dynamics.optimizeTrafficLights(2, 0.1, 0.);
THEN("Green and red time are equal") {
const auto timing =
dynamic_cast<TrafficLight&>(*dynamics.graph().nodeSet().at(1))

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note test

MISRA 12.3 rule
@Grufoony
Copy link
Collaborator Author

Grufoony commented Nov 4, 2024

For me and @filippodll is ok, i don't know what's wrong with codecov

@Grufoony Grufoony merged commit 10512bf into main Nov 5, 2024
24 of 26 checks passed
@Grufoony Grufoony deleted the feature_newTLAlgorithm branch November 5, 2024 08:46
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.

3 participants