diff --git a/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.cpp b/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.cpp index 378bf99ba7fcb54f00a46322f737b66e9d4a9124..c067ef8c568acc9c671c4c8c87fa5018a0ccdf40 100644 --- a/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.cpp +++ b/src/algorithm/DARP/Heuristics/BestInsertionHeuristic.cpp @@ -43,7 +43,7 @@ size_t BestInsertionHeuristic::doBestRequestInsertionForRoute(SAEVKeyPoint &requ size_t vehicleId = 0; bool insertionSuccess{false}; //Iteratively try inserting in every active vehicle and the first inactive vehicle - do { + do { //TODO: improve this to mutualize best insertions amongst best vehicles ? insertionSuccess = tryVehicleBestInsertion(requestKp, vehicleId, route).success(); } while(!insertionSuccess && ++vehicleId <= route.getLastActiveVehicleId() + 1); diff --git a/src/algorithm/Multimodal/Heuristics/SimpleModularHeuristic.cpp b/src/algorithm/Multimodal/Heuristics/SimpleModularHeuristic.cpp index b7a3468a067650e9d004370ac23cd2d5b66589d7..e42e56f19f916a0d1bd20859f4c4b525f16249c8 100644 --- a/src/algorithm/Multimodal/Heuristics/SimpleModularHeuristic.cpp +++ b/src/algorithm/Multimodal/Heuristics/SimpleModularHeuristic.cpp @@ -127,7 +127,7 @@ SimpleModularHeuristic::insertBestTransitAccessInRoute(const std::vector<Request //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"); updateSubRequest(baseRequestId, accessSubRequestsList[0], isEntry); - _route->insertRequestInNewVehicle(_route->getEntrySubRequestOrigin(baseRequestId)); + _route->insertRequestInNewVehicle(_route->getExitSubRequestOrigin(baseRequestId)); } return getSubrequest(baseRequestId, isEntry); @@ -259,3 +259,7 @@ const std::vector<bool> &SimpleModularHeuristic::getUnfulfilledTransitExit() con const std::vector<bool> &SimpleModularHeuristic::getUnfulfilledTransitEntry() const { return _unfulfilledTransitEntry; } + +bool SimpleModularHeuristic::isEntryFulfilled(size_t baseRequestId) { + return !_unfulfilledTransitEntry[baseRequestId]; +} diff --git a/src/algorithm/Multimodal/Heuristics/SimpleModularHeuristic.h b/src/algorithm/Multimodal/Heuristics/SimpleModularHeuristic.h index 57848ad04b360e08b6c8c101d26c9b3ae813f8be..e06ec5b82422a3af686f722f279845d47256eeab 100644 --- a/src/algorithm/Multimodal/Heuristics/SimpleModularHeuristic.h +++ b/src/algorithm/Multimodal/Heuristics/SimpleModularHeuristic.h @@ -178,6 +178,8 @@ protected: uint transitExitTimestamp) const; void updateUnfulfilledSubrequest(size_t baseRequestId, bool isEntry, bool value); + + bool isEntryFulfilled(size_t baseRequestId); };