Ignore:
Timestamp:
03/04/15 15:22:21 (6 years ago)
Author:
jkarder
Message:

#2332:

  • fixed SolutionSimilarityCalculator.Equals
  • problems now wire all of their ISolutionSimilarityCalculators
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Operators/3.3/SolutionSimilarityCalculator.cs

    r12085 r12126  
    111111      if (x == null || y == null) return false;
    112112
    113       var q1 = x.Variables[QualityVariableName];
    114       var q2 = x.Variables[QualityVariableName];
     113      var q1 = x.Variables[QualityVariableName].Value;
     114      var q2 = y.Variables[QualityVariableName].Value;
    115115
    116116      return CheckQualityEquality(q1, q2) && CalculateSolutionSimilarity(x, y).IsAlmost(1.0);
     
    133133        }
    134134      }
    135       return 0; // throw exception?
     135      return 0;
    136136    }
    137137
     
    147147
    148148      if (da1 != null && da2 != null)
    149         return da1.SequenceEqual(da2);
     149        return !da1.Zip(da2, Tuple.Create).Any(x => !x.Item1.IsAlmost(x.Item2));
    150150
    151151      throw new ArgumentException("Could not determine quality equality.");
Note: See TracChangeset for help on using the changeset viewer.