问题
I'm trying to enforce a shift length constraint in OR-TOOLS RL VRPTW problem. Shift length is the total amount of time the vehicle been in service (transit + wait + service), from arriving to the first location until leaving the last location.
It looks like a Time dimension
is the perfect choice, but it accumulates the window start of the first location, which isn't good.
So to re-iterate - I want a dimension that accumulates the transit time, service time and wait times (for the time window at each location), but I do NOT want it to accumulate the window start time of the first location in the route (as this is exactly where this driver's shift started. if the driver started at node i and finished at node j, I would like the constraint to be: time_dimension.CumulVar(j) - time_dimension.CumulVar(i) < shift_length
Is there any obvious modeling trick I'm missing?
来源:https://stackoverflow.com/questions/56466874/shift-length-constraint-in-or-tools-rl-vrptw-problem