Changeset 3076 for trunk/sources
- Timestamp:
- 03/17/10 00:38:34 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGA.cs
r3048 r3076 283 283 foreach (ISelector selector in Selectors.OrderBy(x => x.Name)) 284 284 SelectorParameter.ValidValues.Add(selector); 285 if (oldSelector != null) 286 SelectorParameter.Value = SelectorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldSelector.GetType()); 285 if (oldSelector != null) { 286 ISelector selector = SelectorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldSelector.GetType()); 287 if (selector != null) SelectorParameter.Value = selector; 288 } 287 289 } 288 290 } … … 292 294 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) 293 295 CrossoverParameter.ValidValues.Add(crossover); 294 if (oldCrossover != null) 295 CrossoverParameter.Value = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); 296 if (oldCrossover != null) { 297 ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); 298 if (crossover != null) CrossoverParameter.Value = crossover; 299 } 296 300 } 297 301 private void UpdateMutators() { … … 300 304 foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) 301 305 MutatorParameter.ValidValues.Add(mutator); 302 if (oldMutator != null) 303 MutatorParameter.Value = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType()); 306 if (oldMutator != null) { 307 IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType()); 308 if (mutator != null) MutatorParameter.Value = mutator; 309 } 304 310 } 305 311 #endregion
Note: See TracChangeset
for help on using the changeset viewer.