Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/22/10 08:53:04 (14 years ago)
Author:
gkronber
Message:

Bug fixes in cloning and persistence code. #938

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs

    r3462 r3485  
    3636  [StorableClass]
    3737  public sealed class SymbolicRegressionSolution : DataAnalysisSolution {
     38    [Storable]
    3839    private SymbolicRegressionModel model;
    3940    public SymbolicRegressionModel Model {
     
    5253      : base(problemData) {
    5354      this.model = model;
    54       RecalculateEstimatedValues();
    5555    }
    5656
     
    7575    public override IEnumerable<double> EstimatedValues {
    7676      get {
     77        if (estimatedValues == null) RecalculateEstimatedValues();
    7778        return estimatedValues.AsEnumerable();
    7879      }
     
    8182    public override IEnumerable<double> EstimatedTrainingValues {
    8283      get {
     84        if (estimatedValues == null) RecalculateEstimatedValues();
    8385        int start = ProblemData.TrainingSamplesStart.Value;
    8486        int n = ProblemData.TrainingSamplesEnd.Value - start;
     
    8991    public override IEnumerable<double> EstimatedTestValues {
    9092      get {
     93        if (estimatedValues == null) RecalculateEstimatedValues();
    9194        int start = ProblemData.TestSamplesStart.Value;
    9295        int n = ProblemData.TestSamplesEnd.Value - start;
     
    9497      }
    9598    }
     99
     100    public override IDeepCloneable Clone(Cloner cloner) {
     101      SymbolicRegressionSolution clone = (SymbolicRegressionSolution)base.Clone(cloner);
     102      clone.model = (SymbolicRegressionModel)model.Clone(cloner);
     103      return clone;
     104    }
    96105  }
    97106}
Note: See TracChangeset for help on using the changeset viewer.