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.PermutationEncoding/3.3/Permutation.cs

    r4477 r4722  
    3838    }
    3939
    40     public Permutation() : base() {
    41       permutationType = PermutationTypes.RelativeUndirected;
     40    [StorableConstructor]
     41    protected Permutation(bool deserializing) : base(deserializing) { }
     42    protected Permutation(Permutation original, Cloner cloner)
     43      : base(original, cloner) {
     44      this.permutationType = original.permutationType;
    4245    }
     46    public Permutation() : this(PermutationTypes.RelativeUndirected) { }
    4347    public Permutation(PermutationTypes type) : base() {
    4448      permutationType = type;
    4549    }
    46 
    4750    public Permutation(PermutationTypes type, int length)
    4851      : base(length) {
     
    6467
    6568    public override IDeepCloneable Clone(Cloner cloner) {
    66       Permutation clone = new Permutation(permutationType, array);
    67       cloner.RegisterClonedObject(this, clone);
    68       clone.readOnly = readOnly;
    69       return clone;
     69      return new Permutation(this, cloner);
    7070    }
    7171
Note: See TracChangeset for help on using the changeset viewer.