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

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.VehicleRouting

  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Crossovers/PrinsCrossover.cs

    r4352 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
     24using HeuristicLab.Data;
     25using HeuristicLab.Optimization;
    2426using HeuristicLab.Parameters;
    2527using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    27 using HeuristicLab.Optimization;
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    5353    [StorableConstructor]
    5454    protected PrinsCrossover(bool deserializing) : base(deserializing) { }
    55 
     55    protected PrinsCrossover(PrinsCrossover original, Cloner cloner) : base(original, cloner) { }
    5656    public PrinsCrossover()
    5757      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs

    r4352 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.PermutationEncoding;
    2425using HeuristicLab.Parameters;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    2727
    2828namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    3636    [StorableConstructor]
    3737    private PrinsPermutationCrossover(bool deserializing) : base(deserializing) { }
    38 
     38    private PrinsPermutationCrossover(PrinsPermutationCrossover original, Cloner cloner) : base(original, cloner) { }
     39    public override IDeepCloneable Clone(Cloner cloner) {
     40      return new PrinsPermutationCrossover(this, cloner);
     41    }
    3942    public PrinsPermutationCrossover()
    4043      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Interfaces/IPrinsOperator.cs

    r4352 r4722  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Data;
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsExhaustiveLSManipulator.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.Prins {
     
    3331    [StorableConstructor]
    3432    private PrinsExhaustiveLSManipulator(bool deserializing) : base(deserializing) { }
    35 
     33    private PrinsExhaustiveLSManipulator(PrinsExhaustiveLSManipulator original, Cloner cloner) : base(original, cloner) { }
     34    public override IDeepCloneable Clone(Cloner cloner) {
     35      return new PrinsExhaustiveLSManipulator(this, cloner);
     36    }
    3637    public PrinsExhaustiveLSManipulator()
    3738      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsLSManipulator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using HeuristicLab.Common;
    2224using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
     25using HeuristicLab.Data;
    2426using HeuristicLab.Parameters;
    2527using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    27 using System.Collections.Generic;
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    3737    [StorableConstructor]
    3838    protected PrinsLSManipulator(bool deserializing) : base(deserializing) { }
    39 
     39    protected PrinsLSManipulator(PrinsLSManipulator original, Cloner cloner) : base(original, cloner) { }
    4040    public PrinsLSManipulator()
    4141      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsManipulator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
     24using HeuristicLab.Data;
     25using HeuristicLab.Optimization;
    2426using HeuristicLab.Parameters;
    2527using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    27 using HeuristicLab.Optimization;
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    5353    [StorableConstructor]
    5454    protected PrinsManipulator(bool deserializing) : base(deserializing) { }
    55 
     55    protected PrinsManipulator(PrinsManipulator original, Cloner cloner) : base(original, cloner) { }
    5656    public PrinsManipulator()
    5757      : base() {
     
    6161      Parameters.Add(new LookupParameter<DoubleValue>("EvalOverloadPenalty", "The overload penalty considered in the evaluation."));
    6262      Parameters.Add(new LookupParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation."));
    63 
    6463      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
    6564    }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsPermutationManipulator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Encodings.PermutationEncoding;
    2425using HeuristicLab.Parameters;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    2727
    2828namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    3636    [StorableConstructor]
    3737    private PrinsPermutationManipulator(bool deserializing) : base(deserializing) { }
    38 
     38    private PrinsPermutationManipulator(PrinsPermutationManipulator original, Cloner cloner) : base(original, cloner) { }
     39    public override IDeepCloneable Clone(Cloner cloner) {
     40      return new PrinsPermutationManipulator(this, cloner);
     41    }
    3942    public PrinsPermutationManipulator()
    4043      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsStochasticLSManipulator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using HeuristicLab.Common;
    2224using HeuristicLab.Core;
    23 using HeuristicLab.Encodings.PermutationEncoding;
     25using HeuristicLab.Data;
    2426using HeuristicLab.Parameters;
    2527using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Data;
    27 using System.Collections.Generic;
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    3737    [StorableConstructor]
    3838    private PrinsStochasticLSManipulator(bool deserializing) : base(deserializing) { }
    39 
     39    private PrinsStochasticLSManipulator(PrinsStochasticLSManipulator original, Cloner cloner) : base(original, cloner) { }
     40    public override IDeepCloneable Clone(Cloner cloner) {
     41      return new PrinsStochasticLSManipulator(this, cloner);
     42    }
    4043    public PrinsStochasticLSManipulator()
    4144      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/PrinsEncoding.cs

    r4352 r4722  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
    2224using HeuristicLab.Common;
    2325using HeuristicLab.Core;
     
    2527using HeuristicLab.Encodings.PermutationEncoding;
    2628using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using System.Collections.Generic;
    2829using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    29 using System;
    3030
    3131namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    178178    }
    179179    #endregion
    180 
    181     public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {
    182       PrinsEncoding clone = new PrinsEncoding(
    183         new Permutation(this.PermutationType, this.array), cities,
    184         dueTimeArray, serviceTimeArray, readyTimeArray, demandArray, capacity,
    185         fleetUsageFactor, timeFactor, distanceFactor, overloadPenalty, tardinessPenalty,
    186         coordinates, useDistanceMatrix);
    187 
    188       cloner.RegisterClonedObject(this, clone);
    189       clone.readOnly = readOnly;
    190       return clone;
    191     }
    192 
     180   
     181    [StorableConstructor]
     182    protected PrinsEncoding(bool deserializing) : base(deserializing) { }
     183    protected PrinsEncoding(PrinsEncoding original, Cloner cloner)
     184      : base(original, cloner) {
     185      this.cities = original.cities;
     186      this.dueTimeArray = original.dueTimeArray;
     187      this.serviceTimeArray = original.serviceTimeArray;
     188      this.readyTimeArray = original.readyTimeArray;
     189      this.demandArray = original.demandArray;
     190      this.capacity = original.capacity;
     191      this.fleetUsageFactor = original.fleetUsageFactor;
     192      this.timeFactor = original.timeFactor;
     193      this.distanceFactor = original.distanceFactor;
     194      this.overloadPenalty = original.overloadPenalty;
     195      this.tardinessPenalty = original.tardinessPenalty;
     196      this.coordinates = original.coordinates;
     197      this.useDistanceMatrix = original.useDistanceMatrix;
     198    }
     199    public override IDeepCloneable Clone(Cloner cloner) {
     200      return new PrinsEncoding(this, cloner);
     201    }
    193202    public PrinsEncoding(Permutation permutation, int cities,
    194203      DoubleArray dueTimeArray, DoubleArray serviceTimeArray, DoubleArray readyTimeArray, DoubleArray demandArray, DoubleValue capacity,
     
    211220    }
    212221
    213     [StorableConstructor]
    214     private PrinsEncoding(bool serializing)
    215       : base(serializing) {
    216     }
    217 
    218222    public static PrinsEncoding ConvertFrom(IVRPEncoding encoding, int cities,
    219223      DoubleArray dueTimeArray, DoubleArray serviceTimeArray, DoubleArray readyTimeArray, DoubleArray demandArray, DoubleValue capacity,
Note: See TracChangeset for help on using the changeset viewer.