Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/12 16:46:35 (12 years ago)
Author:
gkronber
Message:

#1847: merged r8084:8205 from trunk into GP move operators branch

Location:
branches/GP-MoveOperators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-MoveOperators

  • branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs

    r8085 r8206  
    5353    [StorableConstructor]
    5454    protected SymbolicRegressionMultiObjectiveProblem(bool deserializing) : base(deserializing) { }
    55     protected SymbolicRegressionMultiObjectiveProblem(SymbolicRegressionMultiObjectiveProblem original, Cloner cloner) : base(original, cloner) { }
     55    protected SymbolicRegressionMultiObjectiveProblem(SymbolicRegressionMultiObjectiveProblem original, Cloner cloner)
     56      : base(original, cloner) {
     57      RegisterEventHandlers();
     58    }
    5659    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionMultiObjectiveProblem(this, cloner); }
    5760
     
    6669      MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
    6770
    68       SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
    69 
     71      RegisterEventHandlers();
    7072      ConfigureGrammarSymbols();
    7173      InitializeOperators();
    7274      UpdateEstimationLimits();
     75    }
     76
     77    [StorableHook(HookType.AfterDeserialization)]
     78    private void AfterDeserialization() {
     79      RegisterEventHandlers();
     80    }
     81
     82    private void RegisterEventHandlers() {
     83      SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
    7384    }
    7485
     
    8596
    8697    private void UpdateEstimationLimits() {
    87       if (ProblemData.TrainingIndizes.Any()) {
    88         var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList();
     98      if (ProblemData.TrainingIndices.Any()) {
     99        var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).ToList();
    89100        var mean = targetValues.Average();
    90101        var range = targetValues.Max() - targetValues.Min();
Note: See TracChangeset for help on using the changeset viewer.