Skip to content
Snippets Groups Projects
  • awenjb's avatar
    7c427502
    Some fixes · 7c427502
    awenjb authored
    - call clean empty route for every new best solution
    - add new elements in the config  file
    - clean up some of the code
    7c427502
    History
    Some fixes
    awenjb authored
    - call clean empty route for every new best solution
    - add new elements in the config  file
    - clean up some of the code
clean_empty_route.cpp 485 B
#include "clean_empty_route.h"
#include "lns/modification/route/remove_route.h"

CleanEmptyRoute::CleanEmptyRoute() {}

void CleanEmptyRoute::destroySolution(Solution &solution) const
{
    for (int routeIndex = solution.getRoutes().size() - 1; routeIndex >= 0; --routeIndex)
    {
        if (solution.getRoute(routeIndex).getRoute().empty())
        {
            RemoveRoute remRoute = RemoveRoute(routeIndex);
            solution.applyDestructSolution(remRoute);
        }
    }
}