Thanks for the answer. They are great help!
This morning I’ve found out the missing option 2), but the other options I missed (especially the one when one inserts between a valid pair).
However, meanwhile, I ran into other problems and these stands even after implementing your other cases.
Ruin/insertation: a ruin could remove one item of a pair (= a fill delivery/backhaul pickup pair), but in case it doesn’t remove the other item of the pair, the insertation phase could only insert the item back to its original position. It leads a much slower convergation and would with high probability stuck the pair to the vehicle it was first inserted.
Therefor, I have to do one of the following:
Option A:
Create my own ruin/insert stategy where the pair is removed/inserted together. My only problem, I don’t know how to do it correctly.
Option B
Use three services instead of two shipments:
- Service 1 = Fill pickup
- Service 2 = Pair (fill delivery+backhaul pickup)
- Service 3 = Backhaul delivery
and then keeping the three on the same route by hard constraint (order-correctly). However, the insert/ruin together problem of Option A still stands here, so I will need specialized ruin/insert strategy for this too.
Option C
Create a new Job type for BackhaulShipment and keeping together the three internally. It looks the tidiest solution, but after some deeper code digging I’ve found out that the handling of Shipment is not in the Shipment implementation alone, but wired into several classes (using instanceof and dedicated methods), so introducing a new Job implementation needs some contribution in several other classes. At the moment I don’t feel my current understanding of the code strong enough to do this.
I would be thankful for any advice, link to any example.
Best regards,
Balage