- Timestamp:
- 09/10/13 15:56:35 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection/3.3/ProportionalSelector.cs
r9456 r9943 104 104 currentQuality += list[index]; 105 105 } 106 if (copy) 106 if (copy) { 107 107 selected[i] = (IScope)scopes[index].Clone(); 108 else { 108 var original = scopes[index].Variables.First().Value; 109 var clone = selected[i].Variables.First().Value; 110 GlobalCloneMap.Add(clone, original); 111 } else { 109 112 selected[i] = scopes[index]; 110 113 scopes.RemoveAt(index); -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection/3.3/RandomSelector.cs
r9456 r9943 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 69 70 70 71 for (int i = 0; i < count; i++) { 71 if (copy) 72 selected[i] = (IScope)scopes[random.Next(scopes.Count)].Clone(); 73 else { 72 if (copy) { 73 var index = random.Next(scopes.Count); 74 selected[i] = (IScope)scopes[index].Clone(); 75 var original = scopes[index].Variables.First().Value; 76 var clone = selected[i].Variables.First().Value; 77 GlobalCloneMap.Add(clone, original); 78 } else { 74 79 int index = random.Next(scopes.Count); 75 80 selected[i] = scopes[index]; -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection/3.3/TournamentSelector.cs
r9456 r9943 79 79 } 80 80 81 if (copy) 81 if (copy) { 82 82 selected[i] = (IScope)scopes[best].Clone(); 83 else { 83 var original = scopes[best].Variables.First().Value; 84 var clone = selected[i].Variables.First().Value; 85 GlobalCloneMap.Add(clone, original); 86 } else { 84 87 selected[i] = scopes[best]; 85 88 scopes.RemoveAt(best);
Note: See TracChangeset
for help on using the changeset viewer.