- Timestamp:
- 10/29/10 17:43:17 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Algorithms.SimulatedAnnealing/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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() {
Note: See TracChangeset
for help on using the changeset viewer.