Skip to content

Commit

Permalink
Merge branch 'master' into feature/max-distance
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Sep 20, 2023
2 parents 719c3a6 + b6942b5 commit 8671c33
Show file tree
Hide file tree
Showing 101 changed files with 1,670 additions and 1,732 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Reserve `vector` capacity whenever possible (#915)
- Refactor heuristics to be able to operate on a subset of jobs and vehicles (#837)
- Account for vehicle/job compatibility in heuristic regrets values (#982)
- Slightly reduce computing times for SWAP* operator (#987)

### Fixed

Expand All @@ -40,6 +41,7 @@
- `max_travel_time` not accounted for with vehicle steps in solving mode (#954)
- `max_travel_time` not accounted for in `RouteSplit` (#941)
- Address sonarcloud "bugs" reports (#984)
- Address some sonarcloud "code smell" reports (#986)

## [v1.13.0] - 2023-01-31

Expand Down
86 changes: 44 additions & 42 deletions libvroom_examples/libvroom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,28 @@ void log_solution(const vroom::Solution& sol, bool geometry) {
for (const auto& step : route.steps) {
std::string type;
switch (step.step_type) {
case vroom::STEP_TYPE::START:
using enum vroom::STEP_TYPE;
case START:
type = "Start";
break;
case vroom::STEP_TYPE::END:
case END:
type = "End";
break;
case vroom::STEP_TYPE::BREAK:
case BREAK:
type = "Break";
break;
case vroom::STEP_TYPE::JOB: {
case JOB: {
assert(step.job_type.has_value());

switch (step.job_type.value()) {
case vroom::JOB_TYPE::SINGLE:
using enum vroom::JOB_TYPE;
case SINGLE:
type = "Job";
break;
case vroom::JOB_TYPE::PICKUP:
case PICKUP:
type = "Pickup";
break;
case vroom::JOB_TYPE::DELIVERY:
case DELIVERY:
type = "Delivery";
break;
}
Expand Down Expand Up @@ -154,36 +156,36 @@ void run_example_with_osrm() {
// priority and time windows. Constraints that are not required can
// be omitted.
std::vector<vroom::Job> jobs;
jobs.push_back(vroom::Job(1,
vroom::Coordinates{1.98935, 48.701},
setup,
service,
job_delivery,
job_empty_pickup,
{1}, // skills
0, // default priority
job_1_tws));
jobs.push_back(vroom::Job(2,
vroom::Coordinates{2.03655, 48.61128},
setup,
service,
job_empty_delivery,
job_pickup,
{1}));
jobs.push_back(vroom::Job(5,
vroom::Coordinates{2.28325, 48.5958},
setup,
service,
job_delivery,
job_empty_pickup,
{14}));
jobs.push_back(vroom::Job(6,
vroom::Coordinates{2.89357, 48.90736},
setup,
service,
job_delivery,
job_empty_pickup,
{14}));
jobs.emplace_back(1,
vroom::Location(vroom::Coordinates{1.98935, 48.701}),
setup,
service,
job_delivery,
job_empty_pickup,
vroom::Skills{1}, // skills
0, // default priority
job_1_tws);
jobs.emplace_back(2,
vroom::Location(vroom::Coordinates{2.03655, 48.61128}),
setup,
service,
job_empty_delivery,
job_pickup,
vroom::Skills{1});
jobs.emplace_back(5,
vroom::Location(vroom::Coordinates{2.28325, 48.5958}),
setup,
service,
job_delivery,
job_empty_pickup,
vroom::Skills{14});
jobs.emplace_back(6,
vroom::Location(vroom::Coordinates{2.89357, 48.90736}),
setup,
service,
job_delivery,
job_empty_pickup,
vroom::Skills{14});

for (const auto& j : jobs) {
problem_instance.add_job(j);
Expand All @@ -196,15 +198,15 @@ void run_example_with_osrm() {

vroom::Job pickup(4,
vroom::JOB_TYPE::PICKUP,
vroom::Coordinates{2.41808, 49.22619},
vroom::Location(vroom::Coordinates{2.41808, 49.22619}),
setup,
service,
pd_amount,
pd_skills);

vroom::Job delivery(3,
vroom::JOB_TYPE::DELIVERY,
vroom::Coordinates{2.39719, 49.07611},
vroom::Location(vroom::Coordinates{2.39719, 49.07611}),
setup,
service,
pd_amount,
Expand Down Expand Up @@ -265,8 +267,8 @@ void run_example_with_custom_matrix() {
// (coordinates are optional). Constraints that are not required can
// be omitted.
std::vector<vroom::Job> jobs;
jobs.push_back(vroom::Job(1414, 1));
jobs.push_back(vroom::Job(1515, 2));
jobs.emplace_back(1414, vroom::Location(1));
jobs.emplace_back(1515, vroom::Location(2));

for (const auto& j : jobs) {
problem_instance.add_job(j);
Expand All @@ -284,7 +286,7 @@ void run_example_with_custom_matrix() {
int main() {
try {
run_example_with_osrm();
// run_example_with_custom_matrix();
run_example_with_custom_matrix();
} catch (const vroom::Exception& e) {
std::cerr << "[Error] " << e.message << std::endl;
}
Expand Down
Loading

0 comments on commit 8671c33

Please sign in to comment.