Changeset 11676


Ignore:
Timestamp:
12/10/14 09:51:08 (5 years ago)
Author:
pfleck
Message:

#2269 Added LayerPopulationSize variable (for PopulationSizeAnalyzer)

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  
    189189    }
    190190
     191    #endregion
     192
     193    #region Preconfigured Analyzers
    191194    [Storable]
    192195    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
     
    235238      var initializeAgeProcessor = new UniformSubScopesProcessor();
    236239      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" };
    238242      var initializeGlobalEvaluatedSolutions = new DataReducer() { Name = "Initialize EvaluatedSolutions" };
    239243      var resultsCollector = new ResultsCollector();
     
    263267
    264268      initializeAgeProcessor.Operator = initializeAge;
    265       initializeAgeProcessor.Successor = initializeLocalEvaluatedSolutions;
     269      initializeAgeProcessor.Successor = initializeLayerPopulationSize;
     270
     271      initializeLayerPopulationSize.ValueParameter.ActualName = "LayerPopulationSize";
     272      initializeLayerPopulationSize.Successor = initializeLocalEvaluatedSolutions;
    266273
    267274      initializeAge.CollectedValues.Add(new ValueParameter<IntValue>("Age", new IntValue(0)));
    268275      initializeAge.Successor = null;
    269276
    270       initializeLocalEvaluatedSolutions.ValueParameter.ActualName = "LayerEvaluatedSolutions";
     277      initializeLocalEvaluatedSolutions.LeftSideParameter.ActualName = "LayerEvaluatedSolutions";
     278      initializeLocalEvaluatedSolutions.RightSideParameter.ActualName = "LayerPopulationSize";
    271279      initializeLocalEvaluatedSolutions.Successor = null;
    272280
     
    526534    #endregion
    527535
     536    #region AgeLimits calculation
    528537    private void RecalculateAgeLimits() {
    529538      IEnumerable<int> scheme;
     
    563572        yield return (int)Math.Pow(@base, i);
    564573    }
     574    #endregion
    565575  }
    566576}
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs

    r11609 r11676  
    132132      generationsIcrementor.Successor = evaluatedSolutionsReducer;
    133133
    134       evaluatedSolutionsReducer.ParameterToReduce.ActualName = "EvaluatedSolutions";
     134      evaluatedSolutionsReducer.ParameterToReduce.ActualName = "LayerEvaluatedSolutions";
    135135      evaluatedSolutionsReducer.TargetParameter.ActualName = "EvaluatedSolutions";
    136136      evaluatedSolutionsReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum);
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersEmigrator.cs

    r11590 r11676  
    6060      var subScopesCounter = new SubScopesCounter();
    6161      // 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)" };
    6363      //var countCalculator = new ExpressionCalculator() { Name = "NumSubScopes = Min(NumSubScopes, PopulationSize)" };
    6464      var bestSelector = new BestSelector();
     
    8181      mergingReducer.Successor = subScopesCounter;
    8282
    83       subScopesCounter.ValueParameter.ActualName = "NumSubScopes";
     83      subScopesCounter.ValueParameter.ActualName = "LayerPopulationSize";
    8484      subScopesCounter.AccumulateParameter.Value = new BoolValue(false);
    8585      subScopesCounter.Successor = countCalculator;
     
    9191      countCalculator.Successor = bestSelector;
    9292
    93       bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "NumSubScopes";
     93      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "LayerPopulationSize";
    9494      bestSelector.QualityParameter.ActualName = QualityParameter.Name;
    9595      bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MergingReducerCalculator.cs

    r11586 r11676  
    3535      get { return (ILookupParameter<IntValue>)Parameters["PopulationSize"]; }
    3636    }
    37     private ILookupParameter<IntValue> NumSubScopesParameter {
    38       get { return (ILookupParameter<IntValue>)Parameters["NumSubScopes"]; }
     37    private ILookupParameter<IntValue> LayerPopulationSizeParameter {
     38      get { return (ILookupParameter<IntValue>)Parameters["LayerPopulationSize"]; }
    3939    }
    4040
     
    5050      : base() {
    5151      Parameters.Add(new LookupParameter<IntValue>("PopulationSize"));
    52       Parameters.Add(new LookupParameter<IntValue>("NumSubScopes"));
     52      Parameters.Add(new LookupParameter<IntValue>("LayerPopulationSize"));
    5353    }
    5454
    5555    public override IOperation Apply() {
    5656      int populationSize = PopulationSizeParameter.ActualValue.Value;
    57       int numSubScopes = NumSubScopesParameter.ActualValue.Value;
     57      int numSubScopes = LayerPopulationSizeParameter.ActualValue.Value;
    5858
    59       NumSubScopesParameter.ActualValue.Value = Math.Min(populationSize, numSubScopes);
     59      LayerPopulationSizeParameter.ActualValue.Value = Math.Min(populationSize, numSubScopes);
    6060
    6161      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.