Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate definition of LocalSearch #638

Merged
merged 2 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Fixed

- Remove duplicate definition of LocalSearch (#638)

## [v1.11.0] - 2021-11-19

### Added
Expand Down
11 changes: 7 additions & 4 deletions src/problems/cvrp/cvrp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ namespace vroom {

using RawSolution = std::vector<RawRoute>;

namespace cvrp {

using LocalSearch = ls::LocalSearch<RawRoute,
cvrp::UnassignedExchange,
cvrp::SwapStar,
Expand All @@ -51,6 +53,7 @@ using LocalSearch = ls::LocalSearch<RawRoute,
cvrp::IntraOrOpt,
cvrp::PDShift,
cvrp::RouteExchange>;
} // namespace cvrp

const std::vector<HeuristicParameters> CVRP::homogeneous_parameters =
{HeuristicParameters(HEURISTIC::BASIC, INIT::NONE, 0.3),
Expand Down Expand Up @@ -220,10 +223,10 @@ Solution CVRP::solve(unsigned exploration_level,
}

// Local search phase.
LocalSearch ls(_input,
solutions[rank],
max_nb_jobs_removal,
search_time);
cvrp::LocalSearch ls(_input,
solutions[rank],
max_nb_jobs_removal,
search_time);
ls.run();

// Store solution indicators.
Expand Down
11 changes: 7 additions & 4 deletions src/problems/vrptw/vrptw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace vroom {

using TWSolution = std::vector<TWRoute>;

namespace vrptw {

using LocalSearch = ls::LocalSearch<TWRoute,
vrptw::UnassignedExchange,
vrptw::SwapStar,
Expand All @@ -50,6 +52,7 @@ using LocalSearch = ls::LocalSearch<TWRoute,
vrptw::IntraOrOpt,
vrptw::PDShift,
vrptw::RouteExchange>;
} // namespace vrptw

const std::vector<HeuristicParameters> VRPTW::homogeneous_parameters =
{HeuristicParameters(HEURISTIC::BASIC, INIT::HIGHER_AMOUNT, 0.3),
Expand Down Expand Up @@ -202,10 +205,10 @@ Solution VRPTW::solve(unsigned exploration_level,
}

// Local search phase.
LocalSearch ls(_input,
tw_solutions[rank],
max_nb_jobs_removal,
search_time);
vrptw::LocalSearch ls(_input,
tw_solutions[rank],
max_nb_jobs_removal,
search_time);
ls.run();

// Store solution indicators.
Expand Down