Skip to content

Conversation

@Grufoony
Copy link
Collaborator

@Grufoony Grufoony commented Jan 31, 2025

requires(is_numeric_v<delay_t>)
void RoadDynamics<delay_t>::addAgentsRandomly(Size nAgents,
const size_t minNodeDistance) {
std::unordered_map<Id, double> src_weights, dst_weights;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
#endif
if (m_verbose) {
std::clog << buildMessage("\033[38;2;0;255;0mDEBUG", message, location, m_verbose) +
"\033[0m\n";

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 4.1 rule Note

MISRA 4.1 rule
@codecov
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 64.51613% with 22 lines in your changes missing coverage. Please review.

Project coverage is 90.46%. Comparing base (f2c151e) to head (6a1443e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/dsm/headers/RoadDynamics.hpp 69.23% 8 Missing ⚠️
src/dsm/sources/Street.cpp 44.44% 5 Missing ⚠️
src/dsm/headers/Dynamics.hpp 42.85% 4 Missing ⚠️
src/dsm/sources/Graph.cpp 60.00% 4 Missing ⚠️
src/dsm/sources/TrafficLight.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #256      +/-   ##
==========================================
- Coverage   90.50%   90.46%   -0.05%     
==========================================
  Files          37       37              
  Lines        4908     4929      +21     
  Branches      454      455       +1     
==========================================
+ Hits         4442     4459      +17     
- Misses        466      470       +4     
Flag Coverage Δ
unittests 90.46% <64.51%> (-0.05%) ⬇️

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.

if (!this->agents().empty()) {
agentId = this->agents().rbegin()->first + 1;
}
Logger::debug(std::format("Adding {} agents at time {}.", nAgents, this->time()));

Check notice

Code scanning / Cppcheck (reported by Codacy)

time is Y2038-unsafe Note

time is Y2038-unsafe
node_t& Graph::addNode(Id id, TArgs&&... args) {
addNode(std::make_unique<node_t>(id, std::forward<TArgs>(args)...));
return dynamic_cast<node_t&>(*m_nodes[id]);
return dynamic_cast<node_t&>(*m_nodes.at(id));

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
edge_t& Graph::addEdge(Id id, TArgs&&... args) {
addStreet(std::make_unique<edge_t>(id, std::forward<TArgs>(args)...));
return dynamic_cast<edge_t&>(*m_streets[id]);
return dynamic_cast<edge_t&>(*m_streets.at(id));

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
}
}
assert(possibleMoves.size() > 0);
if (possibleMoves.empty()) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 14.4 rule Note

MISRA 14.4 rule
}
if (path.size() == 0) {

if (path.empty()) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 14.4 rule Note

MISRA 14.4 rule

bool TrafficLight::isGreen(Id const streetId, Direction direction) const {
if (m_cycles.empty()) {
return true;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
nSources,
dst_weights.size(),
minNodeDistance));
if (nSources == 1 && nDestinations == 1 &&

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
auto result{this->m_graph.shortestPath(srcId, id)};
if (result.has_value() && result.value().path().size() < minNodeDistance &&
dst_weights.size() > 1) {
if (this->itineraries().at(id)->path().getRow(srcId).empty()) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 14.4 rule Note

MISRA 14.4 rule
if (this->itineraries().at(id)->path().getRow(srcId).empty()) {
continue;
}
if (nDestinations > 1 && minNodeDistance > 0) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
@Grufoony Grufoony merged commit 6032b25 into main Feb 14, 2025
26 of 28 checks passed
@Grufoony Grufoony deleted the io_nodes branch February 14, 2025 10:16
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.

Handle labels for input/output nodes when importing with getOSMNodes() function

2 participants