Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (14 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/Moves/PermutationMoveAttribute.cs

    r3376 r4722  
    3131    public double MoveQuality { get; protected set; }
    3232
    33     public PermutationMoveAttribute()
    34       : base() {
    35       MoveQuality = 0;
     33    [StorableConstructor]
     34    protected PermutationMoveAttribute(bool deserializing) : base(deserializing) { }
     35    protected PermutationMoveAttribute(PermutationMoveAttribute original, Cloner cloner)
     36      : base(original, cloner) {
     37      this.MoveQuality = original.MoveQuality;
    3638    }
    37 
     39    public PermutationMoveAttribute() : this(0) { }
    3840    public PermutationMoveAttribute(double moveQuality)
    3941      : base() {
     
    4244
    4345    public override IDeepCloneable Clone(Cloner cloner) {
    44       PermutationMoveAttribute clone = (PermutationMoveAttribute)base.Clone(cloner);
    45       clone.MoveQuality = MoveQuality;
    46       return clone;
     46      return new PermutationMoveAttribute(this, cloner);
    4747    }
    4848  }
Note: See TracChangeset for help on using the changeset viewer.