Changeset 17698 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/SimilarityCalculators
- Timestamp:
- 07/24/20 00:58:42 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/SimilarityCalculators/VRPSimilarityCalculator.cs
r17226 r17698 57 57 } 58 58 59 public static double CalculateSimilarity(PotvinEncod ing left, PotvinEncodingright) {59 public static double CalculateSimilarity(PotvinEncodedSolution left, PotvinEncodedSolution right) { 60 60 if (left == null || right == null) 61 61 throw new ArgumentException("Cannot calculate similarity because one of the provided solutions or both are null."); … … 93 93 94 94 public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) { 95 var sol1 = leftSolution.Variables[SolutionVariableName].Value as IVRPEncod ing;96 var sol2 = rightSolution.Variables[SolutionVariableName].Value as IVRPEncod ing;95 var sol1 = leftSolution.Variables[SolutionVariableName].Value as IVRPEncodedSolution; 96 var sol2 = rightSolution.Variables[SolutionVariableName].Value as IVRPEncodedSolution; 97 97 98 var potvinSol1 = sol1 is PotvinEncod ing ? sol1 as PotvinEncoding : PotvinEncoding.ConvertFrom(sol1, ProblemInstance);99 var potvinSol2 = sol2 is PotvinEncod ing ? 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); 100 100 101 101 return CalculateSimilarity(potvinSol1, potvinSol2);
Note: See TracChangeset
for help on using the changeset viewer.