Changeset 8053 for trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP
- Timestamp:
- 06/19/12 13:17:29 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPEvaluator.cs
r7276 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 22 using HeuristicLab.Common; 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 25 using HeuristicLab.Parameters; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 27 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 28 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Problems.VehicleRouting.Encodings;35 using HeuristicLab.Common;36 29 37 30 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 38 31 [Item("MDCVRPEvaluator", "Represents a multi depot CVRP evaluator.")] 39 32 [StorableClass] 40 public class MDCVRPEvaluator : VRPEvaluator {33 public class MDCVRPEvaluator : VRPEvaluator { 41 34 public ILookupParameter<DoubleValue> OverloadParameter { 42 35 get { return (ILookupParameter<DoubleValue>)Parameters["Overload"]; } … … 103 96 } 104 97 105 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 98 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 106 99 out bool feasible) { 107 100 CVRPInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPInsertionInfo; 108 101 109 102 double costs = 0; 110 103 feasible = tourInsertionInfo.Penalty < double.Epsilon; … … 120 113 feasible = false; 121 114 122 if (insertionInfo.SpareCapacity >= 0)115 if (insertionInfo.SpareCapacity >= 0) 123 116 costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty; 124 117 else 125 118 costs += demand * overloadPenalty; 126 119 } 127 120 128 121 return costs; 129 122 } … … 140 133 OverloadParameter.ActualValue.Value = (tourEvaluation as CVRPEvaluation).Overload; 141 134 } 142 135 143 136 [StorableConstructor] 144 137 protected MDCVRPEvaluator(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPProblemInstance.cs
r7934 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWEvaluator.cs
r7276 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 24 using HeuristicLab.Common; 25 using HeuristicLab.Core; 26 using HeuristicLab.Data; 27 using HeuristicLab.Parameters; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 29 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 30 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Problems.VehicleRouting.Encodings;35 using HeuristicLab.Common;36 31 37 32 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 38 33 [Item("MDCVRPPDTWEvaluator", "Represents a multi depot CVRPPDTW evaluator.")] 39 34 [StorableClass] 40 public class MDCVRPPDTWEvaluator : MDCVRPTWEvaluator {35 public class MDCVRPPDTWEvaluator : MDCVRPTWEvaluator { 41 36 public ILookupParameter<IntValue> PickupViolationsParameter { 42 37 get { return (ILookupParameter<IntValue>)Parameters["PickupViolations"]; } … … 149 144 150 145 double spareCapacity = capacity - currentLoad; 151 CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime, 146 CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime, 152 147 arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity); 153 148 tourInfo.AddStopInsertionInfo(stopInfo); … … 187 182 } 188 183 189 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 184 protected override double GetTourInsertionCosts(IVRPProblemInstance instance, IVRPEncoding solution, TourInsertionInfo tourInsertionInfo, int index, int customer, 190 185 out bool feasible) { 191 186 CVRPPDTWInsertionInfo insertionInfo = tourInsertionInfo.GetStopInsertionInfo(index) as CVRPPDTWInsertionInfo; … … 327 322 PickupViolationsParameter.ActualValue.Value = (tourEvaluation as CVRPPDTWEvaluation).PickupViolations; 328 323 } 329 324 330 325 [StorableConstructor] 331 326 protected MDCVRPPDTWEvaluator(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPPDTW/MDCVRPPDTWProblemInstance.cs
r7934 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWEvaluator.cs
r7276 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 23 using HeuristicLab.Common; 24 using HeuristicLab.Core; 25 using HeuristicLab.Data; 26 using HeuristicLab.Parameters; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 28 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 29 using HeuristicLab.Problems.VehicleRouting.Variants; 34 using HeuristicLab.Problems.VehicleRouting.Encodings;35 using HeuristicLab.Common;36 30 37 31 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 38 32 [Item("MDCVRPTWEvaluator", "Represents a multi depot CVRPTW evaluator.")] 39 33 [StorableClass] 40 public class MDCVRPTWEvaluator : MDCVRPEvaluator {34 public class MDCVRPTWEvaluator : MDCVRPEvaluator { 41 35 public ILookupParameter<DoubleValue> TardinessParameter { 42 36 get { return (ILookupParameter<DoubleValue>)Parameters["Tardiness"]; } … … 130 124 //service 131 125 double currentServiceTime = 0; 132 if (end > 0)126 if (end > 0) 133 127 currentServiceTime = serviceTimes[end - 1]; 134 128 serviceTime += currentServiceTime; … … 193 187 feasible = false; 194 188 195 if (insertionInfo.SpareCapacity >= 0)189 if (insertionInfo.SpareCapacity >= 0) 196 190 costs += (demand - insertionInfo.SpareCapacity) * overloadPenalty; 197 191 else … … 241 235 //arrive later than before, probably don't have to wait 242 236 if (nextStop.WaitingTime > 0) { 243 additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime); 237 additionalTime -= Math.Min(additionalTime, nextStop.WaitingTime); 244 238 } 245 239 … … 248 242 double spare = nextStop.SpareTime - additionalTime; 249 243 if (spare < 0) 250 tardiness += -spare; 244 tardiness += -spare; 251 245 } else { 252 246 tardiness += additionalTime; … … 279 273 TravelTimeParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).TravelTime; 280 274 } 281 275 282 276 [StorableConstructor] 283 277 protected MDCVRPTWEvaluator(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPTW/MDCVRPTWProblemInstance.cs
r7934 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.