Changeset 7511
- Timestamp:
- 02/24/12 09:25:32 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 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() { -
trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs
r7351 r7511 365 365 private void UpdateCrossovers() { 366 366 ICrossover oldCrossover = CrossoverParameter.Value; 367 ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault(); 367 368 CrossoverParameter.ValidValues.Clear(); 368 369 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) … … 371 372 ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); 372 373 if (crossover != null) CrossoverParameter.Value = crossover; 373 } 374 else oldCrossover = null; 375 } 376 if (oldCrossover == null && defaultCrossover != null) 377 CrossoverParameter.Value = defaultCrossover; 374 378 } 375 379 private void UpdateMutators() { -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r7259 r7511 598 598 private void UpdateCrossovers() { 599 599 ICrossover oldCrossover = CrossoverParameter.Value; 600 ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault(); 600 601 CrossoverParameter.ValidValues.Clear(); 601 602 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) … … 604 605 ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); 605 606 if (crossover != null) CrossoverParameter.Value = crossover; 606 } 607 else oldCrossover = null; 608 } 609 if (oldCrossover == null && defaultCrossover != null) 610 CrossoverParameter.Value = defaultCrossover; 607 611 } 608 612 private void UpdateMutators() {
Note: See TracChangeset
for help on using the changeset viewer.