Changeset 6711 for branches/VRP/HeuristicLab.Problems.VehicleRouting
- Timestamp:
- 09/06/11 14:57:26 (13 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4
- Files:
-
- 7 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj
r6710 r6711 123 123 <Compile Include="Analyzer\BestSolution\PickupAndDelivery\BestPickupAndDeliveryVRPSolutionAnalyzer.cs" /> 124 124 <Compile Include="Analyzer\BestSolution\TimeWindowed\BestTimeWindowedVRPSolutionAnalyzer.cs" /> 125 <Compile Include="Analyzer\ConstraintRelaxation\Capacitated\CapacityRelaxationVRPAnalyzer.cs" /> 126 <Compile Include="Analyzer\ConstraintRelaxation\PickupAndDelivery\PickupViolationsRelaxationVRPAnalyzer.cs" /> 127 <Compile Include="Analyzer\ConstraintRelaxation\TimeWindowed\TimeWindowRelaxationVRPAnalyzer.cs" /> 125 128 <Compile Include="Analyzer\VRPSolution.cs" /> 126 129 <Compile Include="Encodings\Alba\AlbaEncoding.cs" /> -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPProblemInstance.cs
r6710 r6711 49 49 set { CapacityParameter.Value = value; } 50 50 } 51 52 [Storable] 53 private DoubleValue currentOverloadPenalty; 54 51 55 public DoubleValue OverloadPenalty { 52 get { return OverloadPenaltyParameter.Value; } 53 set { OverloadPenaltyParameter.Value = value; } 56 get { 57 if (currentOverloadPenalty != null) 58 return currentOverloadPenalty; 59 else 60 return OverloadPenaltyParameter.Value; } 61 set { currentOverloadPenalty = value; } 54 62 } 55 63 … … 87 95 protected CVRPProblemInstance(CVRPProblemInstance original, Cloner cloner) 88 96 : base(original, cloner) { 97 currentOverloadPenalty = cloner.Clone(original.currentOverloadPenalty) as DoubleValue; 98 89 99 AttachEventHandlers(); 90 100 } … … 100 110 OverloadPenaltyParameter.ValueChanged += new EventHandler(OverloadPenaltyParameter_ValueChanged); 101 111 OverloadPenaltyParameter.Value.ValueChanged += new EventHandler(OverloadPenalty_ValueChanged); 112 } 113 114 public override void InitializeState() { 115 base.InitializeState(); 116 117 currentOverloadPenalty = null; 102 118 } 103 119 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWProblemInstance.cs
r6710 r6711 50 50 } 51 51 52 [Storable] 53 private DoubleValue currentPickupViolationPenalty; 54 52 55 public DoubleValue PickupViolationPenalty { 53 get { return PickupViolationPenaltyParameter.Value; } 54 set { PickupViolationPenaltyParameter.Value = value; } 56 get { 57 if (currentPickupViolationPenalty != null) 58 return currentPickupViolationPenalty; 59 else 60 return PickupViolationPenaltyParameter.Value; 61 } 62 set { currentPickupViolationPenalty = value; } 55 63 } 56 64 … … 90 98 protected CVRPPDTWProblemInstance(CVRPPDTWProblemInstance original, Cloner cloner) 91 99 : base(original, cloner) { 100 currentPickupViolationPenalty = cloner.Clone(original.currentPickupViolationPenalty) as DoubleValue; 101 92 102 AttachEventHandlers(); 93 103 } … … 100 110 private void AttachEventHandlers() { 101 111 PickupDeliveryLocationParameter.ValueChanged += new EventHandler(PickupDeliveryLocationParameter_ValueChanged); 112 } 113 114 public override void InitializeState() { 115 base.InitializeState(); 116 117 currentPickupViolationPenalty = null; 102 118 } 103 119 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs
r6710 r6711 71 71 set { TimeFactorParameter.Value = value; } 72 72 } 73 74 [Storable] 75 private DoubleValue currentTardinessPenalty; 76 73 77 public DoubleValue TardinessPenalty { 74 get { return TardinessPenaltyParameter.Value; } 75 set { TardinessPenaltyParameter.Value = value; } 78 get { 79 if (currentTardinessPenalty != null) 80 return currentTardinessPenalty; 81 else 82 return TardinessPenaltyParameter.Value; 83 } 84 set { currentTardinessPenalty = value; } 76 85 } 77 86 … … 113 122 protected CVRPTWProblemInstance(CVRPTWProblemInstance original, Cloner cloner) 114 123 : base(original, cloner) { 124 currentTardinessPenalty = cloner.Clone(original.currentTardinessPenalty) as DoubleValue; 125 115 126 AttachEventHandlers(); 116 127 } … … 126 137 TimeFactorParameter.ValueChanged += new EventHandler(TimeFactorParameter_ValueChanged); 127 138 TimeFactorParameter.Value.ValueChanged += new EventHandler(TimeFactor_ValueChanged); 139 } 140 141 public override void InitializeState() { 142 base.InitializeState(); 143 144 currentTardinessPenalty = null; 128 145 } 129 146 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r6607 r6711 37 37 [Item("VRPProblemInstance", "Represents a VRP instance.")] 38 38 [StorableClass] 39 public abstract class VRPProblemInstance : ParameterizedNamedItem, IVRPProblemInstance{39 public abstract class VRPProblemInstance : ParameterizedNamedItem, IVRPProblemInstance, IStatefulItem { 40 40 public IValueParameter<IVRPEvaluator> EvaluatorParameter { 41 41 get { return (ValueParameter<IVRPEvaluator>)Parameters["Evaluator"]; } … … 273 273 [StorableHook(HookType.AfterDeserialization)] 274 274 private void AfterDeserializationHook() { 275 #region Backwards Compatibility276 if (!Parameters.ContainsKey("BestKnownSolution")) {277 Parameters.Add(new OptionalValueParameter<VRPSolution>("BestKnownSolution", "The best known solution of this TSP instance."));278 }279 if (!Parameters.ContainsKey("BestKnownQuality")) {280 Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this VRP instance."));281 }282 #endregion283 284 275 AttachEventHandlers(); 285 276 } … … 302 293 } 303 294 295 public virtual void InitializeState() { 296 } 297 298 public virtual void ClearState() { 299 } 300 304 301 #region Event handlers 305 302 void EvaluatorParameter_ValueChanged(object sender, EventArgs e) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Variants/Capacitated/ICapacitatedProblemInstance.cs
r4376 r6711 29 29 namespace HeuristicLab.Problems.VehicleRouting.Variants { 30 30 public interface ICapacitatedProblemInstance: IVRPProblemInstance { 31 DoubleValue OverloadPenalty { get; }31 DoubleValue OverloadPenalty { get; set; } 32 32 } 33 33 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Variants/PickupAndDelivery/IPickupAndDeliveryProblemInstance.cs
r6710 r6711 30 30 public interface IPickupAndDeliveryProblemInstance: IVRPProblemInstance { 31 31 IntArray PickupDeliveryLocation { get; } 32 DoubleValue PickupViolationPenalty { get; }32 DoubleValue PickupViolationPenalty { get; set; } 33 33 } 34 34 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Variants/TimeWindowed/ITimeWindowedProblemInstance.cs
r4363 r6711 33 33 DoubleArray ServiceTime { get; } 34 34 DoubleValue TimeFactor { get; } 35 DoubleValue TardinessPenalty { get; }35 DoubleValue TardinessPenalty { get; set; } 36 36 } 37 37 }
Note: See TracChangeset
for help on using the changeset viewer.