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.

File:
1 edited

Legend:

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

    r9456 r9569  
    9494      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
    9595    }
     96    private IFixedValueParameter<BoolValue> ReevaluateElitesParameter {
     97      get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; }
     98    }
    9699    private ValueParameter<MultiAnalyzer> AnalyzerParameter {
    97100      get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
     
    157160      get { return ElitesParameter.Value; }
    158161      set { ElitesParameter.Value = value; }
     162    }
     163    public bool ReevaluteElites {
     164      get { return ReevaluateElitesParameter.Value.Value; }
     165      set { ReevaluateElitesParameter.Value.Value = value; }
    159166    }
    160167    public MultiAnalyzer Analyzer {
     
    192199    private RAPGA(bool deserializing) : base(deserializing) { }
    193200    [StorableHook(HookType.AfterDeserialization)]
    194     private void AfterDeserialization() { Initialize(); }
     201    private void AfterDeserialization() {
     202      if (!Parameters.ContainsKey("ReevaluateElites")) {
     203        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 });
     204      }
     205      Initialize();
     206    }
    195207    private RAPGA(RAPGA original, Cloner cloner)
    196208      : base(original, cloner) {
     
    216228      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
    217229      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
     230      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 });
    218231      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
    219232      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000)));
     
    248261      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
    249262      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
     263      mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
    250264      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
    251265      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
Note: See TracChangeset for help on using the changeset viewer.