Changeset 14927 for branches/PersistenceReintegration/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers
- Timestamp:
- 05/04/17 17:19:35 (8 years ago)
- Location:
- branches/PersistenceReintegration/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceReintegration/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinCrossover.cs
r14185 r14927 26 26 using HeuristicLab.Optimization; 27 27 using HeuristicLab.Parameters; 28 using HeuristicLab.Persistence .Default.CompositeSerializers.Storable;28 using HeuristicLab.Persistence; 29 29 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; … … 32 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 33 33 [Item("PotvinCrossover", "A VRP crossover operation.")] 34 [Storable Class]34 [StorableType("365b6188-8945-45ec-ba4b-9e23fd8ad1c5")] 35 35 public abstract class PotvinCrossover : VRPCrossover, IStochasticOperator, IPotvinOperator { 36 36 public ILookupParameter<IRandom> RandomParameter { -
branches/PersistenceReintegration/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinInsertionBasedCrossover.cs
r14185 r14927 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Persistence .Default.CompositeSerializers.Storable;24 using HeuristicLab.Persistence; 25 25 using System.Collections.Generic; 26 26 using HeuristicLab.Data; … … 32 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 33 33 [Item("PotvinInsertionBasedCrossover", "The IBX crossover for VRP representations. It is implemented as described in Berger, J and Solois, M and Begin, R (1998). A hybrid genetic algorithm for the vehicle routing problem with time windows. LNCS 1418. Springer, London 114-127.")] 34 [Storable Class]34 [StorableType("c64c5246-3ee2-4860-9e92-984dac2fde25")] 35 35 public sealed class PotvinInsertionBasedCrossover : PotvinCrossover { 36 36 public IValueParameter<IntValue> Length { … … 206 206 int length = Math.Min(Length.Value.Value, parent1.Tours.Count) + 1; 207 207 int k = 1; 208 if (length > 1)208 if (length > 1) 209 209 k = random.Next(1, length); 210 210 for (int i = 0; i < k; i++) { … … 230 230 //DESTROY - remove cities from r1 231 231 int removed = 1; 232 if (r1.Stops.Count > 1)232 if (r1.Stops.Count > 1) 233 233 removed = random.Next(1, r1.Stops.Count + 1); 234 234 for (int i = 0; i < removed; i++) { … … 238 238 //REPAIR - add cities from R2 239 239 int maxCount = 1; 240 if (R2.Count > 1)240 if (R2.Count > 1) 241 241 maxCount = random.Next(1, Math.Min(5, R2.Count)); 242 242 int count = 0; … … 248 248 249 249 int place = -1; 250 bool found = FindRouteInsertionPlace(child, childTour, city, allowInfeasible, out place); 250 bool found = FindRouteInsertionPlace(child, childTour, city, allowInfeasible, out place); 251 251 if (found) { 252 252 childTour.Stops.Insert(place, city); -
branches/PersistenceReintegration/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs
r14185 r14927 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Encodings.PermutationEncoding; 25 using HeuristicLab.Persistence .Default.CompositeSerializers.Storable;25 using HeuristicLab.Persistence; 26 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 27 28 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 29 29 [Item("PotvinRouteBasedCrossover", "The RBX crossover for a VRP representations. It is implemented as described in Potvin, J.-Y. and Bengio, S. (1996). The Vehicle Routing Problem with Time Windows - Part II: Genetic Search. INFORMS Journal of Computing, 8:165–172.")] 30 [Storable Class]30 [StorableType("0040d697-3e0e-481f-b2af-5d5a99c0b32c")] 31 31 public sealed class PotvinRouteBasedCrossover : PotvinCrossover { 32 32 [StorableConstructor] -
branches/PersistenceReintegration/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs
r14185 r14927 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Persistence .Default.CompositeSerializers.Storable;24 using HeuristicLab.Persistence; 25 25 using HeuristicLab.Problems.VehicleRouting.Interfaces; 26 26 27 27 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 28 28 [Item("PotvinSequenceBasedCrossover", "The SBX crossover for a VRP representations. It is implemented as described in Potvin, J.-Y. and Bengio, S. (1996). The Vehicle Routing Problem with Time Windows - Part II: Genetic Search. INFORMS Journal of Computing, 8:165–172.")] 29 [Storable Class]29 [StorableType("9e773df8-58d7-4899-9329-22b8cd52fe26")] 30 30 public sealed class PotvinSequenceBasedCrossover : PotvinCrossover { 31 31 [StorableConstructor]
Note: See TracChangeset
for help on using the changeset viewer.