Changeset 6569 for branches/QAPAlgorithms/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs
- Timestamp:
- 07/17/11 22:51:11 (13 years ago)
- Location:
- branches/QAPAlgorithms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/QAPAlgorithms
- Property svn:ignore
-
old new 12 12 *.psess 13 13 *.vsp 14 *.docstates
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/QAPAlgorithms/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting merged: 6441,6448-6450,6455,6459,6491,6522-6523,6548
- Property svn:mergeinfo changed
-
branches/QAPAlgorithms/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs
r5445 r6569 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Data; 26 27 27 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 39 40 public PotvinOneLevelExchangeMainpulator() : base() { } 40 41 41 protected override void Manipulate(IRandom random, PotvinEncoding individual) { 42 public static void Apply(IRandom random, PotvinEncoding individual, 43 DoubleArray dueTime, DoubleArray readyTime, DoubleArray serviceTime, DoubleArray demand, 44 DoubleValue capacity, DistanceMatrix distMatrix, bool allowInfeasible) { 42 45 int selectedIndex = SelectRandomTourBiasedByLength(random, individual); 43 46 Tour route1 = … … 48 51 int insertedRoute, insertedPlace; 49 52 50 if (FindInsertionPlace(individual, route1.Cities[i], selectedIndex, out insertedRoute, out insertedPlace)) { 53 if (FindInsertionPlace(individual, route1.Cities[i], selectedIndex, 54 dueTime, serviceTime, readyTime, demand, capacity, 55 distMatrix, allowInfeasible, 56 out insertedRoute, out insertedPlace)) { 51 57 individual.Tours[insertedRoute].Cities.Insert(insertedPlace, route1.Cities[i]); 52 58 replaced.Add(route1.Cities[i]); … … 65 71 individual.Tours.Remove(route1); 66 72 } 73 74 protected override void Manipulate(IRandom random, PotvinEncoding individual) { 75 BoolValue useDistanceMatrix = UseDistanceMatrixParameter.ActualValue; 76 DoubleMatrix coordinates = CoordinatesParameter.ActualValue; 77 DistanceMatrix distMatrix = VRPUtilities.GetDistanceMatrix(coordinates, DistanceMatrixParameter, useDistanceMatrix); 78 DoubleArray dueTime = DueTimeParameter.ActualValue; 79 DoubleArray readyTime = ReadyTimeParameter.ActualValue; 80 DoubleArray serviceTime = ServiceTimeParameter.ActualValue; 81 DoubleArray demand = DemandParameter.ActualValue; 82 DoubleValue capacity = CapacityParameter.ActualValue; 83 84 bool allowInfeasible = AllowInfeasibleSolutions.Value.Value; 85 86 Apply(random, individual, dueTime, readyTime, serviceTime, demand, capacity, distMatrix, allowInfeasible); 87 } 67 88 } 68 89 }
Note: See TracChangeset
for help on using the changeset viewer.