Optaplanner - availability of Vehicles

爱⌒轻易说出口 提交于 2020-01-02 10:27:08

问题


I am working on a VRPTW problem where vehicles have availablity constraints. This means that they might not be available the entire period of a day - basically a time windows for vehicles. Is there a way to build this in optaplanner?

Thank you and Brgds, Paul


回答1:


This following should work:

  • add 2 fields (start and end) on (TimeWindowed)Vehicle
  • in ArrivalTimeUpdatingVariableListener use at least the vehicle's start time before it leaves a depot
  • add a hard constraint that the vehicle should be back at the depot by it's end time. Make sure to penalize not just -1, but instead, minus the amount of time it's overdue (to avoid a score trap, see docs).


来源:https://stackoverflow.com/questions/21307115/optaplanner-availability-of-vehicles

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