Changeset 9591


Ignore:
Timestamp:
06/05/13 15:28:06 (6 years ago)
Author:
mkommend
Message:

#2038: Added backwards compatibility regions into the modified algorithms for elites reevaluation.

Location:
trunk/sources
Files:
12 edited

Legend:

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

    r9569 r9591  
    111111      : base() {
    112112      Initialize();
     113    }
     114
     115    [StorableHook(HookType.AfterDeserialization)]
     116    private void AfterDeserialization() {
     117      #region Backwards compatible code, remove with 3.4
     118      if (!Parameters.ContainsKey("ReevaluateElites")) {
     119        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
     120      }
     121      #endregion
    113122    }
    114123
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs

    r9554 r9591  
    216216    [StorableHook(HookType.AfterDeserialization)]
    217217    private void AfterDeserialization() {
     218      #region Backwards compatible code, remove with 3.4
    218219      if (!Parameters.ContainsKey("ReevaluateElites")) {
    219220        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 });
    220221      }
     222      #endregion
     223
    221224      Initialize();
    222225    }
     226
     227
    223228
    224229    private GeneticAlgorithm(GeneticAlgorithm original, Cloner cloner)
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs

    r9555 r9591  
    245245    [StorableHook(HookType.AfterDeserialization)]
    246246    private void AfterDeserialization() {
     247      #region Backwards compatible code, remove with 3.4
    247248      if (!Parameters.ContainsKey("ReevaluateElites")) {
    248249        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    249250      }
     251      #endregion
    250252    }
    251253
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs

    r9569 r9591  
    206206    [StorableHook(HookType.AfterDeserialization)]
    207207    private void AfterDeserialization() {
     208      #region Backwards compatible code, remove with 3.4
    208209      if (!Parameters.ContainsKey("ReevaluateElites")) {
    209210        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 });
    210211      }
     212      #endregion
     213
    211214      Initialize();
    212215    }
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs

    r9569 r9591  
    381381    [StorableHook(HookType.AfterDeserialization)]
    382382    private void AfterDeserialization() {
     383      #region Backwards compatible code, remove with 3.4
    383384      if (!Parameters.ContainsKey("ReevaluateElites")) {
    384385        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    385386      }
     387      #endregion
    386388    }
    387389
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs

    r9569 r9591  
    421421    [StorableHook(HookType.AfterDeserialization)]
    422422    private void AfterDeserialization() {
     423      #region Backwards compatible code, remove with 3.4
    423424      if (!Parameters.ContainsKey("ReevaluateElites")) {
    424425        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    425426      }
     427      #endregion
    426428    }
    427429
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs

    r9569 r9591  
    113113    [StorableHook(HookType.AfterDeserialization)]
    114114    private void AfterDeserialization() {
     115      #region Backwards compatible code, remove with 3.4
    115116      if (!Parameters.ContainsKey("ReevaluateElites")) {
    116117        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    117118      }
     119      #endregion
    118120    }
    119121
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs

    r9569 r9591  
    105105    [StorableHook(HookType.AfterDeserialization)]
    106106    private void AfterDeserialization() {
     107      #region Backwards compatible code, remove with 3.4
    107108      if (!Parameters.ContainsKey("ReevaluateElites")) {
    108109        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    109110      }
     111      #endregion
    110112    }
    111113
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs

    r9569 r9591  
    431431    [StorableHook(HookType.AfterDeserialization)]
    432432    private void AfterDeserialization() {
     433      #region Backwards compatible code, remove with 3.4
    433434      if (!Parameters.ContainsKey("ReevaluateElites")) {
    434435        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    435436      }
     437      #endregion
    436438    }
    437439
  • trunk/sources/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs

    r9569 r9591  
    200200    [StorableHook(HookType.AfterDeserialization)]
    201201    private void AfterDeserialization() {
     202      #region Backwards compatible code, remove with 3.4
    202203      if (!Parameters.ContainsKey("ReevaluateElites")) {
    203204        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 });
    204205      }
     206      #endregion
    205207      Initialize();
    206208    }
  • trunk/sources/HeuristicLab.Algorithms.RAPGA/3.3/RAPGAMainLoop.cs

    r9569 r9591  
    119119    public override IDeepCloneable Clone(Cloner cloner) {
    120120      return new RAPGAMainLoop(this, cloner);
     121    }
     122
     123    [StorableHook(HookType.AfterDeserialization)]
     124    private void AfterDeserialization() {
     125      #region Backwards compatible code, remove with 3.4
     126      if (!Parameters.ContainsKey("ReevaluateElites")) {
     127        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
     128      }
     129      #endregion
    121130    }
    122131
Note: See TracChangeset for help on using the changeset viewer.