Changeset 4722 for trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMove.cs
- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting (added) merged: 4686-4687,4689-4693,4696-4697
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMove.cs
r4352 r4722 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; } … … 52 50 [Storable] 53 51 public int Length2 { get; protected set; } 54 55 public AlbaLambdaInterchangeMove(): base() { 52 53 [StorableConstructor] 54 protected AlbaLambdaInterchangeMove(bool deserializing) : base(deserializing) { } 55 protected AlbaLambdaInterchangeMove(AlbaLambdaInterchangeMove original, Cloner cloner) 56 : base(original, cloner) { 57 Tour1 = original.Tour1; 58 Position1 = original.Position1; 59 Length1 = original.Length1; 60 61 Tour2 = original.Tour2; 62 Position2 = original.Position2; 63 Length2 = original.Length2; 64 65 Individual = cloner.Clone(original.Individual); 66 } 67 public override IDeepCloneable Clone(Cloner cloner) { 68 return new AlbaLambdaInterchangeMove(this, cloner); 69 } 70 71 public AlbaLambdaInterchangeMove() 72 : base() { 56 73 Tour1 = -1; 57 74 Position1 = -1; … … 65 82 } 66 83 67 public AlbaLambdaInterchangeMove(int tour1, int position1, int length1, 84 public AlbaLambdaInterchangeMove(int tour1, int position1, int length1, 68 85 int tour2, int position2, int length2, AlbaEncoding permutation) { 69 70 71 86 Tour1 = tour1; 87 Position1 = position1; 88 Length1 = length1; 72 89 73 74 75 90 Tour2 = tour2; 91 Position2 = position2; 92 Length2 = length2; 76 93 77 this.Individual = permutation.Clone() as AlbaEncoding; 78 } 79 80 public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) { 81 AlbaLambdaInterchangeMove clone = new AlbaLambdaInterchangeMove(); 82 83 clone.Tour1 = Tour1; 84 clone.Position1 = Position1; 85 clone.Length1 = Length1; 86 87 clone.Tour2 = Tour2; 88 clone.Position2 = Position2; 89 clone.Length2 = Length2; 90 91 if (Individual != null) 92 clone.Individual = (AlbaEncoding)cloner.Clone(Individual); 93 94 cloner.RegisterClonedObject(this, clone); 95 return clone; 94 this.Individual = permutation.Clone() as AlbaEncoding; 96 95 } 97 96 … … 100 99 public TourEvaluation GetMoveQuality( 101 100 IntValue vehicles, 102 DoubleArray dueTimeArray, DoubleArray serviceTimeArray, DoubleArray readyTimeArray, 101 DoubleArray dueTimeArray, DoubleArray serviceTimeArray, DoubleArray readyTimeArray, 103 102 DoubleArray demandArray, DoubleValue capacity, DoubleMatrix coordinates, 104 103 DoubleValue fleetUsageFactor, DoubleValue timeFactor, DoubleValue distanceFactor, 105 104 DoubleValue overloadPenalty, DoubleValue tardinessPenalty, 106 105 ILookupParameter<DoubleMatrix> distanceMatrix, Data.BoolValue useDistanceMatrix) { 107 108 109 110 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); 111 110 } 112 111
Note: See TracChangeset
for help on using the changeset viewer.