Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/10 17:43:17 (14 years ago)
Author:
mkommend
Message:

Refactored Algorithms.* and fixed BoolValue (ticket #922).

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  
    125125    [StorableConstructor]
    126126    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    }
    127139    public LocalSearch()
    128140      : base() {
     
    166178    }
    167179
    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 
    175180    public override void Prepare() {
    176181      if (Problem != null && MoveGenerator != null && MoveMaker != null && MoveEvaluator != null)
     
    256261
    257262    #region Helpers
    258     [StorableHook(HookType.AfterDeserialization)]
    259263    private void Initialize() {
    260264      if (Problem != null) {
  • branches/CloningRefactoring/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs

    r4068 r4669  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    7980
    8081    [StorableConstructor]
    81     private LocalSearchMainLoop(bool deserializing) : base() { }
     82    private LocalSearchMainLoop(bool deserializing) : base(deserializing) { }
    8283    public LocalSearchMainLoop()
    8384      : base() {
    8485      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);
    8592    }
    8693
Note: See TracChangeset for help on using the changeset viewer.