Changeset 4666
- Timestamp:
- 10/29/10 17:05:34 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.3/CrossValidation.cs
r4617 r4666 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 -
branches/CloningRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.3/LinearRegression.cs
r4437 r4666 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; -
branches/CloningRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.3/SupportVectorMachine.cs
r4437 r4666 145 145 [StorableConstructor] 146 146 private SupportVectorMachine(bool deserializing) : base(deserializing) { } 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 } 160 public override IDeepCloneable Clone(Cloner cloner) { 161 return new SupportVectorMachine(this, cloner); 162 } 147 163 148 164 public override IDeepCloneable Clone(Cloner cloner) { 149 165 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(); 166 155 167 return clone; 156 168 } … … 178 190 179 191 #region Helpers 180 [StorableHook(HookType.AfterDeserialization)]181 192 private void Initialize() { 182 193 solutionCreator.SvmTypeParameter.ActualName = SvmTypeParameter.Name;
Note: See TracChangeset
for help on using the changeset viewer.