OptaPlanner:使计划实体链接并为空 [英] OptaPlanner: Make planning entities chained and nullable

查看:85
本文介绍了OptaPlanner:使计划实体链接并为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的OptaPlanner社区

对于OptaPlanner框架的特定用例,我想使用链式数据结构,就像在车辆路由"示例中使用的那样.在我们的案例中,问题在于有很多客户,并且并非所有客户都可以在特定的计划周期内得到服务.因此,我认为使用可为空的计划变量可能会很有用,因此并非所有任务都需要分配,同时仍具有有效的供应商链. 我的问题是,我该如何解决这个问题?有未分配任务的额外链条吗?还有另一种方法可以规避此问题? 问候 拉斐尔

解决方案

链式计划变量尚不支持nullable=true(至少在7.8版中).

无论如何,我都会应用连续计划,并在第二天开始计划-第二天的决定可能会影响第一天的决定(例如,假设您有100个数据包需要在第2天之前交付,但是在第2天,一半的司机正在休假,而且您没有足够的时间单独在第2天交付所有司机,因此您已经在第1天交付了一些东西.)

因此,我将创建具有固定的VehicleDayVehicleDay-并在示例现在使用Vehicle的所有地方使用它.

Dear OptaPlanner community

For a specific use case of the OptaPlanner framework, I would like to use the chained data structure, as it is used in the Vehicle Routing example. The problem in our case is that there are a lot of customers, and not all of them can be served in a specific planning cycle. For that reason, I thought using nullable planning variables could be useful, so not all tasks need to be assigned, while still having valid chains of Suppliers. My questions is, how could I solve this problem? Have an extra chain with unassigned tasks? Is there another way to circumvent this issue? Regards Raphael

解决方案

Chained planning variables don't support nullable=true yet (in version 7.8 at least).

In any case, I 'd apply continuous planning and start planning the next days too - the decisions on the next days might affect the decisions on the first day (for example presume you have 100 packets that needs to be delivered before day 2, but on day 2 half your drivers are on vacation and you don't have enough time to deliver them all on day 2 alone, so you need to deliver some on day 1 already.)

So, I 'd create VehicleDay which has a fixed Vehicle and Day - and I 'd use that everywhere were the example uses Vehicle now.

这篇关于OptaPlanner:使计划实体链接并为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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