简体   繁体   English

Optaplanner CVRPTWPD:是否可以根据旅游状态提供可变的服务持续时间?

[英]Optaplanner CVRPTWPD: Is it possible to have variable service duration depending on tour state?

I'm currently looking into Optaplanner to solve a CVRPTWPD (Capacitated vehicle routing problem with time windows and pickup and delivery).我目前正在研究 Optaplanner 以解决 CVRPTWPD(具有时间窗和取货和交付的容量车辆路线问题)。 At each location I have to perform a service (loading or unloading of shipments) which takes time.在每个地点,我都必须执行一项需要时间的服务(装卸货物)。
I want to model the depot as n locations (if there are n customer locations), so each customer location has corresponding depot location for the modelling of pickup and delivery.我想将仓库建模为n 个位置(如果有n 个客户位置),因此每个客户位置都有对应的仓库位置,用于建模取货和交付。

The problem I face is the following:我面临的问题如下:
If the vehicle starts at the depot, I do not want to take any time for loading or unloading into account (simulating that the transporter is already loaded with the planned shipments in the morning), but if the vehicle returns to the depot (in this case one or more of the n depot locations) to pick up additional shipments and leaves the depot again afterwards (meaning the next location is a customer location), I want to take the time for loading and unloading into account.如果车辆从车厂出发,我不想花任何时间装卸(模拟运输车已经装好早上计划的货物),但如果车辆返回车厂(在此如果 n 个仓库位置中的一个或多个)提取额外的货物并随后再次离开仓库(意味着下一个位置是客户位置),我想考虑装卸时间。
My question is the following:我的问题如下:
Is it possible for Optaplanner to have variable service duration during optimization run time? Optaplanner 是否可以在优化运行期间具有可变的服务持续时间? I would add a checker which check whether before the index of the depot location in the state of the tour there is a customer location planned before this index and add service duration in this case, because this means that a customer stop was already visited and the transporter is returning to the depot (and therefore service time is needed).我会添加一个检查器,用于检查在旅行状态下的站点位置索引之前是否有在该索引之前计划的客户位置,并在这种情况下添加服务持续时间,因为这意味着已经访问了客户站点并且运输商正在返回仓库(因此需要服务时间)。

I hope I described everything clearly.我希望我清楚地描述了一切。 Thank you for your help!谢谢您的帮助!

Yes, you can.是的你可以。 If you look into the TSP or VRP example, you'd note that a Depot and Customer are a different type, but they share the same interface.如果您查看 TSP 或 VRP 示例,您会注意到 Depot 和 Customer 是不同的类型,但它们共享相同的接口。 This allows them to be chained together to form a route.这允许它们被链接在一起以形成一条路线。

To allow for variable service duration, all you have to do is to check the type of the planning entity and the previous planning entity to see if it is the first depot or not.为了允许可变的服务持续时间,您所要做的就是检查计划实体的类型和之前的计划实体,看看它是否是第一个站点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM