From e9713788662e0cae65e4977dd48e3cb8a2016315 Mon Sep 17 00:00:00 2001 From: Romain BERNARD <romain.bernard@uca.fr> Date: Tue, 27 Feb 2024 18:51:37 +0100 Subject: [PATCH] replace TransitState default values to be coherent with the algorithm's needs --- src/ShortestPath/Transit/TransitAlgorithmState.h | 8 ++++---- src/ShortestPath/Transit/TransitStateContainer.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ShortestPath/Transit/TransitAlgorithmState.h b/src/ShortestPath/Transit/TransitAlgorithmState.h index 4247f98..0b44eee 100644 --- a/src/ShortestPath/Transit/TransitAlgorithmState.h +++ b/src/ShortestPath/Transit/TransitAlgorithmState.h @@ -52,14 +52,14 @@ public: explicit TransitAlgorithmState(int nodeIndex) { _nodeIndex = nodeIndex; - _instant = 0; - _passageIndex = 0; + _instant = INT16_MAX; + _passageIndex = -1; } explicit TransitAlgorithmState() { _nodeIndex = -1; - _instant = 0; - _passageIndex = 0; + _instant = INT16_MAX; + _passageIndex = -1; } [[nodiscard]] int getNodeIndex() const { diff --git a/src/ShortestPath/Transit/TransitStateContainer.h b/src/ShortestPath/Transit/TransitStateContainer.h index a3c1776..b962c0b 100644 --- a/src/ShortestPath/Transit/TransitStateContainer.h +++ b/src/ShortestPath/Transit/TransitStateContainer.h @@ -45,7 +45,7 @@ public: void pushEmptyState(int nodeIndex) { - TransitAlgorithmState newState = TransitAlgorithmState(nodeIndex, INT16_MAX, 0); + TransitAlgorithmState newState = TransitAlgorithmState(nodeIndex); solutionVector.at(nodeIndex).emplace_back(newState); } }; -- GitLab