Changeset 11202 for branches/HiveStatistics/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinLocalSearchManipulator.cs
- Timestamp:
- 07/18/14 12:01:13 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- 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/HiveStatistics/sources/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
-
branches/HiveStatistics/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinLocalSearchManipulator.cs
r8053 r11202 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 52 52 } 53 53 54 private bool FindBetterInsertionPlace(55 PotvinEncoding individual, int tour, int city, int length,54 private static bool FindBetterInsertionPlace( 55 PotvinEncoding individual, IVRPProblemInstance instance, int tour, int city, int length, 56 56 out int insertionTour, out int insertionPlace) { 57 57 bool insertionFound = false; … … 70 70 distance = individual.GetTourLength(individual.Tours[currentTour]); 71 71 individual.Tours[currentTour].Stops.InsertRange(currentCity, toBeDeleted); 72 if ( ProblemInstance.TourFeasible(individual.Tours[currentTour], individual)) {72 if (instance.TourFeasible(individual.Tours[currentTour], individual)) { 73 73 double lengthIncrease = 74 74 individual.GetTourLength(individual.Tours[currentTour]) - distance; … … 92 92 } 93 93 94 p rotected override void Manipulate(IRandom random, PotvinEncoding individual) {94 public static void ApplyManipulation(IRandom random, PotvinEncoding individual, IVRPProblemInstance instance, int maxIterations) { 95 95 //only apply to feasible individuals 96 if ( ProblemInstance.Feasible(individual)) {96 if (instance.Feasible(individual)) { 97 97 bool insertionFound; 98 98 int iterations = 0; … … 107 107 while (city <= individual.Tours[tour].Stops.Count - length && !insertionFound) { 108 108 int insertionTour, insertionPlace; 109 if (FindBetterInsertionPlace(individual, tour, city, length,109 if (FindBetterInsertionPlace(individual, instance, tour, city, length, 110 110 out insertionTour, out insertionPlace)) { 111 111 insertionFound = true; … … 126 126 iterations++; 127 127 } while (insertionFound && 128 iterations < Iterations.Value.Value);128 iterations < maxIterations); 129 129 130 130 IList<Tour> toBeRemoved = new List<Tour>(); … … 139 139 } 140 140 } 141 142 143 protected override void Manipulate(IRandom random, PotvinEncoding individual) { 144 ApplyManipulation(random, individual, ProblemInstance, Iterations.Value.Value); 145 } 141 146 } 142 147 }
Note: See TracChangeset
for help on using the changeset viewer.