- Timestamp:
- 08/09/10 18:08:14 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/VRPOperator.cs
r4174 r4179 25 25 using HeuristicLab.Data; 26 26 using HeuristicLab.Problems.VehicleRouting.Encodings; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using System; 27 29 28 30 namespace HeuristicLab.Problems.VehicleRouting { 31 [Item("VRPOperator", "A VRP operator.")] 32 [StorableClass] 29 33 public abstract class VRPOperator : SingleSuccessorOperator, IVRPOperator { 30 34 public int Cities { … … 32 36 } 33 37 public ILookupParameter<DoubleMatrix> CoordinatesParameter { 34 get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; } 38 get { 39 if (Parameters.ContainsKey("Coordinates")) 40 return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; 41 else 42 return null; 43 } 35 44 } 36 45 public ILookupParameter<DoubleMatrix> DistanceMatrixParameter { 37 get { return (ILookupParameter<DoubleMatrix>)Parameters["DistanceMatrix"]; } 46 get { 47 if (Parameters.ContainsKey("DistanceMatrix")) 48 return (ILookupParameter<DoubleMatrix>)Parameters["DistanceMatrix"]; 49 else 50 return null; 51 } 38 52 } 39 53 public ILookupParameter<BoolValue> UseDistanceMatrixParameter { 40 get { return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"]; } 54 get { 55 if (Parameters.ContainsKey("UseDistanceMatrix")) 56 return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"]; 57 else 58 return null; 59 } 41 60 } 42 61 public ILookupParameter<IntValue> VehiclesParameter { 43 get { return (ILookupParameter<IntValue>)Parameters["Vehicles"]; } 62 get { 63 if (Parameters.ContainsKey("Vehicles")) 64 return (ILookupParameter<IntValue>)Parameters["Vehicles"]; 65 else 66 return null; 67 } 44 68 } 45 69 public ILookupParameter<DoubleValue> CapacityParameter { 46 get { return (ILookupParameter<DoubleValue>)Parameters["Capacity"]; } 70 get { 71 if (Parameters.ContainsKey("Capacity")) 72 return (ILookupParameter<DoubleValue>)Parameters["Capacity"]; 73 else 74 return null; 75 } 47 76 } 48 77 public ILookupParameter<DoubleArray> DemandParameter { 49 get { return (ILookupParameter<DoubleArray>)Parameters["Demand"]; } 78 get { 79 if (Parameters.ContainsKey("Demand")) 80 return (ILookupParameter<DoubleArray>)Parameters["Demand"]; 81 else 82 return null; 83 } 50 84 } 51 85 public ILookupParameter<DoubleArray> ReadyTimeParameter { 52 get { return (ILookupParameter<DoubleArray>)Parameters["ReadyTime"]; } 86 get { 87 if (Parameters.ContainsKey("ReadyTime")) 88 return (ILookupParameter<DoubleArray>)Parameters["ReadyTime"]; 89 else 90 return null; 91 } 53 92 } 54 93 public ILookupParameter<DoubleArray> DueTimeParameter { 55 get { return (ILookupParameter<DoubleArray>)Parameters["DueTime"]; } 94 get { 95 if (Parameters.ContainsKey("DueTime")) 96 return (ILookupParameter<DoubleArray>)Parameters["DueTime"]; 97 else 98 return null; 99 } 56 100 } 57 101 public ILookupParameter<DoubleArray> ServiceTimeParameter { 58 get { return (ILookupParameter<DoubleArray>)Parameters["ServiceTime"]; } 102 get { 103 if (Parameters.ContainsKey("ServiceTime")) 104 return (ILookupParameter<DoubleArray>)Parameters["ServiceTime"]; 105 else 106 return null; 107 } 59 108 } 109 110 [StorableConstructor] 111 protected VRPOperator(bool deserializing) : base(deserializing) { } 60 112 61 113 public VRPOperator()
Note: See TracChangeset
for help on using the changeset viewer.