hi…
i was experimenting with services
and shipments
… ive found that if i intermix the two, jsprit
comes up with an invalid solution…
here’s the issue… ive defined a VehicleType
with a capacity of 1
… ive created some random Shipments
and Services
(each with size of 1
as well) and added them to the problem… when solved, one of the route comes out as follows:
+---------+----------------------+-----------------------+-----------------+-----------------+-----------------+-----------------+
| route | vehicle | activity | job | arrTime | endTime | costs |
+---------+----------------------+-----------------------+-----------------+-----------------+-----------------+-----------------+
| 1 | VEHICLE_1 | start | - | undef | 0 | 0 |
| 1 | VEHICLE_1 | pickupShipment | SHP_6 | 4 | 14 | 4 |
| 1 | VEHICLE_1 | deliverShipment | SHP_6 | 23 | 33 | 13 |
| 1 | VEHICLE_1 | pickupShipment | SHP_8 | 35 | 45 | 15 |
| 1 | VEHICLE_1 | deliverShipment | SHP_8 | 51 | 61 | 21 |
| 1 | VEHICLE_1 | service | SVC_5 | 64 | 74 | 24 |
| 1 | VEHICLE_1 | end | - | 81 | undef | 31 |
+---------+----------------------+-----------------------+-----------------+-----------------+-----------------+-----------------+
how is this possible? the vehicle had a capacity of 1
… how can it deliver the service SVC_5
after the shipments?
I would assume that if the vehicle has to handle SVC_5
, it would need to load 1
unit of goods when leaving the depot… that would fill its capacity and hence this vehicle cannot pickup any more shipments en route till it has serviced SVC_5
… in this case, it would NEED to handle SVC_5
before it can handle any shipments…
activity | job | total capacity | capacity used
---------+-------+----------------+--------------
start | - | 1 | 1
pickup | SHP_6 | 1 | 2 ???
deliver | SHP_6 | 1 | 1
pickup | SHP_8 | 1 | 2 ???
deliver | SHP_8 | 1 | 1
service | SVC_5 | 1 | 0
alternatively, if the vehicle leaves the depot without any goods, it can pick the shipments en route and deliver them as it goes… but in this case, it CANNOT handle SVC_5
as it would not have any goods to deliver…
activity | job | total capacity | capacity used
---------+-------+----------------+--------------
start | - | 1 | 0
pickup | SHP_6 | 1 | 1
deliver | SHP_6 | 1 | 0
pickup | SHP_8 | 1 | 1
deliver | SHP_8 | 1 | 0
service | SVC_5 | 1 | -1????
am i missing something? is this not how shipments and services are meant to work?
Asim