Changeset 13127 for branches/ALPS/HeuristicLab.Algorithms.ALPS
- Timestamp:
- 11/06/15 11:47:44 (9 years ago)
- Location:
- branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs
r13124 r13127 291 291 292 292 Parameters.Add(new ValueParameter<EnumValue<AgingScheme>>("AgingScheme", "The aging scheme for setting the age-limits for the layers.", new EnumValue<AgingScheme>(ALPS.AgingScheme.Polynomial))); 293 Parameters.Add(new ValueParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers ", new IntValue(20)));293 Parameters.Add(new ValueParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers.", new IntValue(20))); 294 294 Parameters.Add(new ValueParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent.", new DoubleValue(1.0)) { Hidden = true }); 295 295 Parameters.Add(new ValueParameter<IntArray>("AgeLimits", "The maximum ages for the Layers.", new IntArray(new int[0])) { Hidden = true }); 296 296 297 297 Parameters.Add(new ValueParameter<IntValue>("MatingPoolRange", "The range of layers used for creating a mating pool. (1 = current + previous layer)", new IntValue(1)) { Hidden = true }); 298 Parameters.Add(new ValueParameter<BoolValue>("ReduceToPopulationSize", "Reduce the LayerPopulationSize after elder migration to PopulationSize", new BoolValue(true)) { Hidden = true });299 300 Parameters.Add(new ValueParameter<MultiTerminator>("Terminator", "The termination criteria which sould be checked.", new MultiTerminator()));298 Parameters.Add(new ValueParameter<BoolValue>("ReduceToPopulationSize", "Reduce the CurrentPopulationSize after elder migration to PopulationSize", new BoolValue(true)) { Hidden = true }); 299 300 Parameters.Add(new ValueParameter<MultiTerminator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop.", new MultiTerminator())); 301 301 #endregion 302 302 … … 306 306 var layer0Processor = new SubScopesProcessor(); 307 307 var localRandomCreator = new LocalRandomCreator(); 308 var layerVariableCreator = new VariableCreator();309 308 var layerSolutionsCreator = new SolutionsCreator(); 310 309 var initializeAgeProcessor = new UniformSubScopesProcessor(); 311 310 var initializeAge = new VariableCreator() { Name = "Initialize Age" }; 312 var initialize LayerPopulationSize = new SubScopesCounter() { Name = "Init LayerPopulationCounter" };311 var initializeCurrentPopulationSize = new SubScopesCounter() { Name = "Init CurrentPopulationCounter" }; 313 312 var initializeLocalEvaluatedSolutions = new Assigner() { Name = "Initialize LayerEvaluatedSolutions" }; 314 313 var initializeGlobalEvaluatedSolutions = new DataReducer() { Name = "Initialize EvaluatedSolutions" }; … … 331 330 layer0Processor.Successor = initializeGlobalEvaluatedSolutions; 332 331 333 localRandomCreator.Successor = layerVariableCreator; 334 335 layerVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Layer", new IntValue(0))); 336 layerVariableCreator.Successor = layerSolutionsCreator; 332 localRandomCreator.Successor = layerSolutionsCreator; 337 333 338 334 layerSolutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name; … … 340 336 341 337 initializeAgeProcessor.Operator = initializeAge; 342 initializeAgeProcessor.Successor = initialize LayerPopulationSize;343 344 initialize LayerPopulationSize.ValueParameter.ActualName = "LayerPopulationSize";345 initialize LayerPopulationSize.Successor = initializeLocalEvaluatedSolutions;338 initializeAgeProcessor.Successor = initializeCurrentPopulationSize; 339 340 initializeCurrentPopulationSize.ValueParameter.ActualName = "CurrentPopulationSize"; 341 initializeCurrentPopulationSize.Successor = initializeLocalEvaluatedSolutions; 346 342 347 343 initializeAge.CollectedValues.Add(new ValueParameter<DoubleValue>("Age", new DoubleValue(0))); … … 349 345 350 346 initializeLocalEvaluatedSolutions.LeftSideParameter.ActualName = "LayerEvaluatedSolutions"; 351 initializeLocalEvaluatedSolutions.RightSideParameter.ActualName = " LayerPopulationSize";347 initializeLocalEvaluatedSolutions.RightSideParameter.ActualName = "CurrentPopulationSize"; 352 348 initializeLocalEvaluatedSolutions.Successor = null; 353 349 … … 362 358 363 359 mainLoop.GlobalRandomParameter.ActualName = "GlobalRandom"; 364 mainLoop.LocalRandomParameter.ActualName = "LocalRandom";360 mainLoop.LocalRandomParameter.ActualName = localRandomCreator.LocalRandomParameter.Name; 365 361 mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions"; 366 362 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; … … 377 373 mainLoop.PlusSelectionParameter.ActualName = PlusSelectionParameter.Name; 378 374 mainLoop.AgeParameter.ActualName = "Age"; 375 mainLoop.AgeGapParameter.ActualName = AgeGapParameter.Name; 379 376 mainLoop.AgeInheritanceParameter.ActualName = AgeInheritanceParameter.Name; 380 377 mainLoop.AgeLimitsParameter.ActualName = AgeLimitsParameter.Name; 381 378 mainLoop.MatingPoolRangeParameter.ActualName = MatingPoolRangeParameter.Name; 382 379 mainLoop.ReduceToPopulationSizeParameter.ActualName = ReduceToPopulationSizeParameter.Name; 380 mainLoop.TerminatorParameter.ActualName = TerminatorParameter.Name; 383 381 #endregion 384 382 -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs
r13124 r13127 98 98 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; } 99 99 } 100 public IValueLookupParameter<IntValue> AgeGapParameter { 101 get { return (IValueLookupParameter<IntValue>)Parameters["AgeGap"]; } 102 } 100 103 public IValueLookupParameter<DoubleValue> AgeInheritanceParameter { 101 104 get { return (IValueLookupParameter<DoubleValue>)Parameters["AgeInheritance"]; } … … 110 113 public IValueLookupParameter<BoolValue> ReduceToPopulationSizeParameter { 111 114 get { return (IValueLookupParameter<BoolValue>)Parameters["ReduceToPopulationSize"]; } 115 } 116 117 public IValueLookupParameter<IOperator> TerminatorParameter { 118 get { return (IValueLookupParameter<IOperator>)Parameters["Terminator"]; } 112 119 } 113 120 #endregion … … 147 154 148 155 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The age of individuals.")); 156 Parameters.Add(new ValueLookupParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers.")); 149 157 Parameters.Add(new ValueLookupParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent.")); 150 158 Parameters.Add(new ValueLookupParameter<IntArray>("AgeLimits", "The maximum ages for the Layers.")); 151 159 152 160 Parameters.Add(new ValueLookupParameter<IntValue>("MatingPoolRange", "The range of sub - populations used for creating a mating pool. (1 = current + previous sub-population)")); 153 Parameters.Add(new ValueLookupParameter<BoolValue>("ReduceToPopulationSize", "Reduce the LayerPopulationSize after elder migration to PopulationSize")); 161 Parameters.Add(new ValueLookupParameter<BoolValue>("ReduceToPopulationSize", "Reduce the CurrentPopulationSize after elder migration to PopulationSize")); 162 163 Parameters.Add(new ValueLookupParameter<IOperator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop")); 154 164 155 165 … … 183 193 initLayerAnalyzerProcessor.Successor = initAnalyzerPlaceholder; 184 194 185 layerVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Layer EvaluatedSolutions"));195 layerVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Layer", new IntValue(0))); 186 196 layerVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("LayerResults")); 187 197 layerVariableCreator.Successor = initLayerAnalyzerPlaceholder; … … 253 263 analyzerPlaceholder.Successor = termination; 254 264 265 termination.TerminatorParameter.ActualName = TerminatorParameter.Name; 255 266 termination.ContinueBranch = matingPoolCreator; 256 267 } … … 273 284 selectorProsessor.Operator = eldersSelector; 274 285 selectorProsessor.Successor = shiftToRightMigrator; 286 287 eldersSelector.AgeParameter.ActualName = AgeParameter.Name; 288 eldersSelector.AgeLimitsParameter.ActualName = AgeLimitsParameter.Name; 289 eldersSelector.NumberOfLayersParameter.ActualName = NumberOfLayersParameter.Name; 290 eldersSelector.LayerParameter.ActualName = "Layer"; 291 eldersSelector.Successor = null; 275 292 276 293 shiftToRightMigrator.ClockwiseMigrationParameter.Value = new BoolValue(true); … … 391 408 reseeder.OperatorGraph.InitialOperator = reseedingController; 392 409 410 reseedingController.GenerationsParameter.ActualName = "Generations"; 411 reseedingController.AgeGapParameter.ActualName = AgeGapParameter.Name; 393 412 reseedingController.FirstLayerOperator = removeIndividuals; 413 reseedingController.Successor = null; 394 414 395 415 removeIndividuals.Successor = createIndividuals; -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/Analyzers/AgeDistributionAnalyzer.cs
r13046 r13127 40 40 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; } 41 41 } 42 public ValueLookupParameter<ResultCollection> ResultsParameter {43 get { return ( ValueLookupParameter<ResultCollection>)Parameters["Results"]; }42 public IValueLookupParameter<ResultCollection> ResultsParameter { 43 get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; } 44 44 } 45 private ValueParameter<StringValue> HistogramNameParameter {46 get { return ( ValueParameter<StringValue>)Parameters["HistogramName"]; }45 private IValueParameter<StringValue> HistogramNameParameter { 46 get { return (IValueParameter<StringValue>)Parameters["HistogramName"]; } 47 47 } 48 private ValueParameter<BoolValue> StoreHistoryParameter {49 get { return ( ValueParameter<BoolValue>)Parameters["StoreHistory"]; }48 private IValueParameter<BoolValue> StoreHistoryParameter { 49 get { return (IValueParameter<BoolValue>)Parameters["StoreHistory"]; } 50 50 } 51 51 public ILookupParameter<IntValue> IterationsParameter { -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/Analyzers/OldestAverageYoungestAgeAnalyzer.cs
r13046 r13127 51 51 get { return (IValueLookupParameter<DataTable>)Parameters["Ages"]; } 52 52 } 53 public ValueLookupParameter<ResultCollection> ResultsParameter {54 get { return ( ValueLookupParameter<ResultCollection>)Parameters["Results"]; }53 public IValueLookupParameter<ResultCollection> ResultsParameter { 54 get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; } 55 55 } 56 56 #endregion -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersSelector.cs
r13046 r13127 34 34 [StorableClass] 35 35 public sealed class EldersSelector : Selector { 36 p rivateIScopeTreeLookupParameter<DoubleValue> AgeParameter {36 public IScopeTreeLookupParameter<DoubleValue> AgeParameter { 37 37 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; } 38 38 } 39 p rivateILookupParameter<IntArray> AgeLimitsParameter {39 public ILookupParameter<IntArray> AgeLimitsParameter { 40 40 get { return (ILookupParameter<IntArray>)Parameters["AgeLimits"]; } 41 41 } 42 p rivateILookupParameter<IntValue> NumberOfLayersParameter {42 public ILookupParameter<IntValue> NumberOfLayersParameter { 43 43 get { return (ILookupParameter<IntValue>)Parameters["NumberOfLayers"]; } 44 44 } 45 p rivateILookupParameter<IntValue> LayerParameter {45 public ILookupParameter<IntValue> LayerParameter { 46 46 get { return (ILookupParameter<IntValue>)Parameters["Layer"]; } 47 47 } … … 57 57 public EldersSelector() 58 58 : base() { 59 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age" ));60 Parameters.Add(new LookupParameter<IntArray>("AgeLimits" ));61 Parameters.Add(new LookupParameter<IntValue>("NumberOfLayers" ));62 Parameters.Add(new LookupParameter<IntValue>("Layer" ));59 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The age of individuals.")); 60 Parameters.Add(new LookupParameter<IntArray>("AgeLimits", "The maximum ages for the Layers.")); 61 Parameters.Add(new LookupParameter<IntValue>("NumberOfLayers", "The number of layers.")); 62 Parameters.Add(new LookupParameter<IntValue>("Layer", "The number of the current Layer.")); 63 63 } 64 64 -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LastScopeCloner.cs
r13124 r13127 69 69 scopes.Add(newScope); 70 70 71 72 71 var next = new OperationCollection(base.Apply()); 73 next.Insert(0, ExecutionContext.CreateChildOperation(NewScopeOperator, newScope)); 72 if (NewScopeOperator != null) 73 next.Insert(0, ExecutionContext.CreateOperation(NewScopeOperator, newScope)); 74 74 return next; 75 75 } -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MatingPoolCreator.cs
r13124 r13127 31 31 [StorableClass] 32 32 public sealed class MatingPoolCreator : SingleSuccessorOperator { 33 34 33 public IValueLookupParameter<IntValue> MatingPoolRangeParameter { 35 34 get { return (IValueLookupParameter<IntValue>)Parameters["MatingPoolRange"]; } … … 55 54 /// / | \ / | \ 56 55 /// Pop1 Pop2 Pop3 => Pop1 Pop2 Pop3 57 /// /|\ /|\ /|\ /|\ /|\/|\58 /// ABC DEF GHI ABC DEFGHI59 /// ABCDEF56 /// /|\ /|\ /|\ /|\ /|\ /|\ 57 /// ABC DEF GHI ABC DEF GHI 58 /// ABC DEF 60 59 /// </pre> 61 60 /// </summary> -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/ReseedingController.cs
r13111 r13127 31 31 [StorableClass] 32 32 public sealed class ReseedingController : SingleSuccessorOperator { 33 p rivateILookupParameter<IntValue> GenerationsParameter {33 public ILookupParameter<IntValue> GenerationsParameter { 34 34 get { return (ILookupParameter<IntValue>)Parameters["Generations"]; } 35 35 } 36 p rivateILookupParameter<IntValue> AgeGapParameter {36 public ILookupParameter<IntValue> AgeGapParameter { 37 37 get { return (ILookupParameter<IntValue>)Parameters["AgeGap"]; } 38 38 } … … 59 59 public ReseedingController() 60 60 : base() { 61 Parameters.Add(new LookupParameter<IntValue>("Generations" ));62 Parameters.Add(new LookupParameter<IntValue>("AgeGap"));63 Parameters.Add(new OperatorParameter("FirstLayerOperator" ));61 Parameters.Add(new LookupParameter<IntValue>("Generations", "The current number of generations.")); 62 Parameters.Add(new ValueLookupParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers.")); 63 Parameters.Add(new OperatorParameter("FirstLayerOperator", "The Operator that is performed on the first layer if reseeding is required.")); 64 64 } 65 65 -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/WeightingReducer.cs
r13096 r13127 33 33 [StorableClass] 34 34 public sealed class WeightingReducer : SingleSuccessorOperator { 35 36 35 public IScopeTreeLookupParameter<DoubleValue> ParameterToReduce { 37 36 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["ParameterToReduce"]; }
Note: See TracChangeset
for help on using the changeset viewer.