From d1d4a986f07612fa7ed46ea69106272807c5649c Mon Sep 17 00:00:00 2001 From: halilsen Date: Sun, 28 Jun 2020 13:51:50 +0200 Subject: [PATCH 1/2] Fix: repetition parameter taken into account --- api/v01/vrp.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/api/v01/vrp.rb b/api/v01/vrp.rb index cb11eda33..b8f119236 100644 --- a/api/v01/vrp.rb +++ b/api/v01/vrp.rb @@ -402,6 +402,7 @@ def self.vrp_request_resolution(this) this.optional(:several_solutions, type: Integer, allow_blank: false, default: 1, desc: 'Return several solution computed with different matrices') this.optional(:batch_heuristic, type: Boolean, default: OptimizerWrapper.config[:debug][:batch_heuristic], desc: 'Compute each heuristic solution') this.optional(:variation_ratio, type: Integer, desc: 'Value of the ratio that will change the matrice') + this.optional(:repetition, type: Integer, documentation: { hidden: true }, desc: 'Number of times the optimization process is going to be repeated. Only the best solution is returned.') this.at_least_one_of :duration, :iterations, :iterations_without_improvment, :stable_iterations, :stable_coefficient, :initial_time_out, :minimum_duration this.mutually_exclusive :initial_time_out, :minimum_duration end From 5d76e2c42e52c01f49b0f82a275477cb9fb609c8 Mon Sep 17 00:00:00 2001 From: halilsen Date: Wed, 1 Jul 2020 16:08:25 +0200 Subject: [PATCH 2/2] Fix: multi_trips expands only once --- lib/interpreters/multi_trips.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/interpreters/multi_trips.rb b/lib/interpreters/multi_trips.rb index d47856b4d..01799c1fc 100644 --- a/lib/interpreters/multi_trips.rb +++ b/lib/interpreters/multi_trips.rb @@ -33,6 +33,7 @@ def expand(vrp) (0..vehicle.trips - 1).collect{ |index| new_vehicle = Marshal.load(Marshal.dump(vehicle)) new_vehicle.id += "_trip_#{index}" + new_vehicle.trips = 1 new_vehicle } else