Changeset 3232 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveTabuMaker.cs
- Timestamp:
- 03/29/10 18:49:55 (14 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveTabuMaker.cs
r3229 r3232 29 29 30 30 namespace HeuristicLab.Encodings.PermutationEncoding { 31 [Item(" TwoOptTabuMoveMaker", "Declares a given 2-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("InversionMoveTabuMaker", "Declares a given inversion move (2-opt) as tabu, by adding its attributes to the tabu list.")] 32 32 [StorableClass] 33 public class TwoOptTabuMoveMaker : TabuMoveMaker, ITwoOptPermutationMoveOperator {33 public class InversionMoveTabuMaker : TabuMaker, IPermutationInversionMoveOperator { 34 34 public override bool CanChangeName { 35 35 get { return false; } … … 38 38 get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; } 39 39 } 40 public ILookupParameter< TwoOptMove> TwoOptMoveParameter {41 get { return (LookupParameter< TwoOptMove>)Parameters["TwoOptMove"]; }40 public ILookupParameter<InversionMove> InversionMoveParameter { 41 get { return (LookupParameter<InversionMove>)Parameters["InversionMove"]; } 42 42 } 43 43 44 public TwoOptTabuMoveMaker()44 public InversionMoveTabuMaker() 45 45 : base() { 46 Parameters.Add(new LookupParameter< TwoOptMove>("TwoOptMove", "The move that was made."));46 Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move that was made.")); 47 47 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); 48 48 } 49 49 50 50 protected override IItem GetTabuAttribute() { 51 TwoOptMove move = TwoOptMoveParameter.ActualValue;51 InversionMove move = InversionMoveParameter.ActualValue; 52 52 Permutation permutation = PermutationParameter.ActualValue; 53 return new TwoOptTabuMoveAttribute( permutation.GetCircular(move.Index1 - 1),53 return new InversionMoveAttribute( permutation.GetCircular(move.Index1 - 1), 54 54 permutation[move.Index1], 55 55 permutation[move.Index2],
Note: See TracChangeset
for help on using the changeset viewer.