Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/19/18 13:35:52 (6 years ago)
Author:
mkommend
Message:

#2955: Used IsProblemDataCompatible and IsDatasetCompatible instead of now obselete AdjustProblemDataProperties when exchanging the problem data of data analysis solutions.

Location:
trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r15583 r16244  
    161161      OnChanged();
    162162    }
    163 
    164     protected override bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
    165       if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
    166       IRegressionProblemData regressionProblemData = problemData as IRegressionProblemData;
    167       if (regressionProblemData == null)
    168         throw new ArgumentException("The problem data is not a regression problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
    169 
    170       var returnValue = base.IsProblemDataCompatible(problemData, out errorMessage);
    171       return returnValue;
    172     }
    173 
    174     public override void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
    175       if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
    176       RegressionProblemData regressionProblemData = problemData as RegressionProblemData;
    177       if (regressionProblemData == null)
    178         throw new ArgumentException("The problem data is not a regression problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
    179 
    180       base.AdjustProblemDataProperties(problemData);
    181     }
    182163  }
    183164}
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs

    r15583 r16244  
    7070    public new IRegressionProblemData ProblemData {
    7171      get { return (IRegressionProblemData)base.ProblemData; }
    72       set { base.ProblemData = value; }
     72      set {
     73        if (value == null) throw new ArgumentNullException("The problemData must not be null.");
     74        string errorMessage = string.Empty;
     75        if (!Model.IsProblemDataCompatible(value, out errorMessage)) throw new ArgumentException(errorMessage);
     76
     77        base.ProblemData = value;
     78      }
    7379    }
    7480
Note: See TracChangeset for help on using the changeset viewer.