Sunday, 15 June 2014

drools planner - Asymetric Distance Matrix for VRP in the OptaPlanner don't work correctly -



drools planner - Asymetric Distance Matrix for VRP in the OptaPlanner don't work correctly -

i implemented asymetric distance matrix vrp in examples of optaplanner suggested in alternative b of reply http://stackoverflow.com/a/19420978/3743175

however values of soft constraints not coincide total value of calculated distance of routes in tests.

anyone have thought of cause of this? i've checked several times, matrix right , problem not occur symmetric instances.

any help welcome.

thanks.

solution found:

i found problem in lines softscore calculation of examples: softscore calculated reverse arcs.

i replaced lines in vehicleroutingincrementalscorecalculator class:

class="lang-java prettyprint-override">... softscore -= vehicle.getlocation().getdistance(customer.getlocation()); ... softscore += vehicle.getlocation().getdistance(customer.getlocation());

with:

... softscore -= customer.getlocation().getdistance(vehicle.getlocation()); ... softscore += customer.getlocation().getdistance(vehicle.getlocation());

and fixed client class next method:

class="lang-java prettyprint-override">public int getdistancetopreviousstandstill() { if (previousstandstill == null) { homecoming 0; } homecoming previousstandstill.getlocation().getdistance(location); }

thanks.

optaplanner drools-planner

No comments:

Post a Comment