Changeset 3128
- Timestamp:
- 03/19/10 17:52:02 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Selection/3.3/BestSelector.cs
r3096 r3128 52 52 var list = temp.ToList(); 53 53 54 i nt j = 0;55 for (int i = 0; i < count; i++) {56 if (copy) {54 if (copy) { 55 for (int i = 0, j = 0; i < count; i++, j++) { 56 if (j >= list.Count) j = 0; 57 57 selected[i] = (IScope)scopes[list[j].index].Clone(); 58 j++;59 if (j >= list.Count) j = 0;60 } else {61 selected[i] = scopes[list[j].index];62 scopes.RemoveAt(list[j].index);63 list.RemoveAt(j);64 58 } 59 } else { 60 int i; 61 for (i = 0; i < count; i++) { 62 selected[i] = scopes[list[i].index]; 63 } 64 // remove the selected scopes starting from the scope with the highest index 65 if (i < list.Count) list.RemoveRange(i, list.Count - i); 66 list = list.OrderBy(x => x.index).ToList(); 67 do { 68 i--; 69 scopes.RemoveAt(list[i].index); 70 } while (i > 0); 65 71 } 66 72 return selected;
Note: See TracChangeset
for help on using the changeset viewer.