Changeset 17717
- Timestamp:
- 08/05/20 04:37:37 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4
- Files:
-
- 2 added
- 1 deleted
- 77 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/BasicTourAnalyzer.cs
r17716 r17717 31 31 using HeuristicLab.Problems.VehicleRouting.Interfaces; 32 32 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 33 using HeuristicLab.Problems.VehicleRouting.Variants;34 33 35 34 namespace HeuristicLab.Problems.VehicleRouting { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/CapacitatedTourAnalyzer.cs
r17716 r17717 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 32 using HeuristicLab.Problems.VehicleRouting.Variants;33 32 34 33 namespace HeuristicLab.Problems.VehicleRouting { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/PickupAndDeliveryTourAnalyzer.cs
r17716 r17717 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 32 using HeuristicLab.Problems.VehicleRouting.Variants;33 32 34 33 namespace HeuristicLab.Problems.VehicleRouting { … … 38 37 [Item("Pickup & Delivery Tour Analyzer", "An operator which analyzes the best, average and worst properties of the VRP tours in the scope tree.")] 39 38 [StorableType("0a108965-fb1a-47a3-a5d4-11d1bfa51b0d")] 40 public sealed class PickupAndDeliveryTourAnalyzer : InstrumentedOperator, IAnalyzer, I CapacitatedOperator {39 public sealed class PickupAndDeliveryTourAnalyzer : InstrumentedOperator, IAnalyzer, IPickupAndDeliveryOperator { 41 40 [Storable] public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { get; private set; } 42 41 [Storable] public IScopeTreeLookupParameter<CVRPPDTWEvaluation> EvaluationResultParameter { get; private set; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/TimeWindowTourAnalyzer.cs
r17716 r17717 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 32 using HeuristicLab.Problems.VehicleRouting.Variants;33 32 34 33 namespace HeuristicLab.Problems.VehicleRouting { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/CapacityRelaxationVRPAnalyzer.cs
r17716 r17717 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 30 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting { … … 37 36 [Item("CapacityRelaxationVRPAnalyzer", "An operator for adaptively relaxing the capacity constraints.")] 38 37 [StorableType("0e244bff-3d76-4af1-95b8-4316c25096be")] 39 public class CapacityRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, ICapacitatedOperator , ISingleObjectiveOperator{38 public class CapacityRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, ICapacitatedOperator { 40 39 [Storable] public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { get; private set; } 41 40 [Storable] public IScopeTreeLookupParameter<IVRPEncodedSolution> VRPToursParameter { get; private set; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/PickupViolationsRelaxationVRPAnalyzer.cs
r17716 r17717 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 30 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting { … … 37 36 [Item("PickupViolationsRelaxationVRPAnalyzer", "An operator for adaptively relaxing the pickup constraints.")] 38 37 [StorableType("bcf16a7c-5e16-4d96-8b6b-9d5a2ddc0420")] 39 public class PickupViolationsRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, IPickupAndDeliveryOperator , ISingleObjectiveOperator{38 public class PickupViolationsRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, IPickupAndDeliveryOperator { 40 39 [Storable] public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { get; private set; } 41 40 [Storable] public IScopeTreeLookupParameter<IVRPEncodedSolution> VRPToursParameter { get; private set; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/TimeWindowRelaxationVRPAnalyzer.cs
r17716 r17717 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 30 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting { … … 37 36 [Item("TimeWindowRelaxationVRPAnalyzer", "An operator for adaptively relaxing the time window constraints.")] 38 37 [StorableType("e782fe43-c77f-445a-a676-7b03db53ca99")] 39 public class TimeWindowRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, ITimeWindowedOperator , ISingleObjectiveOperator{38 public class TimeWindowRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, ITimeWindowedOperator { 40 39 [Storable] public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { get; private set; } 41 40 [Storable] public IScopeTreeLookupParameter<IVRPEncodedSolution> VRPToursParameter { get; private set; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/AlbaEncodedSolution.cs
r17714 r17717 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; … … 138 139 public static AlbaEncodedSolution ConvertFrom(IVRPEncodedSolution encoding, IVRPProblemInstance instance) { 139 140 List<Tour> tours = encoding.GetTours(); 140 141 int cities = 0; 142 foreach (Tour tour in tours) { 143 cities += tour.Stops.Count; 144 } 141 var cities = tours.Sum(x => x.Stops.Count); 145 142 146 143 int emptyVehicles = instance.Vehicles.Value - tours.Count; … … 171 168 } 172 169 173 AlbaEncodedSolution solution = new AlbaEncodedSolution(new Permutation(PermutationTypes.RelativeUndirected, new IntArray(array)), instance); 174 175 return solution; 170 return new AlbaEncodedSolution(new Permutation(PermutationTypes.RelativeUndirected, new IntArray(array)), instance); 176 171 } 177 172 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Crossovers/AlbaCrossover.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/IAlbaOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HeuristicLab.Problems.VehicleRouting.Variants;23 22 using HEAL.Attic; 23 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 24 25 25 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 26 26 [StorableType("E4EADC47-5FEC-429D-B713-795171F8C85B")] 27 public interface IAlbaOperator : 28 ISingleDepotOperator, IHeterogenousCapacitatedOperator, IMultiDepotOperator, ITimeWindowedOperator {27 public interface IAlbaOperator : IGeneralVRPOperator { 28 // the Alba encoding is agnostic to constraints of the VRP 29 29 } 30 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/LocalImprovement/AlbaLambdaInterchangeLocalImprovementOperator.cs
r17704 r17717 111 111 public override IOperation InstrumentedApply() { 112 112 int maxIterations = MaximumIterationsParameter.ActualValue.Value; 113 AlbaEncodedSolution solution = null;113 var solution = VRPToursParameter.ActualValue as AlbaEncodedSolution; 114 114 115 if (VRPToursParameter.ActualValue is AlbaEncodedSolution) 116 solution = VRPToursParameter.ActualValue as AlbaEncodedSolution; 117 else 115 if (solution == null) 118 116 VRPToursParameter.ActualValue = solution = AlbaEncodedSolution.ConvertFrom(VRPToursParameter.ActualValue, ProblemInstance); 119 117 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaCustomerInsertionManipulator.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 using HEAL.Attic;25 25 26 26 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaManipulator.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/GVREncodedSolution.cs
r17714 r17717 27 27 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Problems.VehicleRouting.Variants;30 29 31 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/IGVROperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HeuristicLab.Problems.VehicleRouting.Variants;23 22 using HEAL.Attic; 23 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 24 25 25 namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR { 26 26 [StorableType("8C6EFFE6-4270-497D-9351-13BEDA227E21")] 27 public interface IGVROperator : 28 ISingleDepotOperator, IHomogenousCapacitatedOperator, ITimeWindowedOperator {27 public interface IGVROperator : IGeneralVRPOperator { 28 // GVR is agnostic to any specific VRP constraints 29 29 } 30 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Creators/MultiVRPSolutionCreator.cs
r17698 r17717 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Collections; 26 27 using HeuristicLab.Common; … … 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Parameters; 31 using HEAL.Attic;32 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 using HeuristicLab.Problems.VehicleRouting.Variants;34 33 35 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs
r17698 r17717 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Collections; 26 27 using HeuristicLab.Common; … … 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Parameters; 31 using HEAL.Attic;32 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 using HeuristicLab.Problems.VehicleRouting.Variants;34 33 35 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/RandomParentCloneCrossover.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 using HeuristicLab.Problems.VehicleRouting.Variants;29 28 30 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General.Crossovers { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Manipulators/MultiVRPSolutionManipulator.cs
r17698 r17717 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Collections; 26 27 using HeuristicLab.Common; … … 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Parameters; 31 using HEAL.Attic;32 32 using HeuristicLab.Problems.VehicleRouting.Interfaces; 33 using HeuristicLab.Problems.VehicleRouting.Variants;34 33 35 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveEvaluator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Parameters; 25 using HEAL.Attic;26 26 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 27 using HeuristicLab.Problems.VehicleRouting. Variants;27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 28 29 29 namespace HeuristicLab.Problems.VehicleRouting { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveGenerator.cs
r17698 r17717 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Collections; 26 27 using HeuristicLab.Common; … … 30 31 using HeuristicLab.Optimization; 31 32 using HeuristicLab.Parameters; 32 using HEAL.Attic;33 33 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba; 34 34 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 35 35 using HeuristicLab.Problems.VehicleRouting.Interfaces; 36 using HeuristicLab.Problems.VehicleRouting.Variants;37 36 38 37 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveMaker.cs
r17226 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Parameters; 25 using HEAL.Attic; 26 using HeuristicLab.Problems.VehicleRouting.Variants; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 27 28 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveTabuChecker.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Problems.VehicleRouting.Variants;31 30 32 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveTabuMaker.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Problems.VehicleRouting.Variants;31 30 32 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/ShakingOperators/VehicleRoutingShakingOperator.cs
r17698 r17717 22 22 using System.Collections.Generic; 23 23 using System.Linq; 24 using HEAL.Attic; 24 25 using HeuristicLab.Collections; 25 26 using HeuristicLab.Common; … … 28 29 using HeuristicLab.Optimization.Operators; 29 30 using HeuristicLab.Parameters; 30 using HEAL.Attic;31 31 using HeuristicLab.PluginInfrastructure; 32 32 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 33 33 using HeuristicLab.Problems.VehicleRouting.Interfaces; 34 using HeuristicLab.Problems.VehicleRouting.Variants;35 34 36 35 namespace HeuristicLab.Problems.VehicleRouting { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/IterativeInsertionCreator.cs
r17713 r17717 22 22 using System; 23 23 using System.Collections.Generic; 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Optimization; 28 29 using HeuristicLab.Parameters; 29 using HEAL.Attic;30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 32 using HeuristicLab.Problems.VehicleRouting.Variants;33 32 34 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/PotvinCreator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 using HEAL.Attic;25 25 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 26 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; … … 29 29 [Item("PotvinCreator", "A VRP creator.")] 30 30 [StorableType("9007B8EE-61F5-45D7-A853-951E2435E308")] 31 public abstract class PotvinCreator : VRPCreator, IPotvinOperator, IVRPCreator {31 public abstract class PotvinCreator : VRPCreator, IPotvinOperator, IVRPCreator, IGeneralVRPOperator { 32 32 public override bool CanChangeName { 33 33 get { return false; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/PushForwardInsertionCreator.cs
r17712 r17717 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 32 using HeuristicLab.Problems.VehicleRouting.Variants;33 32 34 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinCrossover.cs
r17712 r17717 33 33 [Item("PotvinCrossover", "A VRP crossover operation.")] 34 34 [StorableType("B2E9AC24-C689-45AD-BEDE-2F226E044BDE")] 35 public abstract class PotvinCrossover : VRPCrossover, IStochasticOperator, IPotvinOperator {35 public abstract class PotvinCrossover : VRPCrossover, IStochasticOperator, IPotvinOperator, IGeneralVRPOperator { 36 36 public ILookupParameter<IRandom> RandomParameter { 37 37 get { return (LookupParameter<IRandom>)Parameters["Random"]; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/IPotvinOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HeuristicLab.Problems.VehicleRouting.Variants;23 22 using HEAL.Attic; 24 23 25 24 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 26 25 [StorableType("90265685-321B-4E34-AD9F-30FA917F07A0")] 27 public interface IPotvinOperator :26 public interface IPotvinOperator /*: 28 27 ISingleDepotOperator, IHomogenousCapacitatedOperator, ITimeWindowedOperator, 29 IMultiDepotOperator, IHeterogenousCapacitatedOperator {28 IMultiDepotOperator, IHeterogenousCapacitatedOperator*/ { 30 29 } 31 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinLocalSearchManipulator.cs
r17712 r17717 31 31 [Item("PotvinLocalSearchManipulator", "The LSM operator which manipulates a VRP representation. 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.")] 32 32 [StorableType("EF16AD46-5C58-4846-95CF-3C3DF78D2F68")] 33 public sealed class PotvinLocalSearchManipulator : PotvinManipulator, IVRPLocalSearchManipulator {33 public sealed class PotvinLocalSearchManipulator : PotvinManipulator, IVRPLocalSearchManipulator, IGeneralVRPOperator { 34 34 public IValueParameter<IntValue> Iterations { 35 35 get { return (IValueParameter<IntValue>)Parameters["Iterations"]; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinManipulator.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 25 26 using HeuristicLab.Optimization; 26 27 using HeuristicLab.Parameters; 27 using HEAL.Attic;28 28 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 using HEAL.Attic;25 25 using HeuristicLab.Problems.VehicleRouting.Interfaces; 26 26 … … 28 28 [Item("PotvinOneLevelExchangeMainpulator", "The 1M operator which manipulates a VRP representation. 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 29 [StorableType("20E22B90-348D-438F-AD17-F1F92BD12C00")] 30 public sealed class PotvinOneLevelExchangeMainpulator : PotvinManipulator {30 public sealed class PotvinOneLevelExchangeMainpulator : PotvinManipulator, IGeneralVRPOperator { 31 31 [StorableConstructor] 32 32 private PotvinOneLevelExchangeMainpulator(StorableConstructorFlag _) : base(_) { } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinPairwiseOneLevelExchangeManipulator.cs
r17712 r17717 25 25 using HeuristicLab.Problems.VehicleRouting.Interfaces; 26 26 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 27 using HeuristicLab.Problems.VehicleRouting.Variants;28 27 29 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 30 29 [Item("PotvinPairwiseOneLevelExchangeMainpulator", "The 1M operator which manipulates a PDP representation. It has been adapted to pickup and delivery from 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. It was adapted to the PDP formulation.")] 31 30 [StorableType("BF040F90-535E-4F3D-9420-0123565A252D")] 32 public sealed class PotvinPairwiseOneLevelExchangeMainpulator : PotvinManipulator {31 public sealed class PotvinPairwiseOneLevelExchangeMainpulator : PotvinManipulator, IGeneralVRPOperator { 33 32 [StorableConstructor] 34 33 private PotvinPairwiseOneLevelExchangeMainpulator(StorableConstructorFlag _) : base(_) { } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinPairwiseTwoLevelExchangeManipulator.cs
r17712 r17717 26 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 27 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 28 using HeuristicLab.Problems.VehicleRouting.Variants;29 28 30 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 31 30 [Item("PotvinPairwiseTwoLevelExchangeManipulator", "The 2M operator which manipulates a VRP representation. It has been adapted to pickup and delivery from 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. It was adapted to the PDP formulation.")] 32 31 [StorableType("8E4D8A17-1204-45CC-8ED7-375FCE0355E8")] 33 public sealed class PotvinPairwiseTwoLevelExchangeManipulator : PotvinManipulator {32 public sealed class PotvinPairwiseTwoLevelExchangeManipulator : PotvinManipulator, IGeneralVRPOperator { 34 33 [StorableConstructor] 35 34 private PotvinPairwiseTwoLevelExchangeManipulator(StorableConstructorFlag _) : base(_) { } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs
r17712 r17717 28 28 [Item("PotvinTwoLevelExchangeManipulator", "The 2M operator which manipulates a VRP representation. 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 29 [StorableType("FB992182-9FD8-4B08-A48C-97378E85DAD5")] 30 public sealed class PotvinTwoLevelExchangeManipulator : PotvinManipulator {30 public sealed class PotvinTwoLevelExchangeManipulator : PotvinManipulator, IGeneralVRPOperator { 31 31 [StorableConstructor] 32 32 private PotvinTwoLevelExchangeManipulator(StorableConstructorFlag _) : base(_) { } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinVehicleAssignmentManipulator.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Encodings.PermutationEncoding; 25 26 using HeuristicLab.Parameters; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Problems.VehicleRouting.Variants;30 29 31 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 32 31 [Item("PotvinVehicleAssignmentMainpulator", "A manipulator that changes the vehicle assignment")] 33 32 [StorableType("57755DA2-B9CB-4A9F-B32C-988BFC06365A")] 34 public sealed class PotvinVehicleAssignmentMainpulator : VRPManipulator, ITimeWindowedOperator, 35 IMultiDepotOperator, IHeterogenousCapacitatedOperator { 33 public sealed class PotvinVehicleAssignmentMainpulator : VRPManipulator, IHeterogenousCapacitatedOperator { 36 34 public IValueParameter<IPermutationManipulator> VehicleAssignmentManipuator { 37 35 get { return (IValueParameter<IPermutationManipulator>)Parameters["VehicleAssignmentManipuator"]; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/IPotvinCustomerRelocationMoveOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 using HEAL.Attic;25 25 26 26 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 27 27 [StorableType("6F70F50C-411C-4AF9-A373-E2BCDFA66F56")] 28 public interface IPotvinCustomerRelocationMoveOperator : IVRPMoveOperator {28 public interface IPotvinCustomerRelocationMoveOperator : IVRPMoveOperator, IGeneralVRPOperator { 29 29 ILookupParameter<PotvinCustomerRelocationMove> CustomerRelocationMoveParameter { get; } 30 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/IPotvinPDExchangeMoveOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 using HEAL.Attic;25 25 26 26 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 27 27 [StorableType("D3D40EAC-F695-4069-9A3A-861CE2997E37")] 28 public interface IPotvinPDExchangeMoveOperator : IVRPMoveOperator {28 public interface IPotvinPDExchangeMoveOperator : IVRPMoveOperator, IPickupAndDeliveryOperator { 29 29 ILookupParameter<PotvinPDExchangeMove> PDExchangeMoveParameter { get; } 30 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeExhaustiveMoveGenerator.cs
r17698 r17717 21 21 22 22 using System.Collections.Generic; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Optimization; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 using HeuristicLab.Problems.VehicleRouting.Variants;29 28 30 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveMaker.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 using HeuristicLab.Problems.VehicleRouting.Variants;29 28 30 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveTabuCriterion.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Problems.VehicleRouting.Variants;31 30 32 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeSingleMoveGenerator.cs
r17698 r17717 21 21 22 22 using System.Collections.Generic; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Optimization; 26 27 using HeuristicLab.Parameters; 27 using HEAL.Attic;28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Problems.VehicleRouting.Variants;30 29 31 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/IPotvinPDRearrangeMoveOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 using HEAL.Attic;25 25 26 26 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 27 27 [StorableType("A5C6D2DD-A20B-4067-8C8D-C527C3E5DBAE")] 28 public interface IPotvinPDRearrangeMoveOperator : IVRPMoveOperator {28 public interface IPotvinPDRearrangeMoveOperator : IVRPMoveOperator, IPickupAndDeliveryOperator { 29 29 ILookupParameter<PotvinPDRearrangeMove> PDRearrangeMoveParameter { get; } 30 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeExhaustiveMoveGenerator.cs
r17698 r17717 21 21 22 22 using System.Collections.Generic; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Optimization; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 using HeuristicLab.Problems.VehicleRouting.Variants;29 28 30 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveMaker.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 using HeuristicLab.Problems.VehicleRouting.Variants;29 28 30 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveTabuCriterion.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Problems.VehicleRouting.Variants;31 30 32 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeSingleMoveGenerator.cs
r17698 r17717 21 21 22 22 using System.Collections.Generic; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Optimization; 26 27 using HeuristicLab.Parameters; 27 using HEAL.Attic;28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Problems.VehicleRouting.Variants;30 29 31 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/IPotvinPDShiftMoveOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 using HEAL.Attic;25 25 26 26 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 27 27 [StorableType("404B8A42-4BC0-47B3-AD95-5294229515B3")] 28 public interface IPotvinPDShiftMoveOperator : IVRPMoveOperator {28 public interface IPotvinPDShiftMoveOperator : IVRPMoveOperator, IPickupAndDeliveryOperator { 29 29 ILookupParameter<PotvinPDShiftMove> PDShiftMoveParameter { get; } 30 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftExhaustiveMoveGenerator.cs
r17698 r17717 21 21 22 22 using System.Collections.Generic; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Optimization; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 using HeuristicLab.Problems.VehicleRouting.Variants;29 28 30 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveMaker.cs
r17698 r17717 21 21 22 22 using System.Collections.Generic; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Optimization; 26 27 using HeuristicLab.Parameters; 27 using HEAL.Attic;28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Problems.VehicleRouting.Variants;30 29 31 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveTabuCriterion.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Problems.VehicleRouting.Variants;31 30 32 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftSingleMoveGenerator.cs
r17698 r17717 21 21 22 22 using System.Collections.Generic; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Optimization; 26 27 using HeuristicLab.Parameters; 27 using HEAL.Attic;28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Problems.VehicleRouting.Variants;30 29 31 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/IPotvinTwoOptStarMoveOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 using HEAL.Attic;25 25 26 26 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 27 27 [StorableType("371BDEC8-9A88-48DF-A44D-76FB6CE52A63")] 28 public interface IPotvinTwoOptStarMoveOperator : IVRPMoveOperator {28 public interface IPotvinTwoOptStarMoveOperator : IVRPMoveOperator, IGeneralVRPOperator { 29 29 ILookupParameter<PotvinTwoOptStarMove> TwoOptStarMoveParameter { get; } 30 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveTabuCriterion.cs
r17698 r17717 21 21 22 22 using System.Collections.Generic; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Optimization; 28 29 using HeuristicLab.Parameters; 29 using HEAL.Attic;30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/IPotvinVehicleAssignmentMoveOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 using HEAL.Attic;25 25 26 26 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 27 27 [StorableType("9C467DEC-0BA6-47B8-8805-3A4494BD0561")] 28 public interface IPotvinVehicleAssignmentMoveOperator : IVRPMoveOperator {28 public interface IPotvinVehicleAssignmentMoveOperator : IVRPMoveOperator, IHeterogenousCapacitatedOperator { 29 29 ILookupParameter<PotvinVehicleAssignmentMove> VehicleAssignmentMoveParameter { get; } 30 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentMoveTabuCriterion.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 using HeuristicLab.Problems.VehicleRouting.Interfaces; 30 using HeuristicLab.Problems.VehicleRouting.Variants;31 30 32 31 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Encodings.PermutationEncoding; 25 26 using HeuristicLab.Parameters; 26 using HEAL.Attic;27 27 28 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { 29 29 [Item("PrinsPermutationCrossover", "An operator which crosses two VRP representations using a standard permutation operator. It is implemented as described in Prins, C. (2004). A simple and effective evolutionary algorithm for the vehicle routing problem. Computers & Operations Research, 12:1985-2002.")] 30 30 [StorableType("F61C494E-4958-4B89-893B-7485A72A1C80")] 31 public sealed class PrinsPermutationCrossover : PrinsCrossover , IPrinsOperator{31 public sealed class PrinsPermutationCrossover : PrinsCrossover { 32 32 public IValueLookupParameter<IPermutationCrossover> InnerCrossoverParameter { 33 33 get { return (IValueLookupParameter<IPermutationCrossover>)Parameters["InnerCrossover"]; } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/IPrinsOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HeuristicLab.Problems.VehicleRouting.Variants;23 22 using HEAL.Attic; 23 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 24 25 25 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { 26 26 [StorableType("02783182-5F42-45F8-A57A-E63459E22C6A")] 27 public interface IPrinsOperator : 28 ISingleDepotOperator, IHomogenousCapacitatedOperator, ITimeWindowedOperator { 27 public interface IPrinsOperator : IGeneralVRPOperator { 29 28 } 30 29 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/PrinsEncodedSolution.cs
r17714 r17717 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; … … 163 164 164 165 public static PrinsEncodedSolution ConvertFrom(List<int> routeParam, IVRPProblemInstance problemInstance) { 165 List<int> route = new List<int>(routeParam); 166 167 while (route.Remove(0)) { //remove all delimiters (0) 168 } 169 170 for (int i = 0; i < route.Count; i++) 171 route[i]--; 166 var route = routeParam.Where(x => x != 0).Select(x => x - 1).ToArray(); 172 167 173 168 return new PrinsEncodedSolution( 174 new Permutation(PermutationTypes.RelativeUndirected, route .ToArray()), problemInstance);169 new Permutation(PermutationTypes.RelativeUndirected, route), problemInstance); 175 170 } 176 171 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuMergeCrossover1.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; 25 using HEAL.Attic; 26 using HeuristicLab.Problems.VehicleRouting.Variants; 26 using HeuristicLab.Problems.VehicleRouting.Interfaces; 27 27 28 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuMergeCrossover2.cs
r17698 r17717 21 21 22 22 using System.Collections.Generic; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; 26 using HEAL.Attic; 27 using HeuristicLab.Problems.VehicleRouting.Variants; 27 using HeuristicLab.Problems.VehicleRouting.Interfaces; 28 28 29 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/IZhuOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HeuristicLab.Problems.VehicleRouting.Variants;23 22 using HEAL.Attic; 23 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 24 25 25 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu { 26 26 [StorableType("CD11FA3C-3B50-4710-AAFC-32C9C61B3321")] 27 public interface IZhuOperator : 28 ISingleDepotOperator, IHomogenousCapacitatedOperator, ITimeWindowedOperator { 27 public interface IZhuOperator : IGeneralVRPOperator { 29 28 } 30 29 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/ZhuEncodedSolution.cs
r17714 r17717 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; … … 114 115 public static ZhuEncodedSolution ConvertFrom(IVRPEncodedSolution encoding, IVRPProblemInstance problemInstance) { 115 116 List<Tour> tours = encoding.GetTours(); 116 List<int> route = new List<int>(); 117 var count = tours.Sum(x => x.Stops.Count); 118 var route = new int[count]; 117 119 120 var i = 0; 118 121 foreach (Tour tour in tours) { 119 122 foreach (int city in tour.Stops) 120 route .Add(city - 1);123 route[i++] = city - 1; 121 124 } 122 125 123 126 return new ZhuEncodedSolution( 124 new Permutation(PermutationTypes.RelativeUndirected, route .ToArray()), problemInstance);127 new Permutation(PermutationTypes.RelativeUndirected, route), problemInstance); 125 128 } 126 129 127 130 public static ZhuEncodedSolution ConvertFrom(List<int> routeParam, IVRPProblemInstance problemInstance) { 128 List<int> route = new List<int>(routeParam); 129 130 while (route.Remove(0)) { //remove all delimiters (0) 131 } 132 133 for (int i = 0; i < route.Count; i++) 134 route[i]--; 131 var route = routeParam.Where(x => x != 0).Select(x => x - 1).ToArray(); 135 132 136 133 return new ZhuEncodedSolution( 137 new Permutation(PermutationTypes.RelativeUndirected, route .ToArray()), problemInstance);134 new Permutation(PermutationTypes.RelativeUndirected, route), problemInstance); 138 135 } 139 136 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj
r17715 r17717 143 143 <Compile Include="Improver\VRPImprovementOperator.cs" /> 144 144 <Compile Include="Improver\VRPIntraRouteImprovementOperator.cs" /> 145 <Compile Include="Interfaces\OperatorCapabilities.cs" /> 145 146 <Compile Include="Interfaces\IVRPEncoding.cs" /> 146 147 <Compile Include="Interfaces\IVRPLocalSearchManipulator.cs" /> 148 <Compile Include="Interfaces\ProblemInstanceFeatures.cs" /> 147 149 <Compile Include="Interpreters\MDCVRPInterpreter.cs" /> 148 150 <Compile Include="Interpreters\VRPInterpreter.cs" /> … … 340 342 <Compile Include="SimilarityCalculators\VRPSimilarityCalculator.cs" /> 341 343 <Compile Include="SolutionParser.cs" /> 342 <Compile Include="Variants\Capacitated\Heterogenous\IHeterogenousCapacitatedProblemInstance.cs" />343 <Compile Include="Variants\Capacitated\Heterogenous\IHeterogenousCapacitatedOperator.cs" />344 <Compile Include="Variants\Capacitated\Homogenous\IHomogenousCapacitatedOperator.cs" />345 <Compile Include="Variants\Capacitated\Homogenous\IHomogenousCapacitatedProblemInstance.cs" />346 <Compile Include="Variants\Capacitated\ICapacitatedProblemInstance.cs" />347 <Compile Include="Variants\Capacitated\ICapacitatedOperator.cs" />348 <Compile Include="Variants\General\IGeneralVRPOperator.cs" />349 <Compile Include="Variants\MultiDepot\IMultiDepotOperator.cs" />350 <Compile Include="Variants\MultiDepot\IMultiDepotProblemInstance.cs" />351 <Compile Include="Variants\PickupAndDelivery\IPickupAndDeliveryOperator.cs" />352 <Compile Include="Variants\PickupAndDelivery\IPickupAndDeliveryProblemInstance.cs" />353 <Compile Include="Variants\SingleDepot\ISingleDepotOperator.cs" />354 <Compile Include="Variants\SingleDepot\ISingleDepotProblemInstance.cs" />355 <Compile Include="Variants\TimeWindowed\ITimeWindowedProblemInstance.cs" />356 <Compile Include="Variants\TimeWindowed\ITimeWindowedOperator.cs" />357 344 <Compile Include="ProblemInstances\SingleDepotVRP\CVRPTWProblemInstance.cs" /> 358 345 <Compile Include="ProblemInstances\SingleDepotVRP\CVRPProblemInstance.cs" /> -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Improver/VRPImprovementOperator.cs
r17698 r17717 21 21 22 22 using System; 23 using HEAL.Attic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 using HeuristicLab.Problems.VehicleRouting.Encodings; 30 30 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 31 31 using HeuristicLab.Problems.VehicleRouting.Interfaces; 32 using HeuristicLab.Problems.VehicleRouting.Variants;33 32 34 33 namespace HeuristicLab.Problems.VehicleRouting { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/PathRelinkers/VRPPathRelinker.cs
r17698 r17717 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 29 30 using HeuristicLab.Optimization.Operators; 30 31 using HeuristicLab.Parameters; 31 using HEAL.Attic;32 32 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 33 33 using HeuristicLab.Problems.VehicleRouting.Interfaces; 34 34 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 35 using HeuristicLab.Problems.VehicleRouting.Variants;36 35 37 36 namespace HeuristicLab.Problems.VehicleRouting { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRPPDTWProblemInstance.cs
r17715 r17717 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 70 69 71 70 public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) { 72 return base.FilterOperators(operators).Where(x => x is IPickupAndDeliveryOperator); 71 return base.FilterOperators(operators) 72 .Where(x => !(x is INotPickupAndDeliveryOperator)) 73 .Union(operators.Where(x => x is IPickupAndDeliveryOperator)); 73 74 } 74 75 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRPProblemInstance.cs
r17715 r17717 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 66 65 67 66 public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) { 68 return base.FilterOperators(operators).Where(x => x is IHeterogenousCapacitatedOperator); 67 return base.FilterOperators(operators) 68 .Where(x => !(x is INotCapacitatedOperaor)) 69 .Union(operators.Where(x => x is IHeterogenousCapacitatedOperator 70 || x is ICapacitatedOperator && !(x is IHomogenousCapacitatedOperator))); 69 71 } 70 72 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRPTWProblemInstance.cs
r17715 r17717 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 88 87 89 88 public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) { 90 return base.FilterOperators(operators). Where(x => x is ITimeWindowedOperator);89 return base.FilterOperators(operators).Union(operators.Where(x => x is ITimeWindowedOperator)); 91 90 } 92 91 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs
r17711 r17717 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 59 58 60 59 public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) { 61 return base.FilterOperators(operators).Where(x => x is IMultiDepotOperator); 60 return base.FilterOperators(operators) 61 .Where(x => !(x is INotMultiDepotOperator)) 62 .Union(operators.Where(x => x is IMultiDepotOperator)); 62 63 } 63 64 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRPPDTWProblemInstance.cs
r17715 r17717 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 70 69 71 70 public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) { 72 return base.FilterOperators(operators).Where(x => x is IPickupAndDeliveryOperator); 71 return base.FilterOperators(operators) 72 .Where(x => !(x is INotPickupAndDeliveryOperator)) 73 .Union(operators.Where(x => x is IPickupAndDeliveryOperator)); 73 74 } 74 75 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRPProblemInstance.cs
r17715 r17717 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 66 65 67 66 public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) { 68 return base.FilterOperators(operators).Where(x => x is IHomogenousCapacitatedOperator); 67 return base.FilterOperators(operators) 68 .Where(x => !(x is INotCapacitatedOperaor)) 69 .Union(operators.Where(x => x is IHomogenousCapacitatedOperator 70 || x is ICapacitatedOperator && !(x is IHeterogenousCapacitatedOperator))); 69 71 } 70 72 protected override VRPEvaluation CreateTourEvaluation() { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRPTWProblemInstance.cs
r17715 r17717 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 using HeuristicLab.Problems.VehicleRouting.Variants;32 31 33 32 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 88 87 89 88 public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) { 90 return base.FilterOperators(operators).Where(x => x is ITimeWindowedOperator); 89 return base.FilterOperators(operators) 90 .Where(x => !(x is INotTimeWindowedOperator)) 91 .Union(operators.Where(x => x is ITimeWindowedOperator)); 91 92 } 92 93 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs
r17711 r17717 27 27 using HeuristicLab.Data; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; 29 using HeuristicLab.Problems.VehicleRouting.Variants;30 29 31 30 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 35 34 36 35 public override IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) { 37 return base.FilterOperators(operators).Where(x => x is ISingleDepotOperator); 36 return base.FilterOperators(operators) 37 .Where(x => !(x is INotSingleDepotOperator)) 38 .Union(operators.Where(x => x is ISingleDepotOperator)); 38 39 } 39 40 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r17711 r17717 93 93 94 94 public virtual IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) { 95 return operators.Where(x => x is I VRPOperator);95 return operators.Where(x => x is IGeneralVRPOperator); 96 96 } 97 97 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r17711 r17717 153 153 } 154 154 155 [Storable(OldName = "operators")]156 private List<IOperator> StorableOperators {157 set { Operators.AddRange(value); }158 }159 160 155 private void AttachEventHandlers() { 161 156 ProblemInstanceParameter.ValueChanged += new EventHandler(ProblemInstanceParameter_ValueChanged); … … 166 161 if (ProblemInstance != null) { 167 162 ProblemInstance.EvaluationChanged += new EventHandler(ProblemInstance_EvaluationChanged); 163 } 164 } 165 166 void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) { 167 EvalBestKnownSolution(); 168 } 169 170 void ProblemInstance_EvaluationChanged(object sender, EventArgs e) { 171 BestKnownQuality = double.NaN; 172 if (BestKnownSolution != null) { 173 // the tour is not valid if there are more vehicles in it than allowed 174 if (ProblemInstance.Vehicles.Value < BestKnownSolution.Solution.GetTours().Count) { 175 BestKnownSolution = null; 176 } else EvalBestKnownSolution(); 168 177 } 169 178 } … … 182 191 } 183 192 184 void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) {185 EvalBestKnownSolution();186 }187 188 void ProblemInstance_EvaluationChanged(object sender, EventArgs e) {189 BestKnownQuality = double.NaN;190 if (BestKnownSolution != null) {191 // the tour is not valid if there are more vehicles in it than allowed192 if (ProblemInstance.Vehicles.Value < BestKnownSolution.Solution.GetTours().Count) {193 BestKnownSolution = null;194 } else EvalBestKnownSolution();195 }196 }197 198 193 void ProblemInstanceParameter_ValueChanged(object sender, EventArgs e) { 199 194 InitializeOperators(); 200 195 AttachProblemInstanceEventHandlers(); 201 202 OnOperatorsChanged(); 203 } 204 205 public void SetProblemInstance(IVRPProblemInstance instance) { 206 ProblemInstanceParameter.ValueChanged -= new EventHandler(ProblemInstanceParameter_ValueChanged); 207 208 ProblemInstance = instance; 209 AttachProblemInstanceEventHandlers(); 210 211 ProblemInstanceParameter.ValueChanged += new EventHandler(ProblemInstanceParameter_ValueChanged); 196 } 197 198 protected override void OnEncodingChanged() { 199 base.OnEncodingChanged(); 200 InitializeOperators(); 212 201 } 213 202 … … 215 204 Encoding.FilterOperators(ProblemInstance); 216 205 217 Operators.Add(new VRPSimilarityCalculator()); 218 Operators.Add(new QualitySimilarityCalculator()); 219 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 220 //Operators.AddRange(ProblemInstance.Operators.OfType<IAnalyzer>()); 206 var newOps = new List<IItem>(); 207 var operatorTypes = new HashSet<Type>(Operators.Select(x => x.GetType())); 208 if (operatorTypes.Add(typeof(VRPSimilarityCalculator))) 209 newOps.Add(new VRPSimilarityCalculator()); 210 if (operatorTypes.Add(typeof(QualitySimilarityCalculator))) 211 newOps.Add(new QualitySimilarityCalculator()); 212 if (operatorTypes.Add(typeof(PopulationSimilarityAnalyzer))) 213 newOps.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 214 215 var assembly = typeof(VehicleRoutingProblem).Assembly; 216 var operators = ApplicationManager.Manager.GetTypes(new[] { typeof(IAnalyzer) }, assembly, true, false, false) 217 .Where(x => operatorTypes.Add(x)).Select(t => (IOperator)Activator.CreateInstance(t)).ToList(); 218 newOps.AddRange(ProblemInstance.FilterOperators(operators)); 219 220 Operators.AddRange(newOps); 221 221 } 222 222 … … 305 305 BestKnownSolution = null; 306 306 307 if (ProblemInstance != null && instance.ProblemInstance != null && 308 instance.ProblemInstance.GetType() == ProblemInstance.GetType()) 309 SetProblemInstance(instance.ProblemInstance); 310 else 311 ProblemInstance = instance.ProblemInstance; 307 ProblemInstance = instance.ProblemInstance; 312 308 313 309 OnReset();
Note: See TracChangeset
for help on using the changeset viewer.