- Timestamp:
- 05/30/12 16:46:06 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPProblemInstance.cs
r7864 r7934 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("MDCVRPProblemInstance", "Represents a multi depot CVRP instance.")] 38 37 [StorableClass] 39 public class MDCVRPProblemInstance : MultiDepotVRPProblemInstance, IHeterogenousCapacitatedProblemInstance {38 public class MDCVRPProblemInstance : MultiDepotVRPProblemInstance, IHeterogenousCapacitatedProblemInstance { 40 39 protected IValueParameter<DoubleArray> CapacityParameter { 41 40 get { return (IValueParameter<DoubleArray>)Parameters["Capacity"]; } … … 66 65 67 66 protected override IEnumerable<IOperator> GetOperators() { 68 69 67 return base.GetOperators() 68 .Where(o => o is IHeterogenousCapacitatedOperator).Cast<IOperator>(); 70 69 } 71 70 … … 81 80 } 82 81 } 83 82 84 83 [StorableConstructor] 85 84 protected MDCVRPProblemInstance(bool deserializing) : base(deserializing) { } … … 99 98 protected MDCVRPProblemInstance(MDCVRPProblemInstance original, Cloner cloner) 100 99 : base(original, cloner) { 101 100 AttachEventHandlers(); 102 101 } 103 102 104 103 [StorableHook(HookType.AfterDeserialization)] 105 private void AfterDeserialization Hook() {104 private void AfterDeserialization() { 106 105 AttachEventHandlers(); 107 106 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs
r7864 r7934 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("MDCVRPPDTWProblemInstance", "Represents a multi depot CVRPPDTW instance.")] 38 37 [StorableClass] 39 public class MDCVRPPDTWProblemInstance : MDCVRPTWProblemInstance, IPickupAndDeliveryProblemInstance {38 public class MDCVRPPDTWProblemInstance : MDCVRPTWProblemInstance, IPickupAndDeliveryProblemInstance { 40 39 protected IValueParameter<IntArray> PickupDeliveryLocationParameter { 41 40 get { return (IValueParameter<IntArray>)Parameters["PickupDeliveryLocation"]; } … … 44 43 get { return (IValueParameter<DoubleValue>)Parameters["EvalPickupViolationPenalty"]; } 45 44 } 46 45 47 46 public IntArray PickupDeliveryLocation { 48 47 get { return PickupDeliveryLocationParameter.Value; } … … 66 65 67 66 protected override IEnumerable<IOperator> GetOperators() { 68 return 67 return 69 68 ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>() 70 69 .Where(o => !(o is IAnalyzer)) … … 77 76 .Cast<IOperator>().Union(base.GetAnalyzers()); 78 77 } 79 78 80 79 protected override IVRPEvaluator Evaluator { 81 80 get { … … 87 86 return PickupDeliveryLocation[city - 1]; 88 87 } 89 88 90 89 [StorableConstructor] 91 90 protected MDCVRPPDTWProblemInstance(bool deserializing) : base(deserializing) { } … … 106 105 protected MDCVRPPDTWProblemInstance(MDCVRPPDTWProblemInstance original, Cloner cloner) 107 106 : base(original, cloner) { 108 107 AttachEventHandlers(); 109 108 } 110 109 111 110 [StorableHook(HookType.AfterDeserialization)] 112 private void AfterDeserialization Hook() {111 private void AfterDeserialization() { 113 112 AttachEventHandlers(); 114 113 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWProblemInstance.cs
r7864 r7934 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("MDCVRPTWProblemInstance", "Represents a multi depot CVRPTW instance.")] 38 37 [StorableClass] 39 public class MDCVRPTWProblemInstance : MDCVRPProblemInstance, ITimeWindowedProblemInstance {38 public class MDCVRPTWProblemInstance : MDCVRPProblemInstance, ITimeWindowedProblemInstance { 40 39 protected IValueParameter<DoubleArray> ReadyTimeParameter { 41 40 get { return (IValueParameter<DoubleArray>)Parameters["ReadyTime"]; } … … 97 96 .Cast<IOperator>().Union(base.GetAnalyzers()); 98 97 } 99 98 100 99 protected override IVRPEvaluator Evaluator { 101 100 get { … … 103 102 } 104 103 } 105 104 106 105 [StorableConstructor] 107 106 protected MDCVRPTWProblemInstance(bool deserializing) : base(deserializing) { } … … 125 124 protected MDCVRPTWProblemInstance(MDCVRPTWProblemInstance original, Cloner cloner) 126 125 : base(original, cloner) { 127 126 AttachEventHandlers(); 128 127 } 129 128 130 129 [StorableHook(HookType.AfterDeserialization)] 131 private void AfterDeserialization Hook() {130 private void AfterDeserialization() { 132 131 AttachEventHandlers(); 133 132 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs
r7864 r7934 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("CVRPProblemInstance", "Represents a single depot CVRP instance.")] 38 37 [StorableClass] 39 public class CVRPProblemInstance : SingleDepotVRPProblemInstance, IHomogenousCapacitatedProblemInstance {38 public class CVRPProblemInstance : SingleDepotVRPProblemInstance, IHomogenousCapacitatedProblemInstance { 40 39 protected IValueParameter<DoubleValue> CapacityParameter { 41 40 get { return (IValueParameter<DoubleValue>)Parameters["Capacity"]; } … … 60 59 return currentOverloadPenalty; 61 60 else 62 return OverloadPenaltyParameter.Value; } 61 return OverloadPenaltyParameter.Value; 62 } 63 63 set { CurrentOverloadPenaltyParameter.Value = value; } 64 64 } 65 65 66 66 protected override IEnumerable<IOperator> GetOperators() { 67 68 67 return base.GetOperators() 68 .Where(o => o is IHomogenousCapacitatedOperator).Cast<IOperator>(); 69 69 } 70 70 … … 80 80 } 81 81 } 82 82 83 83 [StorableConstructor] 84 84 protected CVRPProblemInstance(bool deserializing) : base(deserializing) { } … … 98 98 protected CVRPProblemInstance(CVRPProblemInstance original, Cloner cloner) 99 99 : base(original, cloner) { 100 100 AttachEventHandlers(); 101 101 } 102 102 103 103 [StorableHook(HookType.AfterDeserialization)] 104 private void AfterDeserialization Hook() {104 private void AfterDeserialization() { 105 105 AttachEventHandlers(); 106 106 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs
r7864 r7934 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("CVRPPDTWProblemInstance", "Represents a single depot CVRPPDTW instance.")] 38 37 [StorableClass] 39 public class CVRPPDTWProblemInstance : CVRPTWProblemInstance, IPickupAndDeliveryProblemInstance {38 public class CVRPPDTWProblemInstance : CVRPTWProblemInstance, IPickupAndDeliveryProblemInstance { 40 39 protected IValueParameter<IntArray> PickupDeliveryLocationParameter { 41 40 get { return (IValueParameter<IntArray>)Parameters["PickupDeliveryLocation"]; } … … 44 43 get { return (IValueParameter<DoubleValue>)Parameters["EvalPickupViolationPenalty"]; } 45 44 } 46 45 47 46 public IntArray PickupDeliveryLocation { 48 47 get { return PickupDeliveryLocationParameter.Value; } … … 66 65 67 66 protected override IEnumerable<IOperator> GetOperators() { 68 return 67 return 69 68 ApplicationManager.Manager.GetInstances<IPickupAndDeliveryOperator>() 70 69 .Where(o => !(o is IAnalyzer)) … … 77 76 .Cast<IOperator>().Union(base.GetAnalyzers()); 78 77 } 79 78 80 79 protected override IVRPEvaluator Evaluator { 81 80 get { … … 87 86 return PickupDeliveryLocation[city]; 88 87 } 89 88 90 89 [StorableConstructor] 91 90 protected CVRPPDTWProblemInstance(bool deserializing) : base(deserializing) { } … … 106 105 protected CVRPPDTWProblemInstance(CVRPPDTWProblemInstance original, Cloner cloner) 107 106 : base(original, cloner) { 108 107 AttachEventHandlers(); 109 108 } 110 109 111 110 [StorableHook(HookType.AfterDeserialization)] 112 private void AfterDeserialization Hook() {111 private void AfterDeserialization() { 113 112 AttachEventHandlers(); 114 113 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs
r7864 r7934 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 using HeuristicLab.Parameters;30 27 using HeuristicLab.Data; 31 28 using HeuristicLab.Optimization; 29 using HeuristicLab.Parameters; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 31 using HeuristicLab.PluginInfrastructure; 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 33 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Common;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 37 36 [Item("CVRPTWProblemInstance", "Represents a single depot CVRPTW instance.")] 38 37 [StorableClass] 39 public class CVRPTWProblemInstance : CVRPProblemInstance, ITimeWindowedProblemInstance {38 public class CVRPTWProblemInstance : CVRPProblemInstance, ITimeWindowedProblemInstance { 40 39 protected IValueParameter<DoubleArray> ReadyTimeParameter { 41 40 get { return (IValueParameter<DoubleArray>)Parameters["ReadyTime"]; } … … 97 96 .Cast<IOperator>().Union(base.GetAnalyzers()); 98 97 } 99 98 100 99 protected override IVRPEvaluator Evaluator { 101 100 get { … … 103 102 } 104 103 } 105 104 106 105 [StorableConstructor] 107 106 protected CVRPTWProblemInstance(bool deserializing) : base(deserializing) { } … … 125 124 protected CVRPTWProblemInstance(CVRPTWProblemInstance original, Cloner cloner) 126 125 : base(original, cloner) { 127 126 AttachEventHandlers(); 128 127 } 129 128 130 129 [StorableHook(HookType.AfterDeserialization)] 131 private void AfterDeserialization Hook() {130 private void AfterDeserialization() { 132 131 AttachEventHandlers(); 133 132 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r7852 r7934 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Text; 25 using HeuristicLab.Common; 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 28 using HeuristicLab.Parameters; 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 26 31 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HeuristicLab.Core;29 using HeuristicLab.Parameters;30 using HeuristicLab.Data;31 using HeuristicLab.Optimization;32 using HeuristicLab.PluginInfrastructure;33 using HeuristicLab.Common;34 using HeuristicLab.Problems.VehicleRouting.Encodings.General;35 32 36 33 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 72 69 } 73 70 } 74 71 75 72 protected ValueParameter<DoubleMatrix> CoordinatesParameter { 76 73 get { return (ValueParameter<DoubleMatrix>)Parameters["Coordinates"]; } … … 174 171 175 172 public IVRPEvaluator SolutionEvaluator { 176 get { 173 get { 177 174 return evaluator; 178 175 } … … 187 184 if (distanceMatrix != null) 188 185 distance = distanceMatrix[start, end]; 189 else 186 else 190 187 distance = CalculateDistance(start, end); 191 188 … … 199 196 startDistance = GetDistance(start, customer, solution); 200 197 endDistance = GetDistance(customer, end, solution); 201 198 202 199 double newDistance = startDistance + endDistance; 203 200 … … 244 241 protected abstract IVRPEvaluator Evaluator { get; } 245 242 protected abstract IVRPCreator Creator { get; } 246 243 247 244 [StorableConstructor] 248 245 protected VRPProblemInstance(bool deserializing) : base(deserializing) { } … … 265 262 protected VRPProblemInstance(VRPProblemInstance original, Cloner cloner) 266 263 : base(original, cloner) { 267 evaluator = Evaluator; 264 evaluator = Evaluator; 268 265 AttachEventHandlers(); 269 266 } 270 267 271 268 [StorableHook(HookType.AfterDeserialization)] 272 private void AfterDeserialization Hook() {269 private void AfterDeserialization() { 273 270 evaluator = Evaluator; 274 271 AttachEventHandlers();
Note: See TracChangeset
for help on using the changeset viewer.