From 2bd52af0a54558781a09b978f25b9990098a35aa Mon Sep 17 00:00:00 2001
From: Romain BERNARD <romain.bernard@uca.fr>
Date: Thu, 19 Sep 2024 17:12:45 +0200
Subject: [PATCH] redefine debug messages to use the appropriate macro

---
 .../Heuristics/MultimodalModularHeuristic.cpp          | 10 +++++-----
 .../Multimodal/Heuristics/MultimodalModularHeuristic.h |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/algorithm/Multimodal/Heuristics/MultimodalModularHeuristic.cpp b/src/algorithm/Multimodal/Heuristics/MultimodalModularHeuristic.cpp
index 42264b9..df97c77 100644
--- a/src/algorithm/Multimodal/Heuristics/MultimodalModularHeuristic.cpp
+++ b/src/algorithm/Multimodal/Heuristics/MultimodalModularHeuristic.cpp
@@ -88,7 +88,7 @@ MultimodalModularHeuristic::insertBestTransitAccessInRoute(const Request &baseRe
                                                    _route->getEntrySubRequestOrigin(baseRequestId));
         }
         catch(const TimeWindow::invalid_time_window_exception& e) {
-            DEBUG_MSG("Invalid Time Window during candidate sub request creation, it won't be added to the list");
+            DEBUG_MMH_MSG("Invalid Time Window during candidate sub request creation, it won't be added to the list");
         }
     }
     return insertBestTransitAccessInRoute(accessSubRequestsList, baseRequestId, isEntry);
@@ -112,17 +112,17 @@ MultimodalModularHeuristic::insertBestTransitAccessInRoute(const std::vector<Req
                 _route->getEntrySubRequestOrigin(baseRequestId), *_route);
         //If we've found an insertion that doesn't create a vehicle, stop there
         if(changeList.success()) {
-            DEBUG_MSG("ENTRY CANDIDATE SUCCESS : " + subreq.to_string());
+            DEBUG_MMH_MSG("ENTRY CANDIDATE SUCCESS : " + subreq.to_string());
             return getSubrequest(baseRequestId, isEntry);
         } else {
-            DEBUG_MSG("ENTRY CANDIDATE FAILURE : " + subreq.to_string());
+            DEBUG_MMH_MSG("ENTRY CANDIDATE FAILURE : " + subreq.to_string());
         }
     }
 
     // If no valid candidate was given, still create a fake
     // subrequest and mention failure in the appropriate vector
     if(accessSubRequestsList.empty()) {
-        DEBUG_MSG("UNFULFILLED SUBREQUEST");
+        DEBUG_MMH_MSG(std::string("UNFULFILLED SUBREQUEST ") + (isEntry ? "ENTRY" : "EXIT"));
         updateSubRequest(baseRequestId, (*_requestsVect)[baseRequestId], isEntry);
         updateUnfulfilledSubrequest(baseRequestId, isEntry, true); //mark failures for debug/statistics
         if(!isEntry) { //Exit subrequest : remove entry subrequest and add baseRequest to the "unfulfilled list"
@@ -132,7 +132,7 @@ MultimodalModularHeuristic::insertBestTransitAccessInRoute(const std::vector<Req
     } else {
         // If no active vehicle insertion worked, do best insertion on a new vehicle
         // with the first subrequest (supposedly it's the most advantageous)
-        DEBUG_MSG("CREATE VEHICLE");
+        DEBUG_MMH_MSG("CREATE VEHICLE");
         updateSubRequest(baseRequestId, accessSubRequestsList[0], isEntry);
         _route->insertRequestInNewVehicle(_route->getExitSubRequestOrigin(baseRequestId));
     }
diff --git a/src/algorithm/Multimodal/Heuristics/MultimodalModularHeuristic.h b/src/algorithm/Multimodal/Heuristics/MultimodalModularHeuristic.h
index 324b046..94d3f61 100644
--- a/src/algorithm/Multimodal/Heuristics/MultimodalModularHeuristic.h
+++ b/src/algorithm/Multimodal/Heuristics/MultimodalModularHeuristic.h
@@ -17,9 +17,9 @@
 
 #ifdef DEBUG_MULTIMODAL_HEURISTIC
 #include <iostream>
-#define DEBUG_MSG(str) do { std::cout << "[SMH] " << str << std::endl; } while( false )
+#define DEBUG_MMH_MSG(str) do { std::cout << "[MMH] " << str << std::endl; } while( false )
 #else
-#define DEBUG_MSG(str) do { } while ( false )
+#define DEBUG_MMH_MSG(str) do { } while ( false )
 #endif
 
 class MultimodalModularHeuristic {
-- 
GitLab