Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/02/12 10:13:16 (12 years ago)
Author:
mkommend
Message:

#1810: Corrected event registration for grammar configuration and updated samples.

File:
1 edited

Legend:

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

    r8139 r8175  
    4949    [StorableConstructor]
    5050    protected SymbolicRegressionSingleObjectiveProblem(bool deserializing) : base(deserializing) { }
    51     protected SymbolicRegressionSingleObjectiveProblem(SymbolicRegressionSingleObjectiveProblem original, Cloner cloner) : base(original, cloner) { }
     51    protected SymbolicRegressionSingleObjectiveProblem(SymbolicRegressionSingleObjectiveProblem original, Cloner cloner)
     52      : base(original, cloner) {
     53      RegisterEventHandlers();
     54    }
    5255    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionSingleObjectiveProblem(this, cloner); }
    5356
     
    6265      MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
    6366
    64       SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
    65 
     67      RegisterEventHandlers();
    6668      ConfigureGrammarSymbols();
    6769      InitializeOperators();
     
    7173    [StorableHook(HookType.AfterDeserialization)]
    7274    private void AfterDeserialization() {
     75      RegisterEventHandlers();
    7376      // compatibility
    7477      bool changed = false;
     
    8487        ParameterizeOperators();
    8588      }
     89    }
     90
     91    private void RegisterEventHandlers() {
     92      SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
    8693    }
    8794
Note: See TracChangeset for help on using the changeset viewer.