JSprit算法软硬时间窗 [英] JSprit Algorithm soft and hard time windows

查看:99
本文介绍了JSprit算法软硬时间窗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带时间窗口的服务列表.是否可以以必须满足某些时间窗口(硬时间窗口)而其他时间窗口配置为软时间窗口的方式配置 JSprit?

预先感谢您的帮助

解决方案

可以通过 Service.Builder 为服务分配时间窗口来实现硬时间窗口.默认情况下,服务没有任何时间窗口.可以通过实现 core.problem.constraint.SoftActivityConstraint 来考虑软时间窗口

https://github.com/jsprit/jsprit/blob/master/jsprit-core/src/main/java/jsprit/core/problem/constraint/SoftActivityConstraint.java>

在这里,您可以惩罚迟到"的到达.请记住,新活动的插入不仅会产生局部影响,即对两个相邻活动的影响,而且还会对整个路线产生影响,因为它会转移所有后续活动.反过来,这也会产生需要考虑的额外惩罚.要在恒定时间内对此进行评估,您需要对全球影响进行某种近似.添加软约束后,您还需要在目标函数中考虑它(参见示例及其各自的代码示例以了解其工作原理.

I have list of services with time windows. Is it possible to configure JSprit in way that some time windows must be met (hard time windows) while other are configured to be soft time windows?

Thanks in advance for help

解决方案

Hard time windows can be implemented by assigning a time window to a service via Service.Builder. By default, services do not have any time windows. Soft time windows can be considered by implementing core.problem.constraint.SoftActivityConstraint

https://github.com/jsprit/jsprit/blob/master/jsprit-core/src/main/java/jsprit/core/problem/constraint/SoftActivityConstraint.java

Here, you can penalize "late" arrivals. Keep in mind that the insertion of a new activity does not only have a local impact, i.e. on the two neighboring activities, but it can have an impact on the whole route since it shifts all subsequent activities. This, in turn, can yield additional penalties that need to be considered as well. To evaluate this in constant time, you require some sort of approximation of the global impact. Once you add the soft constraint, you need to account for it in your objective function as well (see for example and its respective code examples to see how this works).

这篇关于JSprit算法软硬时间窗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