Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/13/10 10:28:15 (14 years ago)
Author:
svonolfe
Message:

Updated naming and description of the VRP operators (#1039)

Location:
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion
Files:
1 added
7 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/ExhaustiveIntraRouteInversionMoveGenerator.cs

    r4204 r4206  
    2929
    3030namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    31   [Item("ExhaustiveSimpleLocalSearchMoveGenerator", "Generates all possible simple local search moves from a given Alba VRP encoding.")]
     31  [Item("ExhaustiveIntraRouteInversionGenerator", "Generates all possible intra route inversion moves from a given VRP encoding.")]
    3232  [StorableClass]
    33   public sealed class ExhaustiveSimpleLocalSearchMoveGenerator : SimpleLocalSearchMoveGenerator, IExhaustiveMoveGenerator, IAlbaSimpleLocalSearchMoveOperator {
     33  public sealed class ExhaustiveIntraRouteInversionGenerator : IntraRouteInversionMoveGenerator, IExhaustiveMoveGenerator, IAlbaIntraRouteInversionMoveOperator {
    3434    [StorableConstructor]
    35     private ExhaustiveSimpleLocalSearchMoveGenerator(bool deserializing) : base(deserializing) { }
     35    private ExhaustiveIntraRouteInversionGenerator(bool deserializing) : base(deserializing) { }
    3636
    37     public ExhaustiveSimpleLocalSearchMoveGenerator()
     37    public ExhaustiveIntraRouteInversionGenerator()
    3838      : base() {
    3939    }
    4040
    41     protected override SimpleLocalSearchMove[] GenerateMoves(AlbaEncoding individual) {
    42       List<SimpleLocalSearchMove> moves = new List<SimpleLocalSearchMove>();
     41    protected override IntraRouteInversionMove[] GenerateMoves(AlbaEncoding individual) {
     42      List<IntraRouteInversionMove> moves = new List<IntraRouteInversionMove>();
    4343
    4444      int currentTourStart = 0;
     
    5555          for (int i = 0; i <= tourLength - 4; i++ ) {
    5656            for (int j = i + 2; j <= tourLength - 2; j++) {
    57               SimpleLocalSearchMove move = new SimpleLocalSearchMove(
     57              IntraRouteInversionMove move = new IntraRouteInversionMove(
    5858                currentTourStart + i,
    5959                currentTourStart + j,
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/IntraRouteInversionEvaluator.cs

    r4205 r4206  
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting {
    30   [Item("SimpleLocalSearchMoveEvaluator", "Evaluates a simple local search move for the Alba representation.")]
     30  [Item("IntraRouteInversionMoveEvaluator", "Evaluates a intra route inversion move for a VRP representation.")]
    3131  [StorableClass]
    32   public sealed class SimpleLocalSearchMoveEvaluator : VRPMoveEvaluator, IAlbaSimpleLocalSearchMoveOperator {
    33     public ILookupParameter<SimpleLocalSearchMove> SimpleLocalSearchMoveParameter {
    34       get { return (ILookupParameter<SimpleLocalSearchMove>)Parameters["SimpleLocalSearchMove"]; }
     32  public sealed class IntraRouteInversionMoveEvaluator : VRPMoveEvaluator, IAlbaIntraRouteInversionMoveOperator {
     33    public ILookupParameter<IntraRouteInversionMove> IntraRouteInversionMoveParameter {
     34      get { return (ILookupParameter<IntraRouteInversionMove>)Parameters["IntraRouteInversionMove"]; }
    3535    }
    3636
    3737    [StorableConstructor]
    38     private SimpleLocalSearchMoveEvaluator(bool deserializing) : base(deserializing) { }
     38    private IntraRouteInversionMoveEvaluator(bool deserializing) : base(deserializing) { }
    3939
    40     public SimpleLocalSearchMoveEvaluator()
     40    public IntraRouteInversionMoveEvaluator()
    4141      : base() {
    42       Parameters.Add(new LookupParameter<SimpleLocalSearchMove>("SimpleLocalSearchMove", "The move to evaluate."));
     42        Parameters.Add(new LookupParameter<IntraRouteInversionMove>("IntraRouteInversionMove", "The move to evaluate."));
    4343    }
    4444
    45     public static TourEvaluation GetMoveQuality(AlbaEncoding individual, SimpleLocalSearchMove move,
     45    public static TourEvaluation GetMoveQuality(AlbaEncoding individual, IntraRouteInversionMove move,
    4646      DoubleArray dueTimeArray, DoubleArray serviceTimeArray, DoubleArray readyTimeArray,
    4747      DoubleArray demandArray, DoubleValue capacity, DoubleMatrix coordinates,
     
    5050      ILookupParameter<DoubleMatrix> distanceMatrix, Data.BoolValue useDistanceMatrix) {
    5151      AlbaEncoding newSolution = individual.Clone() as AlbaEncoding;
    52       SimpleLocalSearchMoveMaker.Apply(newSolution, move);
     52      IntraRouteInversionMoveMaker.Apply(newSolution, move);
    5353
    5454      return VRPEvaluator.Evaluate(
     
    6060    protected override TourEvaluation GetMoveQuality() {
    6161      return GetMoveQuality(
    62         VRPToursParameter.ActualValue as AlbaEncoding, SimpleLocalSearchMoveParameter.ActualValue,
     62        VRPToursParameter.ActualValue as AlbaEncoding, IntraRouteInversionMoveParameter.ActualValue,
    6363        DueTimeParameter.ActualValue, ServiceTimeParameter.ActualValue, ReadyTimeParameter.ActualValue,
    6464        DemandParameter.ActualValue, CapacityParameter.ActualValue, CoordinatesParameter.ActualValue,
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/IntraRouteInversionMove.cs

    r4205 r4206  
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    30   [Item("InversionMove", "Item that describes a simple local search move on an Alba VRP representation.")]
     30  [Item("InversionMove", "Item that describes an intra route inversion move on a VRP representation.")]
    3131  [StorableClass]
    32   public class SimpleLocalSearchMove : TwoIndexMove, IVRPMove {
    33     public SimpleLocalSearchMove()
     32  public class IntraRouteInversionMove : TwoIndexMove, IVRPMove {
     33    public IntraRouteInversionMove()
    3434      : base() {
    3535    }
    3636
    37     public SimpleLocalSearchMove(int index1, int index2)
     37    public IntraRouteInversionMove(int index1, int index2)
    3838      : base(index1, index2, null) {
    3939    }
    4040
    41     public SimpleLocalSearchMove(int index1, int index2, AlbaEncoding permutation)
     41    public IntraRouteInversionMove(int index1, int index2, AlbaEncoding permutation)
    4242      : base(index1, index2, permutation) {
    4343    }
    4444
    4545    public override IDeepCloneable Clone(HeuristicLab.Common.Cloner cloner) {
    46       SimpleLocalSearchMove clone = new SimpleLocalSearchMove(
     46      IntraRouteInversionMove clone = new IntraRouteInversionMove(
    4747        Index1, Index2);
    4848
     
    6363      DoubleValue overloadPenalty, DoubleValue tardinessPenalty,
    6464      ILookupParameter<DoubleMatrix> distanceMatrix, Data.BoolValue useDistanceMatrix) {
    65         return SimpleLocalSearchMoveEvaluator.GetMoveQuality(individual as AlbaEncoding, this,
     65        return IntraRouteInversionMoveEvaluator.GetMoveQuality(individual as AlbaEncoding, this,
    6666          dueTimeArray, serviceTimeArray, readyTimeArray, demandArray, capacity,
    6767          coordinates, fleetUsageFactor, timeFactor, distanceFactor,
     
    7070
    7171    public void MakeMove(IRandom random, IVRPEncoding individual) {
    72       SimpleLocalSearchMoveMaker.Apply(individual as AlbaEncoding, this);
     72      IntraRouteInversionMoveMaker.Apply(individual as AlbaEncoding, this);
    7373    }
    7474
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/IntraRouteInversionMoveGenerator.cs

    r4204 r4206  
    2929
    3030namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    31   [Item("SimpleLocalSearchMoveGenerator", "Generates local search moves from a given Alba VRP encoding.")]
     31  [Item("IntraRouteInversionMoveGenerator", "Generates intra route inversion moves from a given VRP encoding.")]
    3232  [StorableClass]
    33   public abstract class SimpleLocalSearchMoveGenerator : AlbaMoveOperator, IExhaustiveMoveGenerator, IAlbaSimpleLocalSearchMoveOperator {
    34     #region IAlbaSimpleLocalSearchMoveOperator Members
    35 
    36     public ILookupParameter<SimpleLocalSearchMove> SimpleLocalSearchMoveParameter {
    37       get { return (ILookupParameter<SimpleLocalSearchMove>)Parameters["SimpleLocalSearchMove"]; }
     33  public abstract class IntraRouteInversionMoveGenerator : AlbaMoveOperator, IExhaustiveMoveGenerator, IAlbaIntraRouteInversionMoveOperator {
     34    public ILookupParameter<IntraRouteInversionMove> IntraRouteInversionMoveParameter {
     35      get { return (ILookupParameter<IntraRouteInversionMove>)Parameters["IntraRouteInversionMove"]; }
    3836    }
    3937
     
    4240    }
    4341
    44     #endregion
     42    [StorableConstructor]
     43    protected IntraRouteInversionMoveGenerator(bool deserializing) : base(deserializing) { }
    4544
    46     [StorableConstructor]
    47     protected SimpleLocalSearchMoveGenerator(bool deserializing) : base(deserializing) { }
    48 
    49     public SimpleLocalSearchMoveGenerator()
     45    public IntraRouteInversionMoveGenerator()
    5046      : base() {
    51         Parameters.Add(new LookupParameter<SimpleLocalSearchMove>("SimpleLocalSearchMove", "The moves that should be generated in subscopes."));
     47        Parameters.Add(new LookupParameter<IntraRouteInversionMove>("IntraRouteInversionMove", "The moves that should be generated in subscopes."));
    5248        Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes."));
    5349    }
    5450
    55     protected abstract SimpleLocalSearchMove[] GenerateMoves(AlbaEncoding individual);
     51    protected abstract IntraRouteInversionMove[] GenerateMoves(AlbaEncoding individual);
    5652
    5753    public override IOperation Apply() {
     
    5955
    6056      AlbaEncoding individual = VRPToursParameter.ActualValue as AlbaEncoding;
    61       SimpleLocalSearchMove[] moves = GenerateMoves(individual);
     57      IntraRouteInversionMove[] moves = GenerateMoves(individual);
    6258      Scope[] moveScopes = new Scope[moves.Length];
    6359      for (int i = 0; i < moveScopes.Length; i++) {
    6460        moveScopes[i] = new Scope(i.ToString());
    65         moveScopes[i].Variables.Add(new Variable(SimpleLocalSearchMoveParameter.ActualName, moves[i]));
     61        moveScopes[i].Variables.Add(new Variable(IntraRouteInversionMoveParameter.ActualName, moves[i]));
    6662      }
    6763      CurrentScopeParameter.ActualValue.SubScopes.AddRange(moveScopes);
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/IntraRouteInversionMoveMaker.cs

    r4204 r4206  
    2828
    2929namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    30   [Item("SimpleLocalSearchMoveMaker", "Peforms a simple local search moves on a given Alba VRP encoding and updates the quality.")]
     30  [Item("IntraRouteInversionMoveMaker", "Peforms the SLS move on a given VRP encoding and updates the quality.  It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")]
    3131  [StorableClass]
    32   public class SimpleLocalSearchMoveMaker : AlbaMoveMaker, IAlbaSimpleLocalSearchMoveOperator, IMoveMaker {
     32  public class IntraRouteInversionMoveMaker : AlbaMoveMaker, IAlbaIntraRouteInversionMoveOperator, IMoveMaker {
    3333    public override bool CanChangeName {
    3434      get { return false; }
     
    4040      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
    4141    }
    42     public ILookupParameter<SimpleLocalSearchMove> SimpleLocalSearchMoveParameter {
    43       get { return (ILookupParameter<SimpleLocalSearchMove>)Parameters["SimpleLocalSearchMove"]; }
     42    public ILookupParameter<IntraRouteInversionMove> IntraRouteInversionMoveParameter {
     43      get { return (ILookupParameter<IntraRouteInversionMove>)Parameters["IntraRouteInversionMove"]; }
    4444    }
    4545
    4646    [StorableConstructor]
    47     private SimpleLocalSearchMoveMaker(bool deserializing) : base(deserializing) { }
     47    private IntraRouteInversionMoveMaker(bool deserializing) : base(deserializing) { }
    4848
    49     public SimpleLocalSearchMoveMaker()
     49    public IntraRouteInversionMoveMaker()
    5050      : base() {
    5151      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution."));
    52       Parameters.Add(new LookupParameter<SimpleLocalSearchMove>("SimpleLocalSearchMove", "The move to make."));
     52      Parameters.Add(new LookupParameter<IntraRouteInversionMove>("IntraRouteInversionMove", "The move to make."));
    5353      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move."));
    5454    }
    5555
    56     public static void Apply(AlbaEncoding solution, SimpleLocalSearchMove move) {
    57       SimpleLocalSearchManipulator.Apply(solution, move.Index1, move.Index2);
     56    public static void Apply(AlbaEncoding solution, IntraRouteInversionMove move) {
     57      IntraRouteInversionManipulator.Apply(solution, move.Index1, move.Index2);
    5858    }
    5959
     
    6363      AlbaEncoding solution = VRPToursParameter.ActualValue as AlbaEncoding;
    6464
    65       SimpleLocalSearchMove move = SimpleLocalSearchMoveParameter.ActualValue;
     65      IntraRouteInversionMove move = IntraRouteInversionMoveParameter.ActualValue;
    6666      DoubleValue moveQuality = MoveQualityParameter.ActualValue;
    6767      DoubleValue quality = QualityParameter.ActualValue;
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/StochasticIntraRouteInversionMutliMoveGenerator.cs

    r4204 r4206  
    3030
    3131namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    32   [Item("StochasticSimpleLocalSearchMultiMoveGenerator", "Generates multiple random simple local search moves from a given Alba VRP encoding.")]
     32  [Item("StochasticIntraRouteInversionMultiMoveGenerator", "Generates multiple random intra route inversion moves from a given VRP encoding.")]
    3333  [StorableClass]
    34   public sealed class StochasticSimpleLocalSearchMultiMoveGenerator : SimpleLocalSearchMoveGenerator, IStochasticOperator, IMultiMoveGenerator, IAlbaSimpleLocalSearchMoveOperator {
     34  public sealed class StochasticIntraRouteInversionMultiMoveGenerator : IntraRouteInversionMoveGenerator, IStochasticOperator, IMultiMoveGenerator, IAlbaIntraRouteInversionMoveOperator {
    3535    public ILookupParameter<IRandom> RandomParameter {
    3636      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     
    4242   
    4343    [StorableConstructor]
    44     private StochasticSimpleLocalSearchMultiMoveGenerator(bool deserializing) : base(deserializing) { }
     44    private StochasticIntraRouteInversionMultiMoveGenerator(bool deserializing) : base(deserializing) { }
    4545
    46     public StochasticSimpleLocalSearchMultiMoveGenerator()
     46    public StochasticIntraRouteInversionMultiMoveGenerator()
    4747      : base() {
    4848        Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
     
    5050    }
    5151
    52     protected override SimpleLocalSearchMove[] GenerateMoves(AlbaEncoding individual) {
     52    protected override IntraRouteInversionMove[] GenerateMoves(AlbaEncoding individual) {
    5353      int sampleSize = SampleSizeParameter.ActualValue.Value;
    5454
    55       SimpleLocalSearchMove[] moves = new SimpleLocalSearchMove[sampleSize];
     55      IntraRouteInversionMove[] moves = new IntraRouteInversionMove[sampleSize];
    5656      for (int i = 0; i < sampleSize; i++) {
    57         moves[i] = StochasticSimpleLocalSearchSingleMoveGenerator.Apply(
     57        moves[i] = StochasticIntraRouteInversionSingleMoveGenerator.Apply(
    5858          individual, Cities, RandomParameter.ActualValue);
    5959      }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/StochasticIntraRouteInversionSingleMoveGenerator.cs

    r4205 r4206  
    3030
    3131namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    32   [Item("StochasticSimpleLocalSearchSingleMoveGenerator", "Generates one random simple local search move from a given Alba VRP encoding.")]
     32  [Item("StochasticIntraRouteInversionSingleMoveGenerator", "Generates one random intra route inversion move from a given VRP encoding.")]
    3333  [StorableClass]
    34   public sealed class StochasticSimpleLocalSearchSingleMoveGenerator : SimpleLocalSearchMoveGenerator,
    35     IStochasticOperator, ISingleMoveGenerator, IAlbaSimpleLocalSearchMoveOperator, IMultiVRPMoveGenerator {
     34  public sealed class StochasticIntraRouteInversionSingleMoveGenerator : IntraRouteInversionMoveGenerator,
     35    IStochasticOperator, ISingleMoveGenerator, IAlbaIntraRouteInversionMoveOperator, IMultiVRPMoveGenerator {
    3636    #region IMultiVRPMoveOperator Members
    3737
    3838    public ILookupParameter VRPMoveParameter {
    39       get { return (ILookupParameter)Parameters["SimpleLocalSearchMove"]; }
     39      get { return (ILookupParameter)Parameters["IntraRouteInversionMove"]; }
    4040    }
    4141
     
    4747   
    4848    [StorableConstructor]
    49     private StochasticSimpleLocalSearchSingleMoveGenerator(bool deserializing) : base(deserializing) { }
     49    private StochasticIntraRouteInversionSingleMoveGenerator(bool deserializing) : base(deserializing) { }
    5050
    51     public StochasticSimpleLocalSearchSingleMoveGenerator()
     51    public StochasticIntraRouteInversionSingleMoveGenerator()
    5252      : base() {
    5353        Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
    5454    }
    5555
    56     public static SimpleLocalSearchMove Apply(AlbaEncoding individual, int cities, IRandom rand) {
     56    public static IntraRouteInversionMove Apply(AlbaEncoding individual, int cities, IRandom rand) {
    5757      int index1 = -1;
    5858      int index2 = -1;
     
    8686      }
    8787
    88       return new SimpleLocalSearchMove(index1, index2, individual);
     88      return new IntraRouteInversionMove(index1, index2, individual);
    8989    }
    9090
    91     protected override SimpleLocalSearchMove[] GenerateMoves(AlbaEncoding individual) {
    92       List<SimpleLocalSearchMove> moves = new List<SimpleLocalSearchMove>();
     91    protected override IntraRouteInversionMove[] GenerateMoves(AlbaEncoding individual) {
     92      List<IntraRouteInversionMove> moves = new List<IntraRouteInversionMove>();
    9393
    94       SimpleLocalSearchMove move = Apply(individual, Cities, RandomParameter.ActualValue);
     94      IntraRouteInversionMove move = Apply(individual, Cities, RandomParameter.ActualValue);
    9595      if(move != null)
    9696        moves.Add(move);
Note: See TracChangeset for help on using the changeset viewer.