Free cookie consent management tool by TermsFeed Policy Generator

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/Encodings/General
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • 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()
Note: See TracChangeset for help on using the changeset viewer.