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

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.VehicleRouting

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

    r4352 r4722  
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using HeuristicLab.Common;
    2224using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
     25using HeuristicLab.Optimization;
    2426using HeuristicLab.Parameters;
    2527using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    27 using HeuristicLab.Optimization;
    28 using System.Collections.Generic;
    2928
    3029namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR {
     
    3837    [StorableConstructor]
    3938    private GVRCrossover(bool deserializing) : base(deserializing) { }
    40 
     39    private GVRCrossover(GVRCrossover original, Cloner cloner) : base(original, cloner) { }
     40    public override IDeepCloneable Clone(Cloner cloner) {
     41      return new GVRCrossover(this, cloner);
     42    }
    4143    public GVRCrossover() {
    4244      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
    43 
    4445      //remove unused parameters
    4546      Parameters.Remove("ReadyTime");
  • 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
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/GVR/Manipulators/GVRDisplacementManipulator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using HeuristicLab.Common;
    2224using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
    24 using HeuristicLab.Parameters;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    27 using System.Collections.Generic;
    2826
    2927namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR {
     
    3331    [StorableConstructor]
    3432    private GVRDisplacementManipulator(bool deserializing) : base(deserializing) { }
    35 
     33    private GVRDisplacementManipulator(GVRDisplacementManipulator original, Cloner cloner) : base(original, cloner) { }
     34    public override IDeepCloneable Clone(Cloner cloner) {
     35      return new GVRDisplacementManipulator(this, cloner);
     36    }
    3637    public GVRDisplacementManipulator()
    3738      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/GVR/Manipulators/GVRInsertionManipulator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
    24 using HeuristicLab.Parameters;
    2524using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    2725
    2826namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR {
     
    3230    [StorableConstructor]
    3331    private GVRInsertionManipulator(bool deserializing) : base(deserializing) { }
    34 
    35     public GVRInsertionManipulator()
    36       : base() {
     32    private GVRInsertionManipulator(GVRInsertionManipulator original, Cloner cloner) : base(original, cloner) { }
     33    public override IDeepCloneable Clone(Cloner cloner) {
     34      return new GVRInsertionManipulator(this, cloner);
    3735    }
     36    public GVRInsertionManipulator() : base() { }
    3837
    3938    protected override void Manipulate(IRandom random, GVREncoding individual) {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/GVR/Manipulators/GVRInversionManipulator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
    24 using HeuristicLab.Parameters;
    2524using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    2725
    2826namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR {
     
    3230    [StorableConstructor]
    3331    private GVRInversionManipulator(bool deserializing) : base(deserializing) { }
    34 
    35     public GVRInversionManipulator()
    36       : base() {
     32    private GVRInversionManipulator(GVRInversionManipulator original, Cloner cloner) : base(original, cloner) { }
     33    public override IDeepCloneable Clone(Cloner cloner) {
     34      return new GVRInversionManipulator(this, cloner);
    3735    }
     36    public GVRInversionManipulator() : base() { }
    3837
    3938    protected override void Manipulate(IRandom random, GVREncoding individual) {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/GVR/Manipulators/GVRManipulator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
     24using HeuristicLab.Optimization;
    2425using HeuristicLab.Parameters;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    27 using HeuristicLab.Optimization;
    2827
    2928namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR {
     
    3736    [StorableConstructor]
    3837    protected GVRManipulator(bool deserializing) : base(deserializing) { }
    39 
     38    protected GVRManipulator(GVRManipulator original, Cloner cloner) : base(original, cloner) { }
    4039    public GVRManipulator() {
    4140      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/GVR/Manipulators/GVRSwapManipulator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
    24 using HeuristicLab.Parameters;
    2524using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    2725
    2826namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR {
     
    3230    [StorableConstructor]
    3331    private GVRSwapManipulator(bool deserializing) : base(deserializing) { }
    34 
     32    private GVRSwapManipulator(GVRSwapManipulator original, Cloner cloner) : base(original, cloner) { }
     33    public override IDeepCloneable Clone(Cloner cloner) {
     34      return new GVRSwapManipulator(this, cloner);
     35    }
    3536    public GVRSwapManipulator()
    3637      : base() {
Note: See TracChangeset for help on using the changeset viewer.