Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/10 20:28:04 (13 years ago)
Author:
abeham
Message:

#922

  • Refactored GVR encoding in HeuristicLab.Problems.VehicleRouting
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/GVR/GVREncoding.cs

    r4352 r4689  
    7575      return tours;
    7676    }
    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;
     77
     78    [StorableConstructor]
     79    protected GVREncoding(bool deserializing) : base(deserializing) { }
     80    protected GVREncoding(GVREncoding original, Cloner cloner)
     81      : base(original, cloner) {
     82      this.capacity = original.capacity;
     83      this.demand = original.demand;
     84      this.Tours = cloner.Clone(original.Tours);
    8485    }
    85 
     86    public override IDeepCloneable Clone(Cloner cloner) {
     87      return new GVREncoding(this, cloner);
     88    }
    8689    public GVREncoding(DoubleValue capacity, DoubleArray demand)
    8790      : base() {
    8891        this.capacity = capacity;
    8992        this.demand = demand;
    90     }
    91 
    92     [StorableConstructor]
    93     private GVREncoding(bool serializing)
    94       : base() {
    9593    }
    9694
Note: See TracChangeset for help on using the changeset viewer.