Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9fa1e218 authored by Tomofumi Yuki's avatar Tomofumi Yuki
Browse files

moved sort of next candidates to the top of the method to avoid issues

with parallel lists
parent c2bfc9a5
No related branches found
No related tags found
1 merge request!4Develop
......@@ -221,6 +221,14 @@ public class TabuExploration extends AbstractExplorationAlgorithm {
return null;
}
Collections.sort(nextSolutionCandidates, new Comparator<WordLengthsExplorer>() {
@Override
public int compare(WordLengthsExplorer o1, WordLengthsExplorer o2) {
return o1.getLastModifiedSymbol().getName().compareTo(o2.getLastModifiedSymbol().getName());
}
});
List<WordLengthsExplorer> listSolution = nextSolutionCandidates;
for (WordLengthsExplorer temp : listSolution) {
......@@ -243,6 +251,7 @@ public class TabuExploration extends AbstractExplorationAlgorithm {
}
}
}
List<Integer> lastModifiedWLs = nextSolutionCandidates.stream()
.map(e -> e.getCurrentW(e.lastModifiedSymbol))
.collect(toList());
......@@ -304,14 +313,6 @@ public class TabuExploration extends AbstractExplorationAlgorithm {
nextSolutionCandidates.get(i).currentSolution.setNote("selected", "F");
}
Collections.sort(nextSolutionCandidates, new Comparator<WordLengthsExplorer>() {
@Override
public int compare(WordLengthsExplorer o1, WordLengthsExplorer o2) {
return o1.getLastModifiedSymbol().getName().compareTo(o2.getLastModifiedSymbol().getName());
}
});
final WordLengthsExplorer nextBest;
if(directionUp) {
nextBest = criteria.stream()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment