- Timestamp:
- 09/29/11 15:51:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Tour.cs
r6607 r6851 48 48 } 49 49 50 public double GetTourLength(IVRPProblemInstance instance ) {50 public double GetTourLength(IVRPProblemInstance instance, IVRPEncoding solution) { 51 51 double length = 0; 52 52 … … 60 60 61 61 for (int i = 1; i < cities.Count; i++) { 62 length += instance.GetDistance(cities[i - 1], cities[i] );62 length += instance.GetDistance(cities[i - 1], cities[i], solution); 63 63 } 64 64 } … … 66 66 return length; 67 67 } 68 69 public bool IsEqual(Tour tour) { 70 bool equal = (tour != null) && (tour.Stops.Count == Stops.Count); 71 int index = 0; 72 73 while (equal && index < Stops.Count) { 74 equal = equal && tour.Stops[index] == Stops[index]; 75 index++; 76 } 77 78 return equal; 79 } 68 80 } 69 81 }
Note: See TracChangeset
for help on using the changeset viewer.