This forum deals with any kind of trip optimization based on xTour1, xTour2 and the Developer APIs "RouteOptimization" and "SequenceOptimization". No matter whether it is automatic planning or manual dispatching, refering to transport orders or service planning.
Attention: this does not refer to PTV Optiflow SaaS and PTV Developer RouteOptimization Optiflow.
I have a question about a basic use case (at leat for those that are familiar with PTV smartour or Intertour).
1. how can I add an order (or several orders) to an existing trip without changing the actual sequence of the stops?
2. additionaly, how can ensure that no new stops is planned before stop N? Example: my truck is alread at stop 4 and the dispatcher wants to assign a pickup order to the truck. Since the first 4 stopps are already completed, it makes no sense to plan a stopp before stopp 4.
Additional question, is it possible to perfom this by using the function planBasictour? Or does it work only with planSequence? Since our developpers already developped methods for PlanBasicTour, it would be better for us.
Many thanks in advance and greetins from Bern.
Sebastiano
I think the easiest way to deal with this is to use the tourSection attribute on the tranportPoint class. xTour will always build up the tour with the tour points in an ascending order. So If you have already a plan, simply set the tour section in order they are present in the input plan. To prevent xTour from moving orders from one tour to another tour you can set the tourfixation in the input plan on the plan.chain[n].tour[n] .
This will make sure that xTour keeps you input plan intact the way you already have it.
When you are adding new orders you can manipulate the tourSection to you needs.
Can the order be planned in anywhere in the planned tour ? use 0 as value.
Do the orders have to be always planned at the end a planned tour? Use 999 as value.
This should cover case 1.
Case 2 is a bit trickier this way. Common practice is to force the first stop in order with this technique, and give the rest of the stops the 999 value. This does mean that the xTour can change the order around of the rest of the trip. Usually this is wanted behavior. If you also want the rest of the trip to maintain the planned order I'm not sure I know of an easy solution to achieve this.
When implementing this keep in mind that 1 and 1000 are special values (see documentation) as in there can only be a single tranportPointwith 1 and a single tranportPoint with 1000 as tourSection in a Tour. When dealing with keeping a trip in order I advise to avoid those values unless you are sure that their limitation suite your use case.
With this technique you still can use all the planning steps to get the optimal result.
sorry for my late answer, we had to left this topic frozen for a while. Many thanks for your detailed answer! We have already implemented the case 1 and it seems to work great.
I havn't tested case 2, but in theory it must work. I'll say , when we will implement this use case (probably in some month).
We have got a case, where xTour cannot insert an additional order to the trip and we don't understand the reason. could you please help us?
See Request in the attachment.
I have made also following test: I have converted all order from type AB to transportDepot, changed the vehicle parameter depotIdEnd="-1" depotIdStart="-1" and I have added the DepotPoints at the begin and at the end of the chain. In this was in works. The Problem is that it is not always possible to use transportDepot orders, that's way we prefere to use the general way of transportAB , when possible.
Thank you in advance for your help!
Regards,
Sebastiano
About converting the orders from TransportAB to TransportDepot, why is this needed? I'm not seeing a direct need for this in your use case you described up till now.
About converting the orders from TransportAB to TransportDepot, why is this needed? I'm not seeing a direct need for this in your use case you described up till now.
I (and our developper) hope too, that is not needed. I have just done a test to see, if there is a difference.
When I execute your request everything gets planned in. You sure this is the right request?
I (and our developper) hope too, that is not needed. I have just done a test to see, if there is a difference.
From a theoretical standpoint: yes there could be a difference. Normally xTour divides the orders among the depots as a start situation for it's planning algorithm. Planning depot free leads to a different internal start situation. If it will lead to an difference in the quality of the result is debatable. In practice I have almost seen no cases where this leads to an improvement.
I have attached the support package including request and response from our local xtour server. (But our Program use the xServer Internet, we use the local xTour only for debugging).
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...