From f68cb03ca18bbdce5516d89c7eaa3adc0f1f4065 Mon Sep 17 00:00:00 2001
From: Romain BERNARD <romain.bernard@uca.fr>
Date: Mon, 24 Jun 2024 17:38:45 +0200
Subject: [PATCH] use a reference for the routes to be properly updated in the
 method

---
 src/algorithm/DARP/Heuristics/BestInsertionHeuristic.cpp | 2 +-
 src/algorithm/DARP/Heuristics/BestInsertionHeuristic.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.cpp b/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.cpp
index e846571..dedbf5f 100644
--- a/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.cpp
+++ b/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.cpp
@@ -33,7 +33,7 @@ bool BestInsertionHeuristic::tryVehicleBestInsertion(size_t requestId, size_t ve
     return bestInsertionFound;
 }
 
-size_t BestInsertionHeuristic::doBestRequestInsertionForRoute(size_t requestId, SAEVRoute route) {
+size_t BestInsertionHeuristic::doBestRequestInsertionForRoute(size_t requestId, SAEVRoute& route) {
     size_t vehicleId = 0;
     bool insertionSuccess{false};
     //Iteratively try inserting in every active vehicle and the first inactive vehicle
diff --git a/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.h b/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.h
index 657a978..ce5606e 100644
--- a/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.h
+++ b/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.h
@@ -17,7 +17,7 @@ public:
      * @param route the route structure in which the request will be inserted
      * @return ID of the vehicle in which the request has been
      */
-    static size_t doBestRequestInsertionForRoute(size_t requestId, SAEVRoute route);
+    static size_t doBestRequestInsertionForRoute(size_t requestId, SAEVRoute& route);
     /**
      * Iteratively tests best insertions wrt scoring function (detour) in the given vehicle and route
      * @param requestId ID of the request to insert in the vehicle
-- 
GitLab