Changeset 4722 for trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing
- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 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.SimulatedAnnealing/3.3/SimulatedAnnealing.cs
r4437 r4722 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) { -
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingMainLoop.cs
r4068 r4722 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.