Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/03/13 14:39:36 (11 years ago)
Author:
mkommend
Message:

#2038: Added reevaluation of elites in ES, IslandGA, IslandOSGA, OSGA, SASEGASA, and RAPGA.

File:
1 edited

Legend:

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

    r9456 r9569  
    6767      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
    6868    }
     69    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
     70      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
     71    }
    6972    public LookupParameter<DoubleValue> ComparisonFactorParameter {
    7073      get { return (LookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
     
    98101      : base() {
    99102      Initialize();
     103    }
     104
     105    [StorableHook(HookType.AfterDeserialization)]
     106    private void AfterDeserialization() {
     107      if (!Parameters.ContainsKey("ReevaluateElites")) {
     108        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
     109      }
    100110    }
    101111
     
    112122      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions."));
    113123      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
     124      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    114125      Parameters.Add(new LookupParameter<DoubleValue>("ComparisonFactor", "The comparison factor is used to determine whether the offspring should be compared to the better parent, the worse parent or a quality value linearly interpolated between them. It is in the range [0;1]."));
    115126      Parameters.Add(new LookupParameter<DoubleValue>("CurrentSuccessRatio", "The current success ratio."));
     
    159170      LeftReducer leftReducer = new LeftReducer();
    160171      MergingReducer mergingReducer2 = new MergingReducer();
     172      ConditionalBranch reevaluateElitesBranch = new ConditionalBranch();
     173      UniformSubScopesProcessor uniformSubScopesProcessor7 = new UniformSubScopesProcessor();
     174      Placeholder evaluator4 = new Placeholder();
     175      SubScopesCounter subScopesCounter4 = new SubScopesCounter();
    161176
    162177      selector.Name = "Selector (placeholder)";
     
    253268      worstSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name;
    254269      worstSelector.QualityParameter.ActualName = QualityParameter.Name;
     270
     271      reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites";
     272      reevaluateElitesBranch.Name = "Reevaluate elites ?";
     273
     274      uniformSubScopesProcessor7.Parallel.Value = true;
     275
     276      evaluator4.Name = "Evaluator (placeholder)";
     277      evaluator4.OperatorParameter.ActualName = EvaluatorParameter.Name;
     278
     279      subScopesCounter4.Name = "Increment EvaluatedSolutions";
     280      subScopesCounter4.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    255281      #endregion
    256282
     
    310336      subScopesProcessor3.Successor = mergingReducer2;
    311337      bestSelector.Successor = rightReducer;
    312       rightReducer.Successor = null;
     338      rightReducer.Successor = reevaluateElitesBranch;
     339      reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor7;
     340      uniformSubScopesProcessor7.Operator = evaluator4;
     341      uniformSubScopesProcessor7.Successor = subScopesCounter4;
     342      subScopesCounter4.Successor = null;
     343      reevaluateElitesBranch.FalseBranch = null;
     344      reevaluateElitesBranch.Successor = null;
    313345      worstSelector.Successor = leftReducer;
    314346      leftReducer.Successor = null;
Note: See TracChangeset for help on using the changeset viewer.