Page 1 of 1

Usage of FIRST_CUSTOMER_STOP and LAST_CUSTOMER_STOP

Posted: Fri Feb 14, 2025 2:04 pm
by marius.vladutoiu
Hello Bernd,
Been trying to see if this FIRST_CUSTOMER_STOP (or LAST_CUSTOMER_STOP) is the right property that we need to implement to achieve the following xTour planning result, and can't quite figure it out:

Basic case:
  • Pickup 3 orders at same address (vehicle depot)
  • Delivery each order at separate addresses.
What I need to achieve:
  • Use xTour to get the best tourplan, BUT define which of the delivery addresses should be delivered FIRST.
So, I tried this case by adding the property FIRST_CUSTOMER_STOP on one of the delivery addresses (which was not naturally delivered first if I just ran xTour with the data without the property), and as a consequence, that particular order for that address was returned as unplannable.
However, if I tried on same delivery address the property LAST_CUSTOMER_STOP, then it worked and placed the respective delivery address last in the chain of events.

Then I tried the opposite case:
Pickup 3 orders at 3 separate locations.
Deliver all three orders at same location (vehicle depot)
In this case, if I declared one of the pickup locations as FIRST_CUSTOMER_STOP, xTour response properly gave me that address as the first one in tour. If I declared that address as LAST_CUSTOMER_STOP, order for that address was considered unplannable.

So my conclusion was that:
FIRST_CUSTOMER_STOP actually works as a FIRST_pickup - only on a multiple-pickup-address case.
LAST_CUSTOMER_STOP actually works as a LAST_delivery - only on a multiple-delivery-address case.

However, in my case, I was hoping to achieve the FIRST_delivery in a multiple-delivery-address case.

What gave me hope is this sentence from the Technical concepts "Trip Sections" :
which said, under the first Detailed Consideration example, this sentence:
A customer site with specified position in trip of type FIRST_CUSTOMER_STOP has to be the very first customer stop within the trip but depot stop(s) can precede within the same trip.

So, is there any way to be able to declare which of the delivery addresses I need to be planned first?
Since the loading address in my case is the actual depot stop, and of course it precedes the first delivery.

Re: Usage of FIRST_CUSTOMER_STOP and LAST_CUSTOMER_STOP

Posted: Mon Feb 17, 2025 1:26 pm
by Bernd Welter
Well, I anticipate you already found the relevant hint: the object you call "depot" is in fact modelled as CustomerSite:
  • top right: the requests's global "pickup" location
  • Red pins / red dashed line: impossible sequence because of the PositionInTrip.FIRSTCUSTOMERSTOP
In the list of the three orders the red one is the unplannable one: all locations are modelled as CustomerSite and as the DeliveryLocation of the red order is by design supposed to be visited AFTER it's PickupLocation it is impossible to satisfy this constraint.
In the list of the three orders the red one is the unplannable one: all locations are modelled as CustomerSite and as the DeliveryLocation of the red order is by design supposed to be visited AFTER it's PickupLocation it is impossible to satisfy this constraint.