Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/10 19:40:07 (13 years ago)
Author:
gkronber
Message:

Refactored cloning in HeuristicLab.Problems.OneMax. #922

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab.Problems.OneMax/3.3/Analyzers/BestOneMaxSolutionAnalyzer.cs

    r4068 r4681  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.OneMax {
     
    3536  [Item("BestOneMaxSolutionAnalyzer", "An operator for analyzing the best solution for a OneMax problem.")]
    3637  [StorableClass]
    37   class BestOneMaxSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
     38  public class BestOneMaxSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
    3839    public LookupParameter<BoolValue> MaximizationParameter {
    3940      get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
     
    5556    }
    5657
     58    [StorableConstructor]
     59    protected BestOneMaxSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     60    protected BestOneMaxSolutionAnalyzer(BestOneMaxSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
    5761    public BestOneMaxSolutionAnalyzer()
    5862      : base() {
     
    6367      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the Onemax solution should be stored."));
    6468      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution."));
     69    }
     70
     71    public override IDeepCloneable Clone(Cloner cloner) {
     72      return new BestOneMaxSolutionAnalyzer(this, cloner);
    6573    }
    6674
Note: See TracChangeset for help on using the changeset viewer.