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:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.VehicleRouting

  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/GVR/GVREncoding.cs

    r4352 r4722  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
    25 using HeuristicLab.Encodings.PermutationEncoding;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using System.Drawing;
    28 using System.Collections.Generic;
    2927using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3028
     
    7573      return tours;
    7674    }
    77    
    78     public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {
    79       GVREncoding clone = new GVREncoding(capacity, demand);
    80       cloner.RegisterClonedObject(this, clone);
    81       clone.Tours = (ItemList<Tour>)cloner.Clone(this.Tours);
    82      
    83       return clone;
     75
     76    [StorableConstructor]
     77    protected GVREncoding(bool deserializing) : base(deserializing) { }
     78    protected GVREncoding(GVREncoding original, Cloner cloner)
     79      : base(original, cloner) {
     80      this.capacity = original.capacity;
     81      this.demand = original.demand;
     82      this.Tours = cloner.Clone(original.Tours);
    8483    }
    85 
     84    public override IDeepCloneable Clone(Cloner cloner) {
     85      return new GVREncoding(this, cloner);
     86    }
    8687    public GVREncoding(DoubleValue capacity, DoubleArray demand)
    8788      : base() {
    8889        this.capacity = capacity;
    8990        this.demand = demand;
    90     }
    91 
    92     [StorableConstructor]
    93     private GVREncoding(bool serializing)
    94       : base() {
    9591    }
    9692
Note: See TracChangeset for help on using the changeset viewer.