JSPrit deliver sooner rather than later if at destination

霸气de小男生 提交于 2019-12-25 07:50:57

问题


Picking up multiple shipments, dropping off at central location. Problem is, sometimes the vehicle fills up and drops things off at central location, but only enough to finish the route. I'd like it to drop off everything it has if it is already at the depot.

See below, it delivers job #3 to the depot, leaving 4 other items in the vehicle (which has a capacity of 5). Then picks up the final thing, before delivering everything.

+--------------------------------------------------------------------------------------------------------------------------------+
| detailed solution                                                                                                              |
+---------+----------------------+-----------------------+-----------------+-----------------+-----------------+-----------------+
| route   | vehicle              | activity              | job             | arrTime         | endTime         | costs           |
+---------+----------------------+-----------------------+-----------------+-----------------+-----------------+-----------------+
| 1       | vehicle              | start                 | -               | undef           | 0               | 0               |
| 1       | vehicle              | pickupShipment        | 3               | 353             | 1253            | 3527            |
| 1       | vehicle              | pickupShipment        | 2               | 1253            | 2153            | 3527            |
| 1       | vehicle              | pickupShipment        | 4               | 2582            | 3482            | 7819            |
| 1       | vehicle              | pickupShipment        | 6               | 3801            | 4701            | 11012           |
| 1       | vehicle              | pickupShipment        | 5               | 4701            | 5601            | 11012           |
| 1       | vehicle              | deliverShipment       | 3               | 5945            | 6845            | 14455           |
| 1       | vehicle              | pickupShipment        | 1               | 7025            | 7925            | 16248           |
| 1       | vehicle              | deliverShipment       | 2               | 8104            | 9004            | 18042           |
| 1       | vehicle              | deliverShipment       | 4               | 9004            | 9904            | 18042           |
| 1       | vehicle              | deliverShipment       | 6               | 9904            | 10804           | 18042           |
| 1       | vehicle              | deliverShipment       | 5               | 10804           | 11704           | 18042           |
| 1       | vehicle              | deliverShipment       | 1               | 11704           | 12604           | 18042           |
| 1       | vehicle              | end                   | -               | 12604           | undef           | 18042           |
+--------------------------------------------------------------------------------------------------------------------------------+

What's a good way to model some time or monetary cost that assures shipments do no spend any unnecessary time in the vehicle? All I want is an optimal route to pick up / drop off shipments.

来源:https://stackoverflow.com/questions/41111292/jsprit-deliver-sooner-rather-than-later-if-at-destination

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!