- Timestamp:
- 10/15/12 15:17:52 (12 years ago)
- 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 135 135 <Private>False</Private> 136 136 </Reference> 137 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 137 138 <Reference Include="HeuristicLab.Operators-3.3"> 138 139 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath> … … 159 160 <Private>false</Private> 160 161 </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" /> 161 164 <Reference Include="HeuristicLab.Problems.Instances-3.3"> 162 165 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath> … … 185 188 <Compile Include="DistanceMeasures\EuclideanDistanceMeasure.cs" /> 186 189 <Compile Include="DomainModel\SimulationObject.cs" /> 190 <Compile Include="Operators\TreePriorityDispatchingMetaOptEvaluator.cs" /> 191 <Compile Include="Operators\PriorityDispatchingMetaOptEvaluator.cs" /> 187 192 <Compile Include="Operators\DialARideEvaluator.cs" /> 188 193 <Compile Include="Operators\DynPDPEvaluator.cs" /> 189 194 <Compile Include="Operators\DynPushForwardInsertionCreator.cs" /> 190 195 <Compile Include="Operators\DynPDPProblemInstance.cs" /> 191 <Compile Include="Operators\ PriorityDispatchingMetaOptEvaluator.cs" />196 <Compile Include="Operators\LinearPriorityDispatchingMetaOptEvaluator.cs" /> 192 197 <Compile Include="Optimizers\DynamicPDProblemInstance.cs" /> 193 198 <Compile Include="Optimizers\DynamicPDPOptimization.cs" /> 194 199 <Compile Include="Optimizers\LocalUpdate\BestInsertion.cs" /> 200 <Compile Include="Optimizers\LocalUpdate\TreePriorityDispatching.cs" /> 201 <Compile Include="Optimizers\LocalUpdate\LinearPriorityDispatching.cs" /> 195 202 <Compile Include="Optimizers\LocalUpdate\PriorityDispatching.cs" /> 196 203 <Compile Include="Optimizers\Reoptimization\PFIHReoptimization.cs" /> -
branches/DynamicVehicleRouting/HeuristicLab.PDPSimulation/3.3/Operators/PriorityDispatchingMetaOptEvaluator.cs
r8783 r8808 19 19 [Item("PriorityDispatchingMetaOptEvaluator", "Metaoptimization of the priority dispatching parameters for the PDP simulation.")] 20 20 [StorableClass] 21 public class PriorityDispatchingMetaOptEvaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {21 public abstract class PriorityDispatchingMetaOptEvaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator { 22 22 public ILookupParameter<DoubleValue> QualityParameter { 23 23 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } 24 }25 26 public IValueLookupParameter<DoubleArray> VectorParameter {27 get { return (IValueLookupParameter<DoubleArray>)Parameters["Vector"]; }28 24 } 29 25 … … 38 34 public PriorityDispatchingMetaOptEvaluator() { 39 35 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "Result of the evaluation of a solution.")); 40 Parameters.Add(new ValueLookupParameter<DoubleArray>("Vector", "The priority dispatching parameters."));41 36 Parameters.Add(new ValueParameter<ItemList<PickupDeliverySimulation>>("Simulation", "The PDP simulation")); 42 37 Parameters.Add(new ValueParameter<IntValue>("Repetitions", "The number of repetitions", new IntValue(1))); … … 47 42 protected PriorityDispatchingMetaOptEvaluator(PriorityDispatchingMetaOptEvaluator original, Cloner cloner) : base(original, cloner) { } 48 43 49 public override IDeepCloneable Clone(Cloner cloner) { 50 return new PriorityDispatchingMetaOptEvaluator(this, cloner); 51 } 44 protected abstract void Parameterize(PriorityDispatching dispatching); 52 45 53 46 public override IOperation Apply() { … … 56 49 ItemList<PickupDeliverySimulation> simulations = SimulationParameter.Value; 57 50 int repetitions = 0; 58 59 DoubleArray vector = VectorParameter.ActualValue;60 51 61 52 object locker = new object(); … … 67 58 PickupDeliverySimulation simulation = originalSimulation.Clone() as PickupDeliverySimulation; 68 59 PriorityDispatching dispatching = simulation.OptimizationParameter.Value as PriorityDispatching; 69 dispatching.WeightsParameter.Value = new RealVector(vector.ToArray());60 Parameterize(dispatching); 70 61 71 62 EventWaitHandle waitHandle = new EventWaitHandle(false, EventResetMode.ManualReset); -
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.