mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
Unassigned job reason tracker returns the last failed constraint instead of the most likely
This commit is contained in:
parent
a714312685
commit
288f6023a3
1 changed files with 2 additions and 1 deletions
|
|
@ -32,12 +32,13 @@ public class UnassignedJobReasonTracker implements JobUnassignedListener {
|
|||
public static String getMostLikelyFailedConstraintName(Frequency failedConstraintNamesFrequency) {
|
||||
if (failedConstraintNamesFrequency == null) return "no reason found";
|
||||
Iterator<Map.Entry<Comparable<?>, Long>> entryIterator = failedConstraintNamesFrequency.entrySetIterator();
|
||||
int maxCount = 0;
|
||||
long maxCount = 0;
|
||||
String mostLikely = null;
|
||||
while (entryIterator.hasNext()) {
|
||||
Map.Entry<Comparable<?>, Long> entry = entryIterator.next();
|
||||
if (entry.getValue() > maxCount) {
|
||||
Comparable<?> key = entry.getKey();
|
||||
maxCount = entry.getValue();
|
||||
mostLikely = key.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue