Changeset 4691 for branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba
- Timestamp:
- 10/29/10 20:34:10 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaPermutationCrossover.cs
r4690 r4691 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Encodings.PermutationEncoding; 24 25 using HeuristicLab.Parameters; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Data;27 using HeuristicLab.Common;28 27 29 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 30 29 [Item("AlbaPermutationCrossover", "An operator which crosses two VRP representations using a standard permutation operator. It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")] 31 30 [StorableClass] 32 public sealed class AlbaPermutationCrossover : AlbaCrossover { 31 public sealed class AlbaPermutationCrossover : AlbaCrossover { 33 32 public IValueLookupParameter<IPermutationCrossover> InnerCrossoverParameter { 34 33 get { return (IValueLookupParameter<IPermutationCrossover>)Parameters["InnerCrossover"]; } … … 39 38 private AlbaPermutationCrossover(AlbaPermutationCrossover original, Cloner cloner) 40 39 : base(original, cloner) { 40 } 41 public override IDeepCloneable Clone(Cloner cloner) { 42 return new AlbaPermutationCrossover(this, cloner); 41 43 } 42 44 public AlbaPermutationCrossover() -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMove.cs
r4690 r4691 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 23 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Encodings.PermutationEncoding;25 using HeuristicLab.Common;26 using System.Collections.Generic;27 26 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 using HeuristicLab.Data;29 27 30 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 31 29 [Item("InversionMove", "Item that describes a lambda move on a VRP representation. It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")] 32 30 [StorableClass] 33 public class AlbaLambdaInterchangeMove : Item, IVRPMove {31 public class AlbaLambdaInterchangeMove : Item, IVRPMove { 34 32 [Storable] 35 33 public IVRPEncoding Individual { get; protected set; } 36 34 37 35 [Storable] 38 36 public int Tour1 { get; protected set; } … … 55 53 [StorableConstructor] 56 54 protected AlbaLambdaInterchangeMove(bool deserializing) : base(deserializing) { } 57 protected AlbaLambdaInterchangeMove(AlbaLambdaInterchangeMove original, Cloner cloner) : base(original, cloner) { 55 protected AlbaLambdaInterchangeMove(AlbaLambdaInterchangeMove original, Cloner cloner) 56 : base(original, cloner) { 58 57 Tour1 = original.Tour1; 59 58 Position1 = original.Position1; … … 66 65 Individual = cloner.Clone(original.Individual); 67 66 } 67 public override IDeepCloneable Clone(Cloner cloner) { 68 return new AlbaLambdaInterchangeMove(this, cloner); 69 } 68 70 69 public AlbaLambdaInterchangeMove(): base() { 71 public AlbaLambdaInterchangeMove() 72 : base() { 70 73 Tour1 = -1; 71 74 Position1 = -1; … … 79 82 } 80 83 81 public AlbaLambdaInterchangeMove(int tour1, int position1, int length1, 84 public AlbaLambdaInterchangeMove(int tour1, int position1, int length1, 82 85 int tour2, int position2, int length2, AlbaEncoding permutation) { 83 84 85 86 Tour1 = tour1; 87 Position1 = position1; 88 Length1 = length1; 86 89 87 88 89 90 Tour2 = tour2; 91 Position2 = position2; 92 Length2 = length2; 90 93 91 94 this.Individual = permutation.Clone() as AlbaEncoding; 92 95 } 93 96 … … 96 99 public TourEvaluation GetMoveQuality( 97 100 IntValue vehicles, 98 DoubleArray dueTimeArray, DoubleArray serviceTimeArray, DoubleArray readyTimeArray, 101 DoubleArray dueTimeArray, DoubleArray serviceTimeArray, DoubleArray readyTimeArray, 99 102 DoubleArray demandArray, DoubleValue capacity, DoubleMatrix coordinates, 100 103 DoubleValue fleetUsageFactor, DoubleValue timeFactor, DoubleValue distanceFactor, 101 104 DoubleValue overloadPenalty, DoubleValue tardinessPenalty, 102 105 ILookupParameter<DoubleMatrix> distanceMatrix, Data.BoolValue useDistanceMatrix) { 103 104 105 106 106 return AlbaLambdaInterchangeMoveEvaluator.GetMoveQuality(Individual as AlbaEncoding, this, vehicles, 107 dueTimeArray, serviceTimeArray, readyTimeArray, demandArray, capacity, 108 coordinates, fleetUsageFactor, timeFactor, distanceFactor, 109 overloadPenalty, tardinessPenalty, distanceMatrix, useDistanceMatrix); 107 110 } 108 111
Note: See TracChangeset
for help on using the changeset viewer.