Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/13/16 19:47:41 (8 years ago)
Author:
gkronber
Message:

#2650 Merged r14282:14322 from trunk to branch (fixing conflicts)

Location:
branches/symbreg-factors-2650
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650

  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis

  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionModel.cs

    r13992 r14330  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using HeuristicLab.Common;
     
    3334    public string TargetVariable {
    3435      get { return targetVariable; }
    35       protected set { targetVariable = value; }
     36      set {
     37        if (string.IsNullOrEmpty(value) || targetVariable == value) return;
     38        targetVariable = value;
     39        OnTargetVariableChanged(this, EventArgs.Empty);
     40      }
    3641    }
    3742
    38     protected RegressionModel(bool deserializing) : base(deserializing) { }
     43    protected RegressionModel(bool deserializing)
     44      : base(deserializing) {
     45      targetVariable = string.Empty;
     46    }
    3947
    4048    protected RegressionModel(RegressionModel original, Cloner cloner)
     
    5664    }
    5765
    58     [StorableHook(HookType.AfterDeserialization)]
    59     private void AfterDeserialization() {
    60       // BackwardsCompatibility3.3
    61       #region Backwards compatible code, remove with 3.4
    62       targetVariable = string.Empty;
    63       #endregion
    64     }
    6566    public abstract IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows);
    6667    public abstract IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData);
     68
     69    #region events
     70    public event EventHandler TargetVariableChanged;
     71    private void OnTargetVariableChanged(object sender, EventArgs args) {
     72      var changed = TargetVariableChanged;
     73      if (changed != null)
     74        changed(sender, args);
     75    }
     76    #endregion
    6777  }
    6878}
Note: See TracChangeset for help on using the changeset viewer.