Changeset 7493 for trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm
- Timestamp:
- 02/21/12 10:37:49 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs
r7259 r7493 353 353 ICrossover oldCrossover = CrossoverParameter.Value; 354 354 CrossoverParameter.ValidValues.Clear(); 355 ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault(); 356 355 357 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) 356 358 CrossoverParameter.ValidValues.Add(crossover); 359 357 360 if (oldCrossover != null) { 358 361 ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); 359 362 if (crossover != null) CrossoverParameter.Value = crossover; 360 } 363 } else if (defaultCrossover != null) 364 CrossoverParameter.Value = defaultCrossover; 361 365 } 362 366 private void UpdateMutators() {
Note: See TracChangeset
for help on using the changeset viewer.