Changeset 3947
- Timestamp:
- 06/25/10 15:01:48 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveOperator.cs
r3938 r3947 43 43 44 44 PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPSolutionParameter.ActualName; 45 IAtomicOperation op = this.ExecutionContext.Create Operation(PermutationMoveOperatorParameter);45 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter); 46 46 op.Operator.Execute((IExecutionContext)op); 47 47 -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveEvaluator.cs
r3938 r3947 54 54 newSolution, 55 55 DueTimeParameter.ActualValue, ServiceTimeParameter.ActualValue, ReadyTimeParameter.ActualValue, 56 DemandParameter.ActualValue, CapacityParameter.ActualValue, 57 FleetUsageFactor. Value, TimeFactor.Value, DistanceFactor.Value, OverloadPenalty.Value, TardinessPenalty.Value,56 DemandParameter.ActualValue, CapacityParameter.ActualValue, 57 FleetUsageFactor.ActualValue, TimeFactor.ActualValue, DistanceFactor.ActualValue, OverloadPenalty.ActualValue, TardinessPenalty.ActualValue, 58 58 CoordinatesParameter.ActualValue, DistanceMatrixParameter, UseDistanceMatrixParameter.ActualValue); 59 59 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs
r3938 r3947 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 using HeuristicLab.Parameters; 31 using HeuristicLab.Data; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 33 34 [Item("AlbaTranslocationMoveGenerator", "An operator which generates translocation moves for the alba representation.")] 34 35 [StorableClass] 35 public sealed class AlbaTranslocationMoveGenerator : AlbaMoveOperator, IPermutationTranslocationMoveOperator, IM oveGenerator {36 public sealed class AlbaTranslocationMoveGenerator : AlbaMoveOperator, IPermutationTranslocationMoveOperator, IMultiMoveGenerator { 36 37 public IValueLookupParameter<TranslocationMoveGenerator> TranslocationMoveGeneratorParameter { 37 38 get { return (IValueLookupParameter<TranslocationMoveGenerator>)Parameters["TranslocationMoveGenerator"]; } … … 40 41 protected override IPermutationMoveOperator PermutationMoveOperatorParameter { 41 42 get { return TranslocationMoveGeneratorParameter.Value; } 42 set { TranslocationMoveGeneratorParameter.Value = value as TranslocationMoveGenerator; } 43 set { 44 TranslocationMoveGeneratorParameter.Value = value as TranslocationMoveGenerator; 45 if (TranslocationMoveGeneratorParameter.Value is IMultiMoveGenerator) { 46 ((IMultiMoveGenerator)TranslocationMoveGeneratorParameter.Value).SampleSizeParameter.ActualName = SampleSizeParameter.Name; 47 } 48 } 43 49 } 44 50 … … 61 67 } 62 68 69 public IValueLookupParameter<IntValue> SampleSizeParameter { 70 get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; } 71 } 72 63 73 public AlbaTranslocationMoveGenerator(): base() { 64 74 Parameters.Add(new ValueLookupParameter<TranslocationMoveGenerator>("TranslocationMoveGenerator", "The move generator.", 65 75 new StochasticTranslocationMultiMoveGenerator())); 76 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate.")); 77 78 ((IMultiMoveGenerator)TranslocationMoveGeneratorParameter.Value).SampleSizeParameter.ActualName = SampleSizeParameter.Name; 66 79 } 67 80 -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Evaluators/VRPEvaluator.cs
r3938 r3947 84 84 get { return (ILookupParameter<DoubleValue>)Parameters["Capacity"]; } 85 85 } 86 /*public ILookupParameter<DoubleValue> MaxTravelTimeParameter {87 get { return (ILookupParameter<DoubleValue>)Parameters["MaxTravelTime"]; }88 } */89 86 public ILookupParameter<DoubleArray> DemandParameter { 90 87 get { return (ILookupParameter<DoubleArray>)Parameters["Demand"]; } … … 99 96 get { return (ILookupParameter<DoubleArray>)Parameters["ServiceTime"]; } 100 97 } 101 public IValueParameter<DoubleValue> FleetUsageFactor { 102 get { return (IValueParameter<DoubleValue>)Parameters["FleetUsageFactor"]; } 103 } 104 public IValueParameter<DoubleValue> TimeFactor { 105 get { return (IValueParameter<DoubleValue>)Parameters["TimeFactor"]; } 106 } 107 public IValueParameter<DoubleValue> DistanceFactor { 108 get { return (IValueParameter<DoubleValue>)Parameters["DistanceFactor"]; } 109 } 110 /*public IValueParameter<DoubleValue> TimePenalty { 111 get { return (IValueParameter<DoubleValue>)Parameters["TimePenalty"]; } 112 } */ 113 public IValueParameter<DoubleValue> OverloadPenalty { 114 get { return (IValueParameter<DoubleValue>)Parameters["OverloadPenalty"]; } 115 } 116 public IValueParameter<DoubleValue> TardinessPenalty { 117 get { return (IValueParameter<DoubleValue>)Parameters["TardinessPenalty"]; } 98 public ILookupParameter<DoubleValue> FleetUsageFactor { 99 get { return (ILookupParameter<DoubleValue>)Parameters["FleetUsageFactor"]; } 100 } 101 public ILookupParameter<DoubleValue> TimeFactor { 102 get { return (ILookupParameter<DoubleValue>)Parameters["TimeFactor"]; } 103 } 104 public ILookupParameter<DoubleValue> DistanceFactor { 105 get { return (ILookupParameter<DoubleValue>)Parameters["DistanceFactor"]; } 106 } 107 public ILookupParameter<DoubleValue> OverloadPenalty { 108 get { return (ILookupParameter<DoubleValue>)Parameters["OverloadPenalty"]; } 109 } 110 public ILookupParameter<DoubleValue> TardinessPenalty { 111 get { return (ILookupParameter<DoubleValue>)Parameters["TardinessPenalty"]; } 118 112 } 119 113 … … 132 126 Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The number of vehicles.")); 133 127 Parameters.Add(new LookupParameter<DoubleValue>("Capacity", "The capacity of each vehicle.")); 134 //Parameters.Add(new LookupParameter<DoubleValue>("MaxTravelTime", "The maximum travel time of each route."));135 128 Parameters.Add(new LookupParameter<DoubleArray>("Demand", "The demand of each customer.")); 136 129 Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime", "The ready time of each customer.")); 137 130 Parameters.Add(new LookupParameter<DoubleArray>("DueTime", "The due time of each customer.")); 138 131 Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer.")); 139 Parameters.Add(new ValueParameter<DoubleValue>("FleetUsageFactor", "The fleet usage factor considered in the evaluation.", new DoubleValue(0))); 140 Parameters.Add(new ValueParameter<DoubleValue>("TimeFactor", "The time factor considered in the evaluation.", new DoubleValue(0))); 141 Parameters.Add(new ValueParameter<DoubleValue>("DistanceFactor", "The distance factor considered in the evaluation.", new DoubleValue(1))); 142 //Parameters.Add(new ValueParameter<DoubleValue>("TimePenalty", "The time penalty considered in the evaluation.", new DoubleValue(10))); 143 Parameters.Add(new ValueParameter<DoubleValue>("OverloadPenalty", "The overload penalty considered in the evaluation.", new DoubleValue(50))); 144 Parameters.Add(new ValueParameter<DoubleValue>("TardinessPenalty", "The tardiness penalty considered in the evaluation.", new DoubleValue(50))); 132 Parameters.Add(new LookupParameter<DoubleValue>("FleetUsageFactor", "The fleet usage factor considered in the evaluation.")); 133 Parameters.Add(new LookupParameter<DoubleValue>("TimeFactor", "The time factor considered in the evaluation.")); 134 Parameters.Add(new LookupParameter<DoubleValue>("DistanceFactor", "The distance factor considered in the evaluation.")); 135 Parameters.Add(new LookupParameter<DoubleValue>("OverloadPenalty", "The overload penalty considered in the evaluation.")); 136 Parameters.Add(new LookupParameter<DoubleValue>("TardinessPenalty", "The tardiness penalty considered in the evaluation.")); 145 137 } 146 138 … … 289 281 } 290 282 291 if (sumEval.Quality < sumEval.Distance) {292 }293 294 283 return sumEval; 295 284 } … … 299 288 300 289 TourEvaluation sumEval = Evaluate(solution, DueTimeParameter.ActualValue, ServiceTimeParameter.ActualValue, ReadyTimeParameter.ActualValue, 301 DemandParameter.ActualValue, CapacityParameter.ActualValue, 302 FleetUsageFactor. Value, TimeFactor.Value, DistanceFactor.Value, OverloadPenalty.Value, TardinessPenalty.Value,290 DemandParameter.ActualValue, CapacityParameter.ActualValue, 291 FleetUsageFactor.ActualValue, TimeFactor.ActualValue, DistanceFactor.ActualValue, OverloadPenalty.ActualValue, TardinessPenalty.ActualValue, 303 292 CoordinatesParameter.ActualValue, DistanceMatrixParameter, UseDistanceMatrixParameter.ActualValue); 304 293 -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Interfaces/IVRPEvaluator.cs
r3938 r3947 46 46 ILookupParameter<DoubleValue> OverloadParameter { get; } 47 47 ILookupParameter<DoubleValue> TardinessParameter { get; } 48 49 ILookupParameter<DoubleValue> FleetUsageFactor { get; } 50 ILookupParameter<DoubleValue> TimeFactor { get; } 51 ILookupParameter<DoubleValue> DistanceFactor { get; } 52 ILookupParameter<DoubleValue> OverloadPenalty { get; } 53 ILookupParameter<DoubleValue> TardinessPenalty { get; } 48 54 } 49 55 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Interfaces/IVRPMoveEvaluator.cs
r3938 r3947 45 45 ILookupParameter<DoubleValue> MoveOverloadParameter { get; } 46 46 ILookupParameter<DoubleValue> MoveTardinessParameter { get; } 47 48 ILookupParameter<DoubleValue> FleetUsageFactor { get; } 49 ILookupParameter<DoubleValue> TimeFactor { get; } 50 ILookupParameter<DoubleValue> DistanceFactor { get; } 51 ILookupParameter<DoubleValue> OverloadPenalty { get; } 52 ILookupParameter<DoubleValue> TardinessPenalty { get; } 47 53 } 48 54 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/MoveEvaluators/VRPMoveEvaluator.cs
r3938 r3947 69 69 get { return (ILookupParameter<DoubleArray>)Parameters["ServiceTime"]; } 70 70 } 71 public I ValueParameter<DoubleValue> FleetUsageFactor {72 get { return (I ValueParameter<DoubleValue>)Parameters["FleetUsageFactor"]; }71 public ILookupParameter<DoubleValue> FleetUsageFactor { 72 get { return (ILookupParameter<DoubleValue>)Parameters["FleetUsageFactor"]; } 73 73 } 74 public I ValueParameter<DoubleValue> TimeFactor {75 get { return (I ValueParameter<DoubleValue>)Parameters["TimeFactor"]; }74 public ILookupParameter<DoubleValue> TimeFactor { 75 get { return (ILookupParameter<DoubleValue>)Parameters["TimeFactor"]; } 76 76 } 77 public I ValueParameter<DoubleValue> DistanceFactor {78 get { return (I ValueParameter<DoubleValue>)Parameters["DistanceFactor"]; }77 public ILookupParameter<DoubleValue> DistanceFactor { 78 get { return (ILookupParameter<DoubleValue>)Parameters["DistanceFactor"]; } 79 79 } 80 public I ValueParameter<DoubleValue> OverloadPenalty {81 get { return (I ValueParameter<DoubleValue>)Parameters["OverloadPenalty"]; }80 public ILookupParameter<DoubleValue> OverloadPenalty { 81 get { return (ILookupParameter<DoubleValue>)Parameters["OverloadPenalty"]; } 82 82 } 83 public I ValueParameter<DoubleValue> TardinessPenalty {84 get { return (I ValueParameter<DoubleValue>)Parameters["TardinessPenalty"]; }83 public ILookupParameter<DoubleValue> TardinessPenalty { 84 get { return (ILookupParameter<DoubleValue>)Parameters["TardinessPenalty"]; } 85 85 } 86 86 … … 126 126 Parameters.Add(new LookupParameter<DoubleArray>("DueTime", "The due time of each customer.")); 127 127 Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer.")); 128 Parameters.Add(new ValueParameter<DoubleValue>("FleetUsageFactor", "The fleet usage factor considered in the evaluation.", new DoubleValue(0)));129 Parameters.Add(new ValueParameter<DoubleValue>("TimeFactor", "The time factor considered in the evaluation.", new DoubleValue(0)));130 Parameters.Add(new ValueParameter<DoubleValue>("DistanceFactor", "The distance factor considered in the evaluation.", new DoubleValue(1)));131 Parameters.Add(new ValueParameter<DoubleValue>("OverloadPenalty", "The overload penalty considered in the evaluation.", new DoubleValue(50)));132 Parameters.Add(new ValueParameter<DoubleValue>("TardinessPenalty", "The tardiness penalty considered in the evaluation.", new DoubleValue(50)));128 Parameters.Add(new LookupParameter<DoubleValue>("FleetUsageFactor", "The fleet usage factor considered in the evaluation.")); 129 Parameters.Add(new LookupParameter<DoubleValue>("TimeFactor", "The time factor considered in the evaluation.")); 130 Parameters.Add(new LookupParameter<DoubleValue>("DistanceFactor", "The distance factor considered in the evaluation.")); 131 Parameters.Add(new LookupParameter<DoubleValue>("OverloadPenalty", "The overload penalty considered in the evaluation.")); 132 Parameters.Add(new LookupParameter<DoubleValue>("TardinessPenalty", "The tardiness penalty considered in the evaluation.")); 133 133 } 134 134 -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/SolomonParser.cs
r3938 r3947 145 145 readyTime.Add((double)int.Parse(m[4].Value)); 146 146 double st = (double)int.Parse(m[6].Value); 147 dueTime.Add( st +(double)int.Parse(m[5].Value));147 dueTime.Add((double)int.Parse(m[5].Value)); 148 148 serviceTime.Add(st); 149 149 line = reader.ReadLine(); -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/VehicleRoutingProblem.cs
r3938 r3947 90 90 get { return EvaluatorParameter; } 91 91 } 92 public IValueParameter<DoubleValue> FleetUsageFactor { 93 get { return (IValueParameter<DoubleValue>)Parameters["FleetUsageFactor"]; } 94 } 95 public IValueParameter<DoubleValue> TimeFactor { 96 get { return (IValueParameter<DoubleValue>)Parameters["TimeFactor"]; } 97 } 98 public IValueParameter<DoubleValue> DistanceFactor { 99 get { return (IValueParameter<DoubleValue>)Parameters["DistanceFactor"]; } 100 } 101 public IValueParameter<DoubleValue> OverloadPenalty { 102 get { return (IValueParameter<DoubleValue>)Parameters["OverloadPenalty"]; } 103 } 104 public IValueParameter<DoubleValue> TardinessPenalty { 105 get { return (IValueParameter<DoubleValue>)Parameters["TardinessPenalty"]; } 106 } 92 107 public OptionalValueParameter<DoubleValue> BestKnownQualityParameter { 93 108 get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; } … … 181 196 Parameters.Add(new ValueParameter<DoubleArray>("ServiceTime", "The service time of each customer.", new DoubleArray())); 182 197 Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this VRP instance.")); 198 Parameters.Add(new ValueParameter<DoubleValue>("FleetUsageFactor", "The fleet usage factor considered in the evaluation.", new DoubleValue(100))); 199 Parameters.Add(new ValueParameter<DoubleValue>("TimeFactor", "The time factor considered in the evaluation.", new DoubleValue(0))); 200 Parameters.Add(new ValueParameter<DoubleValue>("DistanceFactor", "The distance factor considered in the evaluation.", new DoubleValue(1))); 201 Parameters.Add(new ValueParameter<DoubleValue>("OverloadPenalty", "The overload penalty considered in the evaluation.", new DoubleValue(100))); 202 Parameters.Add(new ValueParameter<DoubleValue>("TardinessPenalty", "The tardiness penalty considered in the evaluation.", new DoubleValue(100))); 183 203 184 204 Parameters.Add(new ValueParameter<IVRPCreator>("SolutionCreator", "The operator which should be used to create new VRP solutions.", creator)); … … 343 363 Evaluator.DueTimeParameter.ActualName = DueTimeParameter.Name; 344 364 Evaluator.ServiceTimeParameter.ActualName = ServiceTimeParameter.Name; 365 Evaluator.FleetUsageFactor.ActualName = FleetUsageFactor.Name; 366 Evaluator.TimeFactor.ActualName = TimeFactor.Name; 367 Evaluator.DistanceFactor.ActualName = DistanceFactor.Name; 368 Evaluator.OverloadPenalty.ActualName = OverloadPenalty.Name; 369 Evaluator.TardinessPenalty.ActualName = TardinessPenalty.Name; 345 370 } 346 371 private void ParameterizeAnalyzer() { … … 369 394 op.DueTimeParameter.ActualName = DueTimeParameter.Name; 370 395 op.ServiceTimeParameter.ActualName = ServiceTimeParameter.Name; 396 op.FleetUsageFactor.ActualName = FleetUsageFactor.Name; 397 op.TimeFactor.ActualName = TimeFactor.Name; 398 op.DistanceFactor.ActualName = DistanceFactor.Name; 399 op.OverloadPenalty.ActualName = OverloadPenalty.Name; 400 op.TardinessPenalty.ActualName = TardinessPenalty.Name; 371 401 } 372 402 string translocationMove = Operators.OfType<IMoveGenerator>().OfType<IPermutationTranslocationMoveOperator>().First().TranslocationMoveParameter.ActualName;
Note: See TracChangeset
for help on using the changeset viewer.