Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4179


Ignore:
Timestamp:
08/09/10 18:08:14 (14 years ago)
Author:
svonolfe
Message:

Refactored VRP based on the code review (#1039)

Location:
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3
Files:
2 deleted
29 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestVRPSolutionAnalyzer.cs

    r4068 r4179  
    3535  [StorableClass]
    3636  public sealed class BestVRPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
    37     public ScopeTreeLookupParameter<IVRPEncoding> VRPSolutionParameter {
    38       get { return (ScopeTreeLookupParameter<IVRPEncoding>)Parameters["VRPSolution"]; }
     37    public ScopeTreeLookupParameter<IVRPEncoding> VRPToursParameter {
     38      get { return (ScopeTreeLookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
    3939    }
    4040    public ILookupParameter<DoubleMatrix> DistanceMatrixParameter {
     
    8181    }
    8282
     83    [StorableConstructor]
     84    private BestVRPSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     85
    8386    public BestVRPSolutionAnalyzer()
    8487      : base() {
    85       Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("VRPSolution", "The VRP solutions which should be evaluated."));
     88        Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("VRPTours", "The VRP tours which should be evaluated."));
    8689      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
    8790      Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
     
    103106    public override IOperation Apply() {
    104107      DoubleMatrix coordinates = CoordinatesParameter.ActualValue;
    105       ItemArray<IVRPEncoding> solutions = VRPSolutionParameter.ActualValue;
     108      ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue;
    106109      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    107110      ItemArray<DoubleValue> overloads = OverloadParameter.ActualValue;
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/AlbaEncoding.cs

    r4177 r4179  
    154154        cities);
    155155    }
     156
     157    internal static void RemoveUnusedParameters(ParameterCollection parameters) {
     158      parameters.Remove("DistanceMatrix");
     159      parameters.Remove("UseDistanceMatrix");
     160      parameters.Remove("Capacity");
     161      parameters.Remove("Demand");
     162      parameters.Remove("ReadyTime");
     163      parameters.Remove("DueTime");
     164      parameters.Remove("ServiceTime");
     165    }
    156166  }
    157167}
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaCrossover.cs

    r4177 r4179  
    3030  [StorableClass]
    3131  public sealed class AlbaCrossover : VRPCrossover {   
    32     public IValueLookupParameter<IPermutationCrossover> PermutationCrossoverParameter {
    33       get { return (IValueLookupParameter<IPermutationCrossover>)Parameters["PermutationCrossover"]; }
     32    public IValueLookupParameter<IPermutationCrossover> InnerCrossoverParameter {
     33      get { return (IValueLookupParameter<IPermutationCrossover>)Parameters["InnerCrossover"]; }
    3434    }
     35
     36    [StorableConstructor]
     37    private AlbaCrossover(bool deserializing) : base(deserializing) { }
    3538
    3639    public AlbaCrossover()
    3740      : base() {
    38       Parameters.Add(new ValueLookupParameter<IPermutationCrossover>("PermutationCrossover", "The permutation crossover.", new EdgeRecombinationCrossover()));
     41      Parameters.Add(new ValueLookupParameter<IPermutationCrossover>("InnerCrossover", "The permutation crossover.", new EdgeRecombinationCrossover()));
     42   
     43      AlbaEncoding.RemoveUnusedParameters(Parameters);
    3944    }
    4045
    41     void Crossover() {
    42       PermutationCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName;
     46    private void Crossover() {
     47      //note - the inner crossover is called here and the result is converted to an alba representation
     48      //some refactoring should be done here in the future - the crossover operation should be called directly
     49
     50      InnerCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName;
    4351      IAtomicOperation op = this.ExecutionContext.CreateOperation(
    44         PermutationCrossoverParameter.ActualValue, this.ExecutionContext.Scope);
     52        InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope);
    4553      op.Operator.Execute((IExecutionContext)op);
    4654
    47       string childName = PermutationCrossoverParameter.ActualValue.ChildParameter.ActualName;
     55      string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName;
    4856      if (ExecutionContext.Scope.Variables.ContainsKey(childName)) {
    4957        Permutation permutation = ExecutionContext.Scope.Variables[childName].Value as Permutation;
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaManipulator.cs

    r4177 r4179  
    2929  [Item("AlbaManipulator", "An operator which manipulates an alba VRP representation.")]
    3030  [StorableClass]
    31   public sealed class AlbaManipulator : VRPManipulator {   
    32     public IValueLookupParameter<IPermutationManipulator> PermutationManipulatorParameter {
    33       get { return (IValueLookupParameter<IPermutationManipulator>)Parameters["PermutationManipulator"]; }
     31  public sealed class AlbaManipulator : VRPManipulator {
     32    public IValueLookupParameter<IPermutationManipulator> InnerManipulatorParameter {
     33      get { return (IValueLookupParameter<IPermutationManipulator>)Parameters["InnerManipulator"]; }
    3434    }
     35
     36    [StorableConstructor]
     37    private AlbaManipulator(bool deserializing) : base(deserializing) { }
    3538
    3639    public AlbaManipulator()
    3740      : base() {
    38       Parameters.Add(new ValueLookupParameter<IPermutationManipulator>("PermutationManipulator", "The permutation manipulator.", new TranslocationManipulator()));
     41        Parameters.Add(new ValueLookupParameter<IPermutationManipulator>("InnerManipulator", "The permutation manipulator.", new TranslocationManipulator()));
     42
     43        AlbaEncoding.RemoveUnusedParameters(Parameters);
    3944    }
    4045
    4146    public override IOperation Apply() {
    42       IVRPEncoding solution = VRPSolutionParameter.ActualValue;
     47      IVRPEncoding solution = VRPToursParameter.ActualValue;
    4348      if (!(solution is AlbaEncoding)) {
    44         VRPSolutionParameter.ActualValue = AlbaEncoding.ConvertFrom(solution, VehiclesParameter.ActualValue.Value);
     49        VRPToursParameter.ActualValue = AlbaEncoding.ConvertFrom(solution, VehiclesParameter.ActualValue.Value);
    4550      }
    4651     
    4752      OperationCollection next = new OperationCollection(base.Apply());
    4853
    49       IPermutationManipulator op = PermutationManipulatorParameter.ActualValue;
     54      IPermutationManipulator op = InnerManipulatorParameter.ActualValue;
    5055      if (op != null) {
    51         op.PermutationParameter.ActualName = VRPSolutionParameter.ActualName;
     56        op.PermutationParameter.ActualName = VRPToursParameter.ActualName;
    5257        next.Insert(0, ExecutionContext.CreateOperation(op));
    5358      }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveMaker.cs

    r4177 r4179  
    6161    }
    6262   
     63    [StorableConstructor]
     64    protected AlbaMoveMaker(bool deserializing) : base(deserializing) { }
    6365
    6466    public AlbaMoveMaker()
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveOperator.cs

    r4177 r4179  
    3333    protected abstract IPermutationMoveOperator PermutationMoveOperatorParameter { get; set; }
    3434
     35    [StorableConstructor]
     36    protected AlbaMoveOperator(bool deserializing) : base(deserializing) { }
     37
     38    public AlbaMoveOperator() : base()
     39    {
     40      AlbaEncoding.RemoveUnusedParameters(Parameters);
     41    }
     42
    3543    public override IOperation Apply() {
    36       IVRPEncoding solution = VRPSolutionParameter.ActualValue;
     44      IVRPEncoding solution = VRPToursParameter.ActualValue;
    3745      if (!(solution is AlbaEncoding)) {
    38         VRPSolutionParameter.ActualValue = AlbaEncoding.ConvertFrom(solution, VehiclesParameter.ActualValue.Value);
     46        VRPToursParameter.ActualValue = AlbaEncoding.ConvertFrom(solution, VehiclesParameter.ActualValue.Value);
    3947      }
    4048
    41       PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPSolutionParameter.ActualName;
     49      PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName;
    4250      IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter);
    4351      op.Operator.Execute((IExecutionContext)op);
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveEvaluator.cs

    r4177 r4179  
    3535    }
    3636
     37    [StorableConstructor]
     38    private AlbaTranslocationMoveEvaluator(bool deserializing) : base(deserializing) { }
     39
    3740    public AlbaTranslocationMoveEvaluator()
    3841      : base() {
     
    4346      TranslocationMove move = TranslocationMoveParameter.ActualValue;
    4447      //perform move
    45       AlbaEncoding newSolution = VRPSolutionParameter.ActualValue.Clone() as AlbaEncoding;
     48      AlbaEncoding newSolution = VRPToursParameter.ActualValue.Clone() as AlbaEncoding;
    4649      TranslocationManipulator.Apply(newSolution, move.Index1, move.Index2, move.Index3);
    4750
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs

    r4177 r4179  
    6868    }
    6969
     70    [StorableConstructor]
     71    private AlbaTranslocationMoveGenerator(bool deserializing) : base(deserializing) { }
     72
    7073    public AlbaTranslocationMoveGenerator()
    7174      : base() {
     
    8083      IOperation successor = base.Apply();
    8184
    82       Permutation permutation = VRPSolutionParameter.ActualValue as Permutation;
     85      Permutation permutation = VRPToursParameter.ActualValue as Permutation;
    8386      string moveName = TranslocationMoveGeneratorParameter.ActualValue.TranslocationMoveParameter.Name;
    8487
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveHardTabuCriterion.cs

    r4177 r4179  
    5656    }
    5757
     58    [StorableConstructor]
     59    private AlbaTranslocationMoveHardTabuCriterion(bool deserializing) : base(deserializing) { }
     60
    5861    public AlbaTranslocationMoveHardTabuCriterion()
    5962      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs

    r4177 r4179  
    5252    }
    5353
     54    [StorableConstructor]
     55    private AlbaTranslocationMoveMaker(bool deserializing) : base(deserializing) { }
     56
    5457    public AlbaTranslocationMoveMaker()
    5558      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveSoftTabuCriterion.cs

    r4177 r4179  
    5656    }
    5757
     58    [StorableConstructor]
     59    private AlbaTranslocationMoveSoftTabuCriterion(bool deserializing) : base(deserializing) { }
     60
    5861    public AlbaTranslocationMoveSoftTabuCriterion()
    5962      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveTabuMaker.cs

    r4177 r4179  
    5656    }
    5757
     58    [StorableConstructor]
     59    private AlbaTranslocationMoveTabuMaker(bool deserializing) : base(deserializing) { }
     60
    5861    public AlbaTranslocationMoveTabuMaker()
    5962      : base() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/DefaultRepresentationCreator.cs

    r4176 r4179  
    2727using System.Collections.Generic;
    2828using HeuristicLab.Problems.VehicleRouting.Encodings;
     29using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
     30using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;
    2931
    3032namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
     33  [Item("DefaultRepresentationCreator", "An operator which creates a VRP solution in the default representation.")]
    3134  [StorableClass]
    32   public abstract class IntListRepresentationCreator : VRPCreator {
    33     protected abstract IVRPEncoding CreateEncoding(List<int> route);
    34 
     35  public abstract class DefaultRepresentationCreator : VRPCreator {
    3536    protected abstract List<int> CreateSolution();
    3637
     38    [StorableConstructor]
     39    protected DefaultRepresentationCreator(bool deserializing) : base(deserializing) { }
     40
     41    public DefaultRepresentationCreator() : base() { }
     42
    3743    public override IOperation Apply() {
    38       VRPSolutionParameter.ActualValue = CreateEncoding(CreateSolution());
     44      //choose default encoding here
     45      VRPToursParameter.ActualValue = PotvinEncoding.ConvertFrom(CreateSolution());
    3946
    4047      return base.Apply();
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/PushForwardInsertionCreator.cs

    r4177 r4179  
    3030
    3131namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
     32  [Item("PushForwardCreator", "The push forward insertion heuristic.  It is implemented as described in Sam, and Thangiah, R. (1999). A Hybrid Genetic Algorithms, Simulated Annealing and Tabu Search Heuristic for Vehicle Routing Problems with Time Windows. Practical Handbook of Genetic Algorithms, Volume III, pp 347–381.")]
    3233  [StorableClass]
    33   //The push forward insertion heuristic.  It is implemented as described in Sam, and Thangiah, R. (1999). A Hybrid Genetic Algorithms, Simulated Annealing and Tabu Search Heuristic for Vehicle Routing Problems with Time Windows. Practical Handbook of Genetic Algorithms, Volume III, pp 347–381.
    34   public abstract class PushForwardCreator : IntListRepresentationCreator, IStochasticOperator {
     34  public sealed class PushForwardCreator : DefaultRepresentationCreator, IStochasticOperator {
    3535    #region IStochasticOperator Members
    3636    public ILookupParameter<IRandom> RandomParameter {
     
    5757      get { return (IValueParameter<DoubleValue>)Parameters["GammaVariance"]; }
    5858    }
     59
     60    [StorableConstructor]
     61    private PushForwardCreator(bool deserializing) : base(deserializing) { }
    5962
    6063    public PushForwardCreator()
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/RandomCreator.cs

    r4177 r4179  
    3030
    3131namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
     32  [Item("RandomCreator", "Creates a randomly initialized VRP solution.")]
    3233  [StorableClass]
    33   public abstract class RandomCreator : IntListRepresentationCreator, IStochasticOperator {
     34  public sealed class RandomCreator : DefaultRepresentationCreator, IStochasticOperator {
    3435    #region IStochasticOperator Members
    3536    public ILookupParameter<IRandom> RandomParameter {
     
    3738    }
    3839    #endregion
     40
     41    [StorableConstructor]
     42    private RandomCreator(bool deserializing) : base(deserializing) { }
    3943
    4044    public RandomCreator()
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinCrossover.cs

    r4174 r4179  
    2929
    3030namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
     31  [Item("PotvinCrossover", "A VRP crossover operation on a Potvin encoding.")]
    3132  [StorableClass]
    3233  public abstract class PotvinCrossover : VRPCrossover, IStochasticOperator {
     
    3435      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    3536    }
     37
     38    [StorableConstructor]
     39    protected PotvinCrossover(bool deserializing) : base(deserializing) { }
    3640
    3741    public PotvinCrossover() {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/SequenceBasedCrossover.cs

    r4177 r4179  
    2727
    2828namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    29   [Item("PotvinSBXCrossover", "The SBX crossover for the Potvin VRP representations.  It is implemented as described in Potvin, J.-Y. and Bengio, S. (1996). The Vehicle Routing Problem with Time Windows - Part II: Genetic Search. INFORMS Journal of Computing, 8:165–172.")]
     29  [Item("SequenceBasedCrossover", "The SBX crossover for the Potvin VRP representations.  It is implemented as described in Potvin, J.-Y. and Bengio, S. (1996). The Vehicle Routing Problem with Time Windows - Part II: Genetic Search. INFORMS Journal of Computing, 8:165–172.")]
    3030  [StorableClass]
    31   public sealed class PotvinSBXCrossover : PotvinCrossover {
     31  public sealed class SequenceBasedCrossover : PotvinCrossover {
     32    [StorableConstructor]
     33    private SequenceBasedCrossover(bool deserializing) : base(deserializing) { }
     34
     35    public SequenceBasedCrossover()
     36      : base() { }
     37   
    3238    private Tour FindRoute(PotvinEncoding solution, int city) {
    3339      Tour found = null;
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/OneLevelExchangeManipulator.cs

    r4177 r4179  
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    30   [Item("Potvin1MMainpulator", "The one-level exchange operator which manipulates a Potvin 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.")]
     30  [Item("OneLevelExchangeMainpulator", "The 1M operator which manipulates a Potvin 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.")]
    3131  [StorableClass]
    32   public sealed class Potvin1MMainpulator : PotvinManipulator {
     32  public sealed class OneLevelExchangeMainpulator : PotvinManipulator {
     33    [StorableConstructor]
     34    private OneLevelExchangeMainpulator(bool deserializing) : base(deserializing) { }
     35
     36    public OneLevelExchangeMainpulator() : base() { }
     37   
    3338    protected override void Manipulate(IRandom random, PotvinEncoding individual) {
    3439      int selectedIndex = SelectRandomTourBiasedByLength(random, individual);
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinManipulator.cs

    r4174 r4179  
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
     30  [Item("PotvinManipulator", "A VRP manipulation operation on a Potvin encoding.")]
    3031  [StorableClass]
    3132  public abstract class PotvinManipulator : VRPManipulator, IStochasticOperator {
     
    3334      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    3435    }
     36
     37    [StorableConstructor]
     38    protected PotvinManipulator(bool deserializing) : base(deserializing) { }
    3539
    3640    public PotvinManipulator() {
     
    7680   
    7781    public override IOperation Apply() {
    78       IVRPEncoding solution = VRPSolutionParameter.ActualValue;
     82      IVRPEncoding solution = VRPToursParameter.ActualValue;
    7983      if (!(solution is PotvinEncoding)) {
    80         VRPSolutionParameter.ActualValue = PotvinEncoding.ConvertFrom(solution);
     84        VRPToursParameter.ActualValue = PotvinEncoding.ConvertFrom(solution);
    8185      }
    8286     
    83       Manipulate(RandomParameter.ActualValue, VRPSolutionParameter.ActualValue as PotvinEncoding);
     87      Manipulate(RandomParameter.ActualValue, VRPToursParameter.ActualValue as PotvinEncoding);
    8488
    8589      return base.Apply();
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/TwoLevelExchangeManipulator.cs

    r4177 r4179  
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    30   [Item("Potvin2MMainpulator", "The two-level exchange operator which manipulates a Potvin 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.")]
     30  [Item("TwoLevelExchangeOperator", "The 2M operator which manipulates a Potvin 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.")]
    3131  [StorableClass]
    32   public sealed class Potvin2MMainpulator : PotvinManipulator {
     32  public sealed class TwoLevelExchangeOperator : PotvinManipulator {
     33    [StorableConstructor]
     34    private TwoLevelExchangeOperator(bool deserializing) : base(deserializing) { }
     35
     36    public TwoLevelExchangeOperator(): base() { }
     37   
    3338    protected override void Manipulate(IRandom random, PotvinEncoding individual) {
    3439      int selectedIndex = SelectRandomTourBiasedByLength(random, individual);
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPCreator.cs

    r4154 r4179  
    2727
    2828namespace HeuristicLab.Problems.VehicleRouting.Encodings {
     29  [Item("VRPCreator", "A VRP creator.")]
    2930  [StorableClass]
    3031  public abstract class VRPCreator : VRPOperator, IVRPCreator {
     
    3435
    3536    #region IVRPCreator Members
    36     public ILookupParameter<IVRPEncoding> VRPSolutionParameter {
    37       get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPSolution"]; }
     37    public ILookupParameter<IVRPEncoding> VRPToursParameter {
     38      get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
    3839    }
    3940   
    40       public IValueLookupParameter<IntValue> CitiesParameter {
    41         get { return (IValueLookupParameter<IntValue>)Parameters["Cities"]; }
    42       }
     41    public IValueLookupParameter<IntValue> CitiesParameter {
     42      get { return (IValueLookupParameter<IntValue>)Parameters["Cities"]; }
     43    }
     44
     45    [StorableConstructor]
     46    protected VRPCreator(bool deserializing) : base(deserializing) { }
    4347
    4448    public VRPCreator()
    4549      : base() {
    46       Parameters.Add(new LookupParameter<IVRPEncoding>("VRPSolution", "The new VRP solution."));
     50      Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The new VRP tours."));
    4751    }
    4852
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPCrossover.cs

    r4154 r4179  
    2424using HeuristicLab.Operators;
    2525using HeuristicLab.Parameters;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Problems.VehicleRouting.Encodings {
     29  [Item("VRPCreator", "A VRP crossover operation.")]
     30  [StorableClass]
    2831  public abstract class VRPCrossover : VRPOperator, IVRPCrossover {
    2932    #region IVRPCrossover Members
     
    3942    #endregion
    4043
     44    [StorableConstructor]
     45    protected VRPCrossover(bool deserializing) : base(deserializing) { }
     46
    4147    public VRPCrossover()
    4248      : base() {
    4349      Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("Parents", "The parent permutations which should be crossed."));
    44       ParentsParameter.ActualName = "VRPSolution";
     50      ParentsParameter.ActualName = "VRPTours";
    4551      Parameters.Add(new LookupParameter<IVRPEncoding>("Child", "The child permutation resulting from the crossover."));
    46       ChildParameter.ActualName = "VRPSolution";
     52      ChildParameter.ActualName = "VRPTours";
    4753    }
    4854  }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPManipulator.cs

    r4154 r4179  
    2424using HeuristicLab.Parameters;
    2525using HeuristicLab.Data;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Problems.VehicleRouting.Encodings {
     29  [Item("VRPManipulator", "A VRP manipulation operation.")]
     30  [StorableClass]
    2831  public abstract class VRPManipulator : VRPOperator, IVRPManipulator {
    2932    #region IVRPManipulator Members
    3033
    31     public ILookupParameter<IVRPEncoding> VRPSolutionParameter {
    32       get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPSolution"]; }
     34    public ILookupParameter<IVRPEncoding> VRPToursParameter {
     35      get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
    3336    }
    3437
    3538    #endregion
    3639
     40    [StorableConstructor]
     41    protected VRPManipulator(bool deserializing) : base(deserializing) { }
     42
    3743    public VRPManipulator()
    3844      : base() {
    39       Parameters.Add(new LookupParameter<IVRPEncoding>("VRPSolution", "The new VRP solution."));
     45      Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The new VRP tours."));
    4046    }
    4147  }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/VRPMoveOperator.cs

    r4154 r4179  
    2424using HeuristicLab.Parameters;
    2525using HeuristicLab.Data;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Problems.VehicleRouting.Encodings {
     29  [Item("VRPMoveOperator", "A VRP move operation.")]
     30  [StorableClass]
    2831  public abstract class VRPMoveOperator : VRPOperator, IVRPMoveOperator {
    2932    #region IVRPManipulator Members
    3033
    31     public ILookupParameter<IVRPEncoding> VRPSolutionParameter {
    32       get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPSolution"]; }
     34    public ILookupParameter<IVRPEncoding> VRPToursParameter {
     35      get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
    3336    }
    3437   
    3538    #endregion
    3639
     40    [StorableConstructor]
     41    protected VRPMoveOperator(bool deserializing) : base(deserializing) { }
     42
    3743    public VRPMoveOperator()
    3844      : base() {
    39       Parameters.Add(new LookupParameter<IVRPEncoding>("VRPSolution", "The VRP solution."));
     45      Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours."));
    4046    }
    4147  }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Evaluators/VRPEvaluator.cs

    r4174 r4179  
    6262    }
    6363
    64     public ILookupParameter<IVRPEncoding> VRPSolutionParameter {
    65       get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPSolution"]; }
     64    public ILookupParameter<IVRPEncoding> VRPToursParameter {
     65      get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
    6666    }
    6767   
    6868    public ILookupParameter<DoubleValue> FleetUsageFactor {
    69       get { return (ILookupParameter<DoubleValue>)Parameters["FleetUsageFactor"]; }
     69      get { return (ILookupParameter<DoubleValue>)Parameters["EvalFleetUsageFactor"]; }
    7070    }
    7171    public ILookupParameter<DoubleValue> TimeFactor {
    72       get { return (ILookupParameter<DoubleValue>)Parameters["TimeFactor"]; }
     72      get { return (ILookupParameter<DoubleValue>)Parameters["EvalTimeFactor"]; }
    7373    }
    7474    public ILookupParameter<DoubleValue> DistanceFactor {
    75       get { return (ILookupParameter<DoubleValue>)Parameters["DistanceFactor"]; }
     75      get { return (ILookupParameter<DoubleValue>)Parameters["EvalDistanceFactor"]; }
    7676    }
    7777    public ILookupParameter<DoubleValue> OverloadPenalty {
    78       get { return (ILookupParameter<DoubleValue>)Parameters["OverloadPenalty"]; }
     78      get { return (ILookupParameter<DoubleValue>)Parameters["EvalOverloadPenalty"]; }
    7979    }
    8080    public ILookupParameter<DoubleValue> TardinessPenalty {
    81       get { return (ILookupParameter<DoubleValue>)Parameters["TardinessPenalty"]; }
     81      get { return (ILookupParameter<DoubleValue>)Parameters["EvalTardinessPenalty"]; }
    8282    }
    8383
     
    9090      Parameters.Add(new LookupParameter<DoubleValue>("Overload", "The overload."));
    9191      Parameters.Add(new LookupParameter<DoubleValue>("Tardiness", "The tardiness."));
    92       Parameters.Add(new LookupParameter<IVRPEncoding>("VRPSolution", "The VRP solution which should be evaluated."));
    93       Parameters.Add(new LookupParameter<DoubleValue>("FleetUsageFactor", "The fleet usage factor considered in the evaluation."));
    94       Parameters.Add(new LookupParameter<DoubleValue>("TimeFactor", "The time factor considered in the evaluation."));
    95       Parameters.Add(new LookupParameter<DoubleValue>("DistanceFactor", "The distance factor considered in the evaluation."));
    96       Parameters.Add(new LookupParameter<DoubleValue>("OverloadPenalty", "The overload penalty considered in the evaluation."));
    97       Parameters.Add(new LookupParameter<DoubleValue>("TardinessPenalty", "The tardiness penalty considered in the evaluation."));
     92      Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours which should be evaluated."));
     93      Parameters.Add(new LookupParameter<DoubleValue>("EvalFleetUsageFactor", "The fleet usage factor considered in the evaluation."));
     94      Parameters.Add(new LookupParameter<DoubleValue>("EvalTimeFactor", "The time factor considered in the evaluation."));
     95      Parameters.Add(new LookupParameter<DoubleValue>("EvalDistanceFactor", "The distance factor considered in the evaluation."));
     96      Parameters.Add(new LookupParameter<DoubleValue>("EvalOverloadPenalty", "The overload penalty considered in the evaluation."));
     97      Parameters.Add(new LookupParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation."));
    9898    }
    9999
    100100    private double CalculateFleetUsage() {
    101       IVRPEncoding vrpSolution = VRPSolutionParameter.ActualValue;
     101      IVRPEncoding vrpSolution = VRPToursParameter.ActualValue;
    102102
    103103      return vrpSolution.Tours.Count;
     
    206206
    207207    public sealed override IOperation Apply() {
    208       IVRPEncoding solution = VRPSolutionParameter.ActualValue;
     208      IVRPEncoding solution = VRPToursParameter.ActualValue;
    209209
    210210      TourEvaluation sumEval = Evaluate(solution, DueTimeParameter.ActualValue, ServiceTimeParameter.ActualValue, ReadyTimeParameter.ActualValue,
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/HeuristicLab.Problems.VehicleRouting-3.3.csproj

    r4177 r4179  
    107107  <ItemGroup>
    108108    <Compile Include="Analyzers\BestVRPSolutionAnalyzer.cs" />
    109     <Compile Include="Encodings\Alba\Creators\AlbaRandomCreator.cs" />
    110109    <Compile Include="Encodings\General\RandomCreator.cs" />
    111     <Compile Include="Encodings\Potvin\Creators\PotvinRandomCreator.cs" />
    112     <Compile Include="Encodings\Potvin\Crossovers\PotvinSBXCrossover.cs" />
     110    <Compile Include="Encodings\Potvin\Crossovers\SequenceBasedCrossover.cs" />
    113111    <Compile Include="Encodings\Potvin\Crossovers\PotvinCrossover.cs" />
    114     <Compile Include="Encodings\Potvin\Manipulators\Potvin2MManipulator.cs" />
    115     <Compile Include="Encodings\Potvin\Manipulators\Potvin1MManipulator.cs" />
     112    <Compile Include="Encodings\Potvin\Manipulators\TwoLevelExchangeManipulator.cs" />
     113    <Compile Include="Encodings\Potvin\Manipulators\OneLevelExchangeManipulator.cs" />
    116114    <Compile Include="Encodings\Potvin\Manipulators\PotvinManipulator.cs" />
    117115    <Compile Include="Interfaces\IVRPMoveMaker.cs" />
     
    119117    <Compile Include="VRPOperator.cs" />
    120118    <Compile Include="Encodings\General\PushForwardInsertionCreator.cs" />
    121     <Compile Include="Encodings\General\IntListRepresentationCreator.cs" />
     119    <Compile Include="Encodings\General\DefaultRepresentationCreator.cs" />
    122120    <Compile Include="Encodings\Alba\Crossovers\AlbaCrossover.cs" />
    123121    <Compile Include="Encodings\Alba\Interfaces\IAlbaTranslocationMoveOperator.cs" />
    124     <Compile Include="Encodings\Alba\Creators\AlbaPushForwardInsertionCreator.cs" />
    125122    <Compile Include="Encodings\Alba\Manipulators\AlbaManipulator.cs" />
    126123    <Compile Include="Encodings\Alba\Moves\AlbaMoveOperator.cs" />
     
    131128    <Compile Include="Encodings\Alba\Moves\ThreeOpt\AlbaTranslocationMoveSoftTabuCriterion.cs" />
    132129    <Compile Include="Encodings\Alba\Moves\ThreeOpt\AlbaTranslocationMoveHardTabuCriterion.cs" />
    133     <Compile Include="Encodings\Potvin\Creators\PotvinPushForwardInsertionCreator.cs" />
    134130    <Compile Include="Encodings\Potvin\PotvinEncoding.cs" />
    135131    <Compile Include="Encodings\VRPMoveOperator.cs" />
    136132    <Compile Include="Encodings\VRPCrossover.cs" />
    137133    <Compile Include="Encodings\VRPCreator.cs" />
    138     <Compile Include="Encodings\Alba\Creators\AlbaPermutationCreator.cs" />
    139134    <Compile Include="Encodings\Alba\AlbaEncoding.cs" />
    140135    <Compile Include="Encodings\Tour.cs" />
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Interfaces/IVRPCreator.cs

    r4154 r4179  
    2727  public interface IVRPCreator : IVRPOperator, ISolutionCreator {
    2828    IValueLookupParameter<IntValue> CitiesParameter { get; }
    29     ILookupParameter<IVRPEncoding> VRPSolutionParameter { get; }
     29    ILookupParameter<IVRPEncoding> VRPToursParameter { get; }
    3030  }
    3131}
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Interfaces/IVRPEvaluator.cs

    r4154 r4179  
    2626namespace HeuristicLab.Problems.VehicleRouting {
    2727  public interface IVRPEvaluator : ISingleObjectiveEvaluator, IVRPOperator {
    28     ILookupParameter<IVRPEncoding> VRPSolutionParameter { get; }
     28    ILookupParameter<IVRPEncoding> VRPToursParameter { get; }
    2929   
    3030    ILookupParameter<DoubleValue> VehcilesUtilizedParameter { get; }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Interfaces/IVRPManipulator.cs

    r4150 r4179  
    2626namespace HeuristicLab.Problems.VehicleRouting {
    2727  public interface IVRPManipulator : IVRPOperator, IManipulator {
    28     ILookupParameter<IVRPEncoding> VRPSolutionParameter { get; }
     28    ILookupParameter<IVRPEncoding> VRPToursParameter { get; }
    2929  }
    3030}
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Interfaces/IVRPMoveOperator.cs

    r4150 r4179  
    2626namespace HeuristicLab.Problems.VehicleRouting {
    2727  public interface IVRPMoveOperator : IVRPOperator, IMoveOperator {
    28     ILookupParameter<IVRPEncoding> VRPSolutionParameter { get; }
     28    ILookupParameter<IVRPEncoding> VRPToursParameter { get; }
    2929  }
    3030}
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/MoveEvaluators/VRPMoveEvaluator.cs

    r4154 r4179  
    3636    }
    3737
    38     public ILookupParameter<IVRPEncoding> VRPSolutionParameter {
    39       get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPSolution"]; }
     38    public ILookupParameter<IVRPEncoding> VRPToursParameter {
     39      get { return (ILookupParameter<IVRPEncoding>)Parameters["VRPTours"]; }
    4040    }
    4141   
    4242    public ILookupParameter<DoubleValue> FleetUsageFactor {
    43       get { return (ILookupParameter<DoubleValue>)Parameters["FleetUsageFactor"]; }
     43      get { return (ILookupParameter<DoubleValue>)Parameters["EvalFleetUsageFactor"]; }
    4444    }
    4545    public ILookupParameter<DoubleValue> TimeFactor {
    46       get { return (ILookupParameter<DoubleValue>)Parameters["TimeFactor"]; }
     46      get { return (ILookupParameter<DoubleValue>)Parameters["EvalTimeFactor"]; }
    4747    }
    4848    public ILookupParameter<DoubleValue> DistanceFactor {
    49       get { return (ILookupParameter<DoubleValue>)Parameters["DistanceFactor"]; }
     49      get { return (ILookupParameter<DoubleValue>)Parameters["EvalDistanceFactor"]; }
    5050    }
    5151    public ILookupParameter<DoubleValue> OverloadPenalty {
    52       get { return (ILookupParameter<DoubleValue>)Parameters["OverloadPenalty"]; }
     52      get { return (ILookupParameter<DoubleValue>)Parameters["EvalOverloadPenalty"]; }
    5353    }
    5454    public ILookupParameter<DoubleValue> TardinessPenalty {
    55       get { return (ILookupParameter<DoubleValue>)Parameters["TardinessPenalty"]; }
     55      get { return (ILookupParameter<DoubleValue>)Parameters["EvalTardinessPenalty"]; }
    5656    }
    5757
     
    7878    }
    7979
     80    [StorableConstructor]
     81    protected VRPMoveEvaluator(bool deserializing) : base(deserializing) { }
     82
    8083    protected VRPMoveEvaluator()
    8184      : base() {
    82       Parameters.Add(new LookupParameter<IVRPEncoding>("VRPSolution", "The VRP solution."));
     85      Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours."));
    8386      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of a VRP solution."));
    8487      Parameters.Add(new LookupParameter<DoubleValue>("MoveVehiclesUtilized", "The number of vehicles utilized."));
     
    8891      Parameters.Add(new LookupParameter<DoubleValue>("MoveTardiness", "The tardiness."));
    8992      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The evaluated quality of a move on a VRP solution."));
    90       Parameters.Add(new LookupParameter<DoubleValue>("FleetUsageFactor", "The fleet usage factor considered in the evaluation."));
    91       Parameters.Add(new LookupParameter<DoubleValue>("TimeFactor", "The time factor considered in the evaluation."));
    92       Parameters.Add(new LookupParameter<DoubleValue>("DistanceFactor", "The distance factor considered in the evaluation."));
    93       Parameters.Add(new LookupParameter<DoubleValue>("OverloadPenalty", "The overload penalty considered in the evaluation."));
    94       Parameters.Add(new LookupParameter<DoubleValue>("TardinessPenalty", "The tardiness penalty considered in the evaluation."));
     93      Parameters.Add(new LookupParameter<DoubleValue>("EvalFleetUsageFactor", "The fleet usage factor considered in the evaluation."));
     94      Parameters.Add(new LookupParameter<DoubleValue>("EvalTimeFactor", "The time factor considered in the evaluation."));
     95      Parameters.Add(new LookupParameter<DoubleValue>("EvalDistanceFactor", "The distance factor considered in the evaluation."));
     96      Parameters.Add(new LookupParameter<DoubleValue>("EvalOverloadPenalty", "The overload penalty considered in the evaluation."));
     97      Parameters.Add(new LookupParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation."));
    9598    }
    9699
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/VRPOperator.cs

    r4174 r4179  
    2525using HeuristicLab.Data;
    2626using HeuristicLab.Problems.VehicleRouting.Encodings;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using System;
    2729
    2830namespace HeuristicLab.Problems.VehicleRouting {
     31  [Item("VRPOperator", "A VRP operator.")]
     32  [StorableClass]
    2933  public abstract class VRPOperator : SingleSuccessorOperator, IVRPOperator {
    3034    public int Cities {
     
    3236    }
    3337    public ILookupParameter<DoubleMatrix> CoordinatesParameter {
    34       get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
     38      get {
     39        if (Parameters.ContainsKey("Coordinates"))
     40          return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"];
     41        else
     42          return null;
     43      }
    3544    }
    3645    public ILookupParameter<DoubleMatrix> DistanceMatrixParameter {
    37       get { return (ILookupParameter<DoubleMatrix>)Parameters["DistanceMatrix"]; }
     46      get {
     47        if (Parameters.ContainsKey("DistanceMatrix"))
     48          return (ILookupParameter<DoubleMatrix>)Parameters["DistanceMatrix"];
     49        else
     50          return null;
     51      }
    3852    }
    3953    public ILookupParameter<BoolValue> UseDistanceMatrixParameter {
    40       get { return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
     54      get {
     55        if (Parameters.ContainsKey("UseDistanceMatrix"))
     56          return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"];
     57        else
     58          return null;
     59      }
    4160    }
    4261    public ILookupParameter<IntValue> VehiclesParameter {
    43       get { return (ILookupParameter<IntValue>)Parameters["Vehicles"]; }
     62      get {
     63        if (Parameters.ContainsKey("Vehicles"))
     64          return (ILookupParameter<IntValue>)Parameters["Vehicles"];
     65        else
     66          return null;
     67      }
    4468    }
    4569    public ILookupParameter<DoubleValue> CapacityParameter {
    46       get { return (ILookupParameter<DoubleValue>)Parameters["Capacity"]; }
     70      get {
     71        if (Parameters.ContainsKey("Capacity"))
     72          return (ILookupParameter<DoubleValue>)Parameters["Capacity"];
     73        else
     74          return null;
     75      }
    4776    }
    4877    public ILookupParameter<DoubleArray> DemandParameter {
    49       get { return (ILookupParameter<DoubleArray>)Parameters["Demand"]; }
     78      get {
     79        if (Parameters.ContainsKey("Demand"))
     80          return (ILookupParameter<DoubleArray>)Parameters["Demand"];
     81        else
     82          return null;
     83      }
    5084    }
    5185    public ILookupParameter<DoubleArray> ReadyTimeParameter {
    52       get { return (ILookupParameter<DoubleArray>)Parameters["ReadyTime"]; }
     86      get {
     87        if (Parameters.ContainsKey("ReadyTime"))
     88          return (ILookupParameter<DoubleArray>)Parameters["ReadyTime"];
     89        else
     90          return null;
     91      }
    5392    }
    5493    public ILookupParameter<DoubleArray> DueTimeParameter {
    55       get { return (ILookupParameter<DoubleArray>)Parameters["DueTime"]; }
     94      get {
     95        if (Parameters.ContainsKey("DueTime"))
     96          return (ILookupParameter<DoubleArray>)Parameters["DueTime"];
     97        else
     98          return null;
     99      }
    56100    }
    57101    public ILookupParameter<DoubleArray> ServiceTimeParameter {
    58       get { return (ILookupParameter<DoubleArray>)Parameters["ServiceTime"]; }
     102      get {
     103        if (Parameters.ContainsKey("ServiceTime"))
     104          return (ILookupParameter<DoubleArray>)Parameters["ServiceTime"];
     105        else
     106          return null;
     107      }
    59108    }
     109
     110    [StorableConstructor]
     111    protected VRPOperator(bool deserializing) : base(deserializing) { }
    60112
    61113    public VRPOperator()
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/VehicleRoutingProblem.cs

    r4154 r4179  
    3333using HeuristicLab.PluginInfrastructure;
    3434using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
     35using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3536
    3637namespace HeuristicLab.Problems.VehicleRouting {
     
    9091    }
    9192    public IValueParameter<DoubleValue> FleetUsageFactor {
    92       get { return (IValueParameter<DoubleValue>)Parameters["FleetUsageFactor"]; }
     93      get { return (IValueParameter<DoubleValue>)Parameters["EvalFleetUsageFactor"]; }
    9394    }
    9495    public IValueParameter<DoubleValue> TimeFactor {
    95       get { return (IValueParameter<DoubleValue>)Parameters["TimeFactor"]; }
     96      get { return (IValueParameter<DoubleValue>)Parameters["EvalTimeFactor"]; }
    9697    }
    9798    public IValueParameter<DoubleValue> DistanceFactor {
    98       get { return (IValueParameter<DoubleValue>)Parameters["DistanceFactor"]; }
     99      get { return (IValueParameter<DoubleValue>)Parameters["EvalDistanceFactor"]; }
    99100    }
    100101    public IValueParameter<DoubleValue> OverloadPenalty {
    101       get { return (IValueParameter<DoubleValue>)Parameters["OverloadPenalty"]; }
     102      get { return (IValueParameter<DoubleValue>)Parameters["EvalOverloadPenalty"]; }
    102103    }
    103104    public IValueParameter<DoubleValue> TardinessPenalty {
    104       get { return (IValueParameter<DoubleValue>)Parameters["TardinessPenalty"]; }
     105      get { return (IValueParameter<DoubleValue>)Parameters["EvalTardinessPenalty"]; }
    105106    }
    106107    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
     
    185186    public VehicleRoutingProblem()
    186187      : base() {
    187       IVRPCreator creator = new AlbaPermutationCreator();
     188      IVRPCreator creator = new RandomCreator();
    188189      IVRPEvaluator evaluator = new VRPEvaluator();
    189190
     
    199200      Parameters.Add(new ValueParameter<DoubleArray>("ServiceTime", "The service time of each customer.", new DoubleArray()));
    200201      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this VRP instance."));
    201       Parameters.Add(new ValueParameter<DoubleValue>("FleetUsageFactor", "The fleet usage factor considered in the evaluation.", new DoubleValue(100)));
    202       Parameters.Add(new ValueParameter<DoubleValue>("TimeFactor", "The time factor considered in the evaluation.", new DoubleValue(0)));
    203       Parameters.Add(new ValueParameter<DoubleValue>("DistanceFactor", "The distance factor considered in the evaluation.", new DoubleValue(1)));
    204       Parameters.Add(new ValueParameter<DoubleValue>("OverloadPenalty", "The overload penalty considered in the evaluation.", new DoubleValue(100)));
    205       Parameters.Add(new ValueParameter<DoubleValue>("TardinessPenalty", "The tardiness penalty considered in the evaluation.", new DoubleValue(100)));
     202      Parameters.Add(new ValueParameter<DoubleValue>("EvalFleetUsageFactor", "The fleet usage factor considered in the evaluation.", new DoubleValue(100)));
     203      Parameters.Add(new ValueParameter<DoubleValue>("EvalTimeFactor", "The time factor considered in the evaluation.", new DoubleValue(0)));
     204      Parameters.Add(new ValueParameter<DoubleValue>("EvalDistanceFactor", "The distance factor considered in the evaluation.", new DoubleValue(1)));
     205      Parameters.Add(new ValueParameter<DoubleValue>("EvalOverloadPenalty", "The overload penalty considered in the evaluation.", new DoubleValue(100)));
     206      Parameters.Add(new ValueParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation.", new DoubleValue(100)));
    206207
    207208      Parameters.Add(new ValueParameter<IVRPCreator>("SolutionCreator", "The operator which should be used to create new VRP solutions.", creator));
    208209      Parameters.Add(new ValueParameter<IVRPEvaluator>("Evaluator", "The operator which should be used to evaluate VRP solutions.", evaluator));
    209210
    210       creator.VRPSolutionParameter.ActualName = "VRPSolution";
     211      creator.VRPToursParameter.ActualName = "VRPTours";
    211212      evaluator.QualityParameter.ActualName = "VRPQuality";
    212213
     
    282283      UpdateMoveEvaluators();
    283284      ParameterizeAnalyzer();
    284       //UpdateDistanceMatrix();
    285285      OnEvaluatorChanged();
    286286    }
     
    288288      ParameterizeAnalyzer();
    289289    }
    290     void TranslocationMoveParameter_ActualNameChanged(object sender, EventArgs e) {
     290    private void TranslocationMoveParameter_ActualNameChanged(object sender, EventArgs e) {
    291291      string name = ((ILookupParameter<TranslocationMove>)sender).ActualName;
    292292      foreach (IPermutationTranslocationMoveOperator op in Operators.OfType<IPermutationTranslocationMoveOperator>()) {
     
    299299    [StorableHook(HookType.AfterDeserialization)]
    300300    private void AfterDeserializationHook() {
    301       // BackwardsCompatibility3.3
    302       #region Backwards compatible code (remove with 3.4)
    303       if (operators == null) InitializeOperators();
    304       #endregion
    305301      AttachEventHandlers();
    306302    }
     
    349345    }
    350346    private void ParameterizeEvaluator() {
    351       Evaluator.VRPSolutionParameter.ActualName = SolutionCreator.VRPSolutionParameter.ActualName;
     347      Evaluator.VRPToursParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
    352348      Evaluator.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
    353349      Evaluator.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
     
    371367      BestVRPSolutionAnalyzer.OverloadParameter.ActualName = Evaluator.OverloadParameter.ActualName;
    372368      BestVRPSolutionAnalyzer.TardinessParameter.ActualName = Evaluator.TardinessParameter.ActualName;
    373       BestVRPSolutionAnalyzer.VRPSolutionParameter.ActualName = SolutionCreator.VRPSolutionParameter.ActualName;
     369      BestVRPSolutionAnalyzer.VRPToursParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
    374370      BestVRPSolutionAnalyzer.ResultsParameter.ActualName = "Results";
    375371    }
    376372    private void ParameterizeOperators() {
    377373      foreach (IVRPOperator op in Operators.OfType<IVRPOperator>()) {
    378         op.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
    379         op.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
    380         op.UseDistanceMatrixParameter.ActualName = UseDistanceMatrixParameter.Name;
    381         op.VehiclesParameter.ActualName = VehiclesParameter.Name;
    382         op.CapacityParameter.ActualName = CapacityParameter.Name;
    383         op.DemandParameter.ActualName = DemandParameter.Name;
    384         op.ReadyTimeParameter.ActualName = ReadyTimeParameter.Name;
    385         op.DueTimeParameter.ActualName = DueTimeParameter.Name;
    386         op.ServiceTimeParameter.ActualName = ServiceTimeParameter.Name;
     374        if(op.CoordinatesParameter != null) op.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
     375        if(op.DistanceMatrixParameter != null) op.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
     376        if(op.UseDistanceMatrixParameter != null) op.UseDistanceMatrixParameter.ActualName = UseDistanceMatrixParameter.Name;
     377        if(op.VehiclesParameter != null) op.VehiclesParameter.ActualName = VehiclesParameter.Name;
     378        if(op.CapacityParameter != null) op.CapacityParameter.ActualName = CapacityParameter.Name;
     379        if(op.DemandParameter != null) op.DemandParameter.ActualName = DemandParameter.Name;
     380        if(op.ReadyTimeParameter != null) op.ReadyTimeParameter.ActualName = ReadyTimeParameter.Name;
     381        if(op.DueTimeParameter != null) op.DueTimeParameter.ActualName = DueTimeParameter.Name;
     382        if(op.ServiceTimeParameter != null) op.ServiceTimeParameter.ActualName = ServiceTimeParameter.Name;
    387383      }
    388384     
    389385      foreach (IVRPMoveOperator op in Operators.OfType<IVRPMoveOperator>()) {
    390         op.VRPSolutionParameter.ActualName = SolutionCreator.VRPSolutionParameter.ActualName;
     386        op.VRPToursParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
    391387      }
    392388
     
    398394        op.TardinessPenalty.ActualName = TardinessPenalty.Name;
    399395        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    400         op.VRPSolutionParameter.ActualName = SolutionCreator.VRPSolutionParameter.ActualName;
     396        op.VRPToursParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
    401397      }
    402398      string translocationMove = Operators.OfType<IMoveGenerator>().OfType<IAlbaTranslocationMoveOperator>().First().TranslocationMoveParameter.ActualName;
     
    405401
    406402      foreach (IVRPCrossover op in Operators.OfType<IVRPCrossover>()) {
    407         op.ParentsParameter.ActualName = SolutionCreator.VRPSolutionParameter.ActualName;
    408         op.ChildParameter.ActualName = SolutionCreator.VRPSolutionParameter.ActualName;
     403        op.ParentsParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
     404        op.ChildParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
    409405      }
    410406
    411407      foreach (IVRPManipulator op in Operators.OfType<IVRPManipulator>()) {
    412         op.VRPSolutionParameter.ActualName = SolutionCreator.VRPSolutionParameter.ActualName;
     408        op.VRPToursParameter.ActualName = SolutionCreator.VRPToursParameter.ActualName;
    413409      }
    414410    }
Note: See TracChangeset for help on using the changeset viewer.