Changeset 16692 for branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm
- Timestamp:
- 03/18/19 17:24:30 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r13173 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 280 280 if (!Parameters.ContainsKey("FillPopulationWithParents")) 281 281 Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true }); 282 283 var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>; 284 if (optionalMutatorParameter != null) { 285 Parameters.Remove(optionalMutatorParameter); 286 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 287 foreach (var m in optionalMutatorParameter.ValidValues) 288 MutatorParameter.ValidValues.Add(m); 289 if (optionalMutatorParameter.Value == null) MutationProbability.Value = 0; // to guarantee that the old configuration results in the same behavior 290 else Mutator = optionalMutatorParameter.Value; 291 optionalMutatorParameter.ValidValues.Clear(); // to avoid dangling references to the old parameter its valid values are cleared 292 } 282 293 #endregion 283 294 … … 311 322 Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions.")); 312 323 Parameters.Add(new ValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.05))); 313 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));324 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 314 325 Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1))); 315 326 Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true }); … … 642 653 IManipulator oldMutator = MutatorParameter.Value; 643 654 MutatorParameter.ValidValues.Clear(); 655 IManipulator defaultMutator = Problem.Operators.OfType<IManipulator>().FirstOrDefault(); 656 644 657 foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) 645 658 MutatorParameter.ValidValues.Add(mutator); 659 646 660 if (oldMutator != null) { 647 661 IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType()); 648 662 if (mutator != null) MutatorParameter.Value = mutator; 649 } 663 else oldMutator = null; 664 } 665 666 if (oldMutator == null && defaultMutator != null) 667 MutatorParameter.Value = defaultMutator; 650 668 } 651 669 private void UpdateAnalyzers() { -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r13173 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 55 55 56 56 #region Parameter Properties 57 p rivateValueParameter<IntValue> SeedParameter {57 public IValueParameter<IntValue> SeedParameter { 58 58 get { return (ValueParameter<IntValue>)Parameters["Seed"]; } 59 59 } 60 p rivateValueParameter<BoolValue> SetSeedRandomlyParameter {60 public IValueParameter<BoolValue> SetSeedRandomlyParameter { 61 61 get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; } 62 62 } 63 p rivateValueParameter<IntValue> PopulationSizeParameter {63 public IValueParameter<IntValue> PopulationSizeParameter { 64 64 get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; } 65 65 } … … 70 70 get { return (IConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; } 71 71 } 72 p rivateValueParameter<PercentValue> MutationProbabilityParameter {72 public IValueParameter<PercentValue> MutationProbabilityParameter { 73 73 get { return (ValueParameter<PercentValue>)Parameters["MutationProbability"]; } 74 74 } … … 76 76 get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; } 77 77 } 78 p rivateValueParameter<IntValue> ElitesParameter {78 public IValueParameter<IntValue> ElitesParameter { 79 79 get { return (ValueParameter<IntValue>)Parameters["Elites"]; } 80 80 } 81 p rivateIFixedValueParameter<BoolValue> ReevaluateElitesParameter {81 public IFixedValueParameter<BoolValue> ReevaluateElitesParameter { 82 82 get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; } 83 83 } 84 p rivateValueParameter<IntValue> MaximumGenerationsParameter {84 public IValueParameter<IntValue> MaximumGenerationsParameter { 85 85 get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; } 86 86 } 87 p rivateValueLookupParameter<DoubleValue> SuccessRatioParameter {87 public IValueLookupParameter<DoubleValue> SuccessRatioParameter { 88 88 get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; } 89 89 } 90 p rivateValueLookupParameter<DoubleValue> ComparisonFactorLowerBoundParameter {90 public IValueLookupParameter<DoubleValue> ComparisonFactorLowerBoundParameter { 91 91 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorLowerBound"]; } 92 92 } 93 p rivateValueLookupParameter<DoubleValue> ComparisonFactorUpperBoundParameter {93 public IValueLookupParameter<DoubleValue> ComparisonFactorUpperBoundParameter { 94 94 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorUpperBound"]; } 95 95 } … … 97 97 get { return (IConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters["ComparisonFactorModifier"]; } 98 98 } 99 p rivateValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter {99 public IValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter { 100 100 get { return (ValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; } 101 101 } 102 p rivateValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter {102 public IValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter { 103 103 get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; } 104 104 } 105 p rivateValueLookupParameter<IntValue> SelectedParentsParameter {105 public IValueLookupParameter<IntValue> SelectedParentsParameter { 106 106 get { return (ValueLookupParameter<IntValue>)Parameters["SelectedParents"]; } 107 107 } 108 p rivateValueParameter<MultiAnalyzer> AnalyzerParameter {108 public IValueParameter<MultiAnalyzer> AnalyzerParameter { 109 109 get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 110 110 } 111 p rivateValueParameter<IntValue> MaximumEvaluatedSolutionsParameter {111 public IValueParameter<IntValue> MaximumEvaluatedSolutionsParameter { 112 112 get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; } 113 113 } 114 p rivateIFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {114 public IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter { 115 115 get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; } 116 116 } … … 228 228 if (!Parameters.ContainsKey("FillPopulationWithParents")) 229 229 Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true }); 230 231 var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>; 232 if (optionalMutatorParameter != null) { 233 Parameters.Remove(optionalMutatorParameter); 234 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 235 foreach (var m in optionalMutatorParameter.ValidValues) 236 MutatorParameter.ValidValues.Add(m); 237 if (optionalMutatorParameter.Value == null) MutationProbability.Value = 0; // to guarantee that the old configuration results in the same behavior 238 else Mutator = optionalMutatorParameter.Value; 239 optionalMutatorParameter.ValidValues.Clear(); // to avoid dangling references to the old parameter its valid values are cleared 240 } 230 241 #endregion 231 242 … … 250 261 Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions.")); 251 262 Parameters.Add(new ValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.05))); 252 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));263 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 253 264 Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1))); 254 265 Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true }); … … 487 498 IManipulator oldMutator = MutatorParameter.Value; 488 499 MutatorParameter.ValidValues.Clear(); 500 IManipulator defaultMutator = Problem.Operators.OfType<IManipulator>().FirstOrDefault(); 501 489 502 foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) 490 503 MutatorParameter.ValidValues.Add(mutator); 504 491 505 if (oldMutator != null) { 492 506 IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType()); 493 507 if (mutator != null) MutatorParameter.Value = mutator; 494 } 508 else oldMutator = null; 509 } 510 511 if (oldMutator == null && defaultMutator != null) 512 MutatorParameter.Value = defaultMutator; 495 513 } 496 514 private void UpdateAnalyzers() { -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Plugin.cs.frame
r13321 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 /// Plugin class for HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm", "3.3.1 3.$WCREV$")]28 [Plugin("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm", "3.3.15.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Properties/AssemblyInfo.cs.frame
r13321 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 [assembly: AssemblyCompany("")] 32 32 [assembly: AssemblyProduct("HeuristicLab")] 33 [assembly: AssemblyCopyright("(c) 2002-201 5HEAL")]33 [assembly: AssemblyCopyright("(c) 2002-2018 HEAL")] 34 34 [assembly: AssemblyTrademark("")] 35 35 [assembly: AssemblyCulture("")] … … 53 53 // by using the '*' as shown below: 54 54 [assembly: AssemblyVersion("3.3.0.0")] 55 [assembly: AssemblyFileVersion("3.3.1 3.$WCREV$")]55 [assembly: AssemblyFileVersion("3.3.15.$WCREV$")] -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r12504 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 256 256 if (!Parameters.ContainsKey("FillPopulationWithParents")) 257 257 Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true }); 258 259 var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>; 260 if (optionalMutatorParameter != null) { 261 Parameters.Remove(optionalMutatorParameter); 262 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 263 foreach (var m in optionalMutatorParameter.ValidValues) 264 MutatorParameter.ValidValues.Add(m); 265 if (optionalMutatorParameter.Value == null) MutationProbability.Value = 0; // to guarantee that the old configuration results in the same behavior 266 else Mutator = optionalMutatorParameter.Value; 267 optionalMutatorParameter.ValidValues.Clear(); // to avoid dangling references to the old parameter its valid values are cleared 268 } 258 269 #endregion 259 270 … … 282 293 Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions.")); 283 294 Parameters.Add(new ValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.05))); 284 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));295 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 285 296 Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1))); 286 297 Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true }); … … 561 572 ICrossover oldCrossover = CrossoverParameter.Value; 562 573 CrossoverParameter.ValidValues.Clear(); 574 ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault(); 575 563 576 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) 564 577 CrossoverParameter.ValidValues.Add(crossover); 578 565 579 if (oldCrossover != null) { 566 580 ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); 567 581 if (crossover != null) CrossoverParameter.Value = crossover; 568 } 582 else oldCrossover = null; 583 } 584 if (oldCrossover == null && defaultCrossover != null) 585 CrossoverParameter.Value = defaultCrossover; 569 586 } 570 587 private void UpdateMutators() { 571 588 IManipulator oldMutator = MutatorParameter.Value; 572 589 MutatorParameter.ValidValues.Clear(); 590 IManipulator defaultMutator = Problem.Operators.OfType<IManipulator>().FirstOrDefault(); 591 573 592 foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) 574 593 MutatorParameter.ValidValues.Add(mutator); 594 575 595 if (oldMutator != null) { 576 596 IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType()); 577 597 if (mutator != null) MutatorParameter.Value = mutator; 578 } 598 else oldMutator = null; 599 } 600 601 if (oldMutator == null && defaultMutator != null) 602 MutatorParameter.Value = defaultMutator; 579 603 } 580 604 private void UpdateAnalyzers() { -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs
r12886 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SuccessfulOffspringAnalysis/SuccessfulOffspringAnalyzer.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.