Page 1 of 1

xTour2: Successor of findToursForUnscheduledOrder

Posted: Fri Feb 05, 2021 8:20 am
by Bernd Welter
Hi there,

recently I've been asked about this:
Have you ever think about a mechanism with xS2 to approach findToursForUnscheduledOrder() xS1 function/use case?
The scope of this well known xTour1 method was to check a single orders best insertion position among several potential tours of an existing plan.
Limitation
- no sequence optimization of the matching tour
Benefit
- fast approach

Well, there's no dedicated successor method which replaces the xTour1 approach 1:1 but here's how you can handle this (and even more) in xTour2:
Use the changeToursRequest with a MoveOrdersAction or MoveStopsAction. To ensure the proper position within a target tour use InsertionAtBestPosition.
Click Image to see the animation: <br />Showcase example: add single, unscheduled order to an existing tour at the best position
Click Image to see the animation:
Showcase example: add single, unscheduled order to an existing tour at the best position
  • You have to process this transaction for each potential target tour so it is a bit more complicated but due to the limitation to InsertionAtBestPosition it is still very fast.
  • On the other hand you may try to use parallel requests to speed up the process.
  • If you want to evaluate even more than one potential position in a target tour you can use the xtour.InsertionAfterSpecifiedPosition or xtour.InsertionBeforeSpecifiedPosition and iterate over each existing position in the target tour
  • Refer to a storedRequestId, so you won't have to transfer the whole scenario again and again.
Play with the showcase to get an understanding of this mechanism.

Let us know how you succeeded with this approach!

Best regards,
Bernd