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:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HivePerformance/sources

  • branches/HivePerformance/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs

    r9539 r9616  
    9191    public ValueLookupParameter<IntValue> ElitesParameter {
    9292      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
     93    }
     94    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
     95      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
    9396    }
    9497    public ValueLookupParameter<ResultCollection> ResultsParameter {
     
    144147      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions."));
    145148      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
     149      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    146150      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results."));
    147151      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to the analyze the islands."));
     
    194198      Placeholder analyzer2 = new Placeholder();
    195199      ConditionalBranch generationsTerminationCondition = new ConditionalBranch();
     200      ConditionalBranch reevaluateElitesBranch = new ConditionalBranch();
    196201
    197202
     
    305310      generationsTerminationCondition.Name = "Terminate?";
    306311      generationsTerminationCondition.ConditionParameter.ActualName = "TerminateGenerations";
     312
     313      reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites";
     314      reevaluateElitesBranch.Name = "Reevaluate elites ?";
    307315      #endregion
    308316
     
    345353      evaluator.Successor = null;
    346354      subScopesCounter.Successor = null;
    347       subScopesCounter.Successor = null;
    348355      subScopesProcessor2.Operators.Add(bestSelector);
    349356      subScopesProcessor2.Operators.Add(new EmptyOperator());
     
    351358      mergingReducer.Successor = islandAnalyzer2;
    352359      bestSelector.Successor = rightReducer;
    353       rightReducer.Successor = null;
     360      rightReducer.Successor = reevaluateElitesBranch;
     361      reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor3;
     362      reevaluateElitesBranch.FalseBranch = null;
     363      reevaluateElitesBranch.Successor = null;
    354364      islandAnalyzer2.Successor = islandGenerationsCounter;
    355365      islandGenerationsCounter.Successor = checkIslandGenerationsReachedMaximum;
     
    369379    }
    370380
     381    [StorableHook(HookType.AfterDeserialization)]
     382    private void AfterDeserialization() {
     383      // BackwardsCompatibility3.3
     384      #region Backwards compatible code, remove with 3.4
     385      if (!Parameters.ContainsKey("ReevaluateElites")) {
     386        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
     387      }
     388      #endregion
     389    }
     390
    371391    public override IOperation Apply() {
    372392      if (CrossoverParameter.ActualValue == null)
Note: See TracChangeset for help on using the changeset viewer.