Changeset 4669
- Timestamp:
- 10/29/10 17:43:17 (14 years ago)
- Location:
- branches/CloningRefactoring
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Algorithms.EvolutionStrategy/3.3/EvolutionStrategyMainLoop.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 94 95 95 96 [StorableConstructor] 96 private EvolutionStrategyMainLoop(bool deserializing) : base() { } 97 private EvolutionStrategyMainLoop(bool deserializing) : base(deserializing) { } 98 private EvolutionStrategyMainLoop(EvolutionStrategyMainLoop original, Cloner cloner) 99 : base(original, cloner) { 100 } 101 public override IDeepCloneable Clone(Cloner cloner) { 102 return new EvolutionStrategyMainLoop(this, cloner); 103 } 97 104 public EvolutionStrategyMainLoop() 98 105 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.EvolutionStrategy/3.3/WithoutRepeatingBatchedRandomSelector.cs
r4068 r4669 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 40 41 public IValueLookupParameter<IntValue> ParentsPerChildParameter { 41 42 get { return (IValueLookupParameter<IntValue>)Parameters["ParentsPerChild"]; } 43 } 44 45 [StorableConstructor] 46 protected WithoutRepeatingBatchedRandomSelector(bool deserializing) : base(deserializing) { } 47 protected WithoutRepeatingBatchedRandomSelector(WithoutRepeatingBatchedRandomSelector original, Cloner cloner) 48 : base(original, cloner) { 49 } 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new WithoutRepeatingBatchedRandomSelector(this, cloner); 42 52 } 43 53 -
branches/CloningRefactoring/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs
r4477 r4669 192 192 [StorableConstructor] 193 193 private GeneticAlgorithm(bool deserializing) : base(deserializing) { } 194 194 [StorableHook(HookType.AfterDeserialization)] 195 private void AfterDeserialization() { 196 Initialize(); 197 } 198 199 private GeneticAlgorithm(GeneticAlgorithm original, Cloner cloner) 200 : base(original, cloner) { 201 qualityAnalyzer = cloner.Clone(original.qualityAnalyzer); 202 Initialize(); 203 } 195 204 public override IDeepCloneable Clone(Cloner cloner) { 196 GeneticAlgorithm clone = (GeneticAlgorithm)base.Clone(cloner); 197 clone.qualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(qualityAnalyzer); 198 clone.Initialize(); 199 return clone; 205 return new GeneticAlgorithm(this, cloner); 200 206 } 201 207 … … 265 271 266 272 #region Helpers 267 [StorableHook(HookType.AfterDeserialization)]268 273 private void Initialize() { 269 274 PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged); -
branches/CloningRefactoring/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 82 83 83 84 [StorableConstructor] 84 private GeneticAlgorithmMainLoop(bool deserializing) : base() { } 85 private GeneticAlgorithmMainLoop(bool deserializing) : base(deserializing) { } 86 private GeneticAlgorithmMainLoop(GeneticAlgorithmMainLoop original, Cloner cloner) 87 : base(original, cloner) { 88 } 89 public override IDeepCloneable Clone(Cloner cloner) { 90 return new GeneticAlgorithmMainLoop(this, cloner); 91 } 85 92 public GeneticAlgorithmMainLoop() 86 93 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
r4437 r4669 197 197 [StorableConstructor] 198 198 private IslandGeneticAlgorithm(bool deserializing) : base(deserializing) { } 199 [StorableHook(HookType.AfterDeserialization)] 200 private void AfterDeserialization() { 201 Initialize(); 202 } 203 private IslandGeneticAlgorithm(IslandGeneticAlgorithm original, Cloner cloner) 204 : base(original, cloner) { 205 islandQualityAnalyzer = cloner.Clone(original.islandQualityAnalyzer); 206 qualityAnalyzer = cloner.Clone(original.qualityAnalyzer); 207 Initialize(); 208 } 209 public override IDeepCloneable Clone(Cloner cloner) { 210 return new IslandGeneticAlgorithm(this, cloner); 211 } 212 199 213 public IslandGeneticAlgorithm() 200 214 : base() { … … 282 296 } 283 297 284 public override IDeepCloneable Clone(Cloner cloner) {285 IslandGeneticAlgorithm clone = (IslandGeneticAlgorithm)base.Clone(cloner);286 clone.islandQualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(islandQualityAnalyzer);287 clone.qualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(qualityAnalyzer);288 clone.Initialize();289 return clone;290 }291 292 298 public override void Prepare() { 293 299 if (Problem != null) base.Prepare(); … … 362 368 363 369 #region Helpers 364 [StorableHook(HookType.AfterDeserialization)]365 370 private void Initialize() { 366 371 PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged); -
branches/CloningRefactoring/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 103 104 104 105 [StorableConstructor] 105 private IslandGeneticAlgorithmMainLoop(bool deserializing) : base() { } 106 private IslandGeneticAlgorithmMainLoop(bool deserializing) : base(deserializing) { } 107 private IslandGeneticAlgorithmMainLoop(IslandGeneticAlgorithmMainLoop original, Cloner cloner) 108 : base(original, cloner) { 109 } 110 public override IDeepCloneable Clone(Cloner cloner) { 111 return new IslandGeneticAlgorithmMainLoop(this, cloner); 112 } 106 113 public IslandGeneticAlgorithmMainLoop() 107 114 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs
r4437 r4669 125 125 [StorableConstructor] 126 126 private LocalSearch(bool deserializing) : base(deserializing) { } 127 [StorableHook(HookType.AfterDeserialization)] 128 private void AfterDeserialization() { 129 Initialize(); 130 } 131 private LocalSearch(LocalSearch original, Cloner cloner) 132 : base(original, cloner) { 133 moveQualityAnalyzer = cloner.Clone(original.moveQualityAnalyzer); 134 Initialize(); 135 } 136 public override IDeepCloneable Clone(Cloner cloner) { 137 return new LocalSearch(this, cloner); 138 } 127 139 public LocalSearch() 128 140 : base() { … … 166 178 } 167 179 168 public override IDeepCloneable Clone(Cloner cloner) {169 LocalSearch clone = (LocalSearch)base.Clone(cloner);170 clone.moveQualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(moveQualityAnalyzer);171 clone.Initialize();172 return clone;173 }174 175 180 public override void Prepare() { 176 181 if (Problem != null && MoveGenerator != null && MoveMaker != null && MoveEvaluator != null) … … 256 261 257 262 #region Helpers 258 [StorableHook(HookType.AfterDeserialization)]259 263 private void Initialize() { 260 264 if (Problem != null) { -
branches/CloningRefactoring/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 79 80 80 81 [StorableConstructor] 81 private LocalSearchMainLoop(bool deserializing) : base( ) { }82 private LocalSearchMainLoop(bool deserializing) : base(deserializing) { } 82 83 public LocalSearchMainLoop() 83 84 : base() { 84 85 Initialize(); 86 } 87 private LocalSearchMainLoop(LocalSearchMainLoop original, Cloner cloner) 88 : base(original, cloner) { 89 } 90 public override IDeepCloneable Clone(Cloner cloner) { 91 return new LocalSearchMainLoop(this, cloner); 85 92 } 86 93 -
branches/CloningRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r4437 r4669 253 253 [StorableConstructor] 254 254 private IslandOffspringSelectionGeneticAlgorithm(bool deserializing) : base(deserializing) { } 255 [StorableHook(HookType.AfterDeserialization)] 256 private void AfterDeserialization() { 257 Initialize(); 258 } 259 private IslandOffspringSelectionGeneticAlgorithm(IslandOffspringSelectionGeneticAlgorithm original, Cloner cloner) 260 : base(original, cloner) { 261 islandQualityAnalyzer = cloner.Clone(original.islandQualityAnalyzer); 262 qualityAnalyzer = cloner.Clone(original.qualityAnalyzer); 263 islandSelectionPressureAnalyzer = cloner.Clone(original.islandSelectionPressureAnalyzer); 264 selectionPressureAnalyzer = cloner.Clone(original.selectionPressureAnalyzer); 265 Initialize(); 266 } 267 public override IDeepCloneable Clone(Cloner cloner) { 268 return new IslandOffspringSelectionGeneticAlgorithm(this, cloner); 269 } 255 270 public IslandOffspringSelectionGeneticAlgorithm() 256 271 : base() { … … 357 372 Initialize(); 358 373 } 359 360 public override IDeepCloneable Clone(Cloner cloner) {361 IslandOffspringSelectionGeneticAlgorithm clone = (IslandOffspringSelectionGeneticAlgorithm)base.Clone(cloner);362 clone.islandQualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(islandQualityAnalyzer);363 clone.qualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(qualityAnalyzer);364 clone.islandSelectionPressureAnalyzer = (ValueAnalyzer)cloner.Clone(islandSelectionPressureAnalyzer);365 clone.selectionPressureAnalyzer = (ValueAnalyzer)cloner.Clone(selectionPressureAnalyzer);366 clone.Initialize();367 return clone;368 }369 370 374 public override void Prepare() { 371 375 if (Problem != null) base.Prepare(); … … 454 458 455 459 #region Helpers 456 [StorableHook(HookType.AfterDeserialization)]457 460 private void Initialize() { 458 461 PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged); -
branches/CloningRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 126 127 127 128 [StorableConstructor] 128 private IslandOffspringSelectionGeneticAlgorithmMainLoop(bool deserializing) : base() { } 129 private IslandOffspringSelectionGeneticAlgorithmMainLoop(bool deserializing) : base(deserializing) { } 130 private IslandOffspringSelectionGeneticAlgorithmMainLoop(IslandOffspringSelectionGeneticAlgorithmMainLoop original, Cloner cloner) 131 : base(original, cloner) { 132 } 133 public override IDeepCloneable Clone(Cloner cloner) { 134 return new IslandOffspringSelectionGeneticAlgorithmMainLoop(this, cloner); 135 } 129 136 public IslandOffspringSelectionGeneticAlgorithmMainLoop() 130 137 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r4437 r4669 200 200 [StorableConstructor] 201 201 private OffspringSelectionGeneticAlgorithm(bool deserializing) : base(deserializing) { } 202 [StorableHook(HookType.AfterDeserialization)] 203 private void AfterDeserialization() { 204 Initialize(); 205 } 206 private OffspringSelectionGeneticAlgorithm(OffspringSelectionGeneticAlgorithm original, Cloner cloner) 207 : base(original, cloner) { 208 qualityAnalyzer = cloner.Clone(original.qualityAnalyzer); 209 selectionPressureAnalyzer = cloner.Clone(original.selectionPressureAnalyzer); 210 Initialize(); 211 } 212 public override IDeepCloneable Clone(Cloner cloner) { 213 return new OffspringSelectionGeneticAlgorithm(this, cloner); 214 } 202 215 public OffspringSelectionGeneticAlgorithm() 203 216 : base() { … … 272 285 } 273 286 274 public override IDeepCloneable Clone(Cloner cloner) { 275 OffspringSelectionGeneticAlgorithm clone = (OffspringSelectionGeneticAlgorithm)base.Clone(cloner); 276 clone.qualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(qualityAnalyzer); 277 clone.selectionPressureAnalyzer = (ValueAnalyzer)cloner.Clone(selectionPressureAnalyzer); 278 clone.Initialize(); 279 return clone; 280 } 287 281 288 282 289 public override void Prepare() { … … 345 352 346 353 #region Helpers 347 [StorableHook(HookType.AfterDeserialization)]348 354 private void Initialize() { 349 355 PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged); -
branches/CloningRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 92 93 93 94 [StorableConstructor] 94 private OffspringSelectionGeneticAlgorithmMainLoop(bool deserializing) : base() { } 95 private OffspringSelectionGeneticAlgorithmMainLoop(bool deserializing) : base(deserializing) { } 96 private OffspringSelectionGeneticAlgorithmMainLoop(OffspringSelectionGeneticAlgorithmMainLoop original, Cloner cloner) 97 : base(original, cloner) { 98 } 99 public override IDeepCloneable Clone(Cloner cloner) { 100 return new OffspringSelectionGeneticAlgorithmMainLoop(this, cloner); 101 } 95 102 public OffspringSelectionGeneticAlgorithmMainLoop() 96 103 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 87 88 88 89 [StorableConstructor] 89 private OffspringSelectionGeneticAlgorithmMainOperator(bool deserializing) : base() { } 90 private OffspringSelectionGeneticAlgorithmMainOperator(bool deserializing) : base(deserializing) { } 91 private OffspringSelectionGeneticAlgorithmMainOperator(OffspringSelectionGeneticAlgorithmMainOperator original, Cloner cloner) 92 : base(original, cloner) { 93 } 94 public override IDeepCloneable Clone(Cloner cloner) { 95 return new OffspringSelectionGeneticAlgorithmMainOperator(this, cloner); 96 } 90 97 public OffspringSelectionGeneticAlgorithmMainOperator() 91 98 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r4437 r4669 229 229 [StorableConstructor] 230 230 private SASEGASA(bool deserializing) : base(deserializing) { } 231 [StorableHook(HookType.AfterDeserialization)] 232 private void AfterDeserialization() { 233 Initialize(); 234 } 235 private SASEGASA(SASEGASA original, Cloner cloner) 236 : base(original, cloner) { 237 qualityAnalyzer = cloner.Clone(original.qualityAnalyzer); 238 villageQualityAnalyzer = cloner.Clone(original.villageQualityAnalyzer); 239 selectionPressureAnalyzer = cloner.Clone(original.selectionPressureAnalyzer); 240 villageSelectionPressureAnalyzer = cloner.Clone(original.villageSelectionPressureAnalyzer); 241 Initialize(); 242 } 243 public override IDeepCloneable Clone(Cloner cloner) { 244 return new SASEGASA(this, cloner); 245 } 231 246 public SASEGASA() 232 247 : base() { … … 316 331 } 317 332 318 public override IDeepCloneable Clone(Cloner cloner) {319 SASEGASA clone = (SASEGASA)base.Clone(cloner);320 clone.qualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(qualityAnalyzer);321 clone.villageQualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(villageQualityAnalyzer);322 clone.selectionPressureAnalyzer = (ValueAnalyzer)cloner.Clone(selectionPressureAnalyzer);323 clone.villageSelectionPressureAnalyzer = (ValueAnalyzer)cloner.Clone(villageSelectionPressureAnalyzer);324 clone.Initialize();325 return clone;326 }327 328 333 public override void Prepare() { 329 334 if (Problem != null) base.Prepare(); … … 408 413 409 414 #region Helpers 410 [StorableHook(HookType.AfterDeserialization)]411 415 private void Initialize() { 412 416 NumberOfVillagesParameter.ValueChanged += new EventHandler(NumberOfVillagesParameter_ValueChanged); -
branches/CloningRefactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 108 109 109 110 [StorableConstructor] 110 private SASEGASAMainLoop(bool deserializing) : base() { } 111 private SASEGASAMainLoop(bool deserializing) : base(deserializing) { } 112 private SASEGASAMainLoop(SASEGASAMainLoop original, Cloner cloner) 113 : base(original, cloner) { 114 } 115 public override IDeepCloneable Clone(Cloner cloner) { 116 return new SASEGASAMainLoop(this, cloner); 117 } 111 118 public SASEGASAMainLoop() 112 119 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs
r4437 r4669 143 143 [StorableConstructor] 144 144 private SimulatedAnnealing(bool deserializing) : base(deserializing) { } 145 [StorableHook(HookType.AfterDeserialization)] 146 private void AfterDeserialization() { 147 Initialize(); 148 } 149 private SimulatedAnnealing(SimulatedAnnealing original, Cloner cloner) 150 : base(original, cloner) { 151 qualityAnalyzer = cloner.Clone(original.qualityAnalyzer); 152 Initialize(); 153 } 154 public override IDeepCloneable Clone(Cloner cloner) { 155 return new SimulatedAnnealing(this, cloner); 156 } 145 157 public SimulatedAnnealing() 146 158 : base() { … … 194 206 } 195 207 196 public override IDeepCloneable Clone(Cloner cloner) {197 SimulatedAnnealing clone = (SimulatedAnnealing)base.Clone(cloner);198 clone.qualityAnalyzer = (QualityAnalyzer)cloner.Clone(qualityAnalyzer);199 clone.Initialize();200 return clone;201 }202 203 208 public override void Prepare() { 204 209 if (Problem != null && MoveGenerator != null && MoveMaker != null && MoveEvaluator != null) … … 282 287 283 288 #region Helpers 284 [StorableHook(HookType.AfterDeserialization)]285 289 private void Initialize() { 286 290 if (Problem != null) { -
branches/CloningRefactoring/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingMainLoop.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 83 84 84 85 [StorableConstructor] 85 private SimulatedAnnealingMainLoop(bool deserializing) : base() { } 86 private SimulatedAnnealingMainLoop(bool deserializing) : base(deserializing) { } 87 private SimulatedAnnealingMainLoop(SimulatedAnnealingMainLoop original, Cloner cloner) 88 : base(original, cloner) { 89 } 90 public override IDeepCloneable Clone(Cloner cloner) { 91 return new SimulatedAnnealingMainLoop(this, cloner); 92 } 86 93 public SimulatedAnnealingMainLoop() 87 94 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.TabuSearch/3.3/TabuListCreator.cs
r4068 r4669 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Operators; … … 39 40 } 40 41 42 [StorableConstructor] 43 protected TabuListCreator(bool deserializing) : base(deserializing) { } 44 protected TabuListCreator(TabuListCreator original, Cloner cloner) 45 : base(original, cloner) { 46 } 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new TabuListCreator(this, cloner); 49 } 50 41 51 public TabuListCreator() 42 52 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.TabuSearch/3.3/TabuNeighborhoodAnalyzer.cs
r4068 r4669 21 21 22 22 using System.Linq; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 30 29 31 namespace HeuristicLab.Algorithms.TabuSearch { 32 [StorableClass] 33 [Item("TabuNeighborhoodAnalyzer", "Analyzes the tabu neighborhood")] 30 34 public class TabuNeighborhoodAnalyzer : SingleSuccessorOperator, IAnalyzer { 31 35 public ScopeTreeLookupParameter<BoolValue> IsTabuParameter { … … 39 43 } 40 44 45 [StorableConstructor] 46 protected TabuNeighborhoodAnalyzer(bool deserializing) : base(deserializing) { } 47 protected TabuNeighborhoodAnalyzer(TabuNeighborhoodAnalyzer original, Cloner cloner) 48 : base(original, cloner) { 49 } 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new TabuNeighborhoodAnalyzer(this, cloner); 52 } 41 53 public TabuNeighborhoodAnalyzer() 42 54 : base() { -
branches/CloningRefactoring/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs
r4437 r4669 190 190 [StorableConstructor] 191 191 private TabuSearch(bool deserializing) : base(deserializing) { } 192 192 [StorableHook(HookType.AfterDeserialization)] 193 private void AfterDeserialization() { 194 Initialize(); 195 } 196 private TabuSearch(TabuSearch original, Cloner cloner) 197 : base(original, cloner) { 198 moveQualityAnalyzer = cloner.Clone(original.moveQualityAnalyzer); 199 tabuNeighborhoodAnalyzer = cloner.Clone(original.tabuNeighborhoodAnalyzer); 200 Initialize(); 201 } 193 202 public override IDeepCloneable Clone(Cloner cloner) { 194 TabuSearch clone = (TabuSearch)base.Clone(cloner); 195 clone.moveQualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(moveQualityAnalyzer); 196 clone.tabuNeighborhoodAnalyzer = (TabuNeighborhoodAnalyzer)cloner.Clone(tabuNeighborhoodAnalyzer); 197 clone.Initialize(); 198 return clone; 203 return new TabuSearch(this, cloner); 199 204 } 200 205 … … 313 318 314 319 #region Helpers 315 [StorableHook(HookType.AfterDeserialization)]316 320 private void Initialize() { 317 321 if (Problem != null) { -
branches/CloningRefactoring/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearchMainLoop.cs
r4068 r4669 21 21 22 22 using HeuristicLab.Analysis; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 85 86 86 87 [StorableConstructor] 87 private TabuSearchMainLoop(bool deserializing) : base( ) { }88 private TabuSearchMainLoop(bool deserializing) : base(deserializing) { } 88 89 public TabuSearchMainLoop() 89 90 : base() { 90 91 Initialize(); 92 } 93 private TabuSearchMainLoop(TabuSearchMainLoop original, Cloner cloner) 94 : base(original, cloner) { 95 } 96 public override IDeepCloneable Clone(Cloner cloner) { 97 return new TabuSearchMainLoop(this, cloner); 91 98 } 92 99 -
branches/CloningRefactoring/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSelector.cs
r4068 r4669 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 78 79 get { return CopySelectedParameter.Value; } 79 80 set { CopySelectedParameter.Value = value; } 81 } 82 83 [StorableConstructor] 84 protected TabuSelector(bool deserializing) : base(deserializing) { } 85 protected TabuSelector(TabuSelector original, Cloner cloner) 86 : base(original, cloner) { 87 } 88 public override IDeepCloneable Clone(Cloner cloner) { 89 return new TabuSelector(this, cloner); 80 90 } 81 91 -
branches/CloningRefactoring/HeuristicLab.Data/3.3/BoolValue.cs
r4662 r4669 35 35 } 36 36 37 [StorableConstructor]38 protected BoolValue(bool deserializing) : base(deserializing) { }39 37 protected BoolValue(BoolValue original, Cloner cloner) 40 38 : base(original, cloner) { 41 39 } 42 40 public BoolValue() : base() { } 41 [StorableConstructor] 43 42 public BoolValue(bool value) : base(value) { } 44 43
Note: See TracChangeset
for help on using the changeset viewer.