Skip to content

Commit

Permalink
update ortools version in requirements
Browse files Browse the repository at this point in the history
-this is a temporary fix to avoid random crash in unit test of routing when using ortools9.6 latest version.
-commented some plot functions in unit test
  • Loading branch information
g-poveda committed Mar 28, 2023
1 parent c2245ac commit e804d59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies = [
"matplotlib>=3.1",
"seaborn>=0.10.1",
"pymzn>=0.18.3",
"ortools>=8.0",
"ortools>=9.5,<9.6",
"tqdm>=4.62.3",
"sortedcontainers>=2.4",
"deprecation",
Expand Down
9 changes: 4 additions & 5 deletions tests/pickup_vrp/builders/test_instance_builders.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2022 AIRBUS and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# LICENSE file in the root directory of this source tree.$
import logging

from discrete_optimization.generic_tools.result_storage.result_storage import (
ResultStorage,
Expand Down Expand Up @@ -75,6 +76,7 @@ def test_pickup_and_delivery():


def test_pickup_and_delivery_equilibrate():
logging.basicConfig(level=logging.INFO)
model = create_pickup_and_delivery(
number_of_vehicles=4,
number_of_node=75,
Expand Down Expand Up @@ -109,13 +111,12 @@ def test_pickup_and_delivery_equilibrate():
},
local_search_metaheuristic=local_search_metaheuristic_enum.GUIDED_LOCAL_SEARCH,
first_solution_strategy=first_solution_strategy_enum.AUTOMATIC,
time_limit=20,
time_limit=1,
n_solutions=10000,
)
results = solver.solve_intern()
res_to_plot = min([r for r in results], key=lambda x: x[-1])
check_solution(res_to_plot[0], model)
plot_ortools_solution(res_to_plot, model)


def test_pickup_and_delivery_equilibrate_new_api():
Expand Down Expand Up @@ -201,8 +202,6 @@ def test_selective_tsp():
results = solver.solve_intern()
res_to_plot = min([r for r in results], key=lambda x: x[-1])

plot_ortools_solution(res_to_plot, gpdp)


def test_selective_tsp_new_api():
nb_nodes = 1000
Expand Down

0 comments on commit e804d59

Please sign in to comment.