Changeset 8304 for branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs
- Timestamp:
- 07/19/12 13:19:12 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs
r8303 r8304 43 43 if (left == null || right == null) 44 44 throw new ArgumentException("Cannot calculate similarity because one of the provided solutions or both are null."); 45 if (left == right) return 1.0; 45 46 46 47 int[,] edges = new int[right.Length, 2]; … … 60 61 } 61 62 62 p rotected override double CalculateSimilarity(IScope left, IScope right) {63 Permutationsol1 = left.Variables[Target].Value as Permutation;64 Permutationsol2 = right.Variables[Target].Value as Permutation;63 public override double CalculateIndividualSimilarity(IScope left, IScope right) { 64 var sol1 = left.Variables[Target].Value as Permutation; 65 var sol2 = right.Variables[Target].Value as Permutation; 65 66 66 67 return CalculateSimilarity(sol1, sol2);
Note: See TracChangeset
for help on using the changeset viewer.