Changeset 14454 for branches/MemPRAlgorithm/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt
- Timestamp:
- 12/05/16 16:06:18 (8 years ago)
- Location:
- branches/MemPRAlgorithm/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt
- Files:
-
- 4 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MemPRAlgorithm/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMovePathEvaluator.cs
r14185 r14454 46 46 } 47 47 48 public static double EvaluateByCoordinates(Permutation permutation, TranslocationMove move, DoubleMatrix coordinates, TSP TranslocationMovePathEvaluator evaluator) {48 public static double EvaluateByCoordinates(Permutation permutation, TranslocationMove move, DoubleMatrix coordinates, TSPDistanceFunction distanceFunction) { 49 49 if (move.Index1 == move.Index3 50 50 || move.Index2 == permutation.Length - 1 && move.Index3 == 0 … … 65 65 double moveQuality = 0; 66 66 // remove three edges 67 moveQuality -= evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],67 moveQuality -= TravelingSalesmanProblem.CalculateDistance(distanceFunction, coordinates[edge1source, 0], coordinates[edge1source, 1], 68 68 coordinates[edge1target, 0], coordinates[edge1target, 1]); 69 moveQuality -= evaluator.CalculateDistance(coordinates[edge2source, 0], coordinates[edge2source, 1],69 moveQuality -= TravelingSalesmanProblem.CalculateDistance(distanceFunction, coordinates[edge2source, 0], coordinates[edge2source, 1], 70 70 coordinates[edge2target, 0], coordinates[edge2target, 1]); 71 moveQuality -= evaluator.CalculateDistance(coordinates[edge3source, 0], coordinates[edge3source, 1],71 moveQuality -= TravelingSalesmanProblem.CalculateDistance(distanceFunction, coordinates[edge3source, 0], coordinates[edge3source, 1], 72 72 coordinates[edge3target, 0], coordinates[edge3target, 1]); 73 73 // add three edges 74 moveQuality += evaluator.CalculateDistance(coordinates[edge3source, 0], coordinates[edge3source, 1],74 moveQuality += TravelingSalesmanProblem.CalculateDistance(distanceFunction, coordinates[edge3source, 0], coordinates[edge3source, 1], 75 75 coordinates[edge1target, 0], coordinates[edge1target, 1]); 76 moveQuality += evaluator.CalculateDistance(coordinates[edge2source, 0], coordinates[edge2source, 1],76 moveQuality += TravelingSalesmanProblem.CalculateDistance(distanceFunction, coordinates[edge2source, 0], coordinates[edge2source, 1], 77 77 coordinates[edge3target, 0], coordinates[edge3target, 1]); 78 moveQuality += evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],78 moveQuality += TravelingSalesmanProblem.CalculateDistance(distanceFunction, coordinates[edge1source, 0], coordinates[edge1source, 1], 79 79 coordinates[edge2target, 0], coordinates[edge2target, 1]); 80 80 return moveQuality; … … 110 110 } 111 111 112 protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates ) {113 return EvaluateByCoordinates(permutation, TranslocationMoveParameter.ActualValue, coordinates, this);112 protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates, TSPDistanceFunction distanceFunction) { 113 return EvaluateByCoordinates(permutation, TranslocationMoveParameter.ActualValue, coordinates, distanceFunction); 114 114 } 115 115
Note: See TracChangeset
for help on using the changeset viewer.