Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/19/12 13:19:12 (12 years ago)
Author:
jkarder
Message:

#1331: added support for similarity calculation between multiple individuals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TestFunctions/3.3/SimilarityCalculators/SingleObjectiveTestFunctionSimilarityCalculator.cs

    r8303 r8304  
    5757      if (bounds == null)
    5858        throw new ArgumentException("Cannot calculate similarity because no bounds were provided.");
     59      if (left == right) return 1.0;
    5960
    6061      double maxSum = 0.0;
     
    7172    }
    7273
    73     protected override double CalculateSimilarity(IScope left, IScope right) {
    74       RealVector sol1 = left.Variables[Target].Value as RealVector;
    75       RealVector sol2 = right.Variables[Target].Value as RealVector;
     74    public override double CalculateIndividualSimilarity(IScope left, IScope right) {
     75      var sol1 = left.Variables[Target].Value as RealVector;
     76      var sol2 = right.Variables[Target].Value as RealVector;
    7677
    7778      return CalculateSimilarity(sol1, sol2, Bounds);
Note: See TracChangeset for help on using the changeset viewer.