Changeset 12969 for branches/gteufl/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators
- Timestamp:
- 09/25/15 14:39:59 (9 years ago)
- Location:
- branches/gteufl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gteufl
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 25 obj
-
- Property svn:mergeinfo changed
-
Property
svn:global-ignores
set to
*.nuget
packages
- Property svn:ignore
-
branches/gteufl/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
-
branches/gteufl/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/IterativeInsertionCreator.cs
r9456 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 81 81 } 82 82 83 p rivatestatic PotvinEncoding CreateSolution(IVRPProblemInstance instance, IRandom random, bool adhereTimeWindows) {83 public static PotvinEncoding CreateSolution(IVRPProblemInstance instance, IRandom random, bool adhereTimeWindows) { 84 84 PotvinEncoding result = new PotvinEncoding(instance); 85 85 … … 91 91 customers.Add(i); 92 92 93 customers.Sort( delegate(int city1, int city2){94 95 93 customers.Sort((city1, city2) => { 94 double angle1 = CalculateAngleToDepot(instance, city1); 95 double angle2 = CalculateAngleToDepot(instance, city2); 96 96 97 98 97 return angle1.CompareTo(angle2); 98 }); 99 99 100 100 Tour currentTour = new Tour(); … … 107 107 int stopIdx = 0; 108 108 if (currentTour.Stops.Count > 0) 109 result.FindBestInsertionPlace(currentTour, customers[index]);109 stopIdx = result.FindBestInsertionPlace(currentTour, customers[index]); 110 110 currentTour.Stops.Insert(stopIdx, customers[index]); 111 111 … … 140 140 } 141 141 142 public override IOperation Apply() {142 public override IOperation InstrumentedApply() { 143 143 VRPToursParameter.ActualValue = CreateSolution(ProblemInstance, RandomParameter.ActualValue, AdhereTimeWindowsParameter.Value.Value); 144 144 145 return base. Apply();145 return base.InstrumentedApply(); 146 146 } 147 147 } -
branches/gteufl/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/PotvinCreator.cs
r9456 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/gteufl/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/PushForwardInsertionCreator.cs
r9456 r12969 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 33 33 34 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 35 [Item("PushForwardInsertionCreator", " Creates a randomly initialized VRP solution.")]35 [Item("PushForwardInsertionCreator", "The push forward insertion heuristic. It is implemented as described in Sam, and Thangiah, R. (1999). A Hybrid Genetic Algorithms, Simulated Annealing and Tabu Search Heuristic for Vehicle Routing Problems with Time Windows. Practical Handbook of Genetic Algorithms, Volume III, pp 347–381.")] 36 36 [StorableClass] 37 37 public sealed class PushForwardInsertionCreator : PotvinCreator, IStochasticOperator { … … 138 138 dueTime = 0; 139 139 140 double dist; 141 if (problemInstance.Coordinates[customer + depotCount - 1, 0] < x0) 142 dist = -distance; 143 else 144 dist = distance; 140 double x = problemInstance.Coordinates[customer + depotCount - 1, 0]; 141 double y = problemInstance.Coordinates[customer + depotCount - 1, 1]; 145 142 146 143 double cost = alpha * distance + // distance 0 <-> City[i] 147 -beta * dueTime + // latest arrival time148 -gamma * (Math.Asin((problemInstance.Coordinates[customer + depotCount - 1, 1] - y0) / dist) / 360 * dist); // polar angle144 -beta * dueTime + // latest arrival time 145 -gamma * ((Math.Atan2(y - y0, x - x0) + Math.PI) / (2.0 * Math.PI) * distance); // polar angle 149 146 150 147 if (cost < minCost) { … … 373 370 } 374 371 375 public override IOperation Apply() {372 public override IOperation InstrumentedApply() { 376 373 VRPToursParameter.ActualValue = CreateSolution(ProblemInstance, RandomParameter.ActualValue, 377 374 Alpha.Value.Value, Beta.Value.Value, Gamma.Value.Value, 378 375 AlphaVariance.Value.Value, BetaVariance.Value.Value, GammaVariance.Value.Value); 379 376 380 return base. Apply();377 return base.InstrumentedApply(); 381 378 } 382 379 }
Note: See TracChangeset
for help on using the changeset viewer.