Changeset 4722 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.3/CrossValidation.cs
r4617 r4722 72 72 } 73 73 74 private CrossValidation(CrossValidation original, Cloner cloner) 75 : base(original, cloner) { 76 executionState = original.executionState; 77 storeAlgorithmInEachRun = original.storeAlgorithmInEachRun; 78 runs = cloner.Clone(original.runs); 79 runsCounter = original.runsCounter; 80 algorithm = cloner.Clone(original.algorithm); 81 clonedAlgorithms = cloner.Clone(original.clonedAlgorithms); 82 folds = cloner.Clone(original.folds); 83 numberOfWorkers = cloner.Clone(original.numberOfWorkers); 84 samplesStart = cloner.Clone(original.samplesStart); 85 samplesEnd = cloner.Clone(original.samplesEnd); 86 RegisterEvents(); 87 } 74 88 public override IDeepCloneable Clone(Cloner cloner) { 75 CrossValidation clone = (CrossValidation)base.Clone(cloner); 76 clone.executionState = executionState; 77 clone.storeAlgorithmInEachRun = storeAlgorithmInEachRun; 78 clone.runs = (RunCollection)cloner.Clone(runs); 79 clone.runsCounter = runsCounter; 80 clone.algorithm = (IAlgorithm)cloner.Clone(algorithm); 81 clone.clonedAlgorithms = (ItemCollection<IAlgorithm>)cloner.Clone(clonedAlgorithms); 82 clone.folds = (IntValue)cloner.Clone(folds); 83 clone.numberOfWorkers = (IntValue)cloner.Clone(numberOfWorkers); 84 clone.samplesStart = (IntValue)cloner.Clone(samplesStart); 85 clone.samplesEnd = (IntValue)cloner.Clone(samplesEnd); 86 clone.RegisterEvents(); 87 return clone; 88 } 89 return new CrossValidation(this, cloner); 90 } 91 89 92 #endregion 90 93 -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.3/LinearRegression.cs
r4437 r4722 99 99 [StorableConstructor] 100 100 private LinearRegression(bool deserializing) : base(deserializing) { } 101 [StorableHook(HookType.AfterDeserialization)] 102 private void AfterDeserialization() { 103 Initialize(); 104 } 101 105 106 private LinearRegression(LinearRegression original, Cloner cloner) 107 : base(original, cloner) { 108 solutionCreator = cloner.Clone(original.solutionCreator); 109 evaluator = cloner.Clone(original.evaluator); 110 mseEvaluator = cloner.Clone(original.mseEvaluator); 111 analyzer = cloner.Clone(original.analyzer); 112 Initialize(); 113 } 102 114 public override IDeepCloneable Clone(Cloner cloner) { 103 LinearRegression clone = (LinearRegression)base.Clone(cloner); 104 clone.solutionCreator = (LinearRegressionSolutionCreator)cloner.Clone(solutionCreator); 105 clone.evaluator = (SimpleSymbolicRegressionEvaluator)cloner.Clone(evaluator); 106 clone.mseEvaluator = (SimpleMSEEvaluator)cloner.Clone(mseEvaluator); 107 clone.analyzer = (BestSymbolicRegressionSolutionAnalyzer)cloner.Clone(analyzer); 108 clone.Initialize(); 109 return clone; 115 return new LinearRegression(this, cloner); 110 116 } 111 117 … … 133 139 134 140 #region Helpers 135 [StorableHook(HookType.AfterDeserialization)]136 141 private void Initialize() { 137 142 solutionCreator.SamplesStartParameter.ActualName = TrainingSamplesStartParameter.Name; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.3/SupportVectorMachine.cs
r4437 r4722 145 145 [StorableConstructor] 146 146 private SupportVectorMachine(bool deserializing) : base(deserializing) { } 147 147 [StorableHook(HookType.AfterDeserialization)] 148 private void AfterDeserialization() { 149 Initialize(); 150 } 151 152 private SupportVectorMachine(SupportVectorMachine original, Cloner cloner) 153 : base(original, cloner) { 154 solutionCreator = cloner.Clone(original.solutionCreator); 155 evaluator = cloner.Clone(original.evaluator); 156 mseEvaluator = cloner.Clone(original.mseEvaluator); 157 analyzer = cloner.Clone(original.analyzer); 158 Initialize(); 159 } 148 160 public override IDeepCloneable Clone(Cloner cloner) { 149 SupportVectorMachine clone = (SupportVectorMachine)base.Clone(cloner); 150 clone.solutionCreator = (SupportVectorMachineModelCreator)cloner.Clone(solutionCreator); 151 clone.evaluator = (SupportVectorMachineModelEvaluator)cloner.Clone(evaluator); 152 clone.mseEvaluator = (SimpleMSEEvaluator)cloner.Clone(mseEvaluator); 153 clone.analyzer = (BestSupportVectorRegressionSolutionAnalyzer)cloner.Clone(analyzer); 154 clone.Initialize(); 155 return clone; 161 return new SupportVectorMachine(this, cloner); 156 162 } 157 163 … … 178 184 179 185 #region Helpers 180 [StorableHook(HookType.AfterDeserialization)]181 186 private void Initialize() { 182 187 solutionCreator.SvmTypeParameter.ActualName = SvmTypeParameter.Name;
Note: See TracChangeset
for help on using the changeset viewer.