From b3edab3e81d3bef0245328e5bb5e9847f5b33699 Mon Sep 17 00:00:00 2001 From: Pablo Hoch Date: Tue, 31 Oct 2023 11:44:32 +0100 Subject: [PATCH] rsl: early departure tolerance fix --- modules/paxmon/src/rt_updates.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/paxmon/src/rt_updates.cc b/modules/paxmon/src/rt_updates.cc index 52ee30726..5f2371709 100644 --- a/modules/paxmon/src/rt_updates.cc +++ b/modules/paxmon/src/rt_updates.cc @@ -42,13 +42,15 @@ void check_broken_interchanges( auto const to = ice->to(uv); auto const ic = static_cast(to->current_time()) - static_cast(from->current_time()); - auto const early_departure = static_cast(to->schedule_time()) - - static_cast(to->current_time()); + auto const early_departure = to->current_time() < to->schedule_time() + ? static_cast(to->schedule_time()) - + static_cast(to->current_time()) + : 0; if (ice->is_canceled(uv) || (from->station_ != 0 && to->station_ != 0 && ic < ice->transfer_time()) || (from->station_ == 0 && - early_departure <= uv.early_departure_tolerance_)) { + early_departure > uv.early_departure_tolerance_)) { if (ice->broken_) { continue; }