Changeset 7997 for branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection/3.3/RandomSelector.cs
- Timestamp:
- 06/13/12 13:20:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection/3.3/RandomSelector.cs
r7779 r7997 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 int index = random.Next(scopes.Count); 74 selected[i] = (IScope)scopes[index].Clone(); 75 // map the selected (cloned) tree to the original tree 76 var original = scopes[index].Variables.First().Value; 77 var clone = selected[i].Variables.First().Value; 78 GlobalCloneMap.Add(clone, original); 79 } else { 74 80 int index = random.Next(scopes.Count); 75 81 selected[i] = scopes[index];
Note: See TracChangeset
for help on using the changeset viewer.