shift length constraint in OR-TOOLS RL VRPTW problem?

混江龙づ霸主 提交于 2019-12-11 19:09:01

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!