From 3b34090dc6bab1ac091b9521a23e144bc44365c5 Mon Sep 17 00:00:00 2001 From: Romain BERNARD <romain.bernard@uca.fr> Date: Thu, 20 Jun 2024 13:46:56 +0200 Subject: [PATCH] Remove finalize insertion method --- src/routes/vehicle/SAEVRoute.cpp | 14 -------------- src/routes/vehicle/SAEVRoute.h | 9 --------- 2 files changed, 23 deletions(-) diff --git a/src/routes/vehicle/SAEVRoute.cpp b/src/routes/vehicle/SAEVRoute.cpp index 0255411..08d2579 100644 --- a/src/routes/vehicle/SAEVRoute.cpp +++ b/src/routes/vehicle/SAEVRoute.cpp @@ -358,20 +358,6 @@ bool SAEVRoute::checkRouteTimeWindows(size_t vehicleId) { return true; } -void SAEVRoute::finalizeRequestInsertion(const size_t requestId) { - SAEVKeyPoint * currentKeyPoint = &getOrigin(requestId); - SAEVKeyPoint const * counterpartKP = currentKeyPoint->getCounterpart(); - int requestWeight = counterpartKP->getRequest()->getWeight(); - //Init weight value for Origin KP - currentKeyPoint->setCurrentOccupation(currentKeyPoint->getPredecessor()->getCurrentOccupation() + requestWeight); - //Iterate over KPs in-between Origin and Destination - currentKeyPoint = currentKeyPoint->getSuccessor(); - while(currentKeyPoint != counterpartKP) { - currentKeyPoint->setCurrentOccupation(currentKeyPoint->getCurrentOccupation() + requestWeight); - currentKeyPoint = currentKeyPoint->getSuccessor(); - } -} - /** * Initializes a BestInsertionQueue to guide the best insertion heuristic * @param requestId diff --git a/src/routes/vehicle/SAEVRoute.h b/src/routes/vehicle/SAEVRoute.h index 2c53f70..64be3c1 100644 --- a/src/routes/vehicle/SAEVRoute.h +++ b/src/routes/vehicle/SAEVRoute.h @@ -71,15 +71,6 @@ public: */ SAEVRouteChangelist tryAddRequest(const size_t requestId, SAEVKeyPoint &originRequestPredecessorKP, SAEVKeyPoint &destinationRequestPredecessorKP); - /** - * Call this function whenever a request insertion is considered final (Insertion success + satisfied with result) - * Currently only updates Key Point weights, but other post insertion processes will go here - * Processe(s) : - * 1) Update weights between the request's origin and destination in the vehicle's key points - * @param requestId ID of the request that was inserted - */ - void finalizeRequestInsertion(const size_t requestId); - /** * Verifies time window constraints on our request's origin/destination's projected neighbour, aka originPredecessor/destinationPredecessor and their successor. * There is a special case taken into account if originPredecessor and destinationPredecessor are the same KeyPoint, since then, Origin's successor would be Destination -- GitLab