Closed Khixinhxan closed 4 years ago
Could it be that at stop 20 there is a time window with the left side equal to 21:03:31?
-> 13: Cumul[17:42:19,17:43:06] 17:42:19; Transit[3:20:25,3:21:12] 3:20:25; Slack[1:59:04,1:59:51] 1:59:04
-> 20: Cumul[21:03:31,21:03:31] 21:03:31; Transit[1:20:13,1:20:13] 1:20:13; Slack[0:00:00,0:00:00] 0:00:00
I think Cumul 21:03:31 at 20 by Cumul 17:42:19 + Transit 3:20:25, So why Slack Time is 1:59:04 ? I don't understanding
I have come across the same issue (here and here).
The general formula slack(i) = cumul(j) - cumul(i) - transit(i, j)
provided on the docs does not seem to hold. I do not know yet whether we're misinterpreting the results or it is a bug.
I for my part have now started computing the slack time manually from the CumulVars and TransitVars. Hopefully someone can give some more insights here!
Well the issue is naming is ambiguous and sometime the comments are wrong... On my way to double check the code, then clean the doc and samples.
Here few concepts
So yes internally you have a fixed_transit and a transit variable. https://github.com/google/or-tools/blob/b4298f709f116de08f490ac2bfe5e295fcc91f40/ortools/constraint_solver/routing.h#L2067-L2070
AFAIK (need to double check!!!!) TransitVar(i) == FixedTransitVar(i) + SlackVar(i)
that's would explain why TransitVar
is a range and not a single integer value (todo: need to check/display the value of FixedTransitVar in a vrptw example to confirm)
@selting So here https://github.com/google/or-tools/blob/b4298f709f116de08f490ac2bfe5e295fcc91f40/ortools/constraint_solver/routing.h#L2037-L2039 and here https://github.com/google/or-tools/blob/b4298f709f116de08f490ac2bfe5e295fcc91f40/ortools/constraint_solver/routing.h#L395 transit is the fixed transit value IMHO
Following/Half off topic:
transit callback (i, j) should compute/return the service_time(i) + travel_time(i, j)
Looking at void RoutingDimension::InitializeTransitVariables(int64 slack_max)
you can see:
https://github.com/google/or-tools/blob/b4298f709f116de08f490ac2bfe5e295fcc91f40/ortools/constraint_solver/routing.cc#L5609-L5623
so yes TransitVar == FixedTransitVar + dependentTransit + SlackVar
(if not const 0)
note: dependentTransit comes from AddDimensionDependentDimensionXXXX()
I using CVRPTW, export result Cumul Time, Slack Time I don't understanding this result
Node 13 to 20, why Slack Time is 1:59:04 ?
This my function
Tks all !