Changeset 10643 for trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
- Timestamp:
- 03/21/14 14:20:03 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r10639 r10643 20 20 #endregion 21 21 22 using System.Linq;23 22 using HeuristicLab.Common; 24 23 using HeuristicLab.Core; … … 29 28 using HeuristicLab.Parameters; 30 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.Selection;32 30 33 31 namespace HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm { … … 131 129 public LookupParameter<IntValue> EvaluatedSolutionsParameter { 132 130 get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 131 } 132 public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter { 133 get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; } 133 134 } 134 135 #endregion … … 176 177 Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island.")); 177 178 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated.")); 179 Parameters.Add(new ValueLookupParameter<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.")); 178 180 #endregion 179 181 … … 267 269 mainOperator.SelectorParameter.ActualName = SelectorParameter.Name; 268 270 mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name; 269 foreach (var offspringSelector in mainOperator.OperatorGraph.Operators.OfType<OffspringSelector>()) 270 offspringSelector.FillPopulationWithParents = true; 271 mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name; 271 272 272 273 islandAnalyzer2.Name = "Island Analyzer (placeholder)"; … … 430 431 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 431 432 } 433 if (!Parameters.ContainsKey("FillPopulationWithParents")) 434 Parameters.Add(new ValueLookupParameter<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.")); 432 435 #endregion 433 436 }
Note: See TracChangeset
for help on using the changeset viewer.