Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/12/13 15:02:47 (11 years ago)
Author:
ascheibe
Message:

#2030 merged trunk into hive performance branch

Location:
branches/HivePerformance/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HivePerformance/sources

  • branches/HivePerformance/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3/EvolutionStrategyMainLoop.cs

    r9539 r9616  
    6161      get { return (ValueLookupParameter<BoolValue>)Parameters["PlusSelection"]; }
    6262    }
     63    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
     64      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
     65    }
    6366    public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
    6467      get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
     
    108111      : base() {
    109112      Initialize();
     113    }
     114
     115    [StorableHook(HookType.AfterDeserialization)]
     116    private void AfterDeserialization() {
     117      // BackwardsCompatibility3.3
     118      #region Backwards compatible code, remove with 3.4
     119      if (!Parameters.ContainsKey("ReevaluateElites")) {
     120        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
     121      }
     122      #endregion
    110123    }
    111124
     
    121134      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
    122135      Parameters.Add(new ValueLookupParameter<BoolValue>("PlusSelection", "True for plus selection (elitist population), false for comma selection (non-elitist population)."));
     136      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    123137      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
    124138      Parameters.Add(new ValueLookupParameter<IOperator>("Recombinator", "The operator used to cross solutions."));
     
    162176      Placeholder analyzer2 = new Placeholder();
    163177      ConditionalBranch conditionalBranch = new ConditionalBranch();
     178      ConditionalBranch reevaluateElitesBranch = new ConditionalBranch();
     179      SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
     180      UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor();
     181      Placeholder evaluator2 = new Placeholder();
     182      SubScopesCounter subScopesCounter2 = new SubScopesCounter();
     183
    164184
    165185      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class EvolutionStrategy expects this to be called Generations
     
    235255
    236256      conditionalBranch.ConditionParameter.ActualName = "Terminate";
     257
     258      reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites";
     259      reevaluateElitesBranch.Name = "Reevaluate elites ?";
     260
     261      uniformSubScopesProcessor4.Parallel.Value = true;
     262
     263      evaluator2.Name = "Evaluator (placeholder)";
     264      evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name;
     265
     266      subScopesCounter2.Name = "Increment EvaluatedSolutions";
     267      subScopesCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    237268      #endregion
    238269
     
    266297      evaluator.Successor = null;
    267298      subScopesCounter.Successor = null;
    268       plusOrCommaReplacementBranch.TrueBranch = plusReplacement;
     299
     300      plusOrCommaReplacementBranch.TrueBranch = reevaluateElitesBranch;
     301      reevaluateElitesBranch.TrueBranch = subScopesProcessor2;
     302      reevaluateElitesBranch.FalseBranch = null;
     303      subScopesProcessor2.Operators.Add(uniformSubScopesProcessor4);
     304      subScopesProcessor2.Operators.Add(new EmptyOperator());
     305      uniformSubScopesProcessor4.Operator = evaluator2;
     306      uniformSubScopesProcessor4.Successor = subScopesCounter2;
     307      subScopesCounter2.Successor = null;
     308      reevaluateElitesBranch.Successor = plusReplacement;
     309
    269310      plusOrCommaReplacementBranch.FalseBranch = commaReplacement;
    270311      plusOrCommaReplacementBranch.Successor = bestSelector;
Note: See TracChangeset for help on using the changeset viewer.