Changeset 3232 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveGenerator.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/ThreeOpt/TranslocationMoveGenerator.cs
r3231 r3232 28 28 29 29 namespace HeuristicLab.Encodings.PermutationEncoding { 30 [Item("T hreeOptMoveGenerator", "Base class for move generators that produce 3-opt moves.")]30 [Item("TranslocationMoveGenerator", "Base class for move generators that produce translocation moves (3-opt).")] 31 31 [StorableClass] 32 public abstract class T hreeOptMoveGenerator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, IMoveGenerator {32 public abstract class TranslocationMoveGenerator : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, IMoveGenerator { 33 33 public override bool CanChangeName { 34 34 get { return false; } … … 37 37 get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; } 38 38 } 39 public ILookupParameter<T hreeOptMove> ThreeOptMoveParameter {40 get { return (LookupParameter<T hreeOptMove>)Parameters["ThreeOptMove"]; }39 public ILookupParameter<TranslocationMove> TranslocationMoveParameter { 40 get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; } 41 41 } 42 42 protected ScopeParameter CurrentScopeParameter { … … 44 44 } 45 45 46 public T hreeOptMoveGenerator()46 public TranslocationMoveGenerator() 47 47 : base() { 48 48 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated.")); 49 Parameters.Add(new LookupParameter<T hreeOptMove>("ThreeOptMove", "The moves that should be generated in subscopes."));49 Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The moves that should be generated in subscopes.")); 50 50 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes.")); 51 51 } … … 53 53 public override IOperation Apply() { 54 54 Permutation p = PermutationParameter.ActualValue; 55 T hreeOptMove[] moves = GenerateMoves(p);55 TranslocationMove[] moves = GenerateMoves(p); 56 56 Scope[] moveScopes = new Scope[moves.Length]; 57 57 for (int i = 0; i < moveScopes.Length; i++) { 58 58 moveScopes[i] = new Scope(i.ToString()); 59 moveScopes[i].Variables.Add(new Variable(T hreeOptMoveParameter.ActualName, moves[i]));59 moveScopes[i].Variables.Add(new Variable(TranslocationMoveParameter.ActualName, moves[i])); 60 60 } 61 61 CurrentScopeParameter.ActualValue.SubScopes.AddRange(moveScopes); … … 63 63 } 64 64 65 protected abstract T hreeOptMove[] GenerateMoves(Permutation permutation);65 protected abstract TranslocationMove[] GenerateMoves(Permutation permutation); 66 66 } 67 67 }
Note: See TracChangeset
for help on using the changeset viewer.