I use Shipment to solve multiple trips for vehicle.
Now jsprit return solution like this:
…
pickupShipment
pickupShipment
pickupShipment
pickupShipment
deliverShipment
deliverShipment
pickupShipment
pickupShipment
deliverShipment
deliverShipment
deliverShipment
deliverShipment
…
I try to prevent return to depot with HardActivityConstraint
if (isPickup(newAct) && isDepot(newAct.getLocation().getId()) && isDelivery(prevAct)) {
if (prevCapacity.get(WEIGHT_INDEX) != 0) {
return ConstraintsStatus.NOT_FULFILLED;
}
}
return ConstraintsStatus.FULFILLED;
but it not work…
Is there any way to limit pickup if vehicle has goods on board?