- Timestamp:
- 10/25/17 13:53:11 (7 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/Enhanced OSALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsOs2MainLoop.cs
r15429 r15432 32 32 namespace HeuristicLab.Algorithms.ALPS { 33 33 34 [Item("AlpsO ffspringSelectionGeneticAlgorithmMainLoop", "An ALPS offspring selection genetic algorithm main loop operator.")]34 [Item("AlpsOs2MainLoop", "An ALPS offspring selection genetic algorithm main loop operator.")] 35 35 [StorableClass] 36 public sealed class AlpsO ffspringSelectionGeneticAlgorithmMainLoop : AlgorithmOperator {36 public sealed class AlpsOs2MainLoop : AlgorithmOperator { 37 37 #region Parameter Properties 38 38 public IValueLookupParameter<IRandom> GlobalRandomParameter { … … 121 121 } 122 122 123 public IValueLookupParameter< IntValue> MatingPoolRangeParameter {124 get { return (IValueLookupParameter< IntValue>)Parameters["MatingPoolRange"]; }123 public IValueLookupParameter<DoubleArray> MatingPoolRangesParameter { 124 get { return (IValueLookupParameter<DoubleArray>)Parameters["MatingPoolRanges"]; } 125 125 } 126 126 public IValueLookupParameter<BoolValue> ReduceToPopulationSizeParameter { … … 133 133 #endregion 134 134 135 [StorableConstructor] 136 private AlpsOffspringSelectionGeneticAlgorithmMainLoop(bool deserializing) 137 : base(deserializing) { } 138 private AlpsOffspringSelectionGeneticAlgorithmMainLoop(AlpsOffspringSelectionGeneticAlgorithmMainLoop original, Cloner cloner) 139 : base(original, cloner) { } 140 public override IDeepCloneable Clone(Cloner cloner) { 141 return new AlpsOffspringSelectionGeneticAlgorithmMainLoop(this, cloner); 142 } 143 public AlpsOffspringSelectionGeneticAlgorithmMainLoop() 135 #region Constructor, Cloning & Persistence 136 public AlpsOs2MainLoop() 144 137 : base() { 145 138 Parameters.Add(new ValueLookupParameter<IRandom>("GlobalRandom", "A pseudo random number generator.")); … … 176 169 Parameters.Add(new ValueLookupParameter<IntArray>("AgeLimits", "The maximum age an individual is allowed to reach in a certain layer.")); 177 170 178 Parameters.Add(new ValueLookupParameter< IntValue>("MatingPoolRange", "The range of sub -populations used for creating a mating pool. (1 = current + previous sub-population)"));171 Parameters.Add(new ValueLookupParameter<DoubleArray>("MatingPoolRanges", "The range of sub-populations used for creating a mating pool. (1 = current + previous sub-population)")); 179 172 Parameters.Add(new ValueLookupParameter<BoolValue>("ReduceToPopulationSize", "Reduce the CurrentPopulationSize after elder migration to PopulationSize")); 180 173 … … 189 182 var initAnalyzerPlaceholder = new Placeholder() { Name = "Analyzer (Placeholder)" }; 190 183 var resultsCollector = new ResultsCollector(); 191 var matingPoolCreator = new MatingPoolCreator() { Name = "Create Mating Pools" };184 var matingPoolCreator = new ContinuousMatingPoolCreator() { Name = "Create Mating Pools" }; 192 185 var matingPoolProcessor = new UniformSubScopesProcessor() { Name = "Process Mating Pools" }; 193 186 var initializeLayer = new Assigner() { Name = "Reset LayerEvaluatedSolutions" }; 194 var mainOperator = new AlpsO ffspringSelectionGeneticAlgorithmMainOperator();187 var mainOperator = new AlpsOs2MainOperator(); 195 188 var generationsIcrementor = new IntCounter() { Name = "Increment Generations" }; 196 189 var evaluatedSolutionsReducer = new DataReducer() { Name = "Increment EvaluatedSolutions" }; … … 235 228 resultsCollector.Successor = matingPoolCreator; 236 229 237 matingPoolCreator.MatingPoolRangeParameter.Value = null; 238 matingPoolCreator.MatingPoolRangeParameter.ActualName = MatingPoolRangeParameter.Name; 230 matingPoolCreator.RangesParameter.ActualName = MatingPoolRangesParameter.Name; 231 matingPoolCreator.QualityParameter.ActualName = QualityParameter.Name; 232 matingPoolCreator.MaximizationParameter.ActualName = MaximizationParameter.Name; 239 233 matingPoolCreator.Successor = matingPoolProcessor; 240 234 … … 466 460 return reseeder; 467 461 } 462 463 public override IDeepCloneable Clone(Cloner cloner) { 464 return new AlpsOs2MainLoop(this, cloner); 465 } 466 private AlpsOs2MainLoop(AlpsOs2MainLoop original, Cloner cloner) 467 : base(original, cloner) { } 468 469 [StorableConstructor] 470 private AlpsOs2MainLoop(bool deserializing) 471 : base(deserializing) { } 472 #endregion 468 473 } 469 474 }
Note: See TracChangeset
for help on using the changeset viewer.