Set<Job> ruinedJobSet = new HashSet<>(ruinedJobs);
ruinedJobSet.addAll(ruinedJobs);
to
Set<Job> ruinedJobSet = new HashSet<>(ruinedJobs);
Even though this should not produce any difference, as they are equivalents, I am obtaining slightly poorer results with the second approach on the optimizations I perform, in different projects with different constraints, with a number of services about 100, and 20-100 vehicles. I run it multiple times and the final cost is always equals or higher with the changes introduced in this commit.
Using JDK 1.8.0_192. Will prepare an example if I have time.
Commit https://github.com/graphhopper/jsprit/commit/1ebf2360096f911329f3ebc39fbd395b0fa9e162 slightly changes RuinAndRecreateModule.java, by modifying the creation and populationof the HashSet from
to
Even though this should not produce any difference, as they are equivalents, I am obtaining slightly poorer results with the second approach on the optimizations I perform, in different projects with different constraints, with a number of services about 100, and 20-100 vehicles. I run it multiple times and the final cost is always equals or higher with the changes introduced in this commit.
Using JDK 1.8.0_192. Will prepare an example if I have time.