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:
parent
8696f5ed25
commit
d4b7637b07
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue