Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12999 for branches


Ignore:
Timestamp:
10/13/15 11:18:46 (9 years ago)
Author:
pfleck
Message:

#2269 Removed MatingPoolSelectionPercentageParameter.

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

Legend:

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

    r12998 r12999  
    114114      get { return (IValueParameter<IntValue>)Parameters["MatingPoolRange"]; }
    115115    }
    116     private IValueParameter<PercentValue> MatingPoolSelectionPercentageParameter {
    117       get { return (IValueLookupParameter<PercentValue>)Parameters["MatingPoolSelectionPercentage"]; }
    118     }
    119116
    120117    private IValueParameter<MultiTerminator> TerminatorParameter {
     
    198195      get { return MatingPoolRangeParameter.Value; }
    199196      set { MatingPoolRangeParameter.Value = value; }
    200     }
    201     public PercentValue MatingPoolSelectionPercentage {
    202       get { return MatingPoolSelectionPercentageParameter.Value; }
    203       set { MatingPoolSelectionPercentageParameter.Value = value; }
    204197    }
    205198
     
    303296
    304297      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 });
    305       Parameters.Add(new ValueParameter<PercentValue>("MatingPoolSelectionPercentage", "Percentage of the previous layers used for creating a mating pool.", new PercentValue(1.0, restrictToUnitInterval: true)) { Hidden = true });
    306298
    307299      Parameters.Add(new ValueParameter<MultiTerminator>("Terminator", "The termination criteria which sould be checked.", new MultiTerminator()));
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MatingPoolCreator.cs

    r12045 r12999  
    3737      get { return (ILookupParameter<IntValue>)Parameters["MatingPoolRange"]; }
    3838    }
    39     public ILookupParameter<PercentValue> MatingPoolSelectionPercentageParameter {
    40       get { return (ILookupParameter<PercentValue>)Parameters["MatingPoolSelectionPercentage"]; }
    41     }
    4239
    4340    [StorableConstructor]
     
    5249      : base() {
    5350      Parameters.Add(new LookupParameter<IntValue>("MatingPoolRange"));
    54       Parameters.Add(new LookupParameter<PercentValue>("MatingPoolSelectionPercentage"));
    5551    }
    5652
     
    5854      var layers = ExecutionContext.Scope.SubScopes;
    5955      int range = MatingPoolRangeParameter.ActualValue.Value;
    60       double percentage = MatingPoolSelectionPercentageParameter.ActualValue.Value;
    6156
    6257      for (int layer = layers.Count - 1; layer > 0; layer--) {
     
    6560          var prevLayerScope = layers[layer - n];
    6661          var individuals = prevLayerScope.SubScopes;
    67           foreach (var individual in individuals.Take((int)(individuals.Count * percentage))) {
     62          foreach (var individual in individuals) {
    6863            layerScope.SubScopes.Add((IScope)individual.Clone(new Cloner()));
    6964          }
Note: See TracChangeset for help on using the changeset viewer.