Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/15/12 15:17:52 (12 years ago)
Author:
svonolfe
Message:

Added symbolic tree dispatching and metaoptimization (#1955)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Optimizers/LocalUpdate/PriorityDispatching.cs

    r8787 r8808  
    1414  [Item("PriorityDispatching", "")]
    1515  [StorableClass]
    16   public sealed class PriorityDispatching : DynamicPDPOptimization {
     16  public abstract class PriorityDispatching : DynamicPDPOptimization {
    1717
    1818    private bool IsIdle(Vehicle v) {
     
    2727    }
    2828
    29     public IValueLookupParameter<RealVector> WeightsParameter {
    30       get { return (IValueLookupParameter<RealVector>)Parameters["Weights"]; }
    31     }
    3229
    3330    [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() {
    4534    }
    4635
     
    112101    }
    113102
     103    protected abstract double CalculatePriority(IDictionary<string, double> variables);
     104
    114105    private void GetHighestPriorityOrder(DynPDPProblemInstance instance, Vehicle vehicle, IEnumerable<Order> orders, out Order order, out double priority) {
    115       var weights = WeightsParameter.Value;
    116106      Order best = null;
    117107      double bestPriority = double.MinValue;
     
    165155           variables.Add("LeadTime", o.PickupReadyTime - GetSimulationTime());
    166156
    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);
    186158         }
    187159
Note: See TracChangeset for help on using the changeset viewer.