Changeset 7615 for branches/HeuristicLab.TimeSeries/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm
- Timestamp:
- 03/15/12 09:11:17 (13 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r7268 r7615 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() { -
branches/HeuristicLab.TimeSeries/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r7268 r7615 64 64 get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; } 65 65 } 66 p rivateConstrainedValueParameter<ISelector> SelectorParameter {66 public ConstrainedValueParameter<ISelector> SelectorParameter { 67 67 get { return (ConstrainedValueParameter<ISelector>)Parameters["Selector"]; } 68 68 } 69 p rivateConstrainedValueParameter<ICrossover> CrossoverParameter {69 public ConstrainedValueParameter<ICrossover> CrossoverParameter { 70 70 get { return (ConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; } 71 71 } … … 73 73 get { return (ValueParameter<PercentValue>)Parameters["MutationProbability"]; } 74 74 } 75 p rivateOptionalConstrainedValueParameter<IManipulator> MutatorParameter {75 public OptionalConstrainedValueParameter<IManipulator> MutatorParameter { 76 76 get { return (OptionalConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; } 77 77 } … … 91 91 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorUpperBound"]; } 92 92 } 93 p rivateOptionalConstrainedValueParameter<IDiscreteDoubleValueModifier> ComparisonFactorModifierParameter {93 public OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier> ComparisonFactorModifierParameter { 94 94 get { return (OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters["ComparisonFactorModifier"]; } 95 95 } … … 447 447 ICrossover oldCrossover = CrossoverParameter.Value; 448 448 CrossoverParameter.ValidValues.Clear(); 449 ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault(); 450 449 451 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) 450 452 CrossoverParameter.ValidValues.Add(crossover); 453 451 454 if (oldCrossover != null) { 452 455 ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); 453 456 if (crossover != null) CrossoverParameter.Value = crossover; 454 } 457 else oldCrossover = null; 458 } 459 if (oldCrossover == null && defaultCrossover != null) 460 CrossoverParameter.Value = defaultCrossover; 455 461 } 456 462 private void UpdateMutators() {
Note: See TracChangeset
for help on using the changeset viewer.