本文介绍了Optaplanner-车辆可用性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在研究车辆可用性受限的VRPTW问题.这意味着它们可能在一整天都不可用-基本上是车辆的时间窗口.有没有办法在optaplanner中构建它?
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?
谢谢你和兄弟,保罗
推荐答案
以下操作应该有效:
- 在
(TimeWindowed)Vehicle
上添加2个字段(开始和结束) - 在离开仓库之前至少使用车辆的启动时间
- 添加了一个严格的约束条件,即车辆应在结束时间之前返回仓库.确保不仅处罚-1,而且要减去过期的时间(为避免产生分数陷阱,请参阅文档).
ArrivalTimeUpdatingVariableListener
中的- 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).
这篇关于Optaplanner-车辆可用性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!