Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/09/10 09:55:31 (14 years ago)
Author:
svonolfe
Message:

Merged relevant changes from the trunk into the branch (cloning,...) (#1177)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba
Files:
39 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/AlbaEncoding.cs

    r4383 r4752  
    8181    #endregion
    8282
    83     public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {
    84       AlbaEncoding clone = new AlbaEncoding(
    85         new Permutation(this.PermutationType, new IntArray(this.array)), ProblemInstance);
    86       cloner.RegisterClonedObject(this, clone);
    87       clone.readOnly = readOnly;
    88       return clone;
    89     }
    90 
    9183    public AlbaEncoding(Permutation permutation, IVRPProblemInstance instance)
    9284      : base(permutation, instance) {
     
    9688    private AlbaEncoding(bool serializing)
    9789      : base(serializing) {
     90    }
     91
     92    public override IDeepCloneable Clone(Cloner cloner) {
     93      return new AlbaEncoding(this, cloner);
     94    }
     95
     96    protected AlbaEncoding(AlbaEncoding original, Cloner cloner)
     97      : base(original, cloner) {
    9898    }
    9999
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Creators/AlbaCreator.cs

    r4369 r4752  
    2727using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2828using HeuristicLab.Problems.VehicleRouting.Encodings.General;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4243      : base() {
    4344    }
     45
     46    protected AlbaCreator(AlbaCreator original, Cloner cloner)
     47      : base(original, cloner) {
     48    }
    4449  }
    4550}
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Creators/DefaultRepresentationCreator.cs

    r4365 r4752  
    2828using HeuristicLab.Problems.VehicleRouting.Encodings;
    2929using HeuristicLab.Problems.VehicleRouting.Variants;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4041    public DefaultRepresentationCreator() : base() { }
    4142
     43    protected DefaultRepresentationCreator(DefaultRepresentationCreator original, Cloner cloner)
     44      : base(original, cloner) {
     45    }
     46
    4247    public override IOperation Apply() {
    4348      //choose default encoding here
     
    4550
    4651      return base.Apply();
    47     }   
     52    }
    4853  }
    4954}
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Creators/PushForwardInsertionCreator.cs

    r4365 r4752  
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3030using HeuristicLab.Problems.VehicleRouting.Variants;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    7172      Parameters.Add(new ValueParameter<DoubleValue>("Gamma", "The gamma value.", new DoubleValue(0.2)));
    7273      Parameters.Add(new ValueParameter<DoubleValue>("GammaVariance", "The gamma variance.", new DoubleValue(0.14)));
     74    }
     75
     76    public override IDeepCloneable Clone(Cloner cloner) {
     77      return new PushForwardCreator(this, cloner);
     78    }
     79
     80    private PushForwardCreator(PushForwardCreator original, Cloner cloner)
     81      : base(original, cloner) {
    7382    }
    7483
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Creators/RandomCreator.cs

    r4362 r4752  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4546      : base() {
    4647      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
     48    }
     49
     50    public override IDeepCloneable Clone(Cloner cloner) {
     51      return new RandomCreator(this, cloner);
     52    }
     53
     54    private RandomCreator(RandomCreator original, Cloner cloner)
     55      : base(original, cloner) {
    4756    }
    4857
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Crossovers/AlbaCrossover.cs

    r4376 r4752  
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2929using HeuristicLab.Problems.VehicleRouting.Encodings.General;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4445      : base() {
    4546      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
     47    }
     48
     49    protected AlbaCrossover(AlbaCrossover original, Cloner cloner)
     50      : base(original, cloner) {
    4651    }
    4752
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Crossovers/AlbaPermutationCrossover.cs

    r4365 r4752  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626using HeuristicLab.Data;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4041      : base() {
    4142      Parameters.Add(new ValueLookupParameter<IPermutationCrossover>("InnerCrossover", "The permutation crossover.", new EdgeRecombinationCrossover()));
     43    }
     44
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new AlbaPermutationCrossover(this, cloner);
     47    }
     48
     49    private AlbaPermutationCrossover(AlbaPermutationCrossover original, Cloner cloner)
     50      : base(original, cloner) {
    4251    }
    4352
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaCustomerInsertionManipulator.cs

    r4365 r4752  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626using HeuristicLab.Data;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3536    public AlbaCustomerInsertionManipulator()
    3637      : base() {
     38    }
     39
     40    public override IDeepCloneable Clone(Cloner cloner) {
     41      return new AlbaCustomerInsertionManipulator(this, cloner);
     42    }
     43
     44    private AlbaCustomerInsertionManipulator(AlbaCustomerInsertionManipulator original, Cloner cloner)
     45      : base(original, cloner) {
    3746    }
    3847
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaCustomerInversionManipulator.cs

    r4365 r4752  
    2626using HeuristicLab.Data;
    2727using System.Collections.Generic;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3637    public AlbaCustomerInversionManipulator()
    3738      : base() {
     39    }
     40
     41    public override IDeepCloneable Clone(Cloner cloner) {
     42      return new AlbaCustomerInversionManipulator(this, cloner);
     43    }
     44
     45    private AlbaCustomerInversionManipulator(AlbaCustomerInversionManipulator original, Cloner cloner)
     46      : base(original, cloner) {
    3847    }
    3948
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaCustomerSwapManipulator.cs

    r4365 r4752  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626using HeuristicLab.Data;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3536    public AlbaCustomerSwapManipulator()
    3637      : base() {
     38    }
     39
     40    public override IDeepCloneable Clone(Cloner cloner) {
     41      return new AlbaCustomerSwapManipulator(this, cloner);
     42    }
     43
     44    private AlbaCustomerSwapManipulator(AlbaCustomerSwapManipulator original, Cloner cloner)
     45      : base(original, cloner) {
    3746    }
    3847
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaIntraRouteInversionManipulator.cs

    r4365 r4752  
    2727using System;
    2828using System.Collections.Generic;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3839      : base() {
    3940     }
     41
     42    public override IDeepCloneable Clone(Cloner cloner) {
     43      return new AlbaIntraRouteInversionManipulator(this, cloner);
     44    }
     45
     46    private AlbaIntraRouteInversionManipulator(AlbaIntraRouteInversionManipulator original, Cloner cloner)
     47      : base(original, cloner) {
     48    }
    4049
    4150    public static void Apply(AlbaEncoding individual, int index1, int index2) {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaLambdaInterchangeManipulator.cs

    r4365 r4752  
    2727using System;
    2828using System.Collections.Generic;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4344        Parameters.Add(new ValueParameter<IntValue>("Lambda", "The lambda value.", new IntValue(1)));
    4445     }
     46
     47    public override IDeepCloneable Clone(Cloner cloner) {
     48      return new AlbaLambdaInterchangeManipulator(this, cloner);
     49    }
     50
     51    private AlbaLambdaInterchangeManipulator(AlbaLambdaInterchangeManipulator original, Cloner cloner)
     52      : base(original, cloner) {
     53    }
    4554
    4655    public static void Apply(AlbaEncoding individual, int tour1Index, int position1, int length1,
     
    100109    protected override void Manipulate(IRandom rand, AlbaEncoding individual) {
    101110      List<Tour> tours = individual.GetTours();
    102       int lambda = LambdaParameter.Value.Value;
     111      if (tours.Count > 1) {
     112        int lambda = LambdaParameter.Value.Value;
    103113
    104       int route1Index = rand.Next(tours.Count);
    105       Tour route1 = tours[route1Index];
     114        int route1Index = rand.Next(tours.Count);
     115        Tour route1 = tours[route1Index];
    106116
    107       int route2Index = rand.Next(tours.Count - 1);
    108       if (route2Index >= route1Index)
    109         route2Index += 1;
    110       Tour route2 = tours[route2Index];
    111117
    112       int length1 = rand.Next(Math.Min(lambda + 1, route1.Stops.Count + 1));
    113       int index1 = rand.Next(route1.Stops.Count - length1 + 1);
     118        int route2Index = rand.Next(tours.Count - 1);
     119        if (route2Index >= route1Index)
     120          route2Index += 1;
     121        Tour route2 = tours[route2Index];
    114122
    115       int l2Min = 0;
    116       if (length1 == 0)
    117         l2Min = 1;
    118       int length2 = rand.Next(l2Min, Math.Min(lambda + 1, route2.Stops.Count + 1));
    119       int index2 = rand.Next(route2.Stops.Count - length2 + 1);
     123        int length1 = rand.Next(Math.Min(lambda + 1, route1.Stops.Count + 1));
     124        int index1 = rand.Next(route1.Stops.Count - length1 + 1);
    120125
    121       Apply(individual, route1Index, index1, length1,
    122         route2Index, index2, length2);
     126        int l2Min = 0;
     127        if (length1 == 0)
     128          l2Min = 1;
     129        int length2 = rand.Next(l2Min, Math.Min(lambda + 1, route2.Stops.Count + 1));
     130        int index2 = rand.Next(route2.Stops.Count - length2 + 1);
     131
     132        Apply(individual, route1Index, index1, length1,
     133          route2Index, index2, length2);
     134      }
    123135    }
    124136  }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaManipulator.cs

    r4376 r4752  
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2929using HeuristicLab.Problems.VehicleRouting.Encodings.General;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4344      : base() {
    4445        Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
     46    }
     47
     48    protected AlbaManipulator(AlbaManipulator original, Cloner cloner)
     49      : base(original, cloner) {
    4550    }
    4651
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaPermutationManipulator.cs

    r4365 r4752  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626using HeuristicLab.Data;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4243    }
    4344
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new AlbaPermutationManipualtor(this, cloner);
     47    }
     48
     49    private AlbaPermutationManipualtor(AlbaPermutationManipualtor original, Cloner cloner)
     50      : base(original, cloner) {
     51    }
     52
    4453    protected override void Manipulate(IRandom random, AlbaEncoding individual) {
    4554      InnerManipulatorParameter.ActualValue.PermutationParameter.ActualName = VRPToursParameter.ActualName;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/AlbaMoveEvaluator.cs

    r4369 r4752  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3839      : base() {
    3940    }
     41
     42       protected AlbaMoveEvaluator(AlbaMoveEvaluator original, Cloner cloner)
     43         : base(original, cloner) {
     44       }
    4045  }
    4146}
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/AlbaMoveGenerator.cs

    r4376 r4752  
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4041    }
    4142
     43    protected AlbaMoveGenerator(AlbaMoveGenerator original, Cloner cloner)
     44      : base(original, cloner) {
     45    }
     46
    4247    public override IOperation Apply() {
    4348      IVRPEncoding solution = VRPToursParameter.ActualValue;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/AlbaMoveMaker.cs

    r4378 r4752  
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3940      : base() {
    4041    }
     42
     43    protected AlbaMoveMaker(AlbaMoveMaker original, Cloner cloner)
     44      : base(original, cloner) {
     45    }
    4146  }
    4247}
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaExhaustiveIntraRouteInversionMoveGenerator.cs

    r4370 r4752  
    2828using System.Collections.Generic;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3839    public AlbaExhaustiveIntraRouteInversionGenerator()
    3940      : base() {
     41    }
     42
     43    public override IDeepCloneable Clone(Cloner cloner) {
     44      return new AlbaExhaustiveIntraRouteInversionGenerator(this, cloner);
     45    }
     46
     47    private AlbaExhaustiveIntraRouteInversionGenerator(AlbaExhaustiveIntraRouteInversionGenerator original, Cloner cloner)
     48      : base(original, cloner) {
    4049    }
    4150
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionEvaluator.cs

    r4383 r4752  
    2626using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting {
     
    4748    }
    4849
     50    public override IDeepCloneable Clone(Cloner cloner) {
     51      return new AlbaIntraRouteInversionMoveEvaluator(this, cloner);
     52    }
     53
     54    private AlbaIntraRouteInversionMoveEvaluator(AlbaIntraRouteInversionMoveEvaluator original, Cloner cloner)
     55      : base(original, cloner) {
     56    }
     57
    4958    protected override void EvaluateMove() {
    5059      AlbaEncoding newSolution = IntraRouteInversionMoveParameter.ActualValue.Permutation.Clone() as AlbaEncoding;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMove.cs

    r4383 r4752  
    4646     }
    4747
    48     public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {
    49       AlbaIntraRouteInversionMove clone = new AlbaIntraRouteInversionMove(
    50         Index1, Index2);
     48    public override IDeepCloneable Clone(Cloner cloner) {
     49      return new AlbaIntraRouteInversionMove(this, cloner);
     50    }
    5151
    52       if (Permutation != null)
    53         clone.Permutation = Permutation.Clone() as AlbaEncoding;
    54 
    55       cloner.RegisterClonedObject(this, clone);
    56       return clone;
     52    protected AlbaIntraRouteInversionMove(AlbaIntraRouteInversionMove original, Cloner cloner)
     53      : base(original, cloner) {
     54        if (Permutation != null)
     55          this.Permutation = cloner.Clone(original.Permutation);
    5756    }
    5857
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMoveGenerator.cs

    r4370 r4752  
    2828using System.Collections.Generic;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    5455    }
    5556
     57    protected AlbaIntraRouteInversionMoveGenerator(AlbaIntraRouteInversionMoveGenerator original, Cloner cloner)
     58      : base(original, cloner) {
     59    }
     60
    5661    protected abstract AlbaIntraRouteInversionMove[] GenerateMoves(AlbaEncoding individual, IVRPProblemInstance problemInstance);
    5762
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMoveMaker.cs

    r4383 r4752  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    4748    }
    4849
     50    public override IDeepCloneable Clone(Cloner cloner) {
     51      return new AlbaIntraRouteInversionMoveMaker(this, cloner);
     52    }
     53
     54    protected AlbaIntraRouteInversionMoveMaker(AlbaIntraRouteInversionMoveMaker original, Cloner cloner)
     55      : base(original, cloner) {
     56    }
     57
    4958    public static void Apply(AlbaEncoding solution, AlbaIntraRouteInversionMove move) {
    5059      AlbaIntraRouteInversionManipulator.Apply(solution, move.Index1, move.Index2);
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaStochasticIntraRouteInversionMutliMoveGenerator.cs

    r4370 r4752  
    2929using HeuristicLab.Data;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    5152    }
    5253
     54    public override IDeepCloneable Clone(Cloner cloner) {
     55      return new AlbaStochasticIntraRouteInversionMultiMoveGenerator(this, cloner);
     56    }
     57
     58    private AlbaStochasticIntraRouteInversionMultiMoveGenerator(AlbaStochasticIntraRouteInversionMultiMoveGenerator original, Cloner cloner)
     59      : base(original, cloner) {
     60    }
     61
    5362    protected override AlbaIntraRouteInversionMove[] GenerateMoves(AlbaEncoding individual, IVRPProblemInstance problemInstance) {
    5463      int sampleSize = SampleSizeParameter.ActualValue.Value;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaStochasticIntraRouteInversionSingleMoveGenerator.cs

    r4370 r4752  
    2929using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    5354      : base() {
    5455        Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
     56    }
     57
     58    public override IDeepCloneable Clone(Cloner cloner) {
     59      return new AlbaStochasticIntraRouteInversionSingleMoveGenerator(this, cloner);
     60    }
     61
     62    private AlbaStochasticIntraRouteInversionSingleMoveGenerator(AlbaStochasticIntraRouteInversionSingleMoveGenerator original, Cloner cloner)
     63      : base(original, cloner) {
    5564    }
    5665
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaExhaustiveLambdaInterchangeMoveGenerator.cs

    r4370 r4752  
    2828using System.Collections.Generic;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3839    public AlbaExhaustiveLambdaInterchangeMoveGenerator()
    3940      : base() {
     41    }
     42
     43    public override IDeepCloneable Clone(Cloner cloner) {
     44      return new AlbaExhaustiveLambdaInterchangeMoveGenerator(this, cloner);
     45    }
     46
     47    private AlbaExhaustiveLambdaInterchangeMoveGenerator(AlbaExhaustiveLambdaInterchangeMoveGenerator original, Cloner cloner)
     48      : base(original, cloner) {
    4049    }
    4150
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMove.cs

    r4383 r4752  
    7979    }
    8080
    81     public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {
    82       AlbaLambdaInterchangeMove clone = new AlbaLambdaInterchangeMove();
    83 
    84       clone.Tour1 = Tour1;
    85       clone.Position1 = Position1;
    86       clone.Length1 = Length1;
    87 
    88       clone.Tour2 = Tour2;
    89       clone.Position2 = Position2;
    90       clone.Length2 = Length2;
    91 
    92       if (Individual != null)
    93         clone.Individual = Individual.Clone() as AlbaEncoding;
    94 
    95       cloner.RegisterClonedObject(this, clone);
    96       return clone;
     81    public override IDeepCloneable Clone(Cloner cloner) {
     82      return new AlbaLambdaInterchangeMove(this, cloner);
    9783    }
    9884
     85    protected AlbaLambdaInterchangeMove(AlbaLambdaInterchangeMove original, Cloner cloner)
     86      : base(original, cloner) {
     87      this.Tour1 = original.Tour1;
     88      this.Position1 = original.Position1;
     89      this.Length1 = original.Length1;
    9990
     91      this.Tour2 = original.Tour2;
     92      this.Position2 = original.Position2;
     93      this.Length2 = original.Length2;
     94
     95      this.Individual = cloner.Clone(Individual) as AlbaEncoding;
     96    }
    10097
    10198    #region IVRPMove Members
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMoveEvaluator.cs

    r4383 r4752  
    2626using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting {
     
    4748    }
    4849
     50    public override IDeepCloneable Clone(Cloner cloner) {
     51      return new AlbaLambdaInterchangeMoveEvaluator(this, cloner);
     52    }
     53
     54    private AlbaLambdaInterchangeMoveEvaluator(AlbaLambdaInterchangeMoveEvaluator original, Cloner cloner)
     55      : base(original, cloner) {
     56    }
     57
    4958    protected override void EvaluateMove() {
    5059      AlbaEncoding newSolution = LambdaInterchangeMoveParameter.ActualValue.Individual.Clone() as AlbaEncoding;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMoveGenerator.cs

    r4370 r4752  
    2929using HeuristicLab.Data;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    6465    }
    6566
     67    protected AlbaLambdaInterchangeMoveGenerator(AlbaLambdaInterchangeMoveGenerator original, Cloner cloner)
     68      : base(original, cloner) {
     69    }
     70
    6671    protected abstract AlbaLambdaInterchangeMove[] GenerateMoves(AlbaEncoding individual, IVRPProblemInstance problemInstance, int lambda);
    6772
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMoveMaker.cs

    r4383 r4752  
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2828using System.Collections.Generic;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    5152    }
    5253
     54    public override IDeepCloneable Clone(Cloner cloner) {
     55      return new AlbaLambdaInterchangeMoveMaker(this, cloner);
     56    }
     57
     58    protected AlbaLambdaInterchangeMoveMaker(AlbaLambdaInterchangeMoveMaker original, Cloner cloner)
     59      : base(original, cloner) {
     60    }
     61
    5362    public static void Apply(AlbaEncoding solution, AlbaLambdaInterchangeMove move) {
    5463      AlbaLambdaInterchangeManipulator.Apply(
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaStochasticLambdaInterchangeMutliMoveGenerator.cs

    r4370 r4752  
    2929using HeuristicLab.Data;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    5152    }
    5253
     54    public override IDeepCloneable Clone(Cloner cloner) {
     55      return new AlbaStochasticLambdaInterchangeMultiMoveGenerator(this, cloner);
     56    }
     57
     58    private AlbaStochasticLambdaInterchangeMultiMoveGenerator(AlbaStochasticLambdaInterchangeMultiMoveGenerator original, Cloner cloner)
     59      : base(original, cloner) {
     60    }
     61
    5362    protected override AlbaLambdaInterchangeMove[] GenerateMoves(AlbaEncoding individual, IVRPProblemInstance problemInstance, int lambda) {
    5463      int sampleSize = SampleSizeParameter.ActualValue.Value;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaStochasticLambdaInterchangeSingleMoveGenerator.cs

    r4370 r4752  
    2929using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    5354      : base() {
    5455        Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
     56    }
     57
     58    public override IDeepCloneable Clone(Cloner cloner) {
     59      return new AlbaStochasticLambdaInterchangeSingleMoveGenerator(this, cloner);
     60    }
     61
     62    private AlbaStochasticLambdaInterchangeSingleMoveGenerator(AlbaStochasticLambdaInterchangeSingleMoveGenerator original, Cloner cloner)
     63      : base(original, cloner) {
    5564    }
    5665
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaStochasticTranslocationSingleMoveGenerator.cs

    r4383 r4752  
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3030using HeuristicLab.Problems.VehicleRouting.Encodings.General;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    6364    }
    6465
     66    public override IDeepCloneable Clone(Cloner cloner) {
     67      return new AlbaStochasticTranslocationSingleMoveGenerator(this, cloner);
     68    }
     69
     70    private AlbaStochasticTranslocationSingleMoveGenerator(AlbaStochasticTranslocationSingleMoveGenerator original, Cloner cloner)
     71      : base(original, cloner) {
     72    }
     73
    6574    public override IOperation Apply() {
    6675      IOperation next = base.Apply();
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMove.cs

    r4383 r4752  
    4343    }
    4444
    45     public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {
    46       AlbaTranslocationMove clone = new AlbaTranslocationMove(
    47         Index1, Index2, Index3);
    48       if (Permutation != null)
    49         clone.Permutation = Permutation.Clone() as AlbaEncoding;
     45    [StorableConstructor]
     46    protected AlbaTranslocationMove(bool deserializing) : base(deserializing) { }
    5047
    51       cloner.RegisterClonedObject(this, clone);
    52       return clone;
     48    public override IDeepCloneable Clone(Cloner cloner) {
     49      return new AlbaTranslocationMove(this, cloner);
     50    }
     51
     52    protected AlbaTranslocationMove(AlbaTranslocationMove original, Cloner cloner)
     53      : base(original, cloner) {
     54        this.Index1 = original.Index1;
     55        this.Index2 = original.Index2;
     56        this.Index3 = original.Index3;
     57
     58        this.Permutation = cloner.Clone(Permutation) as AlbaEncoding;
    5359    }
    5460
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveEvaluator.cs

    r4383 r4752  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting {
     
    4748    }
    4849
     50    public override IDeepCloneable Clone(Cloner cloner) {
     51      return new AlbaTranslocationMoveEvaluator(this, cloner);
     52    }
     53
     54    private AlbaTranslocationMoveEvaluator(AlbaTranslocationMoveEvaluator original, Cloner cloner)
     55      : base(original, cloner) {
     56    }
     57
    4958    protected override void EvaluateMove() {
    5059      TranslocationMove move = TranslocationMoveParameter.ActualValue;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs

    r4370 r4752  
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    8586    }
    8687
     88    public override IDeepCloneable Clone(Cloner cloner) {
     89      return new AlbaTranslocationMoveGenerator(this, cloner);
     90    }
     91
     92    private AlbaTranslocationMoveGenerator(AlbaTranslocationMoveGenerator original, Cloner cloner)
     93      : base(original, cloner) {
     94    }
     95
    8796    public override IOperation Apply() {
    8897      IOperation next = base.Apply();
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveHardTabuCriterion.cs

    r4370 r4752  
    2727using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    7071    }
    7172
     73    public override IDeepCloneable Clone(Cloner cloner) {
     74      return new AlbaTranslocationMoveHardTabuCriterion(this, cloner);
     75    }
     76
     77    private AlbaTranslocationMoveHardTabuCriterion(AlbaTranslocationMoveHardTabuCriterion original, Cloner cloner)
     78      : base(original, cloner) {
     79    }
     80
    7281    public override IOperation Apply() {
    7382      IOperation next = base.Apply();
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs

    r4383 r4752  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727using HeuristicLab.Problems.VehicleRouting.Interfaces;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    5354    }
    5455
     56    public override IDeepCloneable Clone(Cloner cloner) {
     57      return new AlbaTranslocationMoveMaker(this, cloner);
     58    }
     59
     60    private AlbaTranslocationMoveMaker(AlbaTranslocationMoveMaker original, Cloner cloner)
     61      : base(original, cloner) {
     62    }
     63
    5564    protected override void PerformMove() {
    5665      IVariable moveVariable = this.ExecutionContext.Scope.Variables[
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveSoftTabuCriterion.cs

    r4370 r4752  
    2727using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    7071    }
    7172
     73    public override IDeepCloneable Clone(Cloner cloner) {
     74      return new AlbaTranslocationMoveSoftTabuCriterion(this, cloner);
     75    }
     76
     77    private AlbaTranslocationMoveSoftTabuCriterion(AlbaTranslocationMoveSoftTabuCriterion original, Cloner cloner)
     78      : base(original, cloner) {
     79    }
     80
    7281    public override IOperation Apply() {
    7382      IOperation next = base.Apply();
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveTabuMaker.cs

    r4370 r4752  
    2727using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    7071    }
    7172
     73    public override IDeepCloneable Clone(Cloner cloner) {
     74      return new AlbaTranslocationMoveTabuMaker(this, cloner);
     75    }
     76
     77    private AlbaTranslocationMoveTabuMaker(AlbaTranslocationMoveTabuMaker original, Cloner cloner)
     78      : base(original, cloner) {
     79    }
     80
    7281    public override IOperation Apply() {
    7382      IOperation next = base.Apply();
Note: See TracChangeset for help on using the changeset viewer.