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.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;
Note: See TracChangeset for help on using the changeset viewer.