Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/24/20 00:58:42 (4 years ago)
Author:
abeham
Message:

#2521: working on VRP (WIP)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/SimilarityCalculators/VRPSimilarityCalculator.cs

    r17226 r17698  
    5757    }
    5858
    59     public static double CalculateSimilarity(PotvinEncoding left, PotvinEncoding right) {
     59    public static double CalculateSimilarity(PotvinEncodedSolution left, PotvinEncodedSolution right) {
    6060      if (left == null || right == null)
    6161        throw new ArgumentException("Cannot calculate similarity because one of the provided solutions or both are null.");
     
    9393
    9494    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
    95       var sol1 = leftSolution.Variables[SolutionVariableName].Value as IVRPEncoding;
    96       var sol2 = rightSolution.Variables[SolutionVariableName].Value as IVRPEncoding;
     95      var sol1 = leftSolution.Variables[SolutionVariableName].Value as IVRPEncodedSolution;
     96      var sol2 = rightSolution.Variables[SolutionVariableName].Value as IVRPEncodedSolution;
    9797
    98       var potvinSol1 = sol1 is PotvinEncoding ? sol1 as PotvinEncoding : PotvinEncoding.ConvertFrom(sol1, ProblemInstance);
    99       var potvinSol2 = sol2 is PotvinEncoding ? sol2 as PotvinEncoding : PotvinEncoding.ConvertFrom(sol2, ProblemInstance);
     98      var potvinSol1 = sol1 is PotvinEncodedSolution ? sol1 as PotvinEncodedSolution : PotvinEncodedSolution.ConvertFrom(sol1, ProblemInstance);
     99      var potvinSol2 = sol2 is PotvinEncodedSolution ? sol2 as PotvinEncodedSolution : PotvinEncodedSolution.ConvertFrom(sol2, ProblemInstance);
    100100
    101101      return CalculateSimilarity(potvinSol1, potvinSol2);
Note: See TracChangeset for help on using the changeset viewer.