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.VehicleRouting/3.3/SimilarityCalculators/VRPSimilarityCalculator.cs

    r8303 r8304  
    4646      if (left == null || right == null)
    4747        throw new ArgumentException("Cannot calculate similarity because one of the provided solutions or both are null.");
     48      if (left == right) return 1.0;
    4849
    4950      // extract edges from first solution
     
    7778    }
    7879
    79     protected override double CalculateSimilarity(IScope left, IScope right) {
    80       PotvinEncoding sol1 = left.Variables[Target].Value as PotvinEncoding;
    81       PotvinEncoding sol2 = right.Variables[Target].Value as PotvinEncoding;
     80    public override double CalculateIndividualSimilarity(IScope left, IScope right) {
     81      var sol1 = left.Variables[Target].Value as PotvinEncoding;
     82      var sol2 = right.Variables[Target].Value as PotvinEncoding;
    8283
    8384      return CalculateSimilarity(sol1, sol2);
Note: See TracChangeset for help on using the changeset viewer.