Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/29/10 18:49:55 (14 years ago)
Author:
abeham
Message:

Renamed operators according to the underlying operation #889

Location:
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt
Files:
1 added
1 deleted
10 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/PreventReaddAndRemovalTranslocationMoveTabuChecker.cs

    r3231 r3232  
    2929
    3030namespace HeuristicLab.Encodings.PermutationEncoding {
    31   [Item("ThreeOptPreventEdgeRemovalAndReadding", "Prevents readding of previously deleted edges as well as deleting previously added edges.")]
     31  [Item("PreventReaddAndRemovalTranslocationMoveTabuChecker", "Prevents readding of previously deleted edges as well as deleting previously added edges.")]
    3232  [StorableClass]
    33   public class PreventReaddDeleteThreeOptTabuMoveEvaluator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, ITabuMoveEvaluator {
     33  public class PreventReaddAndRemovalTranslocationMoveTabuChecker : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, ITabuChecker {
    3434    public override bool CanChangeName {
    3535      get { return false; }
    3636    }
    37     public ILookupParameter<ThreeOptMove> ThreeOptMoveParameter {
    38       get { return (LookupParameter<ThreeOptMove>)Parameters["ThreeOptMove"]; }
     37    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
     38      get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
    3939    }
    4040    public ILookupParameter<Permutation> PermutationParameter {
     
    5151    }
    5252
    53     public PreventReaddDeleteThreeOptTabuMoveEvaluator()
     53    public PreventReaddAndRemovalTranslocationMoveTabuChecker()
    5454      : base() {
    55       Parameters.Add(new LookupParameter<ThreeOptMove>("ThreeOptMove", "The move to evaluate."));
     55      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate."));
    5656      Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu."));
    5757      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
     
    6262    public override IOperation Apply() {
    6363      ItemList<IItem> tabuList = TabuListParameter.ActualValue;
    64       ThreeOptMove move = ThreeOptMoveParameter.ActualValue;
     64      TranslocationMove move = TranslocationMoveParameter.ActualValue;
    6565      Permutation permutation = PermutationParameter.ActualValue;
    6666      int length = permutation.Length;
     
    8383      if (!isTabu) {
    8484        foreach (IItem tabuMove in tabuList) {
    85           ThreeOptTabuMoveAttribute attribute = (tabuMove as ThreeOptTabuMoveAttribute);
     85          TranslocationMoveAttribute attribute = (tabuMove as TranslocationMoveAttribute);
    8686          if (attribute != null) {
    8787            // if previously deleted Edge1Source-Target is readded
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/PreventReaddTranslocationMoveTabuChecker.cs

    r3231 r3232  
    2929
    3030namespace HeuristicLab.Encodings.PermutationEncoding {
    31   [Item("ThreeOptPreventEdgeReadding", "Prevents readding of previously deleted edges.")]
     31  [Item("PreventReaddTranslocationMoveTabuChecker", "Prevents readding of previously deleted edges.")]
    3232  [StorableClass]
    33   public class PreventReaddThreeOptTabuMoveEvaluator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, ITabuMoveEvaluator {
     33  public class PreventReaddTranslocationMoveTabuChecker : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, ITabuChecker {
    3434    public override bool CanChangeName {
    3535      get { return false; }
    3636    }
    37     public ILookupParameter<ThreeOptMove> ThreeOptMoveParameter {
    38       get { return (LookupParameter<ThreeOptMove>)Parameters["ThreeOptMove"]; }
     37    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
     38      get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
    3939    }
    4040    public ILookupParameter<Permutation> PermutationParameter {
     
    5151    }
    5252
    53     public PreventReaddThreeOptTabuMoveEvaluator()
     53    public PreventReaddTranslocationMoveTabuChecker()
    5454      : base() {
    55       Parameters.Add(new LookupParameter<ThreeOptMove>("ThreeOptMove", "The move to evaluate."));
     55      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate."));
    5656      Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu."));
    5757      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
     
    6262    public override IOperation Apply() {
    6363      ItemList<IItem> tabuList = TabuListParameter.ActualValue;
    64       ThreeOptMove move = ThreeOptMoveParameter.ActualValue;
     64      TranslocationMove move = TranslocationMoveParameter.ActualValue;
    6565      Permutation permutation = PermutationParameter.ActualValue;
    6666      int length = permutation.Length;
     
    8383      if (!isTabu) {
    8484        foreach (IItem tabuMove in tabuList) {
    85           ThreeOptTabuMoveAttribute attribute = (tabuMove as ThreeOptTabuMoveAttribute);
     85          TranslocationMoveAttribute attribute = (tabuMove as TranslocationMoveAttribute);
    8686          if (attribute != null) {
    8787            // if previously deleted Edge1Source-Target is readded
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/PreventRemovalTranslocationMoveTabuChecker.cs

    r3231 r3232  
    2929
    3030namespace HeuristicLab.Encodings.PermutationEncoding {
    31   [Item("ThreeOptPreventEdgeRemoval", "Prevents deleting of previously added edges.")]
     31  [Item("PreventRemovalTranslocationMoveTabuChecker", "Prevents deleting of previously added edges.")]
    3232  [StorableClass]
    33   public class PreventDeleteThreeOptTabuMoveEvaluator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, ITabuMoveEvaluator {
     33  public class PreventRemovalTranslocationMoveTabuChecker : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, ITabuChecker {
    3434    public override bool CanChangeName {
    3535      get { return false; }
    3636    }
    37     public ILookupParameter<ThreeOptMove> ThreeOptMoveParameter {
    38       get { return (LookupParameter<ThreeOptMove>)Parameters["ThreeOptMove"]; }
     37    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
     38      get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
    3939    }
    4040    public ILookupParameter<Permutation> PermutationParameter {
     
    5151    }
    5252
    53     public PreventDeleteThreeOptTabuMoveEvaluator()
     53    public PreventRemovalTranslocationMoveTabuChecker()
    5454      : base() {
    55       Parameters.Add(new LookupParameter<ThreeOptMove>("ThreeOptMove", "The move to evaluate."));
     55      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate."));
    5656      Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu."));
    5757      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
     
    6262    public override IOperation Apply() {
    6363      ItemList<IItem> tabuList = TabuListParameter.ActualValue;
    64       ThreeOptMove move = ThreeOptMoveParameter.ActualValue;
     64      TranslocationMove move = TranslocationMoveParameter.ActualValue;
    6565      Permutation permutation = PermutationParameter.ActualValue;
    6666      int length = permutation.Length;
     
    8383      if (!isTabu) {
    8484        foreach (IItem tabuMove in tabuList) {
    85           ThreeOptTabuMoveAttribute attribute = (tabuMove as ThreeOptTabuMoveAttribute);
     85          TranslocationMoveAttribute attribute = (tabuMove as TranslocationMoveAttribute);
    8686          if (attribute != null) {
    8787            // if previously added Edge3Source-Edge1Target is deleted
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationMultiMoveGenerator.cs

    r3231 r3232  
    2828
    2929namespace HeuristicLab.Encodings.PermutationEncoding {
    30   [Item("StochasticThreeOptMultiMoveGenerator", "Randomly samples n from all possible 3-opt moves from a given permutation.")]
     30  [Item("StochasticTranslocationMultiMoveGenerator", "Randomly samples n from all possible translocation and insertion moves (3-opt) from a given permutation.")]
    3131  [StorableClass]
    32   public class StochasticThreeOptMultiMoveGenerator : ThreeOptMoveGenerator, IStochasticOperator, IMultiMoveGenerator {
     32  public class StochasticTranslocationMultiMoveGenerator : TranslocationMoveGenerator, IStochasticOperator, IMultiMoveGenerator {
    3333    public ILookupParameter<IRandom> RandomParameter {
    3434      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     
    4343    }
    4444
    45     public StochasticThreeOptMultiMoveGenerator()
     45    public StochasticTranslocationMultiMoveGenerator()
    4646      : base() {
    4747      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
     
    4949    }
    5050
    51     public static ThreeOptMove[] Apply(Permutation permutation, IRandom random, int sampleSize) {
     51    public static TranslocationMove[] Apply(Permutation permutation, IRandom random, int sampleSize) {
    5252      int length = permutation.Length;
    53       ThreeOptMove[] moves = new ThreeOptMove[sampleSize];
     53      TranslocationMove[] moves = new TranslocationMove[sampleSize];
    5454      for (int i = 0; i < sampleSize; i++) {
    5555        moves[i] = StochasticThreeOptSingleMoveGenerator.Apply(permutation, random);
     
    5858    }
    5959
    60     protected override ThreeOptMove[] GenerateMoves(Permutation permutation) {
     60    protected override TranslocationMove[] GenerateMoves(Permutation permutation) {
    6161      IRandom random = RandomParameter.ActualValue;
    6262      return Apply(permutation, random, SampleSizeParameter.ActualValue.Value);
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationSingleMoveGenerator.cs

    r3231 r3232  
    2828
    2929namespace HeuristicLab.Encodings.PermutationEncoding {
    30   [Item("StochasticThreeOptSingleMoveGenerator", "Randomly samples one from all possible 3-opt moves from a given permutation.")]
     30  [Item("StochasticTranslocationSingleMoveGenerator", "Randomly samples one from all possible translocation and insertion moves (3-opt) from a given permutation.")]
    3131  [StorableClass]
    32   public class StochasticThreeOptSingleMoveGenerator : ThreeOptMoveGenerator, IStochasticOperator, ISingleMoveGenerator {
     32  public class StochasticThreeOptSingleMoveGenerator : TranslocationMoveGenerator, IStochasticOperator, ISingleMoveGenerator {
    3333    public ILookupParameter<IRandom> RandomParameter {
    3434      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     
    4040    }
    4141
    42     public static ThreeOptMove Apply(Permutation permutation, IRandom random) {
     42    public static TranslocationMove Apply(Permutation permutation, IRandom random) {
    4343      int length = permutation.Length;
    4444      int index1, index2, index3;
     
    5151      } while (index3 == index1);
    5252     
    53       return new ThreeOptMove(index1, index2, index3);
     53      return new TranslocationMove(index1, index2, index3);
    5454    }
    5555
    56     protected override ThreeOptMove[] GenerateMoves(Permutation permutation) {
     56    protected override TranslocationMove[] GenerateMoves(Permutation permutation) {
    5757      IRandom random = RandomParameter.ActualValue;
    58       return new ThreeOptMove[] { Apply(permutation, random) };
     58      return new TranslocationMove[] { Apply(permutation, random) };
    5959    }
    6060  }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMove.cs

    r3231 r3232  
    2424
    2525namespace HeuristicLab.Encodings.PermutationEncoding {
    26   [Item("ThreeOptMove", "A move that changes three edges by performing a translocation.")]
     26  [Item("TranslocationMove", "A move that changes three edges by performing a translocation.")]
    2727  [StorableClass]
    28   public class ThreeOptMove : ThreeIndexMove {
    29     public ThreeOptMove()
     28  public class TranslocationMove : ThreeIndexMove {
     29    public TranslocationMove()
    3030      : base() {
    3131    }
    3232
    33     public ThreeOptMove(int index1, int index2, int index3)
     33    public TranslocationMove(int index1, int index2, int index3)
    3434      : base(index1, index2, index3, null) {
    3535    }
    3636
    37     public ThreeOptMove(int index1, int index2, int index3, Permutation permutation)
     37    public TranslocationMove(int index1, int index2, int index3, Permutation permutation)
    3838      : base(index1, index2, index3, permutation) {
    3939    }
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveAttribute.cs

    r3231 r3232  
    2424
    2525namespace HeuristicLab.Encodings.PermutationEncoding {
    26   [Item("ThreeOptTabuMoveAttribute", "Specifies the tabu attributes for a 3-opt move.")]
     26  [Item("TranslocationMoveAttribute", "Specifies the tabu attributes for a translocation and insertion move (3-opt).")]
    2727  [StorableClass]
    28   public class ThreeOptTabuMoveAttribute : Item {
     28  public class TranslocationMoveAttribute : Item {
    2929    [Storable]
    3030    public int Edge1Source { get; private set; }
     
    4141
    4242    [StorableConstructor]
    43     private ThreeOptTabuMoveAttribute(bool deserializing)
     43    private TranslocationMoveAttribute(bool deserializing)
    4444      : base() {
    4545    }
    4646
    47     public ThreeOptTabuMoveAttribute()
     47    public TranslocationMoveAttribute()
    4848      : this(-1, -1, -1, -1, -1, -1) { }
    4949
    50     public ThreeOptTabuMoveAttribute(int edge1Source, int edge1Target, int edge2Source, int edge2Target, int edge3Source, int edge3Target)
     50    public TranslocationMoveAttribute(int edge1Source, int edge1Target, int edge2Source, int edge2Target, int edge3Source, int edge3Target)
    5151      : base() {
    5252      Edge1Source = edge1Source;
     
    5959
    6060    public override IDeepCloneable Clone(Cloner cloner) {
    61       ThreeOptTabuMoveAttribute clone = (ThreeOptTabuMoveAttribute)base.Clone(cloner);
     61      TranslocationMoveAttribute clone = (TranslocationMoveAttribute)base.Clone(cloner);
    6262      clone.Edge1Source = Edge1Source;
    6363      clone.Edge1Target = Edge1Target;
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveGenerator.cs

    r3231 r3232  
    2828
    2929namespace HeuristicLab.Encodings.PermutationEncoding {
    30   [Item("ThreeOptMoveGenerator", "Base class for move generators that produce 3-opt moves.")]
     30  [Item("TranslocationMoveGenerator", "Base class for move generators that produce translocation moves (3-opt).")]
    3131  [StorableClass]
    32   public abstract class ThreeOptMoveGenerator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, IMoveGenerator {
     32  public abstract class TranslocationMoveGenerator : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, IMoveGenerator {
    3333    public override bool CanChangeName {
    3434      get { return false; }
     
    3737      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    3838    }
    39     public ILookupParameter<ThreeOptMove> ThreeOptMoveParameter {
    40       get { return (LookupParameter<ThreeOptMove>)Parameters["ThreeOptMove"]; }
     39    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
     40      get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
    4141    }
    4242    protected ScopeParameter CurrentScopeParameter {
     
    4444    }
    4545
    46     public ThreeOptMoveGenerator()
     46    public TranslocationMoveGenerator()
    4747      : base() {
    4848      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated."));
    49       Parameters.Add(new LookupParameter<ThreeOptMove>("ThreeOptMove", "The moves that should be generated in subscopes."));
     49      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The moves that should be generated in subscopes."));
    5050      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes."));
    5151    }
     
    5353    public override IOperation Apply() {
    5454      Permutation p = PermutationParameter.ActualValue;
    55       ThreeOptMove[] moves = GenerateMoves(p);
     55      TranslocationMove[] moves = GenerateMoves(p);
    5656      Scope[] moveScopes = new Scope[moves.Length];
    5757      for (int i = 0; i < moveScopes.Length; i++) {
    5858        moveScopes[i] = new Scope(i.ToString());
    59         moveScopes[i].Variables.Add(new Variable(ThreeOptMoveParameter.ActualName, moves[i]));
     59        moveScopes[i].Variables.Add(new Variable(TranslocationMoveParameter.ActualName, moves[i]));
    6060      }
    6161      CurrentScopeParameter.ActualValue.SubScopes.AddRange(moveScopes);
     
    6363    }
    6464
    65     protected abstract ThreeOptMove[] GenerateMoves(Permutation permutation);
     65    protected abstract TranslocationMove[] GenerateMoves(Permutation permutation);
    6666  }
    6767}
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveMaker.cs

    r3231 r3232  
    2929
    3030namespace HeuristicLab.Encodings.PermutationEncoding {
    31   [Item("ThreeOptMoveMaker", "Peforms a 3-opt move on a given permutation and updates the quality.")]
     31  [Item("TranslocationMoveMaker", "Peforms a translocation or insertion move (3-opt) on a given permutation and updates the quality.")]
    3232  [StorableClass]
    33   public class ThreeOptMoveMaker : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, IMoveMaker {
     33  public class TranslocationMoveMaker : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, IMoveMaker {
    3434    public override bool CanChangeName {
    3535      get { return false; }
     
    4141      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
    4242    }
    43     public ILookupParameter<ThreeOptMove> ThreeOptMoveParameter {
    44       get { return (ILookupParameter<ThreeOptMove>)Parameters["ThreeOptMove"]; }
     43    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
     44      get { return (ILookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
    4545    }
    4646    public ILookupParameter<Permutation> PermutationParameter {
     
    4848    }
    4949
    50     public ThreeOptMoveMaker()
     50    public TranslocationMoveMaker()
    5151      : base() {
    5252      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution."));
    53       Parameters.Add(new LookupParameter<ThreeOptMove>("ThreeOptMove", "The move to evaluate."));
     53      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate."));
    5454      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move."));
    5555      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
     
    5757
    5858    public override IOperation Apply() {
    59       ThreeOptMove move = ThreeOptMoveParameter.ActualValue;
     59      TranslocationMove move = TranslocationMoveParameter.ActualValue;
    6060      Permutation permutation = PermutationParameter.ActualValue;
    6161      DoubleValue moveQuality = MoveQualityParameter.ActualValue;
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveTabuMaker.cs

    r3231 r3232  
    2929
    3030namespace HeuristicLab.Encodings.PermutationEncoding {
    31   [Item("ThreeOptTabuMoveMaker", "Declares a given 3-opt move as tabu, by adding its attributes to the tabu list. It also removes the oldest entry in the tabu list when its size is greater than tenure.")]
     31  [Item("TranslocationMoveTabuMaker", "Declares a given translocation or insertion move (3-opt) as tabu, by adding its attributes to the tabu list.")]
    3232  [StorableClass]
    33   public class ThreeOptTabuMoveMaker : TabuMoveMaker, IThreeOptPermutationMoveOperator {
     33  public class TranslocationMoveTabuMaker : TabuMaker, IPermutationTranslocationMoveOperator {
    3434    public override bool CanChangeName {
    3535      get { return false; }
     
    3838      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    3939    }
    40     public ILookupParameter<ThreeOptMove> ThreeOptMoveParameter {
    41       get { return (LookupParameter<ThreeOptMove>)Parameters["ThreeOptMove"]; }
     40    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
     41      get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
    4242    }
    4343
    44     public ThreeOptTabuMoveMaker()
     44    public TranslocationMoveTabuMaker()
    4545      : base() {
    46       Parameters.Add(new LookupParameter<ThreeOptMove>("ThreeOptMove", "The move that was made."));
     46      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move that was made."));
    4747      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
    4848    }
    4949
    5050    protected override IItem GetTabuAttribute() {
    51       ThreeOptMove move = ThreeOptMoveParameter.ActualValue;
     51      TranslocationMove move = TranslocationMoveParameter.ActualValue;
    5252      Permutation permutation = PermutationParameter.ActualValue;
    5353      if (move.Index3 > move.Index1)
    54         return new ThreeOptTabuMoveAttribute(permutation.GetCircular(move.Index1 - 1),
     54        return new TranslocationMoveAttribute(permutation.GetCircular(move.Index1 - 1),
    5555        permutation[move.Index1],
    5656        permutation[move.Index2],
     
    5959        permutation.GetCircular(move.Index3 + move.Index2 - move.Index1 + 1));
    6060      else
    61         return new ThreeOptTabuMoveAttribute(permutation.GetCircular(move.Index1 - 1),
     61        return new TranslocationMoveAttribute(permutation.GetCircular(move.Index1 - 1),
    6262        permutation[move.Index1],
    6363        permutation[move.Index2],
Note: See TracChangeset for help on using the changeset viewer.