Increasing xTour poolSize. How to prevent Dima conflicts?

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.
Post Reply
pssdiogo
Posts: 16
Joined: Wed Oct 29, 2014 3:13 pm

Increasing xTour poolSize. How to prevent Dima conflicts?

Post by pssdiogo »

Hello,

I need to use xTour in a multitask approach. So, I would like to have several processes "xTour.planBasicTours" working at same time.

In order to achieve this, on properties file of xTour (Xtour.properties) I increased the number of module instances to 4.

ex:
# The number of module instances to be started as background processes.
poolSize=4



Then, when I make more than one request of xTour.planBasicTours at the same time I get the following error:
2014-09-19 10:16:41,988;ERROR;com.ptvag.xserver.module.xtour.m0001;ed1c2dca-c443-4550-b9f6-7289297b9045;;;;Could not plan basic tours (Reason: Could not delete dima (before usage)). Engine error: Dima is in use by another process (code: -1008).


However, everything works perfect if I chose not to use the array of distance matrices (by setting the directVelocity value on planning parameters).

The problem is that in this case, I need to have the plan results with different driving speeds, according to the road type or location (ex: city or highway).

Can you please help me on this? Thank you.
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Post by Bernd Welter »

Hello Pedro,

the situation you describe is in fact raised by the concurrent access to the Distance Matrices at the same time.
Of course setting the poolsize to 1 is not really a good option because it would limit the throughput to a value that is not required in case of independent distance matrices.

So the next important question is "what is the scope of the concurrent plannings?"
Is it necessary to reuse the existing distance matrix or is it an option to create independent DIMA IDs for the planning calls?
As you can see with this status monitor image it is possible to use two independent DIMA IDs in parallel while the third one is in the queue.<br /><br />My poolsize is two of course
As you can see with this status monitor image it is possible to use two independent DIMA IDs in parallel while the third one is in the queue.

My poolsize is two of course
Kind regards from Germany,
Bernd
pssdiogo
Posts: 16
Joined: Wed Oct 29, 2014 3:13 pm

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Post by pssdiogo »

Hello Bernd,

Thank you for your quick reply. Solved my problem.

I was deleting the existing distance matrix on every call (DistanceMatrixByRoad.deleteBeforeUsage=true), but on all requests I was always using the same dimaID.

Now I’m generating different ID’s for each call and it is working fine. Thank you.

Best regards,
Pedro Diogo
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Post by Bernd Welter »

Another player asked almost the same question and therefore I'd like to add some more lines here.
Depending on your usecase and the available fleet you may approach the DIMAs in various strategies which refers to DIMA IDs but also to the well known "deleteBefore" and "deleteAfter" parameters.

If possible try to identify the "indepencence scope" of the distance matrices. Here are some samples:
  • a DIMA per dispatcher? If a dispatcher doesn't generate several plannings at the same time ..
  • a DIMA per individual vehicle? OK, this might increase the number of DIMAs in your system - maybe not worth to be the price to avoid conflicts
  • a DIMA for each planning - maybe a good approach if applied together with deleteBefore=TRUE / deleteAfter=TRUE.
  • to be completed
Best regards Bernd
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:
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Post by Bernd Welter »

By the way: in the meantime the mechanism of HIGH PERFORMANCE ROUTING has been implemented. This mechanism enables a server to speed up the distane matrix caalculation under certain circumstances.
This mechanism is so fast that it could be the proper approach to calculate the DIMA on the fly whenever you need it.

Here are some more facts about the incredible speed of HPR:
xDima / xTour 1
xDima 2

Definetly worth being checked...

Bernd
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:
Post Reply