print_solution() "time of the route" does not take into account route starting time #2962
Unanswered
ConstantinoSchillebeeckxSimpleRose
asked this question in
Routing (and legacy CP) questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The routing with time windows example uses a
print_solution()
function that calculates the Time of the route as being the earliest arrival time of the vehicle to its depot i.e.assignment.Min(time_var)
:or-tools/ortools/constraint_solver/samples/vrp_time_windows.py
Lines 72 to 93 in c9b7d58
If you change the time window for the depot in that example from
(0,5)
to(1,5)
you'll find that the Time of the route is left unchanged even though the vehicles all leave an hour later.Shouldn't
print_solution()
calculate time of the route using both the route starting time and route ending time? Maybe something naive like:This also corrects the time of the route for cases where a vehicle is not used, e.g.:
Beta Was this translation helpful? Give feedback.
All reactions