Changeset 9750 for branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape.VRP/DistanceCalcualtors
- Timestamp:
- 07/25/13 09:21:45 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape.VRP/DistanceCalcualtors/VRPDistanceCalculator.cs
r7202 r9750 10 10 using HeuristicLab.Encodings.PermutationEncoding; 11 11 using HeuristicLab.Problems.VehicleRouting; 12 using HeuristicLab.Problems.VehicleRouting.Interfaces; 12 13 13 14 namespace HeuristicLab.Analysis.FitnessLandscape.DistanceCalculators.VRP { … … 61 62 private HashSet<Point> GetEdgeSet(IVRPEncoding vrpSolution) { 62 63 HashSet<Point> edges = new HashSet<Point>(); 63 foreach (var tour in vrpSolution.GetTours( null)) {64 if (tour. Cities.Count > 0) {65 edges.Add(CreateUndirectedEdge(0, tour. Cities[0]));66 for (int i = 0; i < tour. Cities.Count - 1; i++) {67 edges.Add(CreateUndirectedEdge(tour. Cities[i], tour.Cities[i + 1]));64 foreach (var tour in vrpSolution.GetTours()) { 65 if (tour.Stops.Count > 0) { 66 edges.Add(CreateUndirectedEdge(0, tour.Stops[0])); 67 for (int i = 0; i < tour.Stops.Count - 1; i++) { 68 edges.Add(CreateUndirectedEdge(tour.Stops[i], tour.Stops[i + 1])); 68 69 } 69 edges.Add(CreateUndirectedEdge(tour. Cities.Last(), 0));70 edges.Add(CreateUndirectedEdge(tour.Stops.Last(), 0)); 70 71 } 71 72 }
Note: See TracChangeset
for help on using the changeset viewer.