- Timestamp:
- 10/15/12 15:17:52 (12 years ago)
- Location:
- branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Optimizers/LocalUpdate
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Optimizers/LocalUpdate/PriorityDispatching.cs
r8787 r8808 14 14 [Item("PriorityDispatching", "")] 15 15 [StorableClass] 16 public sealedclass PriorityDispatching : DynamicPDPOptimization {16 public abstract class PriorityDispatching : DynamicPDPOptimization { 17 17 18 18 private bool IsIdle(Vehicle v) { … … 27 27 } 28 28 29 public IValueLookupParameter<RealVector> WeightsParameter {30 get { return (IValueLookupParameter<RealVector>)Parameters["Weights"]; }31 }32 29 33 30 [StorableConstructor] 34 private PriorityDispatching(bool deserializing) : base(deserializing) { } 35 private PriorityDispatching(PriorityDispatching original, Cloner cloner) : base(original, cloner) { } 36 public PriorityDispatching() { 37 Parameters.Add(new ValueLookupParameter<RealVector>("Weights", "The weights for the individual priorities.")); 38 WeightsParameter.Value = new RealVector(new double[] { 39 100.000, 100.000, 22.349, 74.573, 18.424, 28.913, 0.331, 91.323, 36.969, 44.992, 64.892, 30.736, 23.113, 36.458, 6.178, 99.065, 100.0, 100.0 40 }); 41 } 42 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new PriorityDispatching(this, cloner); 31 protected PriorityDispatching(bool deserializing) : base(deserializing) { } 32 protected PriorityDispatching(PriorityDispatching original, Cloner cloner) : base(original, cloner) { } 33 protected PriorityDispatching() { 45 34 } 46 35 … … 112 101 } 113 102 103 protected abstract double CalculatePriority(IDictionary<string, double> variables); 104 114 105 private void GetHighestPriorityOrder(DynPDPProblemInstance instance, Vehicle vehicle, IEnumerable<Order> orders, out Order order, out double priority) { 115 var weights = WeightsParameter.Value;116 106 Order best = null; 117 107 double bestPriority = double.MinValue; … … 165 155 variables.Add("LeadTime", o.PickupReadyTime - GetSimulationTime()); 166 156 167 prio = 168 weights[0] * variables["DueDate"] 169 + weights[1] * variables["StartDate"] 170 + weights[2] * variables["PickupOrdersAtTarget"] 171 + weights[3] * variables["Distance"] 172 + weights[4] * variables["AverageDistanceToDestinations"] 173 + weights[5] * variables["MinimumDistanceToDestinations"] 174 + weights[6] * variables["MaximumDistanceToDestinations"] 175 + weights[7] * variables["NumberOfOtherCouriersToTarget"] 176 + weights[8] * variables["AverageDistanceToOtherCouriers"] 177 + weights[9] * variables["EarliestTimeOfArrival"] 178 + weights[10] * variables["DeliveryOrdersAtTarget"] 179 + weights[11] * variables["PickupOrderItemsAtTarget"] 180 + weights[12] * variables["DeliveryOrderItemsAtTarget"] 181 + weights[13] * variables["MinimumDistanceToOtherCouriers"] 182 + weights[14] * variables["MaximumDistanceToOtherCouriers"] 183 + weights[15] * variables["DemandSize"] 184 + weights[16] * variables["EDD"] 185 + weights[17] * variables["LeadTime"]; 157 prio = CalculatePriority(variables); 186 158 } 187 159
Note: See TracChangeset
for help on using the changeset viewer.