Changeset 11676
- Timestamp:
- 12/10/14 09:51:08 (10 years ago)
- Location:
- branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs
r11620 r11676 189 189 } 190 190 191 #endregion 192 193 #region Preconfigured Analyzers 191 194 [Storable] 192 195 private BestAverageWorstQualityAnalyzer qualityAnalyzer; … … 235 238 var initializeAgeProcessor = new UniformSubScopesProcessor(); 236 239 var initializeAge = new VariableCreator() { Name = "Initialize Age" }; 237 var initializeLocalEvaluatedSolutions = new SubScopesCounter(); 240 var initializeLayerPopulationSize = new SubScopesCounter() { Name = "Init LayerPopulationCounter" }; 241 var initializeLocalEvaluatedSolutions = new Assigner() { Name = "Initialize LayerEvaluatedSolutions" }; 238 242 var initializeGlobalEvaluatedSolutions = new DataReducer() { Name = "Initialize EvaluatedSolutions" }; 239 243 var resultsCollector = new ResultsCollector(); … … 263 267 264 268 initializeAgeProcessor.Operator = initializeAge; 265 initializeAgeProcessor.Successor = initializeLocalEvaluatedSolutions; 269 initializeAgeProcessor.Successor = initializeLayerPopulationSize; 270 271 initializeLayerPopulationSize.ValueParameter.ActualName = "LayerPopulationSize"; 272 initializeLayerPopulationSize.Successor = initializeLocalEvaluatedSolutions; 266 273 267 274 initializeAge.CollectedValues.Add(new ValueParameter<IntValue>("Age", new IntValue(0))); 268 275 initializeAge.Successor = null; 269 276 270 initializeLocalEvaluatedSolutions.ValueParameter.ActualName = "LayerEvaluatedSolutions"; 277 initializeLocalEvaluatedSolutions.LeftSideParameter.ActualName = "LayerEvaluatedSolutions"; 278 initializeLocalEvaluatedSolutions.RightSideParameter.ActualName = "LayerPopulationSize"; 271 279 initializeLocalEvaluatedSolutions.Successor = null; 272 280 … … 526 534 #endregion 527 535 536 #region AgeLimits calculation 528 537 private void RecalculateAgeLimits() { 529 538 IEnumerable<int> scheme; … … 563 572 yield return (int)Math.Pow(@base, i); 564 573 } 574 #endregion 565 575 } 566 576 } -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs
r11609 r11676 132 132 generationsIcrementor.Successor = evaluatedSolutionsReducer; 133 133 134 evaluatedSolutionsReducer.ParameterToReduce.ActualName = " EvaluatedSolutions";134 evaluatedSolutionsReducer.ParameterToReduce.ActualName = "LayerEvaluatedSolutions"; 135 135 evaluatedSolutionsReducer.TargetParameter.ActualName = "EvaluatedSolutions"; 136 136 evaluatedSolutionsReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum); -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersEmigrator.cs
r11590 r11676 60 60 var subScopesCounter = new SubScopesCounter(); 61 61 // TODO: if expression calculator supports int, use expression calculator 62 var countCalculator = new MergingReducerCalculator() { Name = " NumSubScopes = Min(NumSubScopes, PopulationSize)" };62 var countCalculator = new MergingReducerCalculator() { Name = "LayerPopulationSize = Min(LayerPopulationSize, PopulationSize)" }; 63 63 //var countCalculator = new ExpressionCalculator() { Name = "NumSubScopes = Min(NumSubScopes, PopulationSize)" }; 64 64 var bestSelector = new BestSelector(); … … 81 81 mergingReducer.Successor = subScopesCounter; 82 82 83 subScopesCounter.ValueParameter.ActualName = " NumSubScopes";83 subScopesCounter.ValueParameter.ActualName = "LayerPopulationSize"; 84 84 subScopesCounter.AccumulateParameter.Value = new BoolValue(false); 85 85 subScopesCounter.Successor = countCalculator; … … 91 91 countCalculator.Successor = bestSelector; 92 92 93 bestSelector.NumberOfSelectedSubScopesParameter.ActualName = " NumSubScopes";93 bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "LayerPopulationSize"; 94 94 bestSelector.QualityParameter.ActualName = QualityParameter.Name; 95 95 bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name; -
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MergingReducerCalculator.cs
r11586 r11676 35 35 get { return (ILookupParameter<IntValue>)Parameters["PopulationSize"]; } 36 36 } 37 private ILookupParameter<IntValue> NumSubScopesParameter {38 get { return (ILookupParameter<IntValue>)Parameters[" NumSubScopes"]; }37 private ILookupParameter<IntValue> LayerPopulationSizeParameter { 38 get { return (ILookupParameter<IntValue>)Parameters["LayerPopulationSize"]; } 39 39 } 40 40 … … 50 50 : base() { 51 51 Parameters.Add(new LookupParameter<IntValue>("PopulationSize")); 52 Parameters.Add(new LookupParameter<IntValue>(" NumSubScopes"));52 Parameters.Add(new LookupParameter<IntValue>("LayerPopulationSize")); 53 53 } 54 54 55 55 public override IOperation Apply() { 56 56 int populationSize = PopulationSizeParameter.ActualValue.Value; 57 int numSubScopes = NumSubScopesParameter.ActualValue.Value;57 int numSubScopes = LayerPopulationSizeParameter.ActualValue.Value; 58 58 59 NumSubScopesParameter.ActualValue.Value = Math.Min(populationSize, numSubScopes);59 LayerPopulationSizeParameter.ActualValue.Value = Math.Min(populationSize, numSubScopes); 60 60 61 61 return base.Apply();
Note: See TracChangeset
for help on using the changeset viewer.