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