Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8130


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.

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs

    r7823 r8130  
    6767    }
    6868
     69    [StorableHook(HookType.AfterDeserialization)]
     70    private void AfterDeserialization() {
     71      // compatibility
     72      bool changed = false;
     73      if (!Operators.OfType<SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer>().Any()) {
     74        Operators.Add(new SymbolicClassificationSingleObjectiveTrainingParetoBestSolutionAnalyzer());
     75        changed = true;
     76      }
     77      if (!Operators.OfType<SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer>().Any()) {
     78        Operators.Add(new SymbolicClassificationSingleObjectiveValidationParetoBestSolutionAnalyzer());
     79        changed = true;
     80      }
     81      if (changed) ParameterizeOperators();
     82    }
     83
    6984    private void ConfigureGrammarSymbols() {
    7085      var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
  • 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.