Changeset 7821 for branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting/3.3/Encodings
- Timestamp:
- 05/15/12 10:42:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/LocalImprovement/AlbaLambdaInterchangeLocalImprovementOperator.cs
r7259 r7821 101 101 } 102 102 103 public static void Apply(AlbaEncoding solution, int maxIterations, 103 public static void Apply(AlbaEncoding solution, int maxIterations, bool firstImprovement, 104 104 int lambda, int samples, IRandom random, ref double quality, out int evaluatedSolutions, 105 105 DoubleMatrix distanceMatrix, IntValue vehicles, DoubleArray dueTime, DoubleArray serviceTime, DoubleArray readyTime, … … 110 110 111 111 evaluatedSolutions = 0; 112 113 if (quality == -1) { 114 quality = VRPEvaluator.Evaluate(solution, vehicles, dueTime, serviceTime, readyTime, 115 demand, capacity, fleetUsageFactor, timeFactor, distanceFactor, 116 overloadPenalty, tardinessPenalty, coordinates, 117 distanceMatrixParameter, useDistanceMatrix).Quality; 118 evaluatedSolutions++; 119 } 112 120 113 121 for (int i = 0; i < maxIterations; i++) { … … 126 134 127 135 evaluatedSolutions++; 128 if (moveQuality < quality || quality == -1) {136 if (moveQuality < quality) { 129 137 quality = moveQuality; 130 138 bestMove = move; 139 140 if (firstImprovement) 141 break; 131 142 } 132 143 } … … 155 166 int evaluatedSolutions; 156 167 157 Apply(solution, maxIterations, lambda, samples, random, ref quality, out evaluatedSolutions,168 Apply(solution, maxIterations, false, lambda, samples, random, ref quality, out evaluatedSolutions, 158 169 problem.DistanceMatrix, problem.Vehicles, problem.DueTime, problem.ServiceTime, 159 170 problem.ReadyTime, problem.Demand, problem.Capacity, problem.Coordinates,
Note: See TracChangeset
for help on using the changeset viewer.