Skip to content

Commit 1b476bd

Browse files
committed
Add color naming and reordering to printed solution.txt
1 parent 3169ff7 commit 1b476bd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dkroutingtool/src/py/optimization.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,8 @@ def finalize_route_solution(solution: IntermediateOptimizationSolution, config)
14311431
solution_vehicles = solution.vehicles
14321432

14331433
solution_route_dict = add_display_name(solution_route_dict)
1434-
1434+
solution.route_dict = solution_route_dict
1435+
14351436
routes_for_mapping = {}
14361437
route_dict = solution_route_dict
14371438
vehicles = solution_vehicles

dkroutingtool/src/py/output/route_solution_data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ def serialize_solution(self) -> str:
4949

5050
plan_output = ''
5151
for route_id, route in route_dict.items():
52-
plan_output += 'Route ID {0}'.format(route_id+1)
52+
if 'display_name' in route:
53+
plan_output += 'Route ID {0}'.format(route['display_name'])
54+
else:
55+
plan_output += 'Route ID {0}'.format(route_id+1)
5356
if vehicles != None:
5457
plan_output += ', ' + vehicles[route_id].name + ':\n'
5558
else:

0 commit comments

Comments
 (0)