Changeset 8989
- Timestamp:
- 12/03/12 13:48:23 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.RAPGA/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.RAPGA/3.3/DuplicatesSelector.cs
r8926 r8989 59 59 60 60 var marks = new bool[scopes.Count]; 61 for (int i = 0; i < scopes.Count; i++) { 62 for (int j = i + 1; j < scopes.Count; j++) { 63 if (SimilarityCalculator.Equals(scopes[i], scopes[j])) marks[j] = true; 64 } 65 } 61 for (int i = 0; i < scopes.Count; i++) 62 for (int j = i + 1; j < scopes.Count; j++) 63 marks[j] = SimilarityCalculator.Equals(scopes[i], scopes[j]); 64 66 65 67 66 var selected = new IScope[marks.Count(x => x)]; -
trunk/sources/HeuristicLab.Algorithms.RAPGA/3.3/ProgressiveOffspringPreserver.cs
r8622 r8989 105 105 // as long as offspring is available and not enough offspring has been preserved 106 106 while (i < createdOffspring.Length && OffspringList.Count < MaximumPopulationSize.Value - Elites.Value) { 107 if (similarityMatrix[i].Any(x => x == 1.0)) createdOffspring[i] = null; // discard duplicates107 if (similarityMatrix[i].Any(x => x.IsAlmost(1.0))) createdOffspring[i] = null; // discard duplicates 108 108 else OffspringList.Add(createdOffspring[i]); 109 109 i++;
Note: See TracChangeset
for help on using the changeset viewer.