- Timestamp:
- 06/12/14 13:26:18 (11 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing
- 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 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/DataPreprocessing/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting merged: 10651,10858,10860,10924,10926,10959
- Property svn:mergeinfo changed
-
branches/DataPreprocessing/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveGenerator.cs
r10538 r11009 31 31 using HeuristicLab.Parameters; 32 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 33 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba; 34 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 33 35 using HeuristicLab.Problems.VehicleRouting.Interfaces; 34 36 using HeuristicLab.Problems.VehicleRouting.Variants; … … 99 101 foreach (IOperator op in operators) { 100 102 if (op is IMultiVRPMoveGenerator && !(op is MultiOperator<IMultiVRPMoveGenerator>)) { 101 Operators.Add(op.Clone() as IMultiVRPMoveGenerator, true);103 Operators.Add(op.Clone() as IMultiVRPMoveGenerator, !(op is IAlbaOperator || op is PotvinVehicleAssignmentMultiMoveGenerator)); 102 104 } 103 105 } -
branches/DataPreprocessing/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/IterativeInsertionCreator.cs
r10538 r11009 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 -
branches/DataPreprocessing/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/PushForwardInsertionCreator.cs
r10538 r11009 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) { -
branches/DataPreprocessing/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveTabuCriterion.cs
r9456 r11009 20 20 #endregion 21 21 22 using System.Linq; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 98 99 PotvinCustomerRelocationMove move = CustomerRelocationMoveParameter.ActualValue; 99 100 100 foreach (IItem tabuMove in tabuList) { 101 PotvinCustomerRelocationMoveAttribute attribute = tabuMove as PotvinCustomerRelocationMoveAttribute; 102 101 foreach (var attribute in tabuList.OfType<PotvinCustomerRelocationMoveAttribute>()) { 103 102 if (!useAspiration || moveQuality >= attribute.MoveQuality) { 104 103 if (attribute.City == move.City && attribute.Tour == move.Tour) { -
branches/DataPreprocessing/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r10538 r11009 365 365 Name = instance.Name; 366 366 Description = instance.Description; 367 368 BestKnownQuality = null; 369 BestKnownSolution = null; 370 367 371 if (ProblemInstance != null && instance.ProblemInstance != null && 368 372 instance.ProblemInstance.GetType() == ProblemInstance.GetType()) … … 372 376 373 377 OnReset(); 374 BestKnownQuality = null;375 BestKnownSolution = null;376 378 377 379 if (instance.BestKnownQuality != null) { … … 389 391 390 392 public void Load(VRPData data) { 391 Type interpreterType = typeof(IVRPDataInterpreter<>).MakeGenericType(data.GetType()); 392 var interpreters = ApplicationManager.Manager.GetInstances(interpreterType); 393 IVRPDataInterpreter interpreter = null; 394 foreach (object i in interpreters) { 395 var parentInterfaces = i.GetType().BaseType.GetInterfaces(); 396 var interfaces = i.GetType().GetInterfaces().Except(parentInterfaces); 397 var interpreterInterface = interfaces.First(j => typeof(IVRPDataInterpreter).IsAssignableFrom(j)); 398 var interpreterDataType = interpreterInterface.GetGenericArguments()[0]; 399 if (interpreterDataType == data.GetType()) { 400 interpreter = i as IVRPDataInterpreter; 401 break; 402 } 403 } 404 405 if (interpreter == null) 406 throw new ArgumentException("No interpreter found for the VRP type"); 407 Load(data, interpreter); 393 var interpreterDataType = data.GetType(); 394 var interpreterType = typeof(IVRPDataInterpreter<>).MakeGenericType(interpreterDataType); 395 396 var interpreters = ApplicationManager.Manager.GetTypes(interpreterType); 397 398 var concreteInterpreter = interpreters.Single(t => GetInterpreterDataType(t) == interpreterDataType); 399 400 Load(data, (IVRPDataInterpreter)Activator.CreateInstance(concreteInterpreter)); 401 } 402 403 private Type GetInterpreterDataType(Type type) { 404 var parentInterfaces = type.BaseType.GetInterfaces(); 405 var interfaces = type.GetInterfaces().Except(parentInterfaces); 406 407 var interpreterInterface = interfaces.Single(i => typeof(IVRPDataInterpreter).IsAssignableFrom(i)); 408 return interpreterInterface.GetGenericArguments()[0]; 408 409 } 409 410
Note: See TracChangeset
for help on using the changeset viewer.