英文:
Unplan a variable that does not satisfy a constraint
问题
Timefold 是否可以取消预定一个或多个变量?例如,对于车辆路径规划,我想设置一个开始日期和结束日期,如果干预安排在结束日期之后,它将在我的解决方案中取消预定,即不会与任何车辆关联,并且没有环绕时间。
- 如果可以直接在 Timefold 解决过程中完成,我该如何操作?
- 如果不可能,是否需要在解决后进行后处理?
- 我需要更改我的求解器配置吗?
英文:
Is it possible with Timefold to unschedule one or more variables. For example for vehicle routing I want to set up a start date and an end date and if an intervention is scheduled after the end date then it will be unscheduled in my solution, i.e. it will not will be associated with no vehicle and will have no lap time.
- If it's possible directly during Timefold resolution how can I do it?
- And if it's not possible do I have to go through post resolution processing.
- Do I need to change my solver configuration?
答案1
得分: 0
在我看来,你正在寻找超约束规划。它允许你指定分配值是可选的。因此,求解器可能会留下一些"干预"未分配。
不过,有一些注意事项:
- 它可能仍然会安排一些超出规划窗口的内容,在这种情况下,你可能需要进行后处理,但如果处罚足够高,这些情况可能不会经常发生,甚至不会发生。
- 它可能会在规划窗口内创建未分配的访问。这也需要通过约束来处理。
- 由于你特别提到了车辆路径规划,你可能会遇到超约束规划不支持规划列表变量的限制。(不过这在我们的路线图上。)如果是这种情况,你将不得不使用虚拟车辆来实施一个解决方法。
总的来说,我建议你让求解器分配任何它可以分配的东西,甚至超出规划窗口。参见连续规划。
英文:
In my opinion, you are looking for over-constrained planning. It allows you to specify that assigning a value is optional. So, the solver may leave some "interventions" unassigned.
There are some caveats, though:
- It may still schedule something past the planning window, and in that case you may have to do post-processing, but if the penalty is high enough, those won't happen frequently, or at all.
- It may create unassigned visits within the planning window. That also needs to be dealt with through constraints.
- Since you specifically mention vehicle routing, you may run into a limitation that over-constrained planning is not supported on planning list variable. (It is on our roadmap, though.) If that is the case, you'll have to implement a workaround using a dummy vehicle.
Generally, I'd suggest you let the solver assign anything it can, even outside of the planning window. See continuous planning.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论