Changeset 13117


Ignore:
Timestamp:
11/04/15 17:28:03 (4 years ago)
Author:
pfleck
Message:

#2269 Added ReduceToPopulationSize parameter to control if the population is reduced to the PopulationSize after elder migration (default) or the layer can have more than PopulationSize individuals until the next generation.

Location:
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs

    r13113 r13117  
    293293
    294294      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 });
     295      Parameters.Add(new ValueParameter<BoolValue>("ReduceToPopulationSize", "Reduce the LayerPopulationSize after elder migration to PopulationSize", new BoolValue(true)) { Hidden = true });
    295296
    296297      Parameters.Add(new ValueParameter<MultiTerminator>("Terminator", "The termination criteria which sould be checked.", new MultiTerminator()));
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs

    r13113 r13117  
    162162      var mergingReducer = new MergingReducer();
    163163      var subScopesCounter = new SubScopesCounter();
     164      var reduceToPopulationSizeBranch = new ConditionalBranch() { Name = "ReduceToPopulationSize?" };
    164165      var countCalculator = new ExpressionCalculator() { Name = "LayerPopulationSize = Min(LayerPopulationSize, PopulationSize)" };
    165166      var bestSelector = new BestSelector();
     
    180181      subScopesCounter.ValueParameter.ActualName = "LayerPopulationSize";
    181182      subScopesCounter.AccumulateParameter.Value = new BoolValue(false);
    182       subScopesCounter.Successor = countCalculator;
     183      subScopesCounter.Successor = reduceToPopulationSizeBranch;
     184
     185      reduceToPopulationSizeBranch.ConditionParameter.ActualName = "ReduceToPopulationSize";
     186      reduceToPopulationSizeBranch.TrueBranch = countCalculator;
    183187
    184188      countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize"));
Note: See TracChangeset for help on using the changeset viewer.