问题
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