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 09:42:59 +03:00
parent 8696f5ed25
commit d4b7637b07

View file

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