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)

Location:
branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/HeuristicLab.PDPSimulation-3.3.csproj

    r8777 r8808  
    135135      <Private>False</Private>
    136136    </Reference>
     137    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    137138    <Reference Include="HeuristicLab.Operators-3.3">
    138139      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     
    159160      <Private>false</Private>
    160161    </Reference>
     162    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     163    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    161164    <Reference Include="HeuristicLab.Problems.Instances-3.3">
    162165      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
     
    185188    <Compile Include="DistanceMeasures\EuclideanDistanceMeasure.cs" />
    186189    <Compile Include="DomainModel\SimulationObject.cs" />
     190    <Compile Include="Operators\TreePriorityDispatchingMetaOptEvaluator.cs" />
     191    <Compile Include="Operators\PriorityDispatchingMetaOptEvaluator.cs" />
    187192    <Compile Include="Operators\DialARideEvaluator.cs" />
    188193    <Compile Include="Operators\DynPDPEvaluator.cs" />
    189194    <Compile Include="Operators\DynPushForwardInsertionCreator.cs" />
    190195    <Compile Include="Operators\DynPDPProblemInstance.cs" />
    191     <Compile Include="Operators\PriorityDispatchingMetaOptEvaluator.cs" />
     196    <Compile Include="Operators\LinearPriorityDispatchingMetaOptEvaluator.cs" />
    192197    <Compile Include="Optimizers\DynamicPDProblemInstance.cs" />
    193198    <Compile Include="Optimizers\DynamicPDPOptimization.cs" />
    194199    <Compile Include="Optimizers\LocalUpdate\BestInsertion.cs" />
     200    <Compile Include="Optimizers\LocalUpdate\TreePriorityDispatching.cs" />
     201    <Compile Include="Optimizers\LocalUpdate\LinearPriorityDispatching.cs" />
    195202    <Compile Include="Optimizers\LocalUpdate\PriorityDispatching.cs" />
    196203    <Compile Include="Optimizers\Reoptimization\PFIHReoptimization.cs" />
  • branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Operators/PriorityDispatchingMetaOptEvaluator.cs

    r8783 r8808  
    1919  [Item("PriorityDispatchingMetaOptEvaluator", "Metaoptimization of the priority dispatching parameters for the PDP simulation.")]
    2020  [StorableClass]
    21   public class PriorityDispatchingMetaOptEvaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {
     21  public abstract class PriorityDispatchingMetaOptEvaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {
    2222    public ILookupParameter<DoubleValue> QualityParameter {
    2323      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
    24     }
    25 
    26     public IValueLookupParameter<DoubleArray> VectorParameter {
    27       get { return (IValueLookupParameter<DoubleArray>)Parameters["Vector"]; }
    2824    }
    2925
     
    3834    public PriorityDispatchingMetaOptEvaluator() {
    3935      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "Result of the evaluation of a solution."));
    40       Parameters.Add(new ValueLookupParameter<DoubleArray>("Vector", "The priority dispatching parameters."));
    4136      Parameters.Add(new ValueParameter<ItemList<PickupDeliverySimulation>>("Simulation", "The PDP simulation"));
    4237      Parameters.Add(new ValueParameter<IntValue>("Repetitions", "The number of repetitions", new IntValue(1)));
     
    4742    protected PriorityDispatchingMetaOptEvaluator(PriorityDispatchingMetaOptEvaluator original, Cloner cloner) : base(original, cloner) { }
    4843
    49     public override IDeepCloneable Clone(Cloner cloner) {
    50       return new PriorityDispatchingMetaOptEvaluator(this, cloner);
    51     }
     44    protected abstract void Parameterize(PriorityDispatching dispatching);
    5245
    5346    public override IOperation Apply() {
     
    5649      ItemList<PickupDeliverySimulation> simulations = SimulationParameter.Value;
    5750      int repetitions = 0;
    58 
    59       DoubleArray vector = VectorParameter.ActualValue;
    6051
    6152      object locker = new object();
     
    6758        PickupDeliverySimulation simulation = originalSimulation.Clone() as PickupDeliverySimulation;
    6859        PriorityDispatching dispatching = simulation.OptimizationParameter.Value as PriorityDispatching;
    69         dispatching.WeightsParameter.Value = new RealVector(vector.ToArray());
     60        Parameterize(dispatching);
    7061       
    7162        EventWaitHandle waitHandle = new EventWaitHandle(false, EventResetMode.ManualReset);
  • 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.