Increasing xTour poolSize. How to prevent Dima conflicts?

This forum deals with any kind of trip optimization whether it is automatic planning or manual dispatching, refering to transport orders or service planning.

Increasing xTour poolSize. How to prevent Dima conflicts?

Postby pssdiogo » Mon Nov 03, 2014 9:49 am

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

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Postby Bernd Welter » Tue Nov 04, 2014 5:07 pm

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?

poolsize2.gif
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
User avatar
Bernd Welter
Site Admin
 
Posts: 1412
Joined: Mon Apr 14, 2014 10:28 am

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Postby pssdiogo » Wed Nov 05, 2014 4:00 pm

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

Re: Increasing xTour poolSize. How to prevent Dima conflicts

Postby Bernd Welter » Mon Jul 11, 2016 2:59 pm

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
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1412
Joined: Mon Apr 14, 2014 10:28 am


Return to PTV xTourServer

cron