Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (14 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs

    r4468 r4722  
    2222using System.Linq;
    2323using HeuristicLab.Analysis;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
     
    6768    #endregion
    6869
     70    [StorableConstructor]
     71    private BestSymbolicRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     72    private BestSymbolicRegressionSolutionAnalyzer(BestSymbolicRegressionSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
    6973    public BestSymbolicRegressionSolutionAnalyzer()
    7074      : base() {
     
    7579    }
    7680
     81    public override IDeepCloneable Clone(Cloner cloner) {
     82      return new BestSymbolicRegressionSolutionAnalyzer(this, cloner);
     83    }
     84
    7785    [StorableHook(HookType.AfterDeserialization)]
    78     private void Initialize() {
     86    private void AfterDeserialization() {
    7987      if (!Parameters.ContainsKey(VariableFrequenciesParameterName)) {
    8088        Parameters.Add(new LookupParameter<DataTable>(VariableFrequenciesParameterName, "The variable frequencies table to use for the calculation of variable impacts"));
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs

    r4468 r4722  
    2323using System.Linq;
    2424using HeuristicLab.Analysis;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    2627using HeuristicLab.Data;
     
    165166    #endregion
    166167
     168    [StorableConstructor]
     169    private FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     170    private FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer(FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
    167171    public FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer()
    168172      : base() {
     
    186190    }
    187191
    188     [StorableConstructor]
    189     private FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer(bool deserializing) : base() { }
     192    public override IDeepCloneable Clone(Cloner cloner) {
     193      return new FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer(this, cloner);
     194    }
    190195
    191196    [StorableHook(HookType.AfterDeserialization)]
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityAnalyzer.cs

    r4468 r4722  
    2424using System.Linq;
    2525using HeuristicLab.Analysis;
     26using HeuristicLab.Common;
    2627using HeuristicLab.Core;
    2728using HeuristicLab.Data;
     
    118119    #endregion
    119120
     121    [StorableConstructor]
     122    private SymbolicRegressionModelQualityAnalyzer(bool deserializing) : base(deserializing) { }
     123    private SymbolicRegressionModelQualityAnalyzer(SymbolicRegressionModelQualityAnalyzer original, Cloner cloner) : base(original, cloner) { }
    120124    public SymbolicRegressionModelQualityAnalyzer()
    121125      : base() {
     
    131135    }
    132136
    133     [StorableConstructor]
    134     private SymbolicRegressionModelQualityAnalyzer(bool deserializing) : base() { }
     137    public override IDeepCloneable Clone(Cloner cloner) {
     138      return new SymbolicRegressionModelQualityAnalyzer(this, cloner);
     139    }
    135140
    136141    public override IOperation Apply() {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityCalculator.cs

    r4468 r4722  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    8384    #endregion
    8485
     86    [StorableConstructor]
     87    private SymbolicRegressionModelQualityCalculator(bool deserializing) : base(deserializing) { }
     88    private SymbolicRegressionModelQualityCalculator(SymbolicRegressionModelQualityCalculator original, Cloner cloner) : base(original, cloner) { }
    8589    public SymbolicRegressionModelQualityCalculator()
    8690      : base() {
     
    138142
    139143    }
     144    public override IDeepCloneable Clone(Cloner cloner) {
     145      return new SymbolicRegressionModelQualityCalculator(this, cloner);
     146    }
    140147  }
    141148}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionSolutionLinearScaler.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    5354    }
    5455
     56    [StorableConstructor]
     57    private SymbolicRegressionSolutionLinearScaler(bool deserializing) : base(deserializing) { }
     58    private SymbolicRegressionSolutionLinearScaler(SymbolicRegressionSolutionLinearScaler original, Cloner cloner) : base(original, cloner) { }
    5559    public SymbolicRegressionSolutionLinearScaler()
    5660      : base() {
     
    5963      Parameters.Add(new LookupParameter<DoubleValue>(AlphaParameterName, "Alpha parameter for linear transformation."));
    6064      Parameters.Add(new LookupParameter<DoubleValue>(BetaParameterName, "Beta parameter for linear transformation."));
     65    }
     66
     67    public override IDeepCloneable Clone(Cloner cloner) {
     68      return new SymbolicRegressionSolutionLinearScaler(this, cloner);
    6169    }
    6270
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionTournamentPruning.cs

    r4468 r4722  
    2222using System.Collections.Generic;
    2323using System.Linq;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
     
    3334
    3435namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
    35   public class SymbolicRegressionTournamentPruning : SingleSuccessorOperator, ISymbolicRegressionAnalyzer {
     36  public sealed class SymbolicRegressionTournamentPruning : SingleSuccessorOperator, ISymbolicRegressionAnalyzer {
    3637    private const string RandomParameterName = "Random";
    3738    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
     
    176177    }
    177178    #endregion
    178     protected SymbolicRegressionTournamentPruning(bool deserializing) : base(deserializing) { }
     179
     180    [StorableConstructor]
     181    private SymbolicRegressionTournamentPruning(bool deserializing) : base(deserializing) { }
     182    private SymbolicRegressionTournamentPruning(SymbolicRegressionTournamentPruning original, Cloner cloner) : base(original, cloner) { }
    179183    public SymbolicRegressionTournamentPruning()
    180184      : base() {
     
    201205    }
    202206
     207    public override IDeepCloneable Clone(Cloner cloner) {
     208      return new SymbolicRegressionTournamentPruning(this, cloner);
     209    }
     210
    203211    [StorableHook(HookType.AfterDeserialization)]
    204212    private void AfterDeserialization() {
     
    241249      double lowerEstimationLimit, double upperEstimationLimit,
    242250      double maxPruningRatio, double qualityGainWeight) {
    243         IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart)
    244           .Where(i => i < problemData.TestSamplesStart.Value || problemData.TestSamplesEnd.Value <= i);
     251      IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart)
     252        .Where(i => i < problemData.TestSamplesStart.Value || problemData.TestSamplesEnd.Value <= i);
    245253      int originalSize = tree.Size;
    246254      double originalQuality = evaluator.Evaluate(interpreter, tree,
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionVariableFrequencyAnalyzer.cs

    r4068 r4722  
    2222using System.Linq;
    2323using HeuristicLab.Analysis;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     
    6061    #endregion
    6162
     63    [StorableConstructor]
     64    private SymbolicRegressionVariableFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
     65    private SymbolicRegressionVariableFrequencyAnalyzer(SymbolicRegressionVariableFrequencyAnalyzer original, Cloner cloner) : base(original, cloner) { }
    6266    public SymbolicRegressionVariableFrequencyAnalyzer()
    6367      : base() {
     
    6670      Parameters.Add(new ValueLookupParameter<DataTable>(VariableFrequenciesParameterName, "The data table to store the variable frequencies."));
    6771      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored."));
     72    }
     73
     74    public override IDeepCloneable Clone(Cloner cloner) {
     75      return new SymbolicRegressionVariableFrequencyAnalyzer(this, cloner);
    6876    }
    6977
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs

    r4468 r4722  
    135135    private ResultsCollector resultsCollector;
    136136
     137    [StorableConstructor]
     138    private ValidationBestScaledSymbolicRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     139    private ValidationBestScaledSymbolicRegressionSolutionAnalyzer(ValidationBestScaledSymbolicRegressionSolutionAnalyzer original, Cloner cloner)
     140      : base(original, cloner) {
     141      Initialize();
     142    }
    137143    public ValidationBestScaledSymbolicRegressionSolutionAnalyzer()
    138144      : base() {
     
    249255    }
    250256
    251     [StorableConstructor]
    252     private ValidationBestScaledSymbolicRegressionSolutionAnalyzer(bool deserializing) : base() { }
     257    public override IDeepCloneable Clone(Cloner cloner) {
     258      return new ValidationBestScaledSymbolicRegressionSolutionAnalyzer(this, cloner);
     259    }
    253260
    254261    [StorableHook(HookType.AfterDeserialization)]
     262    private void AfterDeserialization() {
     263      Initialize();
     264    }
    255265    private void Initialize() {
    256266      SymbolicExpressionTreeParameter.DepthChanged += new EventHandler(SymbolicExpressionTreeParameter_DepthChanged);
    257267    }
    258268
    259     public override IDeepCloneable Clone(Cloner cloner) {
    260       ValidationBestScaledSymbolicRegressionSolutionAnalyzer clone = (ValidationBestScaledSymbolicRegressionSolutionAnalyzer)base.Clone(cloner);
    261       clone.Initialize();
    262       return clone;
    263     }
    264269
    265270    private void SymbolicExpressionTreeParameter_DepthChanged(object sender, EventArgs e) {
Note: See TracChangeset for help on using the changeset viewer.