Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4686


Ignore:
Timestamp:
10/29/10 20:20:35 (12 years ago)
Author:
abeham
Message:

#922

  • Refactored Prins encoding in HeuristicLab.Problems.VehicleRouting
Location:
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Crossovers/PrinsCrossover.cs

    r4352 r4686  
    2626using HeuristicLab.Data;
    2727using HeuristicLab.Optimization;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    5354    [StorableConstructor]
    5455    protected PrinsCrossover(bool deserializing) : base(deserializing) { }
    55 
     56    protected PrinsCrossover(PrinsCrossover original, Cloner cloner) : base(original, cloner) { }
    5657    public PrinsCrossover()
    5758      : base() {
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs

    r4352 r4686  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626using HeuristicLab.Data;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    3637    [StorableConstructor]
    3738    private PrinsPermutationCrossover(bool deserializing) : base(deserializing) { }
    38 
     39    private PrinsPermutationCrossover(PrinsPermutationCrossover original, Cloner cloner) : base(original, cloner) { }
     40    public override IDeepCloneable Clone(Cloner cloner) {
     41      return new PrinsPermutationCrossover(this, cloner);
     42    }
    3943    public PrinsPermutationCrossover()
    4044      : base() {
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsExhaustiveLSManipulator.cs

    r4352 r4686  
    2626using HeuristicLab.Data;
    2727using System.Collections.Generic;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    3334    [StorableConstructor]
    3435    private PrinsExhaustiveLSManipulator(bool deserializing) : base(deserializing) { }
    35 
     36    private PrinsExhaustiveLSManipulator(PrinsExhaustiveLSManipulator original, Cloner cloner) : base(original, cloner) { }
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new PrinsExhaustiveLSManipulator(this, cloner);
     39    }
    3640    public PrinsExhaustiveLSManipulator()
    3741      : base() {
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsLSManipulator.cs

    r4352 r4686  
    2626using HeuristicLab.Data;
    2727using System.Collections.Generic;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    3738    [StorableConstructor]
    3839    protected PrinsLSManipulator(bool deserializing) : base(deserializing) { }
    39 
     40    protected PrinsLSManipulator(PrinsLSManipulator original, Cloner cloner) : base(original, cloner) { }
    4041    public PrinsLSManipulator()
    4142      : base() {
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsManipulator.cs

    r4352 r4686  
    2626using HeuristicLab.Data;
    2727using HeuristicLab.Optimization;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    5354    [StorableConstructor]
    5455    protected PrinsManipulator(bool deserializing) : base(deserializing) { }
    55 
     56    protected PrinsManipulator(PrinsManipulator original, Cloner cloner) : base(original, cloner) { }
    5657    public PrinsManipulator()
    5758      : base() {
     
    6162      Parameters.Add(new LookupParameter<DoubleValue>("EvalOverloadPenalty", "The overload penalty considered in the evaluation."));
    6263      Parameters.Add(new LookupParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation."));
    63 
    6464      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
    6565    }
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsPermutationManipulator.cs

    r4352 r4686  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626using HeuristicLab.Data;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    3637    [StorableConstructor]
    3738    private PrinsPermutationManipulator(bool deserializing) : base(deserializing) { }
    38 
     39    private PrinsPermutationManipulator(PrinsPermutationManipulator original, Cloner cloner) : base(original, cloner) { }
     40    public override IDeepCloneable Clone(Cloner cloner) {
     41      return new PrinsPermutationManipulator(this, cloner);
     42    }
    3943    public PrinsPermutationManipulator()
    4044      : base() {
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsStochasticLSManipulator.cs

    r4352 r4686  
    2626using HeuristicLab.Data;
    2727using System.Collections.Generic;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
     
    3738    [StorableConstructor]
    3839    private PrinsStochasticLSManipulator(bool deserializing) : base(deserializing) { }
    39 
     40    private PrinsStochasticLSManipulator(PrinsStochasticLSManipulator original, Cloner cloner) : base(original, cloner) { }
     41    public override IDeepCloneable Clone(Cloner cloner) {
     42      return new PrinsStochasticLSManipulator(this, cloner);
     43    }
    4044    public PrinsStochasticLSManipulator()
    4145      : base() {
  • branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/PrinsEncoding.cs

    r4352 r4686  
    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.