Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/26/12 15:55:07 (12 years ago)
Author:
gkronber
Message:

#1823 added AfterDeserialization hook to add the new analyzers when loading old problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r7823 r8130  
    6969    }
    7070
     71    [StorableHook(HookType.AfterDeserialization)]
     72    private void AfterDeserialization() {
     73      // compatibility
     74      bool changed = false;
     75      if (!Operators.OfType<SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer>().Any()) {
     76        Operators.Add(new SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer());
     77        changed = true;
     78      }
     79      if (!Operators.OfType<SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer>().Any()) {
     80        Operators.Add(new SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer());
     81        changed = true;
     82      }
     83      if (changed) {
     84        ParameterizeOperators();
     85      }
     86    }
     87
    7188    private void ConfigureGrammarSymbols() {
    7289      var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
Note: See TracChangeset for help on using the changeset viewer.