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