Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (13 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/NPointCrossover.cs

    r4068 r4722  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
     
    3637  [Item("NPointCrossover", "N point crossover for binary vectors. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")]
    3738  [StorableClass]
    38   public class NPointCrossover : BinaryVectorCrossover {
     39  public sealed class NPointCrossover : BinaryVectorCrossover {
    3940    /// <summary>
    4041    /// Number of crossover points.
     
    4445    }
    4546
     47    [StorableConstructor]
     48    private NPointCrossover(bool deserializing) : base(deserializing) { }
     49    private NPointCrossover(NPointCrossover original, Cloner cloner) : base(original, cloner) { }
    4650    /// <summary>
    4751    /// Initializes a new instance of <see cref="NPointCrossover"/>
    4852    /// </summary>
    49     public NPointCrossover() {
     53    public NPointCrossover()
     54      : base() {
    5055      Parameters.Add(new ValueLookupParameter<IntValue>("N", "Number of crossover points", new IntValue(2)));
     56    }
     57
     58    public override IDeepCloneable Clone(Cloner cloner) {
     59      return new NPointCrossover(this, cloner);
    5160    }
    5261
Note: See TracChangeset for help on using the changeset viewer.