Skip to content

Commit d489daa

Browse files
committed
fix
1 parent 4c892d8 commit d489daa

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/python/prize_collecting_tsp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
"""Simple prize collecting TSP problem with a max distance."""
1616

17+
from ortools.routing import enums_pb2
1718
from ortools.routing.python import routing
1819

1920

@@ -145,10 +146,10 @@ def distance_callback(from_index, to_index):
145146
# Setting first solution heuristic.
146147
search_parameters = routing.default_routing_search_parameters()
147148
search_parameters.first_solution_strategy = (
148-
routing.FirstSolutionStrategy.PATH_CHEAPEST_ARC
149+
enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC
149150
)
150151
search_parameters.local_search_metaheuristic = (
151-
routing.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH
152+
enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH
152153
)
153154
search_parameters.time_limit.seconds = 15
154155
# search_parameters.log_search = True

examples/python/prize_collecting_vrp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
"""Simple prize collecting VRP problem with a max distance."""
1616

17+
from ortools.routing import enums_pb2
1718
from ortools.routing.python import routing
1819

1920

@@ -155,10 +156,10 @@ def distance_callback(from_index, to_index):
155156
# Setting first solution heuristic.
156157
search_parameters = routing.default_routing_search_parameters()
157158
search_parameters.first_solution_strategy = (
158-
routing.FirstSolutionStrategy.PATH_CHEAPEST_ARC
159+
enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC
159160
)
160161
search_parameters.local_search_metaheuristic = (
161-
routing.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH
162+
enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH
162163
)
163164
search_parameters.time_limit.seconds = 15
164165
# search_parameters.log_search = True

0 commit comments

Comments
 (0)