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.

Location:
trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3/EvolutionStrategyMainLoop.cs

    r9456 r9569  
    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"]; }
     
    121124      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
    122125      Parameters.Add(new ValueLookupParameter<BoolValue>("PlusSelection", "True for plus selection (elitist population), false for comma selection (non-elitist population)."));
     126      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    123127      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
    124128      Parameters.Add(new ValueLookupParameter<IOperator>("Recombinator", "The operator used to cross solutions."));
     
    162166      Placeholder analyzer2 = new Placeholder();
    163167      ConditionalBranch conditionalBranch = new ConditionalBranch();
     168      ConditionalBranch reevaluateElitesBranch = new ConditionalBranch();
     169      SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
     170      UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor();
     171      Placeholder evaluator2 = new Placeholder();
     172      SubScopesCounter subScopesCounter2 = new SubScopesCounter();
     173
    164174
    165175      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class EvolutionStrategy expects this to be called Generations
     
    235245
    236246      conditionalBranch.ConditionParameter.ActualName = "Terminate";
     247
     248      reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites";
     249      reevaluateElitesBranch.Name = "Reevaluate elites ?";
     250
     251      uniformSubScopesProcessor4.Parallel.Value = true;
     252
     253      evaluator2.Name = "Evaluator (placeholder)";
     254      evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name;
     255
     256      subScopesCounter2.Name = "Increment EvaluatedSolutions";
     257      subScopesCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    237258      #endregion
    238259
     
    266287      evaluator.Successor = null;
    267288      subScopesCounter.Successor = null;
    268       plusOrCommaReplacementBranch.TrueBranch = plusReplacement;
     289
     290      plusOrCommaReplacementBranch.TrueBranch = reevaluateElitesBranch;
     291      reevaluateElitesBranch.TrueBranch = subScopesProcessor2;
     292      reevaluateElitesBranch.FalseBranch = null;
     293      subScopesProcessor2.Operators.Add(uniformSubScopesProcessor4);
     294      subScopesProcessor2.Operators.Add(new EmptyOperator());
     295      uniformSubScopesProcessor4.Operator = evaluator2;
     296      uniformSubScopesProcessor4.Successor = subScopesCounter2;
     297      subScopesCounter2.Successor = null;
     298      reevaluateElitesBranch.Successor = plusReplacement;
     299
    269300      plusOrCommaReplacementBranch.FalseBranch = commaReplacement;
    270301      plusOrCommaReplacementBranch.Successor = bestSelector;
Note: See TracChangeset for help on using the changeset viewer.