Changeset 6771
- Timestamp:
- 09/15/11 16:26:41 (13 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs
r6752 r6771 78 78 } 79 79 80 public int FindBestInsertionPlace(Tour tour, int city ) {80 public int FindBestInsertionPlace(Tour tour, int city, int positionToAvoid = -1) { 81 81 int place = -1; 82 82 double minQuality = -1; … … 85 85 86 86 for (int i = 0; i <= tour.Stops.Count; i++) { 87 bool feasible; 88 double quality = ProblemInstance.GetInsertionCosts(eval, city, 0, i, out feasible); 89 if (place < 0 || quality < minQuality) { 90 place = i; 91 minQuality = quality; 87 if (positionToAvoid != i) { 88 bool feasible; 89 double quality = ProblemInstance.GetInsertionCosts(eval, city, 0, i, out feasible); 90 if (place < 0 || quality < minQuality) { 91 place = i; 92 minQuality = quality; 93 } 92 94 } 93 95 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs
r5867 r6771 52 52 53 53 protected override PrinsEncoding Crossover(IRandom random, PrinsEncoding parent1, PrinsEncoding parent2) { 54 if (parent1.Length != parent2.Length) 55 return parent1.Clone() as PrinsEncoding; 56 54 57 //note - the inner crossover is called here and the result is converted to a prins representation 55 58 //some refactoring should be done here in the future - the crossover operation should be called directly -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuHeuristicCrossover1.cs
r4752 r6771 61 61 ZhuEncoding child = parent2.Clone() as ZhuEncoding; 62 62 63 if (parent1.Length != parent2.Length) 64 return child; 65 63 66 int breakPoint = random.Next(child.Length); 64 67 int i = breakPoint; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuHeuristicCrossover2.cs
r4752 r6771 53 53 ZhuEncoding child = parent2.Clone() as ZhuEncoding; 54 54 55 if (parent1.Length != parent2.Length) 56 return child; 57 55 58 int breakPoint = random.Next(child.Length); 56 59 int i = breakPoint; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuMergeCrossover1.cs
r4752 r6771 62 62 ZhuEncoding child = parent2.Clone() as ZhuEncoding; 63 63 64 if (parent1.Length != parent2.Length) 65 return child; 66 64 67 int breakPoint = random.Next(child.Length); 65 68 int i = breakPoint; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuMergeCrossover2.cs
r4752 r6771 54 54 ZhuEncoding child = parent2.Clone() as ZhuEncoding; 55 55 56 if (parent1.Length != parent2.Length) 57 return child; 58 56 59 int breakPoint = random.Next(child.Length); 57 60 int i = breakPoint; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuPermutationCrossover.cs
r5867 r6771 54 54 //note - the inner crossover is called here and the result is converted to a prins representation 55 55 //some refactoring should be done here in the future - the crossover operation should be called directly 56 if (parent1.Length != parent2.Length) 57 return parent1.Clone() as ZhuEncoding; 56 58 57 59 InnerCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName;
Note: See TracChangeset
for help on using the changeset viewer.