Skip to content
Snippets Groups Projects
Commit abc43935 authored by awenjb's avatar awenjb
Browse files

Add new sorting strategies

- add sorting based on demand
- add sorting based on nearest and furthest
- add sorting based on time window
parent caf73959
No related branches found
No related tags found
No related merge requests found
Showing
with 193 additions and 45 deletions
...@@ -102,12 +102,12 @@ void CapacityConstraint::applyModif(Pair const &pair, int routeIndex, int Pickup ...@@ -102,12 +102,12 @@ void CapacityConstraint::applyModif(Pair const &pair, int routeIndex, int Pickup
bool CapacityConstraint::check(InsertPair const &op) const bool CapacityConstraint::check(InsertPair const &op) const
{ {
std::cout << " #Capa Check"; //std::cout << " #Capa Check";
return checkModif(op.getPair(), op.getRouteIndex(), op.getPickupInsertion(), op.getDeliveryInsertion()); return checkModif(op.getPair(), op.getRouteIndex(), op.getPickupInsertion(), op.getDeliveryInsertion());
} }
void CapacityConstraint::apply(InsertPair const &op) void CapacityConstraint::apply(InsertPair const &op)
{ {
std::cout << "-> Apply Modification on Capacity \n"; //std::cout << "-> Apply Modification on Capacity \n";
applyModif(op.getPair(), op.getRouteIndex(), op.getPickupInsertion(), op.getDeliveryInsertion(), true); applyModif(op.getPair(), op.getRouteIndex(), op.getPickupInsertion(), op.getDeliveryInsertion(), true);
} }
......
...@@ -179,7 +179,7 @@ void TimeWindowConstraint::ApplyModif(PDPTWData const &data, Pair const &pair, i ...@@ -179,7 +179,7 @@ void TimeWindowConstraint::ApplyModif(PDPTWData const &data, Pair const &pair, i
bool TimeWindowConstraint::check(InsertPair const &op) const bool TimeWindowConstraint::check(InsertPair const &op) const
{ {
std::cout << " #TW Check"; //std::cout << " #TW Check";
return checkInsertion(getSolution().getData(), return checkInsertion(getSolution().getData(),
op.getPair(), op.getPair(),
op.getRouteIndex(), op.getRouteIndex(),
...@@ -189,7 +189,7 @@ bool TimeWindowConstraint::check(InsertPair const &op) const ...@@ -189,7 +189,7 @@ bool TimeWindowConstraint::check(InsertPair const &op) const
void TimeWindowConstraint::apply(InsertPair const &op) void TimeWindowConstraint::apply(InsertPair const &op)
{ {
std::cout << "-> Apply Modification on Time Windows \n"; //std::cout << "-> Apply Modification on Time Windows \n";
ApplyModif(getSolution().getData(), ApplyModif(getSolution().getData(),
op.getPair(), op.getPair(),
op.getRouteIndex(), op.getRouteIndex(),
......
...@@ -23,16 +23,16 @@ output::LnsOutput lns::runLns(Solution const &initialSolution, OperatorSelector ...@@ -23,16 +23,16 @@ output::LnsOutput lns::runLns(Solution const &initialSolution, OperatorSelector
Solution actualSolution = initialSolution; Solution actualSolution = initialSolution;
Solution bestSolution = initialSolution; Solution bestSolution = initialSolution;
int it = 10; int it = 100;
while (it > 0) while (it > 0)
{ {
std::cout << "\n" << 101-it << " : ";
/** /**
* The solution on which we apply the operators. * The solution on which we apply the operators.
* It is discarded at the end of each loop if it is not accepted by the Acceptance Function. * It is discarded at the end of each loop if it is not accepted by the Acceptance Function.
*/ */
Solution candidateSolution = actualSolution; Solution candidateSolution = actualSolution;
// Chose operator pair // Chose operator pair
auto destructReconstructPair = opSelector.getOperatorPair(); auto destructReconstructPair = opSelector.getOperatorPair();
// Apply operators // Apply operators
...@@ -42,6 +42,7 @@ output::LnsOutput lns::runLns(Solution const &initialSolution, OperatorSelector ...@@ -42,6 +42,7 @@ output::LnsOutput lns::runLns(Solution const &initialSolution, OperatorSelector
// Update best solution // Update best solution
if (isBetterSolution(candidateSolution, bestSolution)) if (isBetterSolution(candidateSolution, bestSolution))
{ {
std::cout << "\n > new Best Solution \n";
checker::checkAll(candidateSolution, candidateSolution.getData(), false); checker::checkAll(candidateSolution, candidateSolution.getData(), false);
bestSolution = candidateSolution; bestSolution = candidateSolution;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
void RandomDestroy::destroySolution(Solution &solution) const void RandomDestroy::destroySolution(Solution &solution) const
{ {
std::cout << " --- Random Destroy --- \n"; std::cout << "RD ";
int nbRequests = solution.requestsFulFilledCount(); int nbRequests = solution.requestsFulFilledCount();
int actualNumberOfPairsToDestroy = std::min(nbRequests, numberOfPairsToDestroy); int actualNumberOfPairsToDestroy = std::min(nbRequests, numberOfPairsToDestroy);
...@@ -23,11 +23,6 @@ void RandomDestroy::destroySolution(Solution &solution) const ...@@ -23,11 +23,6 @@ void RandomDestroy::destroySolution(Solution &solution) const
// choose a random location // choose a random location
int locationNumber = util::getRandomInt(0, remainingPairToDelete * 2 - 1); int locationNumber = util::getRandomInt(0, remainingPairToDelete * 2 - 1);
// test
// locationNumber = nbRequests * 2 - 1;
// std::cout << " " << locationNumber << " \n";
//
int pairID = 0; int pairID = 0;
int routeID = 0; int routeID = 0;
int position = 0; int position = 0;
......
...@@ -11,8 +11,8 @@ void ListHeuristicCostOriented::reconstructSolution(Solution &solution, double b ...@@ -11,8 +11,8 @@ void ListHeuristicCostOriented::reconstructSolution(Solution &solution, double b
switch (strategy) switch (strategy)
{ {
case SortingStrategyType::SHUFFLE: { case SortingStrategyType::SHUFFLE: {
std::cout << " \n(Shuffle)\n";
// copy // copy
std::cout << "S";
sortedPairs = sorting_strategy::Shuffle(solution).sortPairs(); sortedPairs = sorting_strategy::Shuffle(solution).sortPairs();
break; break;
} }
...@@ -22,6 +22,19 @@ void ListHeuristicCostOriented::reconstructSolution(Solution &solution, double b ...@@ -22,6 +22,19 @@ void ListHeuristicCostOriented::reconstructSolution(Solution &solution, double b
break; break;
} }
// just for print (no use)
switch (enumeration)
{
case EnumerationType::ALL_INSERT_PAIR: {
// copy
std::cout << "_AIP ";
}
default:
break;
}
for (int pairID: sortedPairs) for (int pairID: sortedPairs)
{ {
Pair const &pair = solution.getData().getPair(pairID); Pair const &pair = solution.getData().getPair(pairID);
...@@ -33,7 +46,6 @@ void ListHeuristicCostOriented::reconstructSolution(Solution &solution, double b ...@@ -33,7 +46,6 @@ void ListHeuristicCostOriented::reconstructSolution(Solution &solution, double b
switch (enumeration) switch (enumeration)
{ {
case EnumerationType::ALL_INSERT_PAIR: { case EnumerationType::ALL_INSERT_PAIR: {
std::cout << " \n(All insert pair) \n";
enumeration::enumerateAllInsertPair( enumeration::enumerateAllInsertPair(
solution, solution,
pair, pair,
...@@ -49,7 +61,6 @@ void ListHeuristicCostOriented::reconstructSolution(Solution &solution, double b ...@@ -49,7 +61,6 @@ void ListHeuristicCostOriented::reconstructSolution(Solution &solution, double b
if (bestRecreation) if (bestRecreation)
{ {
std::cout << "\n --- Apply recreation --- \n";
solution.applyRecreateSolution(*bestRecreation); solution.applyRecreateSolution(*bestRecreation);
} }
} }
......
...@@ -42,8 +42,6 @@ std::function<void(ModificationType &&)> keepBestSolution(Solution const &soluti ...@@ -42,8 +42,6 @@ std::function<void(ModificationType &&)> keepBestSolution(Solution const &soluti
// then store the best cost and the modification to the pointer // then store the best cost and the modification to the pointer
if (cost < bestCost && util::getRandom() >= blinkRate && solution.checkModification(modification)) if (cost < bestCost && util::getRandom() >= blinkRate && solution.checkModification(modification))
{ {
std::cout << " => Better Modification, update pointer"
<< "\n";
bestModificationPtr = std::make_unique<ModificationType>(modification); bestModificationPtr = std::make_unique<ModificationType>(modification);
bestCost = cost; bestCost = cost;
} }
......
...@@ -18,7 +18,6 @@ void ListHeuristicInsertion::reconstructSolution(Solution &solution, double blin ...@@ -18,7 +18,6 @@ void ListHeuristicInsertion::reconstructSolution(Solution &solution, double blin
switch (strategy) { switch (strategy) {
case SortingStrategyType::SHUFFLE: case SortingStrategyType::SHUFFLE:
{ {
std::cout << " \n(Shuffle)\n";
// copy // copy
sortedPairs = sorting_strategy::Shuffle(solution).sortPairs(); sortedPairs = sorting_strategy::Shuffle(solution).sortPairs();
break; break;
...@@ -54,7 +53,6 @@ std::unique_ptr<AtomicRecreation> ListHeuristicInsertion::selectRecreation(Solut ...@@ -54,7 +53,6 @@ std::unique_ptr<AtomicRecreation> ListHeuristicInsertion::selectRecreation(Solut
switch (enumeration) { switch (enumeration) {
case EnumerationType::ALL_INSERT_PAIR: case EnumerationType::ALL_INSERT_PAIR:
{ {
std::cout << " \n(All insert pair) \n";
enumeration::enumerateAllInsertPair(solution, pair, addToListIfValidTemplate<InsertPair>(solution, modifications)); enumeration::enumerateAllInsertPair(solution, pair, addToListIfValidTemplate<InsertPair>(solution, modifications));
break; break;
......
...@@ -52,8 +52,6 @@ std::function<void(ModificationType &&)> addToListIfValidTemplate(Solution const ...@@ -52,8 +52,6 @@ std::function<void(ModificationType &&)> addToListIfValidTemplate(Solution const
return [&](ModificationType &&modification) { return [&](ModificationType &&modification) {
if (solution.checkModification(modification)) if (solution.checkModification(modification))
{ {
std::cout << " => Insert Modification"
<< "\n";
list.push_front(std::make_unique<ModificationType>(modification)); list.push_front(std::make_unique<ModificationType>(modification));
} }
}; };
......
...@@ -20,8 +20,10 @@ OperatorPair SmallLargeOperatorSelector::getOperatorPair() ...@@ -20,8 +20,10 @@ OperatorPair SmallLargeOperatorSelector::getOperatorPair()
} }
iterationForNextStep = selectorPerSize.at(selectorStep).first; iterationForNextStep = selectorPerSize.at(selectorStep).first;
} }
SimpleOperatorSelector &selector = selectorPerSize.at(selectorStep).second; SimpleOperatorSelector &selector = selectorPerSize.at(selectorStep).second;
OperatorPair pair = selector.getOperatorPair(); OperatorPair pair = selector.getOperatorPair();
// when we arrive at the last iteration of the last selector, we force the acceptance // when we arrive at the last iteration of the last selector, we force the acceptance
if (iterationAtCurrentStep == iterationForNextStep - 1 && selectorStep == selectorPerSize.size()) [[unlikely]] if (iterationAtCurrentStep == iterationForNextStep - 1 && selectorStep == selectorPerSize.size()) [[unlikely]]
{ {
......
#include "sorting_strategy.h" #include "sorting_strategy.h"
#include "input/pdptw_data.h"
#include "input/data.h"
#include "utils.h" #include "utils.h"
#include <algorithm> #include <algorithm>
#include <ranges> #include <ranges>
double getDistanceToDepot(PDPTWData const &data, int pairID)
{
return data::TravelTime(data, 0, pairID);
}
std::vector<int> const &sorting_strategy::Shuffle::sortPairs() const std::vector<int> const &sorting_strategy::Shuffle::sortPairs() const
{ {
auto &bank = getSolution().getPairBank(); auto &bank = getSolution().getPairBank();
std::ranges::shuffle(bank, util::getRawRandom()); std::ranges::shuffle(bank, util::getRawRandom());
return bank; return bank;
}
std::vector<int> const &sorting_strategy::Demand::sortPairs() const
{
auto &bank = getSolution().getPairBank();
// Pair ID = Pickup ID
std::sort(bank.begin(), bank.end(), [&](int a, int b) {
return getSolution().getData().getLocation(a).getDemand() > getSolution().getData().getLocation(b).getDemand();
});
return bank;
}
// Following sorting strategy are based on the pickup, TO DO, sort based on the pickup and the delivery
std::vector<int> const &sorting_strategy::Close::sortPairs() const
{
auto &bank = getSolution().getPairBank();
// Pair ID = Pickup ID
std::sort(bank.begin(), bank.end(), [&](int a, int b) {
return getDistanceToDepot(getSolution().getData(), a) < getDistanceToDepot(getSolution().getData(), b);
});
return bank;
}
std::vector<int> const &sorting_strategy::Far::sortPairs() const
{
auto &bank = getSolution().getPairBank();
// Pair ID = Pickup ID
std::sort(bank.begin(), bank.end(), [&](int a, int b) {
return getDistanceToDepot(getSolution().getData(), a) > getDistanceToDepot(getSolution().getData(), b);
});
return bank;
}
std::vector<int> const &sorting_strategy::TimeWindowWidth::sortPairs() const
{
auto &bank = getSolution().getPairBank();
// Pair ID = Pickup ID
std::sort(bank.begin(), bank.end(), [&](int a, int b) {
return getSolution().getData().getLocation(a).getTimeWindow().getWidth() < getSolution().getData().getLocation(b).getTimeWindow().getWidth();
});
return bank;
}
std::vector<int> const &sorting_strategy::TimeWindowStart::sortPairs() const
{
auto &bank = getSolution().getPairBank();
// Pair ID = Pickup ID
std::sort(bank.begin(), bank.end(), [&](int a, int b) {
return getSolution().getData().getLocation(a).getTimeWindow().getStart() < getSolution().getData().getLocation(b).getTimeWindow().getStart();
});
return bank;
}
std::vector<int> const &sorting_strategy::TimeWindowEnd::sortPairs() const
{
auto &bank = getSolution().getPairBank();
// Pair ID = Pickup ID
std::sort(bank.begin(), bank.end(), [&](int a, int b) {
return getSolution().getData().getLocation(a).getTimeWindow().getEnd() > getSolution().getData().getLocation(b).getTimeWindow().getEnd();
});
return bank;
} }
\ No newline at end of file
#pragma once #pragma once
#include "input/time_window.h"
#include "lns/solution/solution.h" #include "lns/solution/solution.h"
/** /**
* A type of sorting strategy for the bank of pairs * A type of sorting strategy for the bank of pairs
*/ */
enum class SortingStrategyType { enum class SortingStrategyType
SHUFFLE {
SHUFFLE,
DEMAND,
CLOSE,
FAR,
TWWIDTH,
TWSTART,
TWEND,
}; };
namespace sorting_strategy namespace sorting_strategy
...@@ -34,11 +42,69 @@ namespace sorting_strategy ...@@ -34,11 +42,69 @@ namespace sorting_strategy
*/ */
class Shuffle : public SortingStrategy class Shuffle : public SortingStrategy
{ {
public:
using SortingStrategy::SortingStrategy;
std::vector<int> const &sortPairs() const override;
};
/**
* Sort the bank by decreasing order of demand
*/
class Demand : public SortingStrategy
{
public:
using SortingStrategy::SortingStrategy;
std::vector<int> const &sortPairs() const override;
};
/**
* Sort the bank by increasing distance from the depot
*/
class Close : public SortingStrategy
{
public:
using SortingStrategy::SortingStrategy; using SortingStrategy::SortingStrategy;
std::vector<int> const &sortPairs() const override;
};
/**
* Sort the bank by decreasing distance from the depot
*/
class Far : public SortingStrategy
{
public: public:
using SortingStrategy::SortingStrategy;
std::vector<int> const &sortPairs() const override; std::vector<int> const &sortPairs() const override;
}; };
/**
* Sort the bank by increasing time window width
*/
class TimeWindowWidth : public SortingStrategy
{
public:
using SortingStrategy::SortingStrategy;
std::vector<int> const &sortPairs() const override;
};
/**
* Sort the bank by inscreasing time window start
*/
class TimeWindowStart : public SortingStrategy
{
public:
using SortingStrategy::SortingStrategy;
std::vector<int> const &sortPairs() const override;
};
/**
* Sort the bank by decreasing time window end
*/
class TimeWindowEnd : public SortingStrategy
{
public:
using SortingStrategy::SortingStrategy;
std::vector<int> const &sortPairs() const override;
};
}// namespace sorting_strategy }// namespace sorting_strategy
\ No newline at end of file
...@@ -211,18 +211,18 @@ int Solution::requestsFulFilledCount() const ...@@ -211,18 +211,18 @@ int Solution::requestsFulFilledCount() const
bool Solution::checkModification(AtomicRecreation const &modification) const bool Solution::checkModification(AtomicRecreation const &modification) const
{ {
std::cout << "--- Check Modification Validity : "; //std::cout << "--- Check Modification Validity : ";
ModificationCheckVariant const &checkVariant = modification.asCheckVariant(); ModificationCheckVariant const &checkVariant = modification.asCheckVariant();
// visitor pattern // visitor pattern
for (std::unique_ptr<Constraint> const &constraint: constraints) for (std::unique_ptr<Constraint> const &constraint: constraints)
{ {
if (!constraint->checkVariant(checkVariant)) if (!constraint->checkVariant(checkVariant))
{ {
std::cout << "\n"; //std::cout << "\n";
return false; return false;
} }
} }
std::cout << "\n"; //std::cout << "\n";
return true; return true;
} }
...@@ -253,8 +253,6 @@ void Solution::applyRecreateSolution(AtomicRecreation &modification) ...@@ -253,8 +253,6 @@ void Solution::applyRecreateSolution(AtomicRecreation &modification)
} }
afterApplyModification(modification); afterApplyModification(modification);
std::cout << "\n --- \n";
this->print();
} }
void Solution::applyDestructSolution(AtomicDestruction &modification) void Solution::applyDestructSolution(AtomicDestruction &modification)
...@@ -269,7 +267,6 @@ void Solution::applyDestructSolution(AtomicDestruction &modification) ...@@ -269,7 +267,6 @@ void Solution::applyDestructSolution(AtomicDestruction &modification)
pairBank.insert(pairBank.end(), deletedPair.begin(), deletedPair.end()); pairBank.insert(pairBank.end(), deletedPair.begin(), deletedPair.end());
afterApplyModification(modification); afterApplyModification(modification);
this->print();
} }
void Solution::check() const void Solution::check() const
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "lns/modification/pair/remove_pair.h" #include "lns/modification/pair/remove_pair.h"
#include "lns/modification/route/insert_route.h" #include "lns/modification/route/insert_route.h"
#include "lns/modification/route/remove_route.h" #include "lns/modification/route/remove_route.h"
#include "lns/operators/abstract_operator.h"
#include "lns/operators/destruction/random_destroy.h" #include "lns/operators/destruction/random_destroy.h"
#include "lns/operators/reconstruction/enumerate.h" #include "lns/operators/reconstruction/enumerate.h"
#include "lns/operators/reconstruction/list_heuristic_cost_oriented.h" #include "lns/operators/reconstruction/list_heuristic_cost_oriented.h"
...@@ -45,9 +46,9 @@ void simpleLNS(PDPTWData const &data, Solution &startingSolution) ...@@ -45,9 +46,9 @@ void simpleLNS(PDPTWData const &data, Solution &startingSolution)
ThresholdAcceptance acceptor(0.05); ThresholdAcceptance acceptor(0.05);
// lns operators // lns operators
SimpleOperatorSelector smallSelector; SimpleOperatorSelector RandomDestroy_ShuffleBestInsert;
addAllReconstructor(smallSelector); addAllReconstructor(RandomDestroy_ShuffleBestInsert);
smallSelector.addDestructor(RandomDestroy(pairs)); RandomDestroy_ShuffleBestInsert.addDestructor(RandomDestroy(pairs));
SimpleOperatorSelector largeSelector; SimpleOperatorSelector largeSelector;
addAllReconstructor(largeSelector); addAllReconstructor(largeSelector);
...@@ -66,15 +67,16 @@ void simpleLNS(PDPTWData const &data, Solution &startingSolution) ...@@ -66,15 +67,16 @@ void simpleLNS(PDPTWData const &data, Solution &startingSolution)
// lastSelector.addDestructor(RandomDestroy(manyPairs)); // lastSelector.addDestructor(RandomDestroy(manyPairs));
std::vector<SmallLargeOperatorSelector::StepSelector> selectors; std::vector<SmallLargeOperatorSelector::StepSelector> selectors;
selectors.emplace_back(2, std::move(smallSelector)); selectors.emplace_back(10, std::move(RandomDestroy_ShuffleBestInsert));
selectors.emplace_back(2, std::move(largeSelector)); // selectors.emplace_back(100, std::move(largeSelector));
// selectors.emplace_back(2, std::move(veryLargeSelector)); // selectors.emplace_back(2, std::move(veryLargeSelector));
// selectors.emplace_back(2, std::move(hugeSelector)); // selectors.emplace_back(2, std::move(hugeSelector));
// selectors.emplace_back(2, std::move(lastSelector)); // selectors.emplace_back(2, std::move(lastSelector));
SmallLargeOperatorSelector smallLargeSelector(std::move(selectors)); SmallLargeOperatorSelector smallLargeSelector(std::move(selectors));
// run lns // run lns
lns::runLns(startingSolution, smallLargeSelector, acceptor); output::LnsOutput result = lns::runLns(startingSolution, smallLargeSelector, acceptor);
result.getBestSolution().print();
} }
int main(int argc, char **argv) int main(int argc, char **argv)
...@@ -91,7 +93,22 @@ int main(int argc, char **argv) ...@@ -91,7 +93,22 @@ int main(int argc, char **argv)
PDPTWData data = parsing::parseJson(filepath); PDPTWData data = parsing::parseJson(filepath);
Solution startingSolution = Solution::emptySolution(data); Solution startingSolution = Solution::emptySolution(data);
simpleLNS(data, startingSolution); //simpleLNS(data, startingSolution);
///
std::cout << "===== TEST ===== \n";
Solution testSolution = Solution::emptySolution(data);
//ListHeuristicCostOriented reconstruction = ListHeuristicCostOriented(SortingStrategyType::SHUFFLE, EnumerationType::ALL_INSERT_PAIR);
//reconstruction.reconstructSolution(testSolution, 0.01);
testSolution.print();
sorting_strategy::Shuffle(testSolution).sortPairs();
testSolution.print();
sorting_strategy::TimeWindowStart(testSolution).sortPairs();
testSolution.print();
return 0; return 0;
} }
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data) void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data)
{ {
std::cout << " --- Solution Coherence checker : ";
bool errorFlag = false; bool errorFlag = false;
// Vector that will store the route ID serving the location, (-1 if no routes) // Vector that will store the route ID serving the location, (-1 if no routes)
...@@ -23,7 +21,6 @@ void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data) ...@@ -23,7 +21,6 @@ void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data)
int routeID = 0; int routeID = 0;
for (Route const &route: sol.getRoutes()) for (Route const &route: sol.getRoutes())
{ {
std::cout << "#";
// skip if it is an empty route // skip if it is an empty route
if (!route.getRoute().empty()) if (!route.getRoute().empty())
{ {
...@@ -31,8 +28,6 @@ void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data) ...@@ -31,8 +28,6 @@ void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data)
{ {
if (check.at(LocID -1) != -1) if (check.at(LocID -1) != -1)
{ {
std::cout << "#";
// Error the location is already attributed (doublon) // Error the location is already attributed (doublon)
spdlog::error("Location {} has already been visited.", LocID); spdlog::error("Location {} has already been visited.", LocID);
errorFlag = true; errorFlag = true;
...@@ -54,7 +49,6 @@ void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data) ...@@ -54,7 +49,6 @@ void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data)
++routeID; ++routeID;
} }
std::cout << "#";
// checking PairBank coherence (given the routes) // checking PairBank coherence (given the routes)
for (int pairID: sol.getBank()) for (int pairID: sol.getBank())
...@@ -73,8 +67,6 @@ void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data) ...@@ -73,8 +67,6 @@ void checker::checkSolutionCoherence(Solution const &sol, PDPTWData const &data)
sol.print(); sol.print();
throw SolutionConstraintError("Error in the consistency of the solution.", sol); throw SolutionConstraintError("Error in the consistency of the solution.", sol);
} }
std::cout << " : checker end ---\n";
} }
void checker::checkCapacity(Solution const &sol, PDPTWData const &data) void checker::checkCapacity(Solution const &sol, PDPTWData const &data)
......
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