Changeset 9010 for trunk/sources/HeuristicLab.Problems.VehicleRouting
- Timestamp:
- 12/06/12 16:18:16 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/CVRPInterpreter.cs
r8649 r9010 28 28 29 29 namespace HeuristicLab.Problems.VehicleRouting.Interpreters { 30 public class CVRPInterpreter : VRPInterpreter, IVRPDataInterpreter<CVRPData> { 31 public override Type GetDataType() { 32 return typeof(CVRPData); 33 } 34 30 public class CVRPInterpreter : VRPInterpreter, IVRPDataInterpreter<CVRPData> { 35 31 protected override IVRPProblemInstance CreateProblemInstance() { 36 32 return new CVRPProblemInstance(); … … 38 34 39 35 protected override void Interpret(IVRPData data, IVRPProblemInstance problemInstance) { 40 CVRPData cvrpData = data as CVRPData;41 CVRPProblemInstance problem = problemInstance as CVRPProblemInstance;36 CVRPData cvrpData = (CVRPData)data; 37 CVRPProblemInstance problem = (CVRPProblemInstance)problemInstance; 42 38 43 39 if (cvrpData.Coordinates != null) -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/CVRPTWInterpreter.cs
r8649 r9010 28 28 29 29 namespace HeuristicLab.Problems.VehicleRouting.Interpreters { 30 public class CVRPTWInterpreter: CVRPInterpreter, IVRPDataInterpreter<CVRPTWData> { 31 public override Type GetDataType() { 32 return typeof(CVRPTWData); 33 } 34 30 public class CVRPTWInterpreter: CVRPInterpreter, IVRPDataInterpreter<CVRPTWData> { 35 31 protected override IVRPProblemInstance CreateProblemInstance() { 36 32 return new CVRPTWProblemInstance(); … … 40 36 base.Interpret(data, problemInstance); 41 37 42 CVRPTWData cvrptwData = data as CVRPTWData;43 CVRPTWProblemInstance problem = problemInstance as CVRPTWProblemInstance;38 CVRPTWData cvrptwData = (CVRPTWData)data; 39 CVRPTWProblemInstance problem = (CVRPTWProblemInstance)problemInstance; 44 40 45 41 problem.ReadyTime = new DoubleArray(cvrptwData.ReadyTimes); -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/IVRPDataInterpreter.cs
r8649 r9010 34 34 35 35 public interface IVRPDataInterpreter { 36 Type GetDataType();37 36 VRPInstanceDescription Interpret(IVRPData data); 38 37 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/MDCVRPInterpreter.cs
r8649 r9010 28 28 29 29 namespace HeuristicLab.Problems.VehicleRouting.Interpreters { 30 public class MDCVRPInterpreter : VRPInterpreter, IVRPDataInterpreter<MDCVRPData> { 31 public override Type GetDataType() { 32 return typeof(MDCVRPData); 33 } 34 30 public class MDCVRPInterpreter : VRPInterpreter, IVRPDataInterpreter<MDCVRPData> { 35 31 protected override IVRPProblemInstance CreateProblemInstance() { 36 32 return new MDCVRPProblemInstance(); … … 38 34 39 35 protected override void Interpret(IVRPData data, IVRPProblemInstance problemInstance) { 40 MDCVRPData cvrpData = data as MDCVRPData;41 MDCVRPProblemInstance problem = problemInstance as MDCVRPProblemInstance;36 MDCVRPData cvrpData = (MDCVRPData)data; 37 MDCVRPProblemInstance problem = (MDCVRPProblemInstance)problemInstance; 42 38 43 39 if (cvrpData.Coordinates != null) -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/MDCVRPTWInterpreter.cs
r8649 r9010 28 28 29 29 namespace HeuristicLab.Problems.VehicleRouting.Interpreters { 30 public class MDCVRPTWInterpreter : MDCVRPInterpreter, IVRPDataInterpreter<MDCVRPTWData> { 31 public override Type GetDataType() { 32 return typeof(MDCVRPTWData); 33 } 34 30 public class MDCVRPTWInterpreter : MDCVRPInterpreter, IVRPDataInterpreter<MDCVRPTWData> { 35 31 protected override IVRPProblemInstance CreateProblemInstance() { 36 32 return new MDCVRPTWProblemInstance(); … … 40 36 base.Interpret(data, problemInstance); 41 37 42 MDCVRPTWData cvrptwData = data as MDCVRPTWData;43 MDCVRPTWProblemInstance problem = problemInstance as MDCVRPTWProblemInstance;38 MDCVRPTWData cvrptwData = (MDCVRPTWData)data; 39 MDCVRPTWProblemInstance problem = (MDCVRPTWProblemInstance)problemInstance; 44 40 45 41 problem.ReadyTime = new DoubleArray(cvrptwData.ReadyTimes); -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/PDPTWInterpreter.cs
r8649 r9010 28 28 29 29 namespace HeuristicLab.Problems.VehicleRouting.Interpreters { 30 public class PDPTWInterpreter : CVRPTWInterpreter, IVRPDataInterpreter<PDPTWData> { 31 public override Type GetDataType() { 32 return typeof(PDPTWData); 33 } 34 30 public class PDPTWInterpreter : CVRPTWInterpreter, IVRPDataInterpreter<PDPTWData> { 35 31 protected override IVRPProblemInstance CreateProblemInstance() { 36 32 return new CVRPPDTWProblemInstance(); … … 40 36 base.Interpret(data, problemInstance); 41 37 42 PDPTWData pdpData = data as PDPTWData;43 CVRPPDTWProblemInstance problem = problemInstance as CVRPPDTWProblemInstance;38 PDPTWData pdpData = (PDPTWData)data; 39 CVRPPDTWProblemInstance problem = (CVRPPDTWProblemInstance)problemInstance; 44 40 45 41 problem.PickupDeliveryLocation = new IntArray(pdpData.PickupDeliveryLocations); -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/VRPInterpreter.cs
r8649 r9010 50 50 } 51 51 52 public abstract Type GetDataType();53 54 52 protected abstract IVRPProblemInstance CreateProblemInstance(); 55 53
Note: See TracChangeset
for help on using the changeset viewer.