Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/02/12 18:59:15 (12 years ago)
Author:
jkarder
Message:

#1899: applied the changes suggested by ascheibe in comment:6:ticket:1899

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/SimilarityCalculators/VRPSimilarityCalculator.cs

    r8346 r8720  
    9292
    9393    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
    94       var sol1 = leftSolution.Variables[SolutionVariableName].Value as PotvinEncoding;
    95       var sol2 = rightSolution.Variables[SolutionVariableName].Value as PotvinEncoding;
     94      var sol1 = leftSolution.Variables[SolutionVariableName].Value as IVRPEncoding;
     95      var sol2 = rightSolution.Variables[SolutionVariableName].Value as IVRPEncoding;
    9696
    97       return CalculateSimilarity(sol1, sol2);
     97      var potvinSol1 = sol1 is PotvinEncoding ? sol1 as PotvinEncoding : PotvinEncoding.ConvertFrom(sol1, ProblemInstance);
     98      var potvinSol2 = sol2 is PotvinEncoding ? sol2 as PotvinEncoding : PotvinEncoding.ConvertFrom(sol2, ProblemInstance);
     99
     100      return CalculateSimilarity(potvinSol1, potvinSol2);
    98101    }
    99102  }
Note: See TracChangeset for help on using the changeset viewer.