Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17717


Ignore:
Timestamp:
08/05/20 04:37:37 (4 years ago)
Author:
abeham
Message:

#2521: working on VRP (refactoring all the capabilities, features, and operator discovery)

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  
    3131using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3232using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    33 using HeuristicLab.Problems.VehicleRouting.Variants;
    3433
    3534namespace HeuristicLab.Problems.VehicleRouting {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/CapacitatedTourAnalyzer.cs

    r17716 r17717  
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    32 using HeuristicLab.Problems.VehicleRouting.Variants;
    3332
    3433namespace HeuristicLab.Problems.VehicleRouting {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/PickupAndDeliveryTourAnalyzer.cs

    r17716 r17717  
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    32 using HeuristicLab.Problems.VehicleRouting.Variants;
    3332
    3433namespace HeuristicLab.Problems.VehicleRouting {
     
    3837  [Item("Pickup & Delivery Tour Analyzer", "An operator which analyzes the best, average and worst properties of the VRP tours in the scope tree.")]
    3938  [StorableType("0a108965-fb1a-47a3-a5d4-11d1bfa51b0d")]
    40   public sealed class PickupAndDeliveryTourAnalyzer : InstrumentedOperator, IAnalyzer, ICapacitatedOperator {
     39  public sealed class PickupAndDeliveryTourAnalyzer : InstrumentedOperator, IAnalyzer, IPickupAndDeliveryOperator {
    4140    [Storable] public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { get; private set; }
    4241    [Storable] public IScopeTreeLookupParameter<CVRPPDTWEvaluation> EvaluationResultParameter { get; private set; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/TimeWindowTourAnalyzer.cs

    r17716 r17717  
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    32 using HeuristicLab.Problems.VehicleRouting.Variants;
    3332
    3433namespace HeuristicLab.Problems.VehicleRouting {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/CapacityRelaxationVRPAnalyzer.cs

    r17716 r17717  
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3030using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting {
     
    3736  [Item("CapacityRelaxationVRPAnalyzer", "An operator for adaptively relaxing the capacity constraints.")]
    3837  [StorableType("0e244bff-3d76-4af1-95b8-4316c25096be")]
    39   public class CapacityRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, ICapacitatedOperator, ISingleObjectiveOperator {
     38  public class CapacityRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, ICapacitatedOperator {
    4039    [Storable] public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { get; private set; }
    4140    [Storable] public IScopeTreeLookupParameter<IVRPEncodedSolution> VRPToursParameter { get; private set; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/PickupViolationsRelaxationVRPAnalyzer.cs

    r17716 r17717  
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3030using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting {
     
    3736  [Item("PickupViolationsRelaxationVRPAnalyzer", "An operator for adaptively relaxing the pickup constraints.")]
    3837  [StorableType("bcf16a7c-5e16-4d96-8b6b-9d5a2ddc0420")]
    39   public class PickupViolationsRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, IPickupAndDeliveryOperator, ISingleObjectiveOperator {
     38  public class PickupViolationsRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, IPickupAndDeliveryOperator {
    4039    [Storable] public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { get; private set; }
    4140    [Storable] public IScopeTreeLookupParameter<IVRPEncodedSolution> VRPToursParameter { get; private set; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/ConstraintRelaxation/TimeWindowRelaxationVRPAnalyzer.cs

    r17716 r17717  
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3030using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting {
     
    3736  [Item("TimeWindowRelaxationVRPAnalyzer", "An operator for adaptively relaxing the time window constraints.")]
    3837  [StorableType("e782fe43-c77f-445a-a676-7b03db53ca99")]
    39   public class TimeWindowRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, ITimeWindowedOperator, ISingleObjectiveOperator {
     38  public class TimeWindowRelaxationVRPAnalyzer : SingleSuccessorOperator, IAnalyzer, ITimeWindowedOperator {
    4039    [Storable] public ILookupParameter<IVRPProblemInstance> ProblemInstanceParameter { get; private set; }
    4140    [Storable] public IScopeTreeLookupParameter<IVRPEncodedSolution> VRPToursParameter { get; private set; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/AlbaEncodedSolution.cs

    r17714 r17717  
    2121
    2222using System.Collections.Generic;
     23using System.Linq;
    2324using HEAL.Attic;
    2425using HeuristicLab.Common;
     
    138139    public static AlbaEncodedSolution ConvertFrom(IVRPEncodedSolution encoding, IVRPProblemInstance instance) {
    139140      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);
    145142
    146143      int emptyVehicles = instance.Vehicles.Value - tours.Count;
     
    171168      }
    172169
    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);
    176171    }
    177172  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Crossovers/AlbaCrossover.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
    2526using HeuristicLab.Parameters;
    26 using HEAL.Attic;
    2727using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/IAlbaOperator.cs

    r17226 r17717  
    2020#endregion
    2121
    22 using HeuristicLab.Problems.VehicleRouting.Variants;
    2322using HEAL.Attic;
     23using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2424
    2525namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    2626  [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
    2929  }
    3030}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/LocalImprovement/AlbaLambdaInterchangeLocalImprovementOperator.cs

    r17704 r17717  
    111111    public override IOperation InstrumentedApply() {
    112112      int maxIterations = MaximumIterationsParameter.ActualValue.Value;
    113       AlbaEncodedSolution solution = null;
     113      var solution = VRPToursParameter.ActualValue as AlbaEncodedSolution;
    114114
    115       if (VRPToursParameter.ActualValue is AlbaEncodedSolution)
    116         solution = VRPToursParameter.ActualValue as AlbaEncodedSolution;
    117       else
     115      if (solution == null)
    118116        VRPToursParameter.ActualValue = solution = AlbaEncodedSolution.ConvertFrom(VRPToursParameter.ActualValue, ProblemInstance);
    119117
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaCustomerInsertionManipulator.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaManipulator.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
    2526using HeuristicLab.Parameters;
    26 using HEAL.Attic;
    2727using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/GVREncodedSolution.cs

    r17714 r17717  
    2727using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
    29 using HeuristicLab.Problems.VehicleRouting.Variants;
    3029
    3130namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/GVR/IGVROperator.cs

    r17226 r17717  
    2020#endregion
    2121
    22 using HeuristicLab.Problems.VehicleRouting.Variants;
    2322using HEAL.Attic;
     23using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2424
    2525namespace HeuristicLab.Problems.VehicleRouting.Encodings.GVR {
    2626  [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
    2929  }
    3030}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Creators/MultiVRPSolutionCreator.cs

    r17698 r17717  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HEAL.Attic;
    2526using HeuristicLab.Collections;
    2627using HeuristicLab.Common;
     
    2930using HeuristicLab.Optimization;
    3031using HeuristicLab.Parameters;
    31 using HEAL.Attic;
    3232using HeuristicLab.Problems.VehicleRouting.Interfaces;
    33 using HeuristicLab.Problems.VehicleRouting.Variants;
    3433
    3534namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs

    r17698 r17717  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HEAL.Attic;
    2526using HeuristicLab.Collections;
    2627using HeuristicLab.Common;
     
    2930using HeuristicLab.Optimization;
    3031using HeuristicLab.Parameters;
    31 using HEAL.Attic;
    3232using HeuristicLab.Problems.VehicleRouting.Interfaces;
    33 using HeuristicLab.Problems.VehicleRouting.Variants;
    3433
    3534namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/RandomParentCloneCrossover.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
    2526using HeuristicLab.Parameters;
    26 using HEAL.Attic;
    2727using HeuristicLab.Problems.VehicleRouting.Interfaces;
    28 using HeuristicLab.Problems.VehicleRouting.Variants;
    2928
    3029namespace HeuristicLab.Problems.VehicleRouting.Encodings.General.Crossovers {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Manipulators/MultiVRPSolutionManipulator.cs

    r17698 r17717  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HEAL.Attic;
    2526using HeuristicLab.Collections;
    2627using HeuristicLab.Common;
     
    2930using HeuristicLab.Optimization;
    3031using HeuristicLab.Parameters;
    31 using HEAL.Attic;
    3232using HeuristicLab.Problems.VehicleRouting.Interfaces;
    33 using HeuristicLab.Problems.VehicleRouting.Variants;
    3433
    3534namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveEvaluator.cs

    r17226 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Parameters;
    25 using HEAL.Attic;
    2626using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    27 using HeuristicLab.Problems.VehicleRouting.Variants;
     27using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveGenerator.cs

    r17698 r17717  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HEAL.Attic;
    2526using HeuristicLab.Collections;
    2627using HeuristicLab.Common;
     
    3031using HeuristicLab.Optimization;
    3132using HeuristicLab.Parameters;
    32 using HEAL.Attic;
    3333using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
    3434using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;
    3535using HeuristicLab.Problems.VehicleRouting.Interfaces;
    36 using HeuristicLab.Problems.VehicleRouting.Variants;
    3736
    3837namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveMaker.cs

    r17226 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Parameters;
    25 using HEAL.Attic;
    26 using HeuristicLab.Problems.VehicleRouting.Variants;
     26using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2727
    2828namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveTabuChecker.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2627using HeuristicLab.Optimization;
    2728using HeuristicLab.Parameters;
    28 using HEAL.Attic;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    30 using HeuristicLab.Problems.VehicleRouting.Variants;
    3130
    3231namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveTabuMaker.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2627using HeuristicLab.Optimization;
    2728using HeuristicLab.Parameters;
    28 using HEAL.Attic;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    30 using HeuristicLab.Problems.VehicleRouting.Variants;
    3130
    3231namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/ShakingOperators/VehicleRoutingShakingOperator.cs

    r17698 r17717  
    2222using System.Collections.Generic;
    2323using System.Linq;
     24using HEAL.Attic;
    2425using HeuristicLab.Collections;
    2526using HeuristicLab.Common;
     
    2829using HeuristicLab.Optimization.Operators;
    2930using HeuristicLab.Parameters;
    30 using HEAL.Attic;
    3131using HeuristicLab.PluginInfrastructure;
    3232using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3333using HeuristicLab.Problems.VehicleRouting.Interfaces;
    34 using HeuristicLab.Problems.VehicleRouting.Variants;
    3534
    3635namespace HeuristicLab.Problems.VehicleRouting {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/IterativeInsertionCreator.cs

    r17713 r17717  
    2222using System;
    2323using System.Collections.Generic;
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     
    2728using HeuristicLab.Optimization;
    2829using HeuristicLab.Parameters;
    29 using HEAL.Attic;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    32 using HeuristicLab.Problems.VehicleRouting.Variants;
    3332
    3433namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/PotvinCreator.cs

    r17226 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    24 using HEAL.Attic;
    2525using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2626using HeuristicLab.Problems.VehicleRouting.Interfaces;
     
    2929  [Item("PotvinCreator", "A VRP creator.")]
    3030  [StorableType("9007B8EE-61F5-45D7-A853-951E2435E308")]
    31   public abstract class PotvinCreator : VRPCreator, IPotvinOperator, IVRPCreator {
     31  public abstract class PotvinCreator : VRPCreator, IPotvinOperator, IVRPCreator, IGeneralVRPOperator {
    3232    public override bool CanChangeName {
    3333      get { return false; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Creators/PushForwardInsertionCreator.cs

    r17712 r17717  
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    32 using HeuristicLab.Problems.VehicleRouting.Variants;
    3332
    3433namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinCrossover.cs

    r17712 r17717  
    3333  [Item("PotvinCrossover", "A VRP crossover operation.")]
    3434  [StorableType("B2E9AC24-C689-45AD-BEDE-2F226E044BDE")]
    35   public abstract class PotvinCrossover : VRPCrossover, IStochasticOperator, IPotvinOperator {
     35  public abstract class PotvinCrossover : VRPCrossover, IStochasticOperator, IPotvinOperator, IGeneralVRPOperator {
    3636    public ILookupParameter<IRandom> RandomParameter {
    3737      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/IPotvinOperator.cs

    r17226 r17717  
    2020#endregion
    2121
    22 using HeuristicLab.Problems.VehicleRouting.Variants;
    2322using HEAL.Attic;
    2423
    2524namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    2625  [StorableType("90265685-321B-4E34-AD9F-30FA917F07A0")]
    27   public interface IPotvinOperator :
     26  public interface IPotvinOperator /*:
    2827    ISingleDepotOperator, IHomogenousCapacitatedOperator, ITimeWindowedOperator,
    29     IMultiDepotOperator, IHeterogenousCapacitatedOperator {
     28    IMultiDepotOperator, IHeterogenousCapacitatedOperator*/ {
    3029  }
    3130}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinLocalSearchManipulator.cs

    r17712 r17717  
    3131  [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.")]
    3232  [StorableType("EF16AD46-5C58-4846-95CF-3C3DF78D2F68")]
    33   public sealed class PotvinLocalSearchManipulator : PotvinManipulator, IVRPLocalSearchManipulator {
     33  public sealed class PotvinLocalSearchManipulator : PotvinManipulator, IVRPLocalSearchManipulator, IGeneralVRPOperator {
    3434    public IValueParameter<IntValue> Iterations {
    3535      get { return (IValueParameter<IntValue>)Parameters["Iterations"]; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinManipulator.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2526using HeuristicLab.Optimization;
    2627using HeuristicLab.Parameters;
    27 using HEAL.Attic;
    2828using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    24 using HEAL.Attic;
    2525using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2626
     
    2828  [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.")]
    2929  [StorableType("20E22B90-348D-438F-AD17-F1F92BD12C00")]
    30   public sealed class PotvinOneLevelExchangeMainpulator : PotvinManipulator {
     30  public sealed class PotvinOneLevelExchangeMainpulator : PotvinManipulator, IGeneralVRPOperator {
    3131    [StorableConstructor]
    3232    private PotvinOneLevelExchangeMainpulator(StorableConstructorFlag _) : base(_) { }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinPairwiseOneLevelExchangeManipulator.cs

    r17712 r17717  
    2525using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2626using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    27 using HeuristicLab.Problems.VehicleRouting.Variants;
    2827
    2928namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    3029  [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.")]
    3130  [StorableType("BF040F90-535E-4F3D-9420-0123565A252D")]
    32   public sealed class PotvinPairwiseOneLevelExchangeMainpulator : PotvinManipulator {
     31  public sealed class PotvinPairwiseOneLevelExchangeMainpulator : PotvinManipulator, IGeneralVRPOperator {
    3332    [StorableConstructor]
    3433    private PotvinPairwiseOneLevelExchangeMainpulator(StorableConstructorFlag _) : base(_) { }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinPairwiseTwoLevelExchangeManipulator.cs

    r17712 r17717  
    2626using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2727using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    28 using HeuristicLab.Problems.VehicleRouting.Variants;
    2928
    3029namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    3130  [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.")]
    3231  [StorableType("8E4D8A17-1204-45CC-8ED7-375FCE0355E8")]
    33   public sealed class PotvinPairwiseTwoLevelExchangeManipulator : PotvinManipulator {
     32  public sealed class PotvinPairwiseTwoLevelExchangeManipulator : PotvinManipulator, IGeneralVRPOperator {
    3433    [StorableConstructor]
    3534    private PotvinPairwiseTwoLevelExchangeManipulator(StorableConstructorFlag _) : base(_) { }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs

    r17712 r17717  
    2828  [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.")]
    2929  [StorableType("FB992182-9FD8-4B08-A48C-97378E85DAD5")]
    30   public sealed class PotvinTwoLevelExchangeManipulator : PotvinManipulator {
     30  public sealed class PotvinTwoLevelExchangeManipulator : PotvinManipulator, IGeneralVRPOperator {
    3131    [StorableConstructor]
    3232    private PotvinTwoLevelExchangeManipulator(StorableConstructorFlag _) : base(_) { }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinVehicleAssignmentManipulator.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Encodings.PermutationEncoding;
    2526using HeuristicLab.Parameters;
    26 using HEAL.Attic;
    2727using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
    29 using HeuristicLab.Problems.VehicleRouting.Variants;
    3029
    3130namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    3231  [Item("PotvinVehicleAssignmentMainpulator", "A manipulator that changes the vehicle assignment")]
    3332  [StorableType("57755DA2-B9CB-4A9F-B32C-988BFC06365A")]
    34   public sealed class PotvinVehicleAssignmentMainpulator : VRPManipulator, ITimeWindowedOperator,
    35     IMultiDepotOperator, IHeterogenousCapacitatedOperator {
     33  public sealed class PotvinVehicleAssignmentMainpulator : VRPManipulator, IHeterogenousCapacitatedOperator {
    3634    public IValueParameter<IPermutationManipulator> VehicleAssignmentManipuator {
    3735      get { return (IValueParameter<IPermutationManipulator>)Parameters["VehicleAssignmentManipuator"]; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/IPotvinCustomerRelocationMoveOperator.cs

    r17226 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Problems.VehicleRouting.Interfaces;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    2727  [StorableType("6F70F50C-411C-4AF9-A373-E2BCDFA66F56")]
    28   public interface IPotvinCustomerRelocationMoveOperator : IVRPMoveOperator {
     28  public interface IPotvinCustomerRelocationMoveOperator : IVRPMoveOperator, IGeneralVRPOperator {
    2929    ILookupParameter<PotvinCustomerRelocationMove> CustomerRelocationMoveParameter { get; }
    3030  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/IPotvinPDExchangeMoveOperator.cs

    r17226 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Problems.VehicleRouting.Interfaces;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    2727  [StorableType("D3D40EAC-F695-4069-9A3A-861CE2997E37")]
    28   public interface IPotvinPDExchangeMoveOperator : IVRPMoveOperator {
     28  public interface IPotvinPDExchangeMoveOperator : IVRPMoveOperator, IPickupAndDeliveryOperator {
    2929    ILookupParameter<PotvinPDExchangeMove> PDExchangeMoveParameter { get; }
    3030  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeExhaustiveMoveGenerator.cs

    r17698 r17717  
    2121
    2222using System.Collections.Generic;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Optimization;
    26 using HEAL.Attic;
    2727using HeuristicLab.Problems.VehicleRouting.Interfaces;
    28 using HeuristicLab.Problems.VehicleRouting.Variants;
    2928
    3029namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveMaker.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
    2526using HeuristicLab.Parameters;
    26 using HEAL.Attic;
    2727using HeuristicLab.Problems.VehicleRouting.Interfaces;
    28 using HeuristicLab.Problems.VehicleRouting.Variants;
    2928
    3029namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeMoveTabuCriterion.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2627using HeuristicLab.Optimization;
    2728using HeuristicLab.Parameters;
    28 using HEAL.Attic;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    30 using HeuristicLab.Problems.VehicleRouting.Variants;
    3130
    3231namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDExchange/PotvinPDExchangeSingleMoveGenerator.cs

    r17698 r17717  
    2121
    2222using System.Collections.Generic;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Optimization;
    2627using HeuristicLab.Parameters;
    27 using HEAL.Attic;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
    29 using HeuristicLab.Problems.VehicleRouting.Variants;
    3029
    3130namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/IPotvinPDRearrangeMoveOperator.cs

    r17226 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Problems.VehicleRouting.Interfaces;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    2727  [StorableType("A5C6D2DD-A20B-4067-8C8D-C527C3E5DBAE")]
    28   public interface IPotvinPDRearrangeMoveOperator : IVRPMoveOperator {
     28  public interface IPotvinPDRearrangeMoveOperator : IVRPMoveOperator, IPickupAndDeliveryOperator {
    2929    ILookupParameter<PotvinPDRearrangeMove> PDRearrangeMoveParameter { get; }
    3030  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeExhaustiveMoveGenerator.cs

    r17698 r17717  
    2121
    2222using System.Collections.Generic;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Optimization;
    26 using HEAL.Attic;
    2727using HeuristicLab.Problems.VehicleRouting.Interfaces;
    28 using HeuristicLab.Problems.VehicleRouting.Variants;
    2928
    3029namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveMaker.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
    2526using HeuristicLab.Parameters;
    26 using HEAL.Attic;
    2727using HeuristicLab.Problems.VehicleRouting.Interfaces;
    28 using HeuristicLab.Problems.VehicleRouting.Variants;
    2928
    3029namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeMoveTabuCriterion.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2627using HeuristicLab.Optimization;
    2728using HeuristicLab.Parameters;
    28 using HEAL.Attic;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    30 using HeuristicLab.Problems.VehicleRouting.Variants;
    3130
    3231namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDRearrange/PotvinPDRearrangeSingleMoveGenerator.cs

    r17698 r17717  
    2121
    2222using System.Collections.Generic;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Optimization;
    2627using HeuristicLab.Parameters;
    27 using HEAL.Attic;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
    29 using HeuristicLab.Problems.VehicleRouting.Variants;
    3029
    3130namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/IPotvinPDShiftMoveOperator.cs

    r17226 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Problems.VehicleRouting.Interfaces;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    2727  [StorableType("404B8A42-4BC0-47B3-AD95-5294229515B3")]
    28   public interface IPotvinPDShiftMoveOperator : IVRPMoveOperator {
     28  public interface IPotvinPDShiftMoveOperator : IVRPMoveOperator, IPickupAndDeliveryOperator {
    2929    ILookupParameter<PotvinPDShiftMove> PDShiftMoveParameter { get; }
    3030  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftExhaustiveMoveGenerator.cs

    r17698 r17717  
    2121
    2222using System.Collections.Generic;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Optimization;
    26 using HEAL.Attic;
    2727using HeuristicLab.Problems.VehicleRouting.Interfaces;
    28 using HeuristicLab.Problems.VehicleRouting.Variants;
    2928
    3029namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveMaker.cs

    r17698 r17717  
    2121
    2222using System.Collections.Generic;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Optimization;
    2627using HeuristicLab.Parameters;
    27 using HEAL.Attic;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
    29 using HeuristicLab.Problems.VehicleRouting.Variants;
    3029
    3130namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftMoveTabuCriterion.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2627using HeuristicLab.Optimization;
    2728using HeuristicLab.Parameters;
    28 using HEAL.Attic;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    30 using HeuristicLab.Problems.VehicleRouting.Variants;
    3130
    3231namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/PickupDelivery/PDShift/PotvinPDShiftSingleMoveGenerator.cs

    r17698 r17717  
    2121
    2222using System.Collections.Generic;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Optimization;
    2627using HeuristicLab.Parameters;
    27 using HEAL.Attic;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
    29 using HeuristicLab.Problems.VehicleRouting.Variants;
    3029
    3130namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/IPotvinTwoOptStarMoveOperator.cs

    r17226 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Problems.VehicleRouting.Interfaces;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    2727  [StorableType("371BDEC8-9A88-48DF-A44D-76FB6CE52A63")]
    28   public interface IPotvinTwoOptStarMoveOperator : IVRPMoveOperator {
     28  public interface IPotvinTwoOptStarMoveOperator : IVRPMoveOperator, IGeneralVRPOperator {
    2929    ILookupParameter<PotvinTwoOptStarMove> TwoOptStarMoveParameter { get; }
    3030  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/TwoOptStar/PotvinTwoOptStarMoveTabuCriterion.cs

    r17698 r17717  
    2121
    2222using System.Collections.Generic;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    2728using HeuristicLab.Optimization;
    2829using HeuristicLab.Parameters;
    29 using HEAL.Attic;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/IPotvinVehicleAssignmentMoveOperator.cs

    r17226 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Problems.VehicleRouting.Interfaces;
    24 using HEAL.Attic;
    2525
    2626namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    2727  [StorableType("9C467DEC-0BA6-47B8-8805-3A4494BD0561")]
    28   public interface IPotvinVehicleAssignmentMoveOperator : IVRPMoveOperator {
     28  public interface IPotvinVehicleAssignmentMoveOperator : IVRPMoveOperator, IHeterogenousCapacitatedOperator {
    2929    ILookupParameter<PotvinVehicleAssignmentMove> VehicleAssignmentMoveParameter { get; }
    3030  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/VehicleAssignment/PotvinVehicleAssignmentMoveTabuCriterion.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2627using HeuristicLab.Optimization;
    2728using HeuristicLab.Parameters;
    28 using HEAL.Attic;
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    30 using HeuristicLab.Problems.VehicleRouting.Variants;
    3130
    3231namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Encodings.PermutationEncoding;
    2526using HeuristicLab.Parameters;
    26 using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
    2929  [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.")]
    3030  [StorableType("F61C494E-4958-4B89-893B-7485A72A1C80")]
    31   public sealed class PrinsPermutationCrossover : PrinsCrossover, IPrinsOperator {
     31  public sealed class PrinsPermutationCrossover : PrinsCrossover {
    3232    public IValueLookupParameter<IPermutationCrossover> InnerCrossoverParameter {
    3333      get { return (IValueLookupParameter<IPermutationCrossover>)Parameters["InnerCrossover"]; }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/IPrinsOperator.cs

    r17226 r17717  
    2020#endregion
    2121
    22 using HeuristicLab.Problems.VehicleRouting.Variants;
    2322using HEAL.Attic;
     23using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2424
    2525namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins {
    2626  [StorableType("02783182-5F42-45F8-A57A-E63459E22C6A")]
    27   public interface IPrinsOperator :
    28     ISingleDepotOperator, IHomogenousCapacitatedOperator, ITimeWindowedOperator {
     27  public interface IPrinsOperator : IGeneralVRPOperator {
    2928  }
    3029}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/PrinsEncodedSolution.cs

    r17714 r17717  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Linq;
    2425using HEAL.Attic;
    2526using HeuristicLab.Common;
     
    163164
    164165    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();
    172167
    173168      return new PrinsEncodedSolution(
    174         new Permutation(PermutationTypes.RelativeUndirected, route.ToArray()), problemInstance);
     169        new Permutation(PermutationTypes.RelativeUndirected, route), problemInstance);
    175170    }
    176171  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuMergeCrossover1.cs

    r17698 r17717  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
    25 using HEAL.Attic;
    26 using HeuristicLab.Problems.VehicleRouting.Variants;
     26using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2727
    2828namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuMergeCrossover2.cs

    r17698 r17717  
    2121
    2222using System.Collections.Generic;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
    26 using HEAL.Attic;
    27 using HeuristicLab.Problems.VehicleRouting.Variants;
     27using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/IZhuOperator.cs

    r17226 r17717  
    2020#endregion
    2121
    22 using HeuristicLab.Problems.VehicleRouting.Variants;
    2322using HEAL.Attic;
     23using HeuristicLab.Problems.VehicleRouting.Interfaces;
    2424
    2525namespace HeuristicLab.Problems.VehicleRouting.Encodings.Zhu {
    2626  [StorableType("CD11FA3C-3B50-4710-AAFC-32C9C61B3321")]
    27   public interface IZhuOperator :
    28     ISingleDepotOperator, IHomogenousCapacitatedOperator, ITimeWindowedOperator {
     27  public interface IZhuOperator : IGeneralVRPOperator {
    2928  }
    3029}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/ZhuEncodedSolution.cs

    r17714 r17717  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Linq;
    2425using HEAL.Attic;
    2526using HeuristicLab.Common;
     
    114115    public static ZhuEncodedSolution ConvertFrom(IVRPEncodedSolution encoding, IVRPProblemInstance problemInstance) {
    115116      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];
    117119
     120      var i = 0;
    118121      foreach (Tour tour in tours) {
    119122        foreach (int city in tour.Stops)
    120           route.Add(city - 1);
     123          route[i++] = city - 1;
    121124      }
    122125
    123126      return new ZhuEncodedSolution(
    124         new Permutation(PermutationTypes.RelativeUndirected, route.ToArray()), problemInstance);
     127        new Permutation(PermutationTypes.RelativeUndirected, route), problemInstance);
    125128    }
    126129
    127130    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();
    135132
    136133      return new ZhuEncodedSolution(
    137         new Permutation(PermutationTypes.RelativeUndirected, route.ToArray()), problemInstance);
     134        new Permutation(PermutationTypes.RelativeUndirected, route), problemInstance);
    138135    }
    139136  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj

    r17715 r17717  
    143143    <Compile Include="Improver\VRPImprovementOperator.cs" />
    144144    <Compile Include="Improver\VRPIntraRouteImprovementOperator.cs" />
     145    <Compile Include="Interfaces\OperatorCapabilities.cs" />
    145146    <Compile Include="Interfaces\IVRPEncoding.cs" />
    146147    <Compile Include="Interfaces\IVRPLocalSearchManipulator.cs" />
     148    <Compile Include="Interfaces\ProblemInstanceFeatures.cs" />
    147149    <Compile Include="Interpreters\MDCVRPInterpreter.cs" />
    148150    <Compile Include="Interpreters\VRPInterpreter.cs" />
     
    340342    <Compile Include="SimilarityCalculators\VRPSimilarityCalculator.cs" />
    341343    <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" />
    357344    <Compile Include="ProblemInstances\SingleDepotVRP\CVRPTWProblemInstance.cs" />
    358345    <Compile Include="ProblemInstances\SingleDepotVRP\CVRPProblemInstance.cs" />
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Improver/VRPImprovementOperator.cs

    r17698 r17717  
    2121
    2222using System;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    2627using HeuristicLab.Optimization;
    2728using HeuristicLab.Parameters;
    28 using HEAL.Attic;
    2929using HeuristicLab.Problems.VehicleRouting.Encodings;
    3030using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;
    3131using HeuristicLab.Problems.VehicleRouting.Interfaces;
    32 using HeuristicLab.Problems.VehicleRouting.Variants;
    3332
    3433namespace HeuristicLab.Problems.VehicleRouting {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/PathRelinkers/VRPPathRelinker.cs

    r17698 r17717  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
     
    2930using HeuristicLab.Optimization.Operators;
    3031using HeuristicLab.Parameters;
    31 using HEAL.Attic;
    3232using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;
    3333using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3434using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    35 using HeuristicLab.Problems.VehicleRouting.Variants;
    3635
    3736namespace HeuristicLab.Problems.VehicleRouting {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRPPDTWProblemInstance.cs

    r17715 r17717  
    2929using HeuristicLab.Parameters;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    7069
    7170    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));
    7374    }
    7475
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRPProblemInstance.cs

    r17715 r17717  
    2929using HeuristicLab.Parameters;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    6665
    6766    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)));
    6971    }
    7072
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRPTWProblemInstance.cs

    r17715 r17717  
    2929using HeuristicLab.Parameters;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    8887
    8988    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));
    9190    }
    9291
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs

    r17711 r17717  
    2929using HeuristicLab.Parameters;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    5958
    6059    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));
    6263    }
    6364
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRPPDTWProblemInstance.cs

    r17715 r17717  
    2929using HeuristicLab.Parameters;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    7069
    7170    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));
    7374    }
    7475
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRPProblemInstance.cs

    r17715 r17717  
    2929using HeuristicLab.Parameters;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    6665
    6766    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)));
    6971    }
    7072    protected override VRPEvaluation CreateTourEvaluation() {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRPTWProblemInstance.cs

    r17715 r17717  
    2929using HeuristicLab.Parameters;
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    31 using HeuristicLab.Problems.VehicleRouting.Variants;
    3231
    3332namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    8887
    8988    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));
    9192    }
    9293
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs

    r17711 r17717  
    2727using HeuristicLab.Data;
    2828using HeuristicLab.Problems.VehicleRouting.Interfaces;
    29 using HeuristicLab.Problems.VehicleRouting.Variants;
    3029
    3130namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    3534
    3635    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));
    3839    }
    3940
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r17711 r17717  
    9393
    9494    public virtual IEnumerable<IOperator> FilterOperators(IEnumerable<IOperator> operators) {
    95       return operators.Where(x => x is IVRPOperator);
     95      return operators.Where(x => x is IGeneralVRPOperator);
    9696    }
    9797
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs

    r17711 r17717  
    153153    }
    154154
    155     [Storable(OldName = "operators")]
    156     private List<IOperator> StorableOperators {
    157       set { Operators.AddRange(value); }
    158     }
    159 
    160155    private void AttachEventHandlers() {
    161156      ProblemInstanceParameter.ValueChanged += new EventHandler(ProblemInstanceParameter_ValueChanged);
     
    166161      if (ProblemInstance != null) {
    167162        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();
    168177      }
    169178    }
     
    182191    }
    183192
    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 allowed
    192         if (ProblemInstance.Vehicles.Value < BestKnownSolution.Solution.GetTours().Count) {
    193           BestKnownSolution = null;
    194         } else EvalBestKnownSolution();
    195       }
    196     }
    197 
    198193    void ProblemInstanceParameter_ValueChanged(object sender, EventArgs e) {
    199194      InitializeOperators();
    200195      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();
    212201    }
    213202
     
    215204      Encoding.FilterOperators(ProblemInstance);
    216205
    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);
    221221    }
    222222
     
    305305      BestKnownSolution = null;
    306306
    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;
    312308
    313309      OnReset();
Note: See TracChangeset for help on using the changeset viewer.