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.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs

    r8085 r8206  
    4949    [StorableConstructor]
    5050    protected SymbolicClassificationMultiObjectiveProblem(bool deserializing) : base(deserializing) { }
    51     protected SymbolicClassificationMultiObjectiveProblem(SymbolicClassificationMultiObjectiveProblem original, Cloner cloner) : base(original, cloner) { }
     51    protected SymbolicClassificationMultiObjectiveProblem(SymbolicClassificationMultiObjectiveProblem original, Cloner cloner)
     52      : base(original, cloner) {
     53      RegisterEventHandlers();
     54    }
    5255    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicClassificationMultiObjectiveProblem(this, cloner); }
    5356
     
    6265      MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
    6366
    64       SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
    6567
     68      RegisterEventHandlers();
    6669      ConfigureGrammarSymbols();
    6770      InitializeOperators();
    6871      UpdateEstimationLimits();
     72    }
     73
     74    [StorableHook(HookType.AfterDeserialization)]
     75    private void AfterDeserialization() {
     76      RegisterEventHandlers();
     77    }
     78
     79    private void RegisterEventHandlers() {
     80      SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
    6981    }
    7082
     
    8193
    8294    private void UpdateEstimationLimits() {
    83       if (ProblemData.TrainingIndizes.Any()) {
    84         var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList();
     95      if (ProblemData.TrainingIndices.Any()) {
     96        var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).ToList();
    8597        var mean = targetValues.Average();
    8698        var range = targetValues.Max() - targetValues.Min();
Note: See TracChangeset for help on using the changeset viewer.