Changeset 7511 for trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm
- Timestamp:
- 02/24/12 09:25:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
r7395 r7511 497 497 private void UpdateCrossovers() { 498 498 ICrossover oldCrossover = CrossoverParameter.Value; 499 ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault(); 499 500 CrossoverParameter.ValidValues.Clear(); 500 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) { 501 ParameterizeStochasticOperatorForIsland(crossover); 501 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) 502 502 CrossoverParameter.ValidValues.Add(crossover); 503 }504 503 if (oldCrossover != null) { 505 504 ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); 506 505 if (crossover != null) CrossoverParameter.Value = crossover; 507 } 506 else oldCrossover = null; 507 } 508 if (oldCrossover == null && defaultCrossover != null) 509 CrossoverParameter.Value = defaultCrossover; 508 510 } 509 511 private void UpdateMutators() {
Note: See TracChangeset
for help on using the changeset viewer.