1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

Fix the condition to use bestCost as this is what we are traceing.

Added log to debug to state the termination
This commit is contained in:
safraeli 2019-05-23 10:14:54 +03:00
parent d4b7637b07
commit 595ef67ae8

View file

@ -109,7 +109,7 @@ public class IterationWithoutImprovementTermination implements PrematureAlgorith
boolean unassignedJobsEqual = (currentJobsUnassigned == unassignedJobsCount.get(i - noIterationWithoutImprovement));
boolean progressTooSlow = 100 * ((costs.get(i - noIterationWithoutImprovement) - bestCost) / bestCost) <= terminationByCostPercentage;
if (unassignedJobsEqual && progressTooSlow){
log.debug("Termination condition by percentage reached: " + this);
log.debug("Termination condition by percentage reached after " + Integer.toString(i) + " Iterations: \n" + this);
return true;
}else
return false;