Changeset 3700


Ignore:
Timestamp:
05/07/10 14:33:49 (12 years ago)
Author:
abeham
Message:

#839

  • added parameter selected parents to Island OSGA
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r3698 r3700  
    120120    private ValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter {
    121121      get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; }
     122    }
     123    private ValueLookupParameter<IntValue> SelectedParentsParameter {
     124      get { return (ValueLookupParameter<IntValue>)Parameters["SelectedParents"]; }
    122125    }
    123126    private ValueParameter<MultiAnalyzer> AnalyzerParameter {
     
    274277      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.", new DoubleValue(100)));
    275278      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.", new BoolValue(false)));
     279      Parameters.Add(new ValueLookupParameter<IntValue>("SelectedParents", "Should be about 2 * PopulationSize, for large problems use a smaller value to decrease memory footprint.", new IntValue(200)));
    276280      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the islands.", new MultiAnalyzer()));
    277281      Parameters.Add(new ValueParameter<MultiAnalyzer>("IslandAnalyzer", "The operator used to analyze each island.", new MultiAnalyzer()));
     
    482486      foreach (ISelector selector in SelectorParameter.ValidValues) {
    483487        selector.CopySelected = new BoolValue(true);
    484         selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * (PopulationSize.Value - Elites.Value));
     488        selector.NumberOfSelectedSubScopesParameter.Value = null;
     489        selector.NumberOfSelectedSubScopesParameter.ActualName = SelectedParentsParameter.Name;
    485490        ParameterizeStochasticOperator(selector);
    486491      }
Note: See TracChangeset for help on using the changeset viewer.