Changeset 9030
- Timestamp:
- 12/12/12 09:19:39 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Operators/3.3/SingleObjectiveSolutionSimilarityCalculator.cs
r8988 r9030 53 53 double q1 = ((DoubleValue)x.Variables[QualityVariableName].Value).Value; 54 54 double q2 = ((DoubleValue)y.Variables[QualityVariableName].Value).Value; 55 return q1.IsAlmost(q2) &&CalculateSolutionSimilarity(x, y).IsAlmost(1.0);55 return q1.IsAlmost(q2) || CalculateSolutionSimilarity(x, y).IsAlmost(1.0); 56 56 } 57 57 -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs
r8327 r9030 50 50 if (left.Length != right.Length) 51 51 throw new ArgumentException("Cannot calculate similarity because the provided solutions have different lengths."); 52 var comparer = new PermutationEqualityComparer(); 53 if (object.ReferenceEquals(left, right) || comparer.Equals(left, right)) return 1.0; 52 if (object.ReferenceEquals(left, right)) return 1.0; 54 53 55 54 switch (left.PermutationType) {
Note: See TracChangeset
for help on using the changeset viewer.