Skip to content

Commit 12ab72c

Browse files
committed
Add warning for agents who have been stationary for too long
1 parent dc4a8a4 commit 12ab72c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/dsm/dsm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
static constexpr uint8_t DSM_VERSION_MAJOR = 2;
88
static constexpr uint8_t DSM_VERSION_MINOR = 6;
9-
static constexpr uint8_t DSM_VERSION_PATCH = 19;
9+
static constexpr uint8_t DSM_VERSION_PATCH = 20;
1010

1111
static auto const DSM_VERSION =
1212
std::format("{}.{}.{}", DSM_VERSION_MAJOR, DSM_VERSION_MINOR, DSM_VERSION_PATCH);

src/dsm/headers/RoadDynamics.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,23 @@ namespace dsm {
603603
Logger::debug("Skipping due to time");
604604
continue;
605605
}
606+
{
607+
auto const timeDiff{this->time() - pAgentTemp->freeTime()};
608+
if (timeDiff > 120) {
609+
Logger::warning(std::format(
610+
"Time {} - Agent currently on {} ({} -> {}), targetting {} ({} turn - "
611+
"Traffic "
612+
"Light? {}), has been still for more than 120 seconds ({} seconds)",
613+
this->time(),
614+
pStreet->id(),
615+
pStreet->source(),
616+
pStreet->target(),
617+
pAgentTemp->nextStreetId().value_or(-1),
618+
directionToString.at(pStreet->laneMapping().at(queueIndex)),
619+
this->graph().node(pStreet->target())->isTrafficLight(),
620+
timeDiff));
621+
}
622+
}
606623
pAgentTemp->setSpeed(0.);
607624
const auto& destinationNode{this->graph().node(pStreet->target())};
608625
if (destinationNode->isFull()) {

0 commit comments

Comments
 (0)