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

prio improvement

This commit is contained in:
oblonski 2017-06-28 23:19:15 +02:00
parent c47dae32d3
commit f54241144c
No known key found for this signature in database
GPG key ID: 179DE487285680D1
2 changed files with 4 additions and 4 deletions

View file

@ -100,14 +100,14 @@ public final class BestInsertion extends AbstractInsertionStrategy {
private void sometimesSortPriorities(List<Job> unassignedJobList) { private void sometimesSortPriorities(List<Job> unassignedJobList) {
if(random.nextDouble() < 0.5){ // if(random.nextDouble() < 0.5){
Collections.sort(unassignedJobList, new Comparator<Job>() { Collections.sort(unassignedJobList, new Comparator<Job>() {
@Override @Override
public int compare(Job o1, Job o2) { public int compare(Job o1, Job o2) {
return o1.getPriority() - o2.getPriority(); return o1.getPriority() - o2.getPriority();
} }
}); });
} //}
} }
} }

View file

@ -150,14 +150,14 @@ public final class BestInsertionConcurrent extends AbstractInsertionStrategy {
} }
private void sometimesSortPriorities(List<Job> unassignedJobList) { private void sometimesSortPriorities(List<Job> unassignedJobList) {
if(random.nextDouble() < 0.5){ // if(random.nextDouble() < 0.5){
Collections.sort(unassignedJobList, new Comparator<Job>() { Collections.sort(unassignedJobList, new Comparator<Job>() {
@Override @Override
public int compare(Job o1, Job o2) { public int compare(Job o1, Job o2) {
return o1.getPriority() - o2.getPriority(); return o1.getPriority() - o2.getPriority();
} }
}); });
} // }
} }
private Insertion getBestInsertion(Batch batch, Job unassignedJob) { private Insertion getBestInsertion(Batch batch, Job unassignedJob) {