Skip to content

Commit 9294f0f

Browse files
committed
Remove private embeed wrapper and solver
1 parent 80bb687 commit 9294f0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+0
-3919
lines changed

Dockerfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ ENV LANG C.UTF-8
2424

2525
WORKDIR /srv/app
2626

27-
# # Set correct environment variables.
28-
# RUN apt update && apt install -y \
29-
# python3.8 python3-pip && \
30-
# pip3 install protobuf==3.20.* && \
31-
# pip3 install schema && \
32-
# pip3 install scikit-learn
33-
# RUN pip3 install unconstrained-initialization/dependencies/fastvrpy-0.5.2.tar.gz --user
34-
3527
RUN apt update && \
3628
libgeos=$(apt-cache search 'libgeos-' | grep -P 'libgeos-\d.*' | awk '{print $1}') && \
3729
apt install -y git libgeos-dev ${libgeos} libicu-dev libglpk-dev nano

api/v01/entities/vrp_input.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ module VrpConfiguration
154154
end
155155

156156
params :vrp_request_preprocessing do
157-
optional(:unconstrained_initialization, type: Boolean, desc: 'Use experimental algorithm to find an initial solution')
158157
optional(:max_split_size, type: Integer, desc: 'Divide the problem into clusters beyond this threshold')
159158
optional(:partition_method, type: String, documentation: { hidden: true }, desc: '[ DEPRECATED : use partitions structure instead ]')
160159
optional(:partition_metric, type: Symbol, documentation: { hidden: true }, desc: '[ DEPRECATED : use partitions structure instead ]')

config/access.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ module OptimizerWrapper
2626
'solvers' => { profile: :solvers },
2727
'vroom' => { profile: :vroom },
2828
'ortools' => { profile: :ortools },
29-
'unconstrained_initialization' => { profile: :unconstrained_initialization },
3029
}
3130
end

config/environments/development.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
require './wrappers/demo'
2020
require './wrappers/vroom'
2121
require './wrappers/ortools'
22-
require './wrappers/unconstrained_initialization'
2322

2423
require './lib/cache_manager'
2524
require './util/logger'
@@ -38,7 +37,6 @@ module OptimizerWrapper
3837
ORTOOLS_EXEC =
3938
'LD_LIBRARY_PATH=../or-tools/dependencies/install/lib/:../or-tools/lib/ ../optimizer-ortools/tsp_simple'.freeze
4039
ORTOOLS = Wrappers::Ortools.new(tmp_dir: TMP_DIR, exec_ortools: ORTOOLS_EXEC)
41-
UNCONSTRAINED_INITIALIZATION = Wrappers::UnconstrainedInitialization.new(tmp: TMP_DIR)
4240

4341
PARAMS_LIMIT = { points: 100000, vehicles: 1000 }.freeze
4442
QUOTAS = [{ daily: 100000, monthly: 1000000, yearly: 10000000 }].freeze # Only taken into account if REDIS_COUNT
@@ -61,7 +59,6 @@ module OptimizerWrapper
6159
demo: DEMO,
6260
vroom: VROOM,
6361
ortools: ORTOOLS,
64-
unconstrained_initialization: UNCONSTRAINED_INITIALIZATION,
6562
},
6663
profiles: {
6764
demo: {
@@ -72,14 +69,6 @@ module OptimizerWrapper
7269
params_limit: PARAMS_LIMIT,
7370
quotas: QUOTAS, # Only taken into account if REDIS_COUNT
7471
},
75-
unconstrained_initialization: {
76-
queue: 'DEFAULT',
77-
services: {
78-
vrp: [:unconstrained_initialization]
79-
},
80-
params_limit: PARAMS_LIMIT,
81-
quotas: QUOTAS,
82-
},
8372
},
8473
solve: {
8574
synchronously: ENV['OPTIM_SOLVE_SYNCHRONOUSLY'] == 'true',

config/environments/production.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
require './wrappers/demo'
2020
require './wrappers/vroom'
2121
require './wrappers/ortools'
22-
require './wrappers/unconstrained_initialization'
2322

2423
require './lib/cache_manager'
2524
require './util/logger'
@@ -39,7 +38,6 @@ module OptimizerWrapper
3938
ORTOOLS_EXEC =
4039
'LD_LIBRARY_PATH=../or-tools/dependencies/install/lib/:../or-tools/lib/ ../optimizer-ortools/tsp_simple'.freeze
4140
ORTOOLS = Wrappers::Ortools.new(tmp_dir: TMP_DIR, exec_ortools: ORTOOLS_EXEC, threads: 4)
42-
UNCONSTRAINED_INITIALIZATION = Wrappers::UnconstrainedInitialization.new(tmp: TMP_DIR)
4341

4442
PARAMS_LIMIT = { points: 100000, vehicles: 1000 }.freeze
4543
QUOTAS = [{ daily: 100000, monthly: 1000000 }].freeze # Only taken into account if REDIS_COUNT
@@ -62,7 +60,6 @@ module OptimizerWrapper
6260
demo: DEMO,
6361
vroom: VROOM,
6462
ortools: ORTOOLS,
65-
unconstrained_initialization: UNCONSTRAINED_INITIALIZATION,
6663
},
6764
profiles: {
6865
demo: {
@@ -73,14 +70,6 @@ module OptimizerWrapper
7370
params_limit: PARAMS_LIMIT,
7471
quotas: QUOTAS, # Only taken into account if REDIS_COUNT
7572
},
76-
unconstrained_initialization: {
77-
queue: 'DEFAULT',
78-
services: {
79-
vrp: [:unconstrained_initialization]
80-
},
81-
params_limit: PARAMS_LIMIT,
82-
quotas: QUOTAS,
83-
},
8473
},
8574
solve: {
8675
synchronously: ENV['OPTIM_SOLVE_SYNCHRONOUSLY'] == 'true',

config/environments/test.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
require './wrappers/demo'
2020
require './wrappers/vroom'
2121
require './wrappers/ortools'
22-
require './wrappers/unconstrained_initialization'
2322
require './lib/cache_manager'
2423
require './util/logger'
2524

@@ -38,7 +37,6 @@ module OptimizerWrapper
3837
ORTOOLS_EXEC =
3938
'LD_LIBRARY_PATH=../or-tools/dependencies/install/lib/:../or-tools/lib/ ../optimizer-ortools/tsp_simple'.freeze
4039
ORTOOLS = Wrappers::Ortools.new(tmp_dir: TMP_DIR, exec_ortools: ORTOOLS_EXEC)
41-
UNCONSTRAINED_INITIALIZATION = Wrappers::UnconstrainedInitialization.new(tmp_dir: TMP_DIR)
4240

4341
PARAMS_LIMIT = { points: 150, vehicles: 10 }.freeze
4442
QUOTAS = [{ daily: 100000, monthly: 1000000, yearly: 10000000 }].freeze # Only taken into account if REDIS_COUNT
@@ -61,7 +59,6 @@ module OptimizerWrapper
6159
demo: DEMO,
6260
vroom: VROOM,
6361
ortools: ORTOOLS,
64-
unconstrained_initialization: UNCONSTRAINED_INITIALIZATION,
6562
},
6663
profiles: {
6764
demo: {
@@ -97,14 +94,6 @@ module OptimizerWrapper
9794
params_limit: PARAMS_LIMIT,
9895
quotas: QUOTAS, # Only taken into account if REDIS_COUNT
9996
},
100-
unconstrained_initialization: {
101-
queue: 'DEFAULT',
102-
services: {
103-
vrp: [:unconstrained_initialization]
104-
},
105-
params_limit: PARAMS_LIMIT,
106-
quotas: QUOTAS,
107-
},
10897
quotas: {
10998
queue: 'DEFAULT',
11099
services: {

models/configuration.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class Partition < Base
3434
end
3535

3636
class Preprocessing < Base
37-
field :unconstrained_initialization, default: false
3837
field :max_split_size, default: nil
3938
field :cluster_threshold, default: nil
4039
field :prefer_short_segment, default: false

optimizer_wrapper.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -246,25 +246,6 @@ def self.solve(service_vrp, job = nil, block = nil)
246246
end
247247
}
248248

249-
# if unconstrained_initialization parameter is true :
250-
# use Localsearch algorithm and inject routes in the vrp
251-
252-
if vrp.configuration.preprocessing.unconstrained_initialization
253-
initial_solution = OptimizerWrapper.config[:services][:unconstrained_initialization].solve(vrp, 'test')
254-
routes = initial_solution[:routes].map{ |r| r[:stops].map{ |s| s[:id] } }
255-
routes.each_with_index{ |route, index|
256-
mission_ids = route
257-
r = Models::Route.create(
258-
vehicle: vrp.vehicles[index],
259-
mission_ids: mission_ids
260-
)
261-
vrp.routes << r
262-
}
263-
initial_solution_elapsed_time = tic - Time.now
264-
vrp.configuration.resolution.duration =
265-
[1, vrp.configuration.resolution.duration - initial_solution_elapsed_time,
266-
vrp.configuration.resolution.minimum_duration].max
267-
end
268249
# vrp.periodic_heuristic check the first_solution_stategy which may change right after periodic heuristic
269250
periodic_heuristic_flag = vrp.periodic_heuristic?
270251
# TODO: refactor with dedicated class

0 commit comments

Comments
 (0)