Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/25/13 13:39:13 (11 years ago)
Author:
mkommend
Message:

#1997: Merged trunk changes in data analysis island GA branch.

Location:
branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm

  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r8121 r9756  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    100100      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
    101101    }
     102    private IFixedValueParameter<BoolValue> ReevaluateElitesParameter {
     103      get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; }
     104    }
    102105    private ValueLookupParameter<DoubleValue> SuccessRatioParameter {
    103106      get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
     
    192195      get { return ElitesParameter.Value; }
    193196      set { ElitesParameter.Value = value; }
     197    }
     198    public bool ReevaluteElites {
     199      get { return ReevaluateElitesParameter.Value.Value; }
     200      set { ReevaluateElitesParameter.Value.Value = value; }
    194201    }
    195202    private DoubleValue SuccessRatio {
     
    257264    [StorableHook(HookType.AfterDeserialization)]
    258265    private void AfterDeserialization() {
    259       #region Backwards Compatibility
     266      // BackwardsCompatibility3.3
     267      #region Backwards compatible code, remove with 3.4
    260268      if (successfulOffspringAnalyzer == null)
    261269        successfulOffspringAnalyzer = new SuccessfulOffspringAnalyzer();
     270      if (!Parameters.ContainsKey("ReevaluateElites")) {
     271        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", (BoolValue)new BoolValue(false).AsReadOnly()) { Hidden = true });
     272      }
    262273      #endregion
    263274
     
    293304      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
    294305      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
     306      Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true });
    295307      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.", new DoubleValue(1)));
    296308      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start).", new DoubleValue(0)));
     
    355367      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
    356368      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
     369      mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
    357370      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
    358371      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
Note: See TracChangeset for help on using the changeset viewer.