Skip to content
Snippets Groups Projects
Commit d9945f01 authored by Romain BERNARD's avatar Romain BERNARD
Browse files

add debug messages

parent 3f57879e
No related branches found
No related tags found
1 merge request!2Route manipulation API with automatic constraint propagation
......@@ -15,7 +15,7 @@ bool BestInsertionHeuristic::tryVehicleBestInsertion(size_t requestId, size_t ve
BestInsertionQueue bestInsertionsQueue = route.getBestFeasibleInsertionsQueue(requestId, vehicleId); //TODO: check perfs between BestInsertionsQueue vs BestFeasibleInsertionsQueue
bool bestInsertionFound = false;
BestRequestInsertion currentBestInsertion;
DEBUG_MSG("Trying to insert request " + std::to_string(requestId) + " in vehicle " + std::to_string(vehicleId));
while(!bestInsertionsQueue.empty() && !bestInsertionFound) {
currentBestInsertion = bestInsertionsQueue.topAndPop();
SAEVRouteChangelist lastInsertionChangelist = route.tryAddRequest(requestId,
......@@ -23,9 +23,10 @@ bool BestInsertionHeuristic::tryVehicleBestInsertion(size_t requestId, size_t ve
*currentBestInsertion.getDestinationInsertionKp());
//If insertion worked, signal it, otherwise revert changes
if(lastInsertionChangelist.getStatus() == SAEVRouteChangelist::InsertionStatus::SUCCESS) {
DEBUG_MSG("Best valid insertion found !\n\t" + currentBestInsertion.to_string());
DEBUG_MSG("\tBest valid insertion found !\n\t\t" + currentBestInsertion.to_string());
bestInsertionFound = true;
} else {
DEBUG_MSG("Failed to insert best insertion " + currentBestInsertion.to_string());
lastInsertionChangelist.revertChanges();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment