From 523e09e255d7df3a01fcb4f015cca2bfe92c472a Mon Sep 17 00:00:00 2001 From: Pierre Graber Date: Fri, 8 Jul 2022 15:45:47 +0200 Subject: [PATCH] [OO] Base setup_duration on point_id --- CHANGELOG.md | 2 ++ wrappers/ortools.rb | 5 ++++- wrappers/ortools_vrp_pb.rb | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2271d24d..0a5ac639b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ ### Changed +- Base `setup_duration` within optimizer-ortools on `point_id` instead of `matrix_index` [#444] (https://github.com/Mapotempo/optimizer-api/pull/444) + ### Removed ### Fixed diff --git a/wrappers/ortools.rb b/wrappers/ortools.rb index 0b17aee64..52d835fe2 100644 --- a/wrappers/ortools.rb +++ b/wrappers/ortools.rb @@ -190,6 +190,7 @@ def solve(vrp, job, thread_proc = nil, &block) !q.nil? && (q.fill || q.empty) }, problem_index: service_index, + point_id: service.activity.point_id ) services = update_services_positions(services, services_positions, service.id, @@ -237,6 +238,7 @@ def solve(vrp, job, thread_proc = nil, &block) !q.nil? && (q.fill || q.empty) }, problem_index: service_index, + point_id: possible_activity.point_id ) services = update_services_positions(services, services_positions, service.id, @@ -310,7 +312,8 @@ def solve(vrp, job, thread_proc = nil, &block) max_ride_time: vehicle.maximum_ride_time || 0, max_ride_distance: vehicle.maximum_ride_distance || 0, free_approach: vehicle.free_approach || false, - free_return: vehicle.free_return || false + free_return: vehicle.free_return || false, + start_point_id: vehicle.start_point_id.to_s ) } diff --git a/wrappers/ortools_vrp_pb.rb b/wrappers/ortools_vrp_pb.rb index ad69e8e82..5d9c01ad0 100644 --- a/wrappers/ortools_vrp_pb.rb +++ b/wrappers/ortools_vrp_pb.rb @@ -30,6 +30,7 @@ optional :exclusion_cost, :float, 13 repeated :refill_quantities, :bool, 14 optional :problem_index, :uint32, 15 + optional :point_id, :string, 16 end add_message "ortools_vrp.Rest" do optional :time_window, :message, 1, "ortools_vrp.TimeWindow" @@ -72,6 +73,7 @@ optional :additional_setup, :uint32, 26 optional :free_approach, :bool, 27 optional :free_return, :bool, 28 + optional :start_point_id, :string, 29 end add_message "ortools_vrp.Relation" do optional :type, :string, 1