xTour2: individual pickup times at the depot?

This forum deals with any kind of trip optimization whether it is automatic planning or manual dispatching, refering to transport orders or service planning.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

xTour2: individual pickup times at the depot?

Post by Bernd Welter »

Hi there,

yesterday I received the following question from a user who wants to cover a specific requirement:
I'd like to model delivery of orders from a single depot with predefined service time for pickup (30 minutes AdditionalServiceTimePerPickupStop, 0 minutes per order) where orders have different pickup time windows. I created a DepotSite for each of the different opening intervals and as long the pickup time windows are overlapping, the orders are delivered on the same tour which is great, but the service time on pickup from depot is calculated for each of the windows:
the timeslots for pickup and delivery of each order
the timeslots for pickup and delivery of each order
Is there a workaround for it or a better approach besides moving service time from stop to order?
Here's the first feedback from DEV - feelfree to join the discussion and to draw attention to similar aspects:
Alex mentions that you could model the pickups as “customers” and then rely on the property “customer id”. With this approach the stopServiceTime applies only once per “site approach”.
This could solve the challenge but also create side effects, e.g. in the context of the trip definition.
Did you already try this approach? Are you aware of the definition of “trips”?
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
grudolf
Posts: 3
Joined: Tue Oct 04, 2022 2:41 pm

Re: xTour2: individual pickup times at the depot?

Post by grudolf »

DepotSite
Because the orders have multiple pickup time windows, the DepotSite is redefined for each of those windows, f.e. DEPOT-WINDOW-00 and DEPOT-WINDOW-01 in the example tour below, both having the AdditionalServiceTimePerPickupStop fixed to 30 minutes. "Driving" from first to second depot takes no time, but the service time is duplicated:

Code: Select all

<trips id="8443a99c-8cd0-45d3-b22c-3b934177f3ed">
	<stops locationId="DEPOT-WINDOW-01" customerId="">
		<tasks orderId="ORDER-CUST-3-BIG" taskType="PICKUP"/>
	</stops>
	<stops locationId="CUST-SITE-3" customerId="">
		<tasks orderId="ORDER-CUST-3-BIG" taskType="DELIVERY"/>
		<tasks orderId="ORDER-CUST-3-RETURN" taskType="PICKUP"/>
	</stops>
	<stops locationId="DEPOT-WINDOW-01" customerId="">
		<tasks orderId="ORDER-CUST-3-RETURN" taskType="DELIVERY"/>
	</stops>
</trips>
<trips id="744dc324-23fc-4e7b-becb-54cd6327186d">
	<stops locationId="DEPOT-WINDOW-00" customerId="">
		<tasks orderId="ORDER-CUST-1" taskType="PICKUP"/>
	</stops>
	<stops locationId="DEPOT-WINDOW-01" customerId="">
		<tasks orderId="ORDER-CUST-3" taskType="PICKUP"/>
		<tasks orderId="ORDER-CUST-2" taskType="PICKUP"/>
	</stops>
	<stops locationId="CUST-SITE-2" customerId="">
		<tasks orderId="ORDER-CUST-2" taskType="DELIVERY"/>
	</stops>
	<stops locationId="CUST-SITE-3" customerId="">
		<tasks orderId="ORDER-CUST-3" taskType="DELIVERY"/>
	</stops>
	<stops locationId="CUST-SITE-1" customerId="">
		<tasks orderId="ORDER-CUST-1" taskType="DELIVERY"/>
	</stops>
</trips>
<!--...-->
<tourEvents startTime="2022-06-01T07:07:11.000+02:00" tripId="744dc324-23fc-4e7b-becb-54cd6327186d" locationId="DEPOT-WINDOW-00" duration="0.0">
	<eventTypes>TRIP_START</eventTypes>
</tourEvents>
<tourEvents startTime="2022-06-01T07:07:11.000+02:00" tripId="744dc324-23fc-4e7b-becb-54cd6327186d" locationId="DEPOT-WINDOW-00" orderId="ORDER-CUST-1" duration="1800.0">
	<eventTypes>SERVICE</eventTypes>
</tourEvents>
<tourEvents startTime="2022-06-01T07:37:11.000+02:00" tripId="744dc324-23fc-4e7b-becb-54cd6327186d" duration="0.0">
	<eventTypes>DRIVING</eventTypes>
