Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/28/13 16:56:21 (11 years ago)
Author:
mkommend
Message:

#2038: Merged r9553:9555, r9569, r9591:r9592, r9618 into the stable branch.

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs

    r9456 r9673  
    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      // BackwardsCompatibility3.3
     108      #region Backwards compatible code, remove with 3.4
     109      if (!Parameters.ContainsKey("ReevaluateElites")) {
     110        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
     111      }
     112      #endregion
    100113    }
    101114
     
    112125      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions."));
    113126      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
     127      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    114128      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]."));
    115129      Parameters.Add(new LookupParameter<DoubleValue>("CurrentSuccessRatio", "The current success ratio."));
     
    159173      LeftReducer leftReducer = new LeftReducer();
    160174      MergingReducer mergingReducer2 = new MergingReducer();
     175      ConditionalBranch reevaluateElitesBranch = new ConditionalBranch();
     176      UniformSubScopesProcessor uniformSubScopesProcessor7 = new UniformSubScopesProcessor();
     177      Placeholder evaluator4 = new Placeholder();
     178      SubScopesCounter subScopesCounter4 = new SubScopesCounter();
    161179
    162180      selector.Name = "Selector (placeholder)";
     
    253271      worstSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name;
    254272      worstSelector.QualityParameter.ActualName = QualityParameter.Name;
     273
     274      reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites";
     275      reevaluateElitesBranch.Name = "Reevaluate elites ?";
     276
     277      uniformSubScopesProcessor7.Parallel.Value = true;
     278
     279      evaluator4.Name = "Evaluator (placeholder)";
     280      evaluator4.OperatorParameter.ActualName = EvaluatorParameter.Name;
     281
     282      subScopesCounter4.Name = "Increment EvaluatedSolutions";
     283      subScopesCounter4.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    255284      #endregion
    256285
     
    310339      subScopesProcessor3.Successor = mergingReducer2;
    311340      bestSelector.Successor = rightReducer;
    312       rightReducer.Successor = null;
     341      rightReducer.Successor = reevaluateElitesBranch;
     342      reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor7;
     343      uniformSubScopesProcessor7.Operator = evaluator4;
     344      uniformSubScopesProcessor7.Successor = subScopesCounter4;
     345      subScopesCounter4.Successor = null;
     346      reevaluateElitesBranch.FalseBranch = null;
     347      reevaluateElitesBranch.Successor = null;
    313348      worstSelector.Successor = leftReducer;
    314349      leftReducer.Successor = null;
Note: See TracChangeset for help on using the changeset viewer.