Changeset 8346 for trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs
- Timestamp:
- 07/27/12 15:21:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs
r8053 r8346 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Problems.VehicleRouting.Interfaces; 25 26 26 27 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { … … 42 43 } 43 44 44 protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) { 45 bool allowInfeasible = AllowInfeasibleSolutions.Value.Value; 46 45 public static PotvinEncoding Apply(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2, IVRPProblemInstance problemInstance, bool allowInfeasible) { 47 46 PotvinEncoding child = parent1.Clone() as PotvinEncoding; 48 47 Tour newTour = new Tour(); 49 48 50 int cities = ProblemInstance.Cities.Value;49 int cities = problemInstance.Cities.Value; 51 50 52 51 if (cities > 0) { … … 77 76 child.Unrouted.Add(city); 78 77 79 if (Repair(random, child, newTour, ProblemInstance, allowInfeasible) || allowInfeasible) {78 if (Repair(random, child, newTour, problemInstance, allowInfeasible) || allowInfeasible) { 80 79 return child; 81 80 } else { … … 89 88 } 90 89 } 90 91 protected override PotvinEncoding Crossover(IRandom random, PotvinEncoding parent1, PotvinEncoding parent2) { 92 return Apply(random, parent1, parent2, ProblemInstance, AllowInfeasibleSolutions.Value.Value); 93 } 91 94 } 92 95 }
Note: See TracChangeset
for help on using the changeset viewer.