</tourEvents>
<tourEvents startTime="2022-06-01T07:37:11.000+02:00" tripId="744dc324-23fc-4e7b-becb-54cd6327186d" locationId="DEPOT-WINDOW-01" orderId="ORDER-CUST-3" duration="1800.0">
	<eventTypes>SERVICE</eventTypes>
</tourEvents>
<tourEvents startTime="2022-06-01T08:07:11.000+02:00" tripId="744dc324-23fc-4e7b-becb-54cd6327186d" locationId="DEPOT-WINDOW-01" orderId="ORDER-CUST-2" duration="0.0">
	<eventTypes>SERVICE</eventTypes>
</tourEvents>
CustomerSite
Modeling depots as CustomerSites with same client id calculates loading time as expected, but there's also a side effect - the tour now has a single trip (No depots = no point where vehicle is guaranteed to be empty?). The orders were configured so that deliveries to customers and pickup of customer returns have same TripSectionNumber.


Code: Select all

<trips id="bd0c9981-cf38-4712-b4a8-d11d456a6c5e">
	<stops locationId="DEPOT-WINDOW-00" customerId="DEPOT">
		<tasks orderId="ORDER-CUST-1" taskType="PICKUP"/>
	</stops>
	<stops locationId="DEPOT-WINDOW-01" customerId="DEPOT">
		<tasks orderId="ORDER-CUST-2" taskType="PICKUP"/>
		<tasks orderId="ORDER-CUST-3" taskType="PICKUP"/>
	</stops>
	<stops locationId="CUST-SITE-3" customerId="">
		<tasks orderId="ORDER-CUST-3" taskType="DELIVERY"/>
		<tasks orderId="ORDER-CUST-3-RETURN" taskType="PICKUP"/>
	</stops>
	<stops locationId="CUST-SITE-2" customerId="">
		<tasks orderId="ORDER-CUST-2" taskType="DELIVERY"/>
	</stops>
	<stops locationId="CUST-SITE-1" customerId="">
		<tasks orderId="ORDER-CUST-1" taskType="DELIVERY"/>
	</stops>
	<stops locationId="DEPOT-WINDOW-01" customerId="DEPOT">
		<tasks orderId="ORDER-CUST-3-RETURN" taskType="DELIVERY"/>
		<tasks orderId="ORDER-CUST-3-BIG" taskType="PICKUP"/>
	</stops>
	<stops locationId="CUST-SITE-3" customerId="">
		<tasks orderId="ORDER-CUST-3-BIG" taskType="DELIVERY"/>
	</stops>
</trips>
<!--...-->
<tourEvents startTime="2022-06-01T06:27:49.000+02:00" tripId="bd0c9981-cf38-4712-b4a8-d11d456a6c5e" locationId="DEPOT-WINDOW-00" duration="0.0">
	<eventTypes>TRIP_START</eventTypes>
</tourEvents>
<tourEvents startTime="2022-06-01T06:27:49.000+02:00" tripId="bd0c9981-cf38-4712-b4a8-d11d456a6c5e" locationId="DEPOT-WINDOW-00" orderId="ORDER-CUST-1" duration="1800.0">
	<eventTypes>SERVICE</eventTypes>
</tourEvents>
<tourEvents startTime="2022-06-01T06:57:49.000+02:00" tripId="bd0c9981-cf38-4712-b4a8-d11d456a6c5e" duration="0.0">
	<eventTypes>DRIVING</eventTypes>
</tourEvents>
<tourEvents startTime="2022-06-01T06:57:49.000+02:00" tripId="bd0c9981-cf38-4712-b4a8-d11d456a6c5e" locationId="DEPOT-WINDOW-01" orderId="ORDER-CUST-2" duration="0.0">
	<eventTypes>SERVICE</eventTypes>
</tourEvents>
<tourEvents startTime="2022-06-01T06:57:49.000+02:00" tripId="bd0c9981-cf38-4712-b4a8-d11d456a6c5e" locationId="DEPOT-WINDOW-01" orderId="ORDER-CUST-3" duration="0.0">
	<eventTypes>SERVICE</eventTypes>
</tourEvents>
Post Reply