Skip to content

Commit

Permalink
Fixes during review.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Aug 14, 2023
1 parent 4787a90 commit f609029
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/algorithms/heuristics/heuristics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ T basic(const Input& input, INIT init, double lambda, SORT sort) {

// Build replacement sequence for current insertion.
std::vector<Index> modified_with_pd;
modified_with_pd.reserve(current_r.size() - pickup_r + 3);
modified_with_pd.reserve(current_r.size() - pickup_r + 2);
modified_with_pd.push_back(job_rank);

Amount modified_delivery = input.zero_amount();
Expand Down Expand Up @@ -788,7 +788,7 @@ T dynamic_vehicle_choice(const Input& input,

// Build replacement sequence for current insertion.
std::vector<Index> modified_with_pd;
modified_with_pd.reserve(current_r.size() - pickup_r + 3);
modified_with_pd.reserve(current_r.size() - pickup_r + 2);
modified_with_pd.push_back(job_rank);

Amount modified_delivery = input.zero_amount();
Expand Down Expand Up @@ -872,7 +872,7 @@ T dynamic_vehicle_choice(const Input& input,
keep_going = true;
}
if (input.jobs[best_job_rank].type == JOB_TYPE::PICKUP) {
std::vector<Index> modified_with_pd({best_job_rank});
std::vector<Index> modified_with_pd;
modified_with_pd.reserve(best_delivery_r - best_pickup_r + 2);
modified_with_pd.push_back(best_job_rank);

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/local_search/insertion_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ RouteInsertion compute_best_insertion_pd(const Input& input,

// Build replacement sequence for current insertion.
std::vector<Index> modified_with_pd;
if (pickup_r < end_d_rank) {
if (pickup_r <= end_d_rank) {
modified_with_pd.reserve(end_d_rank - pickup_r + 2);
}
modified_with_pd.push_back(j);
Expand Down

0 comments on commit f609029

Please sign in to comment.