Skip to content

Commit 6849aaa

Browse files
committed
Add debug msgs
1 parent f98b46f commit 6849aaa

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/dsf/headers/RoadDynamics.hpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ namespace dsf {
396396
}
397397
updatePaths();
398398
std::for_each(
399-
this->graph().edges().cbegin(),
399+
DSM_EXECUTION this->graph().edges().cbegin(),
400400
this->graph().edges().cend(),
401401
[this](auto const& pair) {
402402
m_turnCounts.emplace(pair.first, std::array<unsigned long long, 4>{0, 0, 0, 0});
@@ -1133,15 +1133,19 @@ namespace dsf {
11331133
}
11341134
}
11351135
}
1136+
Logger::debug(std::format(
1137+
"Exiting first while loop with srcId = {} and dstId = {}", srcId, dstId));
11361138
if (nSources > 1) {
11371139
dstId = srcId;
11381140
}
11391141
while (dstId == srcId) {
11401142
dRand = dstUniformDist(this->m_generator);
11411143
sum = 0.;
1144+
std::size_t n_emptyRows = 0;
11421145
for (const auto& [id, weight] : dst_weights) {
11431146
// if the node is at a minimum distance from the destination, skip it
11441147
if (this->itineraries().at(id)->path()->getRow(srcId).empty()) {
1148+
++n_emptyRows;
11451149
continue;
11461150
}
11471151
if (std::holds_alternative<size_t>(minNodeDistance)) {
@@ -1170,7 +1174,16 @@ namespace dsf {
11701174
break;
11711175
}
11721176
}
1177+
if (n_emptyRows == dst_weights.size()) {
1178+
Logger::error(
1179+
std::format("No destination nodes found from "
1180+
"source node {}.",
1181+
srcId));
1182+
return;
1183+
}
11731184
}
1185+
Logger::debug(std::format(
1186+
"Exiting second while loop with srcId = {} and dstId = {}", srcId, dstId));
11741187
// find the itinerary with the given destination as destination
11751188
auto itineraryIt{std::find_if(this->itineraries().cbegin(),
11761189
this->itineraries().cend(),

0 commit comments

Comments
 (0)