- Timestamp:
- 08/19/10 16:51:30 (14 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General
- Files:
-
- 2 added
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/Interfaces/IVRPMove.cs
r4205 r4268 27 27 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { 28 28 public interface IVRPMove : IItem { 29 TourEvaluation GetMoveQuality(IVRPEncoding individual, 29 TourEvaluation GetMoveQuality(IVRPEncoding individual, IntValue vehicles, 30 30 DoubleArray dueTimeArray, DoubleArray serviceTimeArray, DoubleArray readyTimeArray, DoubleArray demandArray, 31 31 DoubleValue capacity,DoubleMatrix coordinates, -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveEvaluator.cs
r4205 r4268 47 47 return move.GetMoveQuality( 48 48 VRPToursParameter.ActualValue, 49 VehiclesParameter.ActualValue, 49 50 DueTimeParameter.ActualValue, 50 51 ServiceTimeParameter.ActualValue, -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/TourEncoding.cs
r4230 r4268 37 37 38 38 #region IVRPEncoding Members 39 public virtual List<Tour> GetTours() { 40 return new List<Tour>(Tours); 39 public virtual List<Tour> GetTours(ILookupParameter<DoubleMatrix> distanceMatrix = null, int maxVehicles = int.MaxValue) { 40 List<Tour> result = new List<Tour>(Tours); 41 42 while (result.Count > maxVehicles) { 43 Tour tour = result[result.Count - 1]; 44 result[result.Count - 2].Cities.AddRange(tour.Cities); 45 46 result.Remove(tour); 47 } 48 49 return result; 41 50 } 42 51 … … 66 75 : base() { 67 76 } 68 69 public static void ConvertFrom(IVRPEncoding encoding, TourEncoding solution ) {70 solution.Tours = new ItemList<Tour>(encoding.GetTours( ));77 78 public static void ConvertFrom(IVRPEncoding encoding, TourEncoding solution, ILookupParameter<DoubleMatrix> distanceMatrix) { 79 solution.Tours = new ItemList<Tour>(encoding.GetTours(distanceMatrix)); 71 80 } 72 81
Note: See TracChangeset
for help on using the changeset viewer.