- Timestamp:
- 03/15/12 14:29:53 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPPathMoveEvaluator.cs
r7259 r7621 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 78 79 DistanceMatrix distanceMatrix = DistanceMatrixParameter.ActualValue; 79 80 if (distanceMatrix == null) { 81 if (coordinates == null) throw new InvalidOperationException("Neither a distance matrix nor coordinates were given."); 80 82 distanceMatrix = CalculateDistanceMatrix(coordinates); 81 83 DistanceMatrixParameter.ActualValue = distanceMatrix; 82 84 } 83 85 relativeQualityDifference = EvaluateByDistanceMatrix(permutation, distanceMatrix); 84 } else relativeQualityDifference = EvaluateByCoordinates(permutation, coordinates); 86 } else { 87 if (coordinates == null) throw new InvalidOperationException("No coordinates were given."); 88 relativeQualityDifference = EvaluateByCoordinates(permutation, coordinates); 89 } 85 90 DoubleValue moveQuality = MoveQualityParameter.ActualValue; 86 91 if (moveQuality == null) MoveQualityParameter.ActualValue = new DoubleValue(QualityParameter.ActualValue.Value + relativeQualityDifference);
Note: See TracChangeset
for help on using the changeset viewer.