Changeset 3232
- Timestamp:
- 03/29/10 18:49:55 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 added
- 6 deleted
- 9 edited
- 29 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs
r3201 r3232 63 63 get { return (ConstrainedValueParameter<ISingleObjectiveMoveEvaluator>)Parameters["MoveEvaluator"]; } 64 64 } 65 private ConstrainedValueParameter<ITabu MoveEvaluator> TabuMoveEvaluatorParameter {66 get { return (ConstrainedValueParameter<ITabu MoveEvaluator>)Parameters["TabuMoveEvaluator"]; }67 } 68 private ConstrainedValueParameter<ITabuM oveMaker> TabuMoveMakerParameter {69 get { return (ConstrainedValueParameter<ITabuM oveMaker>)Parameters["TabuMoveMaker"]; }65 private ConstrainedValueParameter<ITabuChecker> TabuMoveEvaluatorParameter { 66 get { return (ConstrainedValueParameter<ITabuChecker>)Parameters["TabuMoveEvaluator"]; } 67 } 68 private ConstrainedValueParameter<ITabuMaker> TabuMoveMakerParameter { 69 get { return (ConstrainedValueParameter<ITabuMaker>)Parameters["TabuMoveMaker"]; } 70 70 } 71 71 private ValueParameter<IntValue> TabuTenureParameter { … … 101 101 set { MoveEvaluatorParameter.Value = value; } 102 102 } 103 public ITabu MoveEvaluator TabuMoveEvaluator {103 public ITabuChecker TabuMoveEvaluator { 104 104 get { return TabuMoveEvaluatorParameter.Value; } 105 105 set { TabuMoveEvaluatorParameter.Value = value; } 106 106 } 107 public ITabuM oveMaker TabuMoveMaker {107 public ITabuMaker TabuMoveMaker { 108 108 get { return TabuMoveMakerParameter.Value; } 109 109 set { TabuMoveMakerParameter.Value = value; } … … 137 137 Parameters.Add(new ConstrainedValueParameter<IMoveMaker>("MoveMaker", "The operator used to perform a move.")); 138 138 Parameters.Add(new ConstrainedValueParameter<ISingleObjectiveMoveEvaluator>("MoveEvaluator", "The operator used to evaluate a move.")); 139 Parameters.Add(new ConstrainedValueParameter<ITabu MoveEvaluator>("TabuMoveEvaluator", "The operator to evaluate whether a move is tabu or not."));140 Parameters.Add(new ConstrainedValueParameter<ITabuM oveMaker>("TabuMoveMaker", "The operator used to insert attributes of a move into the tabu list."));139 Parameters.Add(new ConstrainedValueParameter<ITabuChecker>("TabuMoveEvaluator", "The operator to evaluate whether a move is tabu or not.")); 140 Parameters.Add(new ConstrainedValueParameter<ITabuMaker>("TabuMoveMaker", "The operator used to insert attributes of a move into the tabu list.")); 141 141 Parameters.Add(new ValueParameter<IntValue>("TabuTenure", "The length of the tabu list.", new IntValue(10))); 142 142 Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(1000))); … … 193 193 op.MoveQualityParameter.ActualNameChanged += new EventHandler(MoveEvaluator_MoveQualityParameter_ActualNameChanged); 194 194 } 195 foreach (ITabu MoveEvaluator op in Problem.Operators.OfType<ITabuMoveEvaluator>()) {195 foreach (ITabuChecker op in Problem.Operators.OfType<ITabuChecker>()) { 196 196 op.MoveTabuParameter.ActualNameChanged += new EventHandler(TabuMoveEvaluator_MoveTabuParameter_ActualNameChanged); 197 197 } … … 234 234 op.MoveQualityParameter.ActualNameChanged += new EventHandler(MoveEvaluator_MoveQualityParameter_ActualNameChanged); 235 235 } 236 foreach (ITabu MoveEvaluator op in Problem.Operators.OfType<ITabuMoveEvaluator>()) {236 foreach (ITabuChecker op in Problem.Operators.OfType<ITabuChecker>()) { 237 237 op.MoveTabuParameter.ActualNameChanged -= new EventHandler(TabuMoveEvaluator_MoveTabuParameter_ActualNameChanged); 238 238 op.MoveTabuParameter.ActualNameChanged += new EventHandler(TabuMoveEvaluator_MoveTabuParameter_ActualNameChanged); … … 310 310 IMoveMaker oldMoveMaker = MoveMaker; 311 311 ISingleObjectiveMoveEvaluator oldMoveEvaluator = MoveEvaluator; 312 ITabu MoveEvaluator oldTabuMoveEvaluator = TabuMoveEvaluator;313 ITabuM oveMaker oldTabuMoveMaker = TabuMoveMaker;312 ITabuChecker oldTabuMoveEvaluator = TabuMoveEvaluator; 313 ITabuMaker oldTabuMoveMaker = TabuMoveMaker; 314 314 ClearMoveParameters(); 315 315 if (MoveGenerator != null) { … … 325 325 foreach (ISingleObjectiveMoveEvaluator moveEvaluator in operators.OfType<ISingleObjectiveMoveEvaluator>()) 326 326 MoveEvaluatorParameter.ValidValues.Add(moveEvaluator); 327 foreach (ITabu MoveEvaluator tabuMoveEvaluator in operators.OfType<ITabuMoveEvaluator>())327 foreach (ITabuChecker tabuMoveEvaluator in operators.OfType<ITabuChecker>()) 328 328 TabuMoveEvaluatorParameter.ValidValues.Add(tabuMoveEvaluator); 329 foreach (ITabuM oveMaker tabuMoveMaker in operators.OfType<ITabuMoveMaker>())329 foreach (ITabuMaker tabuMoveMaker in operators.OfType<ITabuMaker>()) 330 330 TabuMoveMakerParameter.ValidValues.Add(tabuMoveMaker); 331 331 } … … 339 339 } 340 340 if (oldTabuMoveMaker != null) { 341 ITabuM oveMaker tmm = TabuMoveMakerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTabuMoveMaker.GetType());341 ITabuMaker tmm = TabuMoveMakerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTabuMoveMaker.GetType()); 342 342 if (tmm != null) TabuMoveMaker = tmm; 343 343 } 344 344 if (oldTabuMoveEvaluator != null) { 345 ITabu MoveEvaluator tme = TabuMoveEvaluatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTabuMoveEvaluator.GetType());345 ITabuChecker tme = TabuMoveEvaluatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTabuMoveEvaluator.GetType()); 346 346 if (tme != null) TabuMoveEvaluator = tme; 347 347 } -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/OneBitflipTabuMoveMaker.cs
r3119 r3232 31 31 [Item("OneBitflipTabuMoveMaker", "Declares a given one bitflip 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.")] 32 32 [StorableClass] 33 public class OneBitflipTabuMoveMaker : TabuM oveMaker, IOneBitflipMoveOperator {33 public class OneBitflipTabuMoveMaker : TabuMaker, IOneBitflipMoveOperator { 34 34 public ILookupParameter<BinaryVector> BinaryVectorParameter { 35 35 get { return (ILookupParameter<BinaryVector>)Parameters["BinaryVector"]; } -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/PreventOneBitflipTabuMoveEvaluator.cs
r3117 r3232 31 31 [Item("PreventOneBitflipTabuMoveEvaluator", "Prevents peforming a one bitflip move again.")] 32 32 [StorableClass] 33 public class PreventOneBitflipTabuMoveEvaluator : SingleSuccessorOperator, IOneBitflipMoveOperator, ITabu MoveEvaluator {33 public class PreventOneBitflipTabuMoveEvaluator : SingleSuccessorOperator, IOneBitflipMoveOperator, ITabuChecker { 34 34 public ILookupParameter<OneBitflipMove> OneBitflipMoveParameter { 35 35 get { return (LookupParameter<OneBitflipMove>)Parameters["OneBitflipMove"]; } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj
r3231 r3232 98 98 <Compile Include="Interfaces\IPermutationMoveOperator.cs" /> 99 99 <Compile Include="Interfaces\IPermutationOperator.cs" /> 100 <Compile Include="Interfaces\I ThreeOptPermutationMoveOperator.cs" />101 <Compile Include="Interfaces\I TwoOptPermutationMoveOperator.cs" />100 <Compile Include="Interfaces\IPermutationTranslocationMoveOperator.cs" /> 101 <Compile Include="Interfaces\IPermutationInversionMoveOperator.cs" /> 102 102 <Compile Include="Manipulators\InsertionManipulator.cs" /> 103 103 <Compile Include="Manipulators\InversionManipulator.cs" /> … … 108 108 <Compile Include="Manipulators\TranslocationManipulator.cs" /> 109 109 <Compile Include="Moves\ThreeIndexMove.cs" /> 110 <Compile Include="Moves\ThreeOpt\ Insertion\ExhaustiveInsertionMoveGenerator.cs">110 <Compile Include="Moves\ThreeOpt\ExhaustiveInsertionMoveGenerator.cs"> 111 111 <SubType>Code</SubType> 112 112 </Compile> 113 <Compile Include="Moves\ThreeOpt\PreventDeleteThreeOptTabuMoveEvaluator.cs"> 114 <SubType>Code</SubType> 115 </Compile> 116 <Compile Include="Moves\ThreeOpt\PreventReaddDeleteThreeOptTabuMoveEvaluator.cs"> 117 <SubType>Code</SubType> 118 </Compile> 119 <Compile Include="Moves\ThreeOpt\PreventReaddThreeOptTabuMoveEvaluator.cs"> 120 <SubType>Code</SubType> 121 </Compile> 122 <Compile Include="Moves\ThreeOpt\StochasticThreeOptMultiMoveGenerator.cs"> 123 <SubType>Code</SubType> 124 </Compile> 125 <Compile Include="Moves\ThreeOpt\StochasticThreeOptSingleMoveGenerator.cs"> 126 <SubType>Code</SubType> 127 </Compile> 128 <Compile Include="Moves\ThreeOpt\ThreeOptMove.cs"> 129 <SubType>Code</SubType> 130 </Compile> 131 <Compile Include="Moves\ThreeOpt\ThreeOptMoveGenerator.cs"> 132 <SubType>Code</SubType> 133 </Compile> 134 <Compile Include="Moves\ThreeOpt\ThreeOptMoveMaker.cs"> 135 <SubType>Code</SubType> 136 </Compile> 137 <Compile Include="Moves\ThreeOpt\ThreeOptTabuMoveAttribute.cs"> 138 <SubType>Code</SubType> 139 </Compile> 140 <Compile Include="Moves\ThreeOpt\ThreeOptTabuMoveMaker.cs"> 141 <SubType>Code</SubType> 142 </Compile> 113 <Compile Include="Moves\ThreeOpt\PreventReaddAndRemovalTranslocationMoveTabuChecker.cs" /> 114 <Compile Include="Moves\ThreeOpt\PreventReaddTranslocationMoveTabuChecker.cs" /> 115 <Compile Include="Moves\ThreeOpt\PreventRemovalTranslocationMoveTabuChecker.cs" /> 116 <Compile Include="Moves\ThreeOpt\StochasticTranslocationMultiMoveGenerator.cs" /> 117 <Compile Include="Moves\ThreeOpt\StochasticTranslocationSingleMoveGenerator.cs" /> 118 <Compile Include="Moves\ThreeOpt\TranslocationMove.cs" /> 119 <Compile Include="Moves\ThreeOpt\TranslocationMoveAttribute.cs" /> 120 <Compile Include="Moves\ThreeOpt\TranslocationMoveGenerator.cs" /> 121 <Compile Include="Moves\ThreeOpt\TranslocationMoveMaker.cs" /> 122 <Compile Include="Moves\ThreeOpt\TranslocationMoveTabuMaker.cs" /> 143 123 <Compile Include="Moves\TwoIndexMove.cs"> 144 124 <SubType>Code</SubType> 145 125 </Compile> 146 <Compile Include="Moves\TwoOpt\ExhaustiveTwoOptMoveGenerator.cs"> 147 <SubType>Code</SubType> 148 </Compile> 149 <Compile Include="Moves\TwoOpt\PreventDeleteTwoOptTabuMoveEvaluator.cs"> 150 <SubType>Code</SubType> 151 </Compile> 152 <Compile Include="Moves\TwoOpt\PreventReaddDeleteTwoOptTabuMoveEvaluator.cs"> 153 <SubType>Code</SubType> 154 </Compile> 155 <Compile Include="Moves\TwoOpt\PreventReaddTwoOptTabuMoveEvaluator.cs"> 156 <SubType>Code</SubType> 157 </Compile> 158 <Compile Include="Moves\TwoOpt\StochasticTwoOptMultiMoveGenerator.cs"> 159 <SubType>Code</SubType> 160 </Compile> 161 <Compile Include="Moves\TwoOpt\StochasticTwoOptSingleMoveGenerator.cs"> 162 <SubType>Code</SubType> 163 </Compile> 164 <Compile Include="Moves\TwoOpt\TwoOptMove.cs"> 165 <SubType>Code</SubType> 166 </Compile> 167 <Compile Include="Moves\TwoOpt\TwoOptMoveGenerator.cs"> 168 <SubType>Code</SubType> 169 </Compile> 170 <Compile Include="Moves\TwoOpt\TwoOptMoveMaker.cs"> 171 <SubType>Code</SubType> 172 </Compile> 173 <Compile Include="Moves\TwoOpt\TwoOptTabuMoveAttribute.cs"> 174 <SubType>Code</SubType> 175 </Compile> 176 <Compile Include="Moves\TwoOpt\TwoOptTabuMoveMaker.cs"> 177 <SubType>Code</SubType> 178 </Compile> 126 <Compile Include="Moves\TwoOpt\ExhaustiveInversionMoveGenerator.cs" /> 127 <Compile Include="Moves\TwoOpt\InversionMove.cs" /> 128 <Compile Include="Moves\TwoOpt\InversionMoveAttribute.cs" /> 129 <Compile Include="Moves\TwoOpt\InversionMoveGenerator.cs" /> 130 <Compile Include="Moves\TwoOpt\InversionMoveMaker.cs" /> 131 <Compile Include="Moves\TwoOpt\InversionMoveTabuMaker.cs" /> 132 <Compile Include="Moves\TwoOpt\PreventReaddAndRemovalInversionMoveTabuChecker.cs" /> 133 <Compile Include="Moves\TwoOpt\PreventReaddInversionMoveTabuChecker.cs" /> 134 <Compile Include="Moves\TwoOpt\PreventRemovalInversionMoveTabuChecker.cs" /> 135 <Compile Include="Moves\TwoOpt\StochasticInversionMultiMoveGenerator.cs" /> 136 <Compile Include="Moves\TwoOpt\StochasticInversionSingleMoveGenerator.cs" /> 179 137 <Compile Include="PermutationManipulator.cs" /> 180 138 <Compile Include="PermutationCrossover.cs" /> -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/PreventReaddAndRemovalTranslocationMoveTabuChecker.cs
r3231 r3232 29 29 30 30 namespace 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.")] 32 32 [StorableClass] 33 public class PreventReadd DeleteThreeOptTabuMoveEvaluator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, ITabuMoveEvaluator {33 public class PreventReaddAndRemovalTranslocationMoveTabuChecker : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, ITabuChecker { 34 34 public override bool CanChangeName { 35 35 get { return false; } 36 36 } 37 public ILookupParameter<T hreeOptMove> ThreeOptMoveParameter {38 get { return (LookupParameter<T hreeOptMove>)Parameters["ThreeOptMove"]; }37 public ILookupParameter<TranslocationMove> TranslocationMoveParameter { 38 get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; } 39 39 } 40 40 public ILookupParameter<Permutation> PermutationParameter { … … 51 51 } 52 52 53 public PreventReadd DeleteThreeOptTabuMoveEvaluator()53 public PreventReaddAndRemovalTranslocationMoveTabuChecker() 54 54 : base() { 55 Parameters.Add(new LookupParameter<T hreeOptMove>("ThreeOptMove", "The move to evaluate."));55 Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate.")); 56 56 Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu.")); 57 57 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); … … 62 62 public override IOperation Apply() { 63 63 ItemList<IItem> tabuList = TabuListParameter.ActualValue; 64 T hreeOptMove move = ThreeOptMoveParameter.ActualValue;64 TranslocationMove move = TranslocationMoveParameter.ActualValue; 65 65 Permutation permutation = PermutationParameter.ActualValue; 66 66 int length = permutation.Length; … … 83 83 if (!isTabu) { 84 84 foreach (IItem tabuMove in tabuList) { 85 T hreeOptTabuMoveAttribute attribute = (tabuMove as ThreeOptTabuMoveAttribute);85 TranslocationMoveAttribute attribute = (tabuMove as TranslocationMoveAttribute); 86 86 if (attribute != null) { 87 87 // if previously deleted Edge1Source-Target is readded -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/PreventReaddTranslocationMoveTabuChecker.cs
r3231 r3232 29 29 30 30 namespace HeuristicLab.Encodings.PermutationEncoding { 31 [Item(" ThreeOptPreventEdgeReadding", "Prevents readding of previously deleted edges.")]31 [Item("PreventReaddTranslocationMoveTabuChecker", "Prevents readding of previously deleted edges.")] 32 32 [StorableClass] 33 public class PreventReaddT hreeOptTabuMoveEvaluator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, ITabuMoveEvaluator {33 public class PreventReaddTranslocationMoveTabuChecker : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, ITabuChecker { 34 34 public override bool CanChangeName { 35 35 get { return false; } 36 36 } 37 public ILookupParameter<T hreeOptMove> ThreeOptMoveParameter {38 get { return (LookupParameter<T hreeOptMove>)Parameters["ThreeOptMove"]; }37 public ILookupParameter<TranslocationMove> TranslocationMoveParameter { 38 get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; } 39 39 } 40 40 public ILookupParameter<Permutation> PermutationParameter { … … 51 51 } 52 52 53 public PreventReaddT hreeOptTabuMoveEvaluator()53 public PreventReaddTranslocationMoveTabuChecker() 54 54 : base() { 55 Parameters.Add(new LookupParameter<T hreeOptMove>("ThreeOptMove", "The move to evaluate."));55 Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate.")); 56 56 Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu.")); 57 57 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); … … 62 62 public override IOperation Apply() { 63 63 ItemList<IItem> tabuList = TabuListParameter.ActualValue; 64 T hreeOptMove move = ThreeOptMoveParameter.ActualValue;64 TranslocationMove move = TranslocationMoveParameter.ActualValue; 65 65 Permutation permutation = PermutationParameter.ActualValue; 66 66 int length = permutation.Length; … … 83 83 if (!isTabu) { 84 84 foreach (IItem tabuMove in tabuList) { 85 T hreeOptTabuMoveAttribute attribute = (tabuMove as ThreeOptTabuMoveAttribute);85 TranslocationMoveAttribute attribute = (tabuMove as TranslocationMoveAttribute); 86 86 if (attribute != null) { 87 87 // if previously deleted Edge1Source-Target is readded -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/PreventRemovalTranslocationMoveTabuChecker.cs
r3231 r3232 29 29 30 30 namespace HeuristicLab.Encodings.PermutationEncoding { 31 [Item(" ThreeOptPreventEdgeRemoval", "Prevents deleting of previously added edges.")]31 [Item("PreventRemovalTranslocationMoveTabuChecker", "Prevents deleting of previously added edges.")] 32 32 [StorableClass] 33 public class Prevent DeleteThreeOptTabuMoveEvaluator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, ITabuMoveEvaluator {33 public class PreventRemovalTranslocationMoveTabuChecker : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, ITabuChecker { 34 34 public override bool CanChangeName { 35 35 get { return false; } 36 36 } 37 public ILookupParameter<T hreeOptMove> ThreeOptMoveParameter {38 get { return (LookupParameter<T hreeOptMove>)Parameters["ThreeOptMove"]; }37 public ILookupParameter<TranslocationMove> TranslocationMoveParameter { 38 get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; } 39 39 } 40 40 public ILookupParameter<Permutation> PermutationParameter { … … 51 51 } 52 52 53 public Prevent DeleteThreeOptTabuMoveEvaluator()53 public PreventRemovalTranslocationMoveTabuChecker() 54 54 : base() { 55 Parameters.Add(new LookupParameter<T hreeOptMove>("ThreeOptMove", "The move to evaluate."));55 Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate.")); 56 56 Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu.")); 57 57 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); … … 62 62 public override IOperation Apply() { 63 63 ItemList<IItem> tabuList = TabuListParameter.ActualValue; 64 T hreeOptMove move = ThreeOptMoveParameter.ActualValue;64 TranslocationMove move = TranslocationMoveParameter.ActualValue; 65 65 Permutation permutation = PermutationParameter.ActualValue; 66 66 int length = permutation.Length; … … 83 83 if (!isTabu) { 84 84 foreach (IItem tabuMove in tabuList) { 85 T hreeOptTabuMoveAttribute attribute = (tabuMove as ThreeOptTabuMoveAttribute);85 TranslocationMoveAttribute attribute = (tabuMove as TranslocationMoveAttribute); 86 86 if (attribute != null) { 87 87 // if previously added Edge3Source-Edge1Target is deleted -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationMultiMoveGenerator.cs
r3231 r3232 28 28 29 29 namespace HeuristicLab.Encodings.PermutationEncoding { 30 [Item("StochasticT hreeOptMultiMoveGenerator", "Randomly samples n from all possible 3-opt movesfrom a given permutation.")]30 [Item("StochasticTranslocationMultiMoveGenerator", "Randomly samples n from all possible translocation and insertion moves (3-opt) from a given permutation.")] 31 31 [StorableClass] 32 public class StochasticT hreeOptMultiMoveGenerator : ThreeOptMoveGenerator, IStochasticOperator, IMultiMoveGenerator {32 public class StochasticTranslocationMultiMoveGenerator : TranslocationMoveGenerator, IStochasticOperator, IMultiMoveGenerator { 33 33 public ILookupParameter<IRandom> RandomParameter { 34 34 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } … … 43 43 } 44 44 45 public StochasticT hreeOptMultiMoveGenerator()45 public StochasticTranslocationMultiMoveGenerator() 46 46 : base() { 47 47 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); … … 49 49 } 50 50 51 public static T hreeOptMove[] Apply(Permutation permutation, IRandom random, int sampleSize) {51 public static TranslocationMove[] Apply(Permutation permutation, IRandom random, int sampleSize) { 52 52 int length = permutation.Length; 53 T hreeOptMove[] moves = new ThreeOptMove[sampleSize];53 TranslocationMove[] moves = new TranslocationMove[sampleSize]; 54 54 for (int i = 0; i < sampleSize; i++) { 55 55 moves[i] = StochasticThreeOptSingleMoveGenerator.Apply(permutation, random); … … 58 58 } 59 59 60 protected override T hreeOptMove[] GenerateMoves(Permutation permutation) {60 protected override TranslocationMove[] GenerateMoves(Permutation permutation) { 61 61 IRandom random = RandomParameter.ActualValue; 62 62 return Apply(permutation, random, SampleSizeParameter.ActualValue.Value); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationSingleMoveGenerator.cs
r3231 r3232 28 28 29 29 namespace HeuristicLab.Encodings.PermutationEncoding { 30 [Item("StochasticT hreeOptSingleMoveGenerator", "Randomly samples one from all possible 3-opt movesfrom a given permutation.")]30 [Item("StochasticTranslocationSingleMoveGenerator", "Randomly samples one from all possible translocation and insertion moves (3-opt) from a given permutation.")] 31 31 [StorableClass] 32 public class StochasticThreeOptSingleMoveGenerator : T hreeOptMoveGenerator, IStochasticOperator, ISingleMoveGenerator {32 public class StochasticThreeOptSingleMoveGenerator : TranslocationMoveGenerator, IStochasticOperator, ISingleMoveGenerator { 33 33 public ILookupParameter<IRandom> RandomParameter { 34 34 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } … … 40 40 } 41 41 42 public static T hreeOptMove Apply(Permutation permutation, IRandom random) {42 public static TranslocationMove Apply(Permutation permutation, IRandom random) { 43 43 int length = permutation.Length; 44 44 int index1, index2, index3; … … 51 51 } while (index3 == index1); 52 52 53 return new T hreeOptMove(index1, index2, index3);53 return new TranslocationMove(index1, index2, index3); 54 54 } 55 55 56 protected override T hreeOptMove[] GenerateMoves(Permutation permutation) {56 protected override TranslocationMove[] GenerateMoves(Permutation permutation) { 57 57 IRandom random = RandomParameter.ActualValue; 58 return new T hreeOptMove[] { Apply(permutation, random) };58 return new TranslocationMove[] { Apply(permutation, random) }; 59 59 } 60 60 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMove.cs
r3231 r3232 24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding { 26 [Item("T hreeOptMove", "A move that changes three edges by performing a translocation.")]26 [Item("TranslocationMove", "A move that changes three edges by performing a translocation.")] 27 27 [StorableClass] 28 public class T hreeOptMove : ThreeIndexMove {29 public T hreeOptMove()28 public class TranslocationMove : ThreeIndexMove { 29 public TranslocationMove() 30 30 : base() { 31 31 } 32 32 33 public T hreeOptMove(int index1, int index2, int index3)33 public TranslocationMove(int index1, int index2, int index3) 34 34 : base(index1, index2, index3, null) { 35 35 } 36 36 37 public T hreeOptMove(int index1, int index2, int index3, Permutation permutation)37 public TranslocationMove(int index1, int index2, int index3, Permutation permutation) 38 38 : base(index1, index2, index3, permutation) { 39 39 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveAttribute.cs
r3231 r3232 24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding { 26 [Item("T hreeOptTabuMoveAttribute", "Specifies the tabu attributes for a 3-opt move.")]26 [Item("TranslocationMoveAttribute", "Specifies the tabu attributes for a translocation and insertion move (3-opt).")] 27 27 [StorableClass] 28 public class T hreeOptTabuMoveAttribute : Item {28 public class TranslocationMoveAttribute : Item { 29 29 [Storable] 30 30 public int Edge1Source { get; private set; } … … 41 41 42 42 [StorableConstructor] 43 private T hreeOptTabuMoveAttribute(bool deserializing)43 private TranslocationMoveAttribute(bool deserializing) 44 44 : base() { 45 45 } 46 46 47 public T hreeOptTabuMoveAttribute()47 public TranslocationMoveAttribute() 48 48 : this(-1, -1, -1, -1, -1, -1) { } 49 49 50 public T hreeOptTabuMoveAttribute(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) 51 51 : base() { 52 52 Edge1Source = edge1Source; … … 59 59 60 60 public override IDeepCloneable Clone(Cloner cloner) { 61 T hreeOptTabuMoveAttribute clone = (ThreeOptTabuMoveAttribute)base.Clone(cloner);61 TranslocationMoveAttribute clone = (TranslocationMoveAttribute)base.Clone(cloner); 62 62 clone.Edge1Source = Edge1Source; 63 63 clone.Edge1Target = Edge1Target; -
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 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveMaker.cs
r3231 r3232 29 29 30 30 namespace HeuristicLab.Encodings.PermutationEncoding { 31 [Item("T hreeOptMoveMaker", "Peforms a 3-opt moveon 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.")] 32 32 [StorableClass] 33 public class T hreeOptMoveMaker : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, IMoveMaker {33 public class TranslocationMoveMaker : SingleSuccessorOperator, IPermutationTranslocationMoveOperator, IMoveMaker { 34 34 public override bool CanChangeName { 35 35 get { return false; } … … 41 41 get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; } 42 42 } 43 public ILookupParameter<T hreeOptMove> ThreeOptMoveParameter {44 get { return (ILookupParameter<T hreeOptMove>)Parameters["ThreeOptMove"]; }43 public ILookupParameter<TranslocationMove> TranslocationMoveParameter { 44 get { return (ILookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; } 45 45 } 46 46 public ILookupParameter<Permutation> PermutationParameter { … … 48 48 } 49 49 50 public T hreeOptMoveMaker()50 public TranslocationMoveMaker() 51 51 : base() { 52 52 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution.")); 53 Parameters.Add(new LookupParameter<T hreeOptMove>("ThreeOptMove", "The move to evaluate."));53 Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate.")); 54 54 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move.")); 55 55 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); … … 57 57 58 58 public override IOperation Apply() { 59 T hreeOptMove move = ThreeOptMoveParameter.ActualValue;59 TranslocationMove move = TranslocationMoveParameter.ActualValue; 60 60 Permutation permutation = PermutationParameter.ActualValue; 61 61 DoubleValue moveQuality = MoveQualityParameter.ActualValue; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/TranslocationMoveTabuMaker.cs
r3231 r3232 29 29 30 30 namespace HeuristicLab.Encodings.PermutationEncoding { 31 [Item("T hreeOptTabuMoveMaker", "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.")] 32 32 [StorableClass] 33 public class T hreeOptTabuMoveMaker : TabuMoveMaker, IThreeOptPermutationMoveOperator {33 public class TranslocationMoveTabuMaker : TabuMaker, IPermutationTranslocationMoveOperator { 34 34 public override bool CanChangeName { 35 35 get { return false; } … … 38 38 get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; } 39 39 } 40 public ILookupParameter<T hreeOptMove> ThreeOptMoveParameter {41 get { return (LookupParameter<T hreeOptMove>)Parameters["ThreeOptMove"]; }40 public ILookupParameter<TranslocationMove> TranslocationMoveParameter { 41 get { return (LookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; } 42 42 } 43 43 44 public T hreeOptTabuMoveMaker()44 public TranslocationMoveTabuMaker() 45 45 : base() { 46 Parameters.Add(new LookupParameter<T hreeOptMove>("ThreeOptMove", "The move that was made."));46 Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "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 T hreeOptMove move = ThreeOptMoveParameter.ActualValue;51 TranslocationMove move = TranslocationMoveParameter.ActualValue; 52 52 Permutation permutation = PermutationParameter.ActualValue; 53 53 if (move.Index3 > move.Index1) 54 return new T hreeOptTabuMoveAttribute(permutation.GetCircular(move.Index1 - 1),54 return new TranslocationMoveAttribute(permutation.GetCircular(move.Index1 - 1), 55 55 permutation[move.Index1], 56 56 permutation[move.Index2], … … 59 59 permutation.GetCircular(move.Index3 + move.Index2 - move.Index1 + 1)); 60 60 else 61 return new T hreeOptTabuMoveAttribute(permutation.GetCircular(move.Index1 - 1),61 return new TranslocationMoveAttribute(permutation.GetCircular(move.Index1 - 1), 62 62 permutation[move.Index1], 63 63 permutation[move.Index2], -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/ExhaustiveInversionMoveGenerator.cs
r3229 r3232 26 26 27 27 namespace HeuristicLab.Encodings.PermutationEncoding { 28 [Item("Exhaustive TwoOptMoveGenerator", "Generates all possible 2-opt moves (inversion) from a given permutation.")]28 [Item("ExhaustiveInversionMoveGenerator", "Generates all possible inversion moves (2-opt) from a given permutation.")] 29 29 [StorableClass] 30 public class Exhaustive TwoOptMoveGenerator : TwoOptMoveGenerator, IExhaustiveMoveGenerator {31 public static TwoOptMove[] Apply(Permutation permutation) {30 public class ExhaustiveInversionMoveGenerator : InversionMoveGenerator, IExhaustiveMoveGenerator { 31 public static InversionMove[] Apply(Permutation permutation) { 32 32 int length = permutation.Length; 33 33 int totalMoves = (length) * (length - 1) / 2; // - 3; 34 TwoOptMove[] moves = new TwoOptMove[totalMoves];34 InversionMove[] moves = new InversionMove[totalMoves]; 35 35 int count = 0; 36 36 for (int i = 0; i < length - 1; i++) … … 39 39 /*if (i == 0 && j >= length - 2) continue; 40 40 else if (i == 1 && j >= length - 1) continue;*/ 41 moves[count++] = new TwoOptMove(i, j);41 moves[count++] = new InversionMove(i, j); 42 42 } 43 43 return moves; 44 44 } 45 45 46 protected override TwoOptMove[] GenerateMoves(Permutation permutation) {46 protected override InversionMove[] GenerateMoves(Permutation permutation) { 47 47 return Apply(permutation); 48 48 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMove.cs
r3229 r3232 24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding { 26 [Item(" TwoOptMove", "Item that describes a 2-Opt move.")]26 [Item("InversionMove", "Item that describes an inversion move (2-opt).")] 27 27 [StorableClass] 28 public class TwoOptMove : TwoIndexMove {29 public TwoOptMove()28 public class InversionMove : TwoIndexMove { 29 public InversionMove() 30 30 : base() { 31 31 } 32 32 33 public TwoOptMove(int index1, int index2)33 public InversionMove(int index1, int index2) 34 34 : base(index1, index2, null) { 35 35 } 36 36 37 public TwoOptMove(int index1, int index2, Permutation permutation)37 public InversionMove(int index1, int index2, Permutation permutation) 38 38 : base(index1, index2, permutation) { 39 39 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveAttribute.cs
r3229 r3232 24 24 25 25 namespace HeuristicLab.Encodings.PermutationEncoding { 26 [Item(" TwoOptTabuMoveAttribute", "Specifies the tabu attributes for a 2-opt move.")]26 [Item("InversionMoveAttribute", "Specifies the tabu attributes for an inversion move (2-opt).")] 27 27 [StorableClass] 28 public class TwoOptTabuMoveAttribute : Item {28 public class InversionMoveAttribute : Item { 29 29 [Storable] 30 30 public int Edge1Source { get; private set; } … … 37 37 38 38 [StorableConstructor] 39 private TwoOptTabuMoveAttribute(bool deserializing)39 private InversionMoveAttribute(bool deserializing) 40 40 : base() { 41 41 } 42 42 43 public TwoOptTabuMoveAttribute()43 public InversionMoveAttribute() 44 44 : this(-1, -1, -1, -1) { } 45 45 46 public TwoOptTabuMoveAttribute(int edge1Source, int edge1Target, int edge2Source, int edge2Target)46 public InversionMoveAttribute(int edge1Source, int edge1Target, int edge2Source, int edge2Target) 47 47 : base() { 48 48 Edge1Source = edge1Source; … … 53 53 54 54 public override IDeepCloneable Clone(Cloner cloner) { 55 TwoOptTabuMoveAttribute clone = (TwoOptTabuMoveAttribute)base.Clone(cloner);55 InversionMoveAttribute clone = (InversionMoveAttribute)base.Clone(cloner); 56 56 clone.Edge1Source = Edge1Source; 57 57 clone.Edge1Target = Edge1Target; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveGenerator.cs
r3229 r3232 28 28 29 29 namespace HeuristicLab.Encodings.PermutationEncoding { 30 [Item(" TwoOptMoveGenerator", "Base class for all 2-optmove generators.")]30 [Item("InversionMoveGenerator", "Base class for all inversion (2-opt) move generators.")] 31 31 [StorableClass] 32 public abstract class TwoOptMoveGenerator : SingleSuccessorOperator, ITwoOptPermutationMoveOperator, IMoveGenerator {32 public abstract class InversionMoveGenerator : SingleSuccessorOperator, IPermutationInversionMoveOperator, 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< TwoOptMove> TwoOptMoveParameter {40 get { return (LookupParameter< TwoOptMove>)Parameters["TwoOptMove"]; }39 public ILookupParameter<InversionMove> InversionMoveParameter { 40 get { return (LookupParameter<InversionMove>)Parameters["InversionMove"]; } 41 41 } 42 42 protected ScopeParameter CurrentScopeParameter { … … 44 44 } 45 45 46 public TwoOptMoveGenerator()46 public InversionMoveGenerator() 47 47 : base() { 48 48 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated.")); 49 Parameters.Add(new LookupParameter< TwoOptMove>("TwoOptMove", "The moves that should be generated in subscopes."));49 Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "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 TwoOptMove[] moves = GenerateMoves(p);55 InversionMove[] 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( TwoOptMoveParameter.ActualName, moves[i]));59 moveScopes[i].Variables.Add(new Variable(InversionMoveParameter.ActualName, moves[i])); 60 60 } 61 61 CurrentScopeParameter.ActualValue.SubScopes.AddRange(moveScopes); … … 63 63 } 64 64 65 protected abstract TwoOptMove[] GenerateMoves(Permutation permutation);65 protected abstract InversionMove[] GenerateMoves(Permutation permutation); 66 66 } 67 67 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/InversionMoveMaker.cs
r3229 r3232 29 29 30 30 namespace HeuristicLab.Encodings.PermutationEncoding { 31 [Item(" TwoOptMoveMaker", "Peforms a 2-opt moveon a given permutation and updates the quality.")]31 [Item("InversionMoveMaker", "Peforms an inversion move (2-opt) on a given permutation and updates the quality.")] 32 32 [StorableClass] 33 public class TwoOptMoveMaker : SingleSuccessorOperator, ITwoOptPermutationMoveOperator, IMoveMaker {33 public class InversionMoveMaker : SingleSuccessorOperator, IPermutationInversionMoveOperator, IMoveMaker { 34 34 public override bool CanChangeName { 35 35 get { return false; } … … 41 41 get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; } 42 42 } 43 public ILookupParameter< TwoOptMove> TwoOptMoveParameter {44 get { return (ILookupParameter< TwoOptMove>)Parameters["TwoOptMove"]; }43 public ILookupParameter<InversionMove> InversionMoveParameter { 44 get { return (ILookupParameter<InversionMove>)Parameters["InversionMove"]; } 45 45 } 46 46 public ILookupParameter<Permutation> PermutationParameter { … … 48 48 } 49 49 50 public TwoOptMoveMaker()50 public InversionMoveMaker() 51 51 : base() { 52 52 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution.")); 53 Parameters.Add(new LookupParameter< TwoOptMove>("TwoOptMove", "The move to evaluate."));53 Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate.")); 54 54 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move.")); 55 55 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); … … 57 57 58 58 public override IOperation Apply() { 59 TwoOptMove move = TwoOptMoveParameter.ActualValue;59 InversionMove move = InversionMoveParameter.ActualValue; 60 60 Permutation permutation = PermutationParameter.ActualValue; 61 61 DoubleValue moveQuality = MoveQualityParameter.ActualValue; -
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], -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/PreventReaddAndRemovalInversionMoveTabuChecker.cs
r3229 r3232 29 29 30 30 namespace HeuristicLab.Encodings.PermutationEncoding { 31 [Item(" TwoOptPreventEdgeRemovalAndReadding", "Prevents readding of previously deleted edges as well as deleting previously added edges.")]31 [Item("PreventReaddAndRemovalInversionMoveTabuChecker", "Prevents readding of previously deleted edges as well as deleting previously added edges.")] 32 32 [StorableClass] 33 public class PreventReadd DeleteTwoOptTabuMoveEvaluator : SingleSuccessorOperator, ITwoOptPermutationMoveOperator, ITabuMoveEvaluator {33 public class PreventReaddAndRemovalInversionMoveTabuChecker : SingleSuccessorOperator, IPermutationInversionMoveOperator, ITabuChecker { 34 34 public override bool CanChangeName { 35 35 get { return false; } 36 36 } 37 public ILookupParameter< TwoOptMove> TwoOptMoveParameter {38 get { return (LookupParameter< TwoOptMove>)Parameters["TwoOptMove"]; }37 public ILookupParameter<InversionMove> InversionMoveParameter { 38 get { return (LookupParameter<InversionMove>)Parameters["InversionMove"]; } 39 39 } 40 40 public ILookupParameter<Permutation> PermutationParameter { … … 51 51 } 52 52 53 public PreventReadd DeleteTwoOptTabuMoveEvaluator()53 public PreventReaddAndRemovalInversionMoveTabuChecker() 54 54 : base() { 55 Parameters.Add(new LookupParameter< TwoOptMove>("TwoOptMove", "The move to evaluate."));55 Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate.")); 56 56 Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu.")); 57 57 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); … … 62 62 public override IOperation Apply() { 63 63 ItemList<IItem> tabuList = TabuListParameter.ActualValue; 64 TwoOptMove move = TwoOptMoveParameter.ActualValue;64 InversionMove move = InversionMoveParameter.ActualValue; 65 65 Permutation permutation = PermutationParameter.ActualValue; 66 66 int length = permutation.Length; … … 72 72 if (!isTabu) { 73 73 foreach (IItem tabuMove in tabuList) { 74 TwoOptTabuMoveAttribute attribute = (tabuMove as TwoOptTabuMoveAttribute);74 InversionMoveAttribute attribute = (tabuMove as InversionMoveAttribute); 75 75 if (attribute != null) { 76 76 // if previously deleted Edge1Source-Target is readded -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/PreventReaddInversionMoveTabuChecker.cs
r3229 r3232 29 29 30 30 namespace HeuristicLab.Encodings.PermutationEncoding { 31 [Item(" TwoOptPreventEdgeReadding", "Prevents readding of previously deleted edges, but allows deleting previously added edges.")]31 [Item("PreventReaddInversionMoveTabuChecker", "Prevents readding of previously deleted edges, but allows deleting previously added edges.")] 32 32 [StorableClass] 33 public class PreventReadd TwoOptTabuMoveEvaluator : SingleSuccessorOperator, ITwoOptPermutationMoveOperator, ITabuMoveEvaluator {33 public class PreventReaddInversionMoveTabuChecker : SingleSuccessorOperator, IPermutationInversionMoveOperator, ITabuChecker { 34 34 public override bool CanChangeName { 35 35 get { return false; } 36 36 } 37 public ILookupParameter< TwoOptMove> TwoOptMoveParameter {38 get { return (LookupParameter< TwoOptMove>)Parameters["TwoOptMove"]; }37 public ILookupParameter<InversionMove> InversionMoveParameter { 38 get { return (LookupParameter<InversionMove>)Parameters["InversionMove"]; } 39 39 } 40 40 public ILookupParameter<Permutation> PermutationParameter { … … 51 51 } 52 52 53 public PreventReadd TwoOptTabuMoveEvaluator()53 public PreventReaddInversionMoveTabuChecker() 54 54 : base() { 55 Parameters.Add(new LookupParameter< TwoOptMove>("TwoOptMove", "The move to evaluate."));55 Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate.")); 56 56 Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu.")); 57 57 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); … … 62 62 public override IOperation Apply() { 63 63 ItemList<IItem> tabuList = TabuListParameter.ActualValue; 64 TwoOptMove move = TwoOptMoveParameter.ActualValue;64 InversionMove move = InversionMoveParameter.ActualValue; 65 65 Permutation permutation = PermutationParameter.ActualValue; 66 66 int length = permutation.Length; … … 72 72 if (!isTabu) { 73 73 foreach (IItem tabuMove in tabuList) { 74 TwoOptTabuMoveAttribute attribute = (tabuMove as TwoOptTabuMoveAttribute);74 InversionMoveAttribute attribute = (tabuMove as InversionMoveAttribute); 75 75 if (attribute != null) { 76 76 // if previously deleted Edge1Source-Target is readded -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/PreventRemovalInversionMoveTabuChecker.cs
r3229 r3232 29 29 30 30 namespace HeuristicLab.Encodings.PermutationEncoding { 31 [Item(" TwoOptPreventEdgeRemoval", "Prevents deleting of previously added edges.")]31 [Item("PreventRemovalInversionMoveTabuChecker", "Prevents deleting of previously added edges.")] 32 32 [StorableClass] 33 public class Prevent DeleteTwoOptTabuMoveEvaluator : SingleSuccessorOperator, ITwoOptPermutationMoveOperator, ITabuMoveEvaluator {33 public class PreventRemovalInversionMoveTabuChecker : SingleSuccessorOperator, IPermutationInversionMoveOperator, ITabuChecker { 34 34 public override bool CanChangeName { 35 35 get { return false; } 36 36 } 37 public ILookupParameter< TwoOptMove> TwoOptMoveParameter {38 get { return (LookupParameter< TwoOptMove>)Parameters["TwoOptMove"]; }37 public ILookupParameter<InversionMove> InversionMoveParameter { 38 get { return (LookupParameter<InversionMove>)Parameters["InversionMove"]; } 39 39 } 40 40 public ILookupParameter<Permutation> PermutationParameter { … … 51 51 } 52 52 53 public Prevent DeleteTwoOptTabuMoveEvaluator()53 public PreventRemovalInversionMoveTabuChecker() 54 54 : base() { 55 Parameters.Add(new LookupParameter< TwoOptMove>("TwoOptMove", "The move to evaluate."));55 Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate.")); 56 56 Parameters.Add(new LookupParameter<BoolValue>("MoveTabu", "The variable to store if a move was tabu.")); 57 57 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); … … 62 62 public override IOperation Apply() { 63 63 ItemList<IItem> tabuList = TabuListParameter.ActualValue; 64 TwoOptMove move = TwoOptMoveParameter.ActualValue;64 InversionMove move = InversionMoveParameter.ActualValue; 65 65 Permutation permutation = PermutationParameter.ActualValue; 66 66 int length = permutation.Length; … … 72 72 if (!isTabu) { 73 73 foreach (IItem tabuMove in tabuList) { 74 TwoOptTabuMoveAttribute attribute = (tabuMove as TwoOptTabuMoveAttribute);74 InversionMoveAttribute attribute = (tabuMove as InversionMoveAttribute); 75 75 if (attribute != null) { 76 76 // if previously added Edge1Source-Edge2Source is deleted -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionMultiMoveGenerator.cs
r3229 r3232 28 28 29 29 namespace HeuristicLab.Encodings.PermutationEncoding { 30 [Item("Stochastic TwoOptMultiMoveGenerator", "Randomly samples n from all possible 2-opt moves (inversion) from a given permutation.")]30 [Item("StochasticInversionMultiMoveGenerator", "Randomly samples n from all possible inversion moves (2-opt) from a given permutation.")] 31 31 [StorableClass] 32 public class Stochastic TwoOptMultiMoveGenerator : TwoOptMoveGenerator, IMultiMoveGenerator, IStochasticOperator {32 public class StochasticInversionMultiMoveGenerator : InversionMoveGenerator, IMultiMoveGenerator, IStochasticOperator { 33 33 public ILookupParameter<IRandom> RandomParameter { 34 34 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } … … 43 43 } 44 44 45 public Stochastic TwoOptMultiMoveGenerator()45 public StochasticInversionMultiMoveGenerator() 46 46 : base() { 47 47 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); … … 49 49 } 50 50 51 public static TwoOptMove[] Apply(Permutation permutation, IRandom random, int sampleSize) {51 public static InversionMove[] Apply(Permutation permutation, IRandom random, int sampleSize) { 52 52 int length = permutation.Length; 53 TwoOptMove[] moves = new TwoOptMove[sampleSize];53 InversionMove[] moves = new InversionMove[sampleSize]; 54 54 for (int i = 0; i < sampleSize; i++) { 55 moves[i] = Stochastic TwoOptSingleMoveGenerator.Apply(permutation, random);55 moves[i] = StochasticInversionSingleMoveGenerator.Apply(permutation, random); 56 56 } 57 57 return moves; 58 58 } 59 59 60 protected override TwoOptMove[] GenerateMoves(Permutation permutation) {60 protected override InversionMove[] GenerateMoves(Permutation permutation) { 61 61 IRandom random = RandomParameter.ActualValue; 62 62 return Apply(permutation, random, SampleSizeParameter.ActualValue.Value); -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionSingleMoveGenerator.cs
r3229 r3232 28 28 29 29 namespace HeuristicLab.Encodings.PermutationEncoding { 30 [Item("Stochastic TwoOptSingleMoveGenerator", "Randomly samples a single from all possible 2-opt moves (inversion) from a given permutation.")]30 [Item("StochasticInversionSingleMoveGenerator", "Randomly samples a single from all possible inversion moves (2-opt) from a given permutation.")] 31 31 [StorableClass] 32 public class Stochastic TwoOptSingleMoveGenerator : TwoOptMoveGenerator, IStochasticOperator, ISingleMoveGenerator {32 public class StochasticInversionSingleMoveGenerator : InversionMoveGenerator, IStochasticOperator, ISingleMoveGenerator { 33 33 public ILookupParameter<IRandom> RandomParameter { 34 34 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 35 35 } 36 36 37 public Stochastic TwoOptSingleMoveGenerator()37 public StochasticInversionSingleMoveGenerator() 38 38 : base() { 39 39 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); 40 40 } 41 41 42 public static TwoOptMove Apply(Permutation permutation, IRandom random) {42 public static InversionMove Apply(Permutation permutation, IRandom random) { 43 43 int length = permutation.Length; 44 44 int index1 = random.Next(length - 1); 45 45 int index2 = random.Next(index1 + 1, length); 46 return new TwoOptMove(index1, index2);;46 return new InversionMove(index1, index2);; 47 47 } 48 48 49 protected override TwoOptMove[] GenerateMoves(Permutation permutation) {49 protected override InversionMove[] GenerateMoves(Permutation permutation) { 50 50 IRandom random = RandomParameter.ActualValue; 51 return new TwoOptMove[] { Apply(permutation, random) };51 return new InversionMove[] { Apply(permutation, random) }; 52 52 } 53 53 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveTabuMoveEvaluator.cs
r3192 r3232 31 31 [Item("PreventFallBackToSkippedPositions", "Prevents falling back into ranges that have been moved over before.")] 32 32 [StorableClass] 33 public class PreventFallBackToSkippedPositions : SingleSuccessorOperator, IAdditiveRealVectorMoveOperator, ITabu MoveEvaluator {33 public class PreventFallBackToSkippedPositions : SingleSuccessorOperator, IAdditiveRealVectorMoveOperator, ITabuChecker { 34 34 public ILookupParameter<AdditiveMove> AdditiveMoveParameter { 35 35 get { return (LookupParameter<AdditiveMove>)Parameters["AdditiveMove"]; } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveTabuMoveMaker.cs
r3192 r3232 31 31 [Item("AdditiveTabuMoveMaker", "Sets the move tabu.")] 32 32 [StorableClass] 33 public class AdditiveTabuMoveMaker : TabuM oveMaker, IAdditiveRealVectorMoveOperator {33 public class AdditiveTabuMoveMaker : TabuMaker, IAdditiveRealVectorMoveOperator { 34 34 public ILookupParameter<AdditiveMove> AdditiveMoveParameter { 35 35 get { return (ILookupParameter<AdditiveMove>)Parameters["AdditiveMove"]; } -
trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r3226 r3232 115 115 <Compile Include="Interfaces\ISolutionCreator.cs" /> 116 116 <Compile Include="Interfaces\IStochasticOperator.cs" /> 117 <Compile Include="Interfaces\ITabu MoveEvaluator.cs" />118 <Compile Include="Interfaces\ITabuM oveMaker.cs" />117 <Compile Include="Interfaces\ITabuChecker.cs" /> 118 <Compile Include="Interfaces\ITabuMaker.cs" /> 119 119 <Compile Include="Result.cs" /> 120 <Compile Include="TabuM oveMaker.cs" />120 <Compile Include="TabuMaker.cs" /> 121 121 <Compile Include="UserDefinedAlgorithm.cs" /> 122 122 <Compile Include="EngineAlgorithm.cs" /> -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/HeuristicLab.Problems.TravelingSalesman-3.3.csproj
r3209 r3232 87 87 <Compile Include="Evaluators\TSPGeoPathEvaluator.cs" /> 88 88 <Compile Include="HeuristicLabProblemsTravelingSalesmanPlugin.cs" /> 89 <Compile Include="MoveEvaluators\ThreeOpt\TSPThreeOptRoundedEuclideanPathMoveEvaluator.cs" /> 90 <Compile Include="MoveEvaluators\ThreeOpt\TSPThreeOptEuclideanPathMoveEvaluator.cs" /> 91 <Compile Include="MoveEvaluators\ThreeOpt\TSPThreeOptGeoPathMoveEvaluator.cs" /> 92 <Compile Include="MoveEvaluators\TwoOpt\TSPTwoOptEuclideanPathMoveEvaluator.cs" /> 93 <Compile Include="MoveEvaluators\TwoOpt\TSPTwoOptGeoPathMoveEvaluator.cs" /> 94 <Compile Include="MoveEvaluators\TwoOpt\TSPTwoOptPathMoveEvaluator.cs" /> 95 <Compile Include="MoveEvaluators\TwoOpt\TSPTwoOptRoundedEuclideanPathMoveEvaluator.cs" /> 89 <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMoveEuclideanPathEvaluator.cs" /> 90 <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMoveGeoPathEvaluator.cs" /> 91 <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMovePathEvaluator.cs" /> 92 <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMoveRoundedEuclideanPathEvaluator.cs" /> 93 <Compile Include="MoveEvaluators\TwoOpt\TSPInversionMoveEuclideanPathEvaluator.cs" /> 94 <Compile Include="MoveEvaluators\TwoOpt\TSPInversionMoveGeoPathEvaluator.cs" /> 95 <Compile Include="MoveEvaluators\TwoOpt\TSPInversionMovePathEvaluator.cs" /> 96 <Compile Include="MoveEvaluators\TwoOpt\TSPInversionMoveRoundedEuclideanPathEvaluator.cs" /> 96 97 <Compile Include="TravelingSalesmanProblem.cs" /> 97 98 <Compile Include="TSPLIBTourParser.cs" /> … … 109 110 <Compile Include="Interfaces\ITSPPathEvaluator.cs" /> 110 111 <Compile Include="Interfaces\ITSPPathMoveEvaluator.cs" /> 111 <Compile Include="MoveEvaluators\ThreeOpt\TSPThreeOptPathMoveEvaluator.cs" />112 112 <Compile Include="MoveEvaluators\TSPPathMoveEvaluator.cs" /> 113 113 <Compile Include="MoveEvaluators\TSPMoveEvaluator.cs" /> -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveEuclideanPathEvaluator.cs
r3229 r3232 26 26 namespace HeuristicLab.Problems.TravelingSalesman { 27 27 /// <summary> 28 /// An operator to evaluate 3-opt moves.28 /// An operator to evaluate translocation or insertion moves (3-opt). 29 29 /// </summary> 30 [Item("TSPT hreeOptEuclideanPathMoveEvaluator", "Operator for evaluating a 3-opt movebased on euclidean distances.")]30 [Item("TSPTranslocationMoveEuclideanPathEvaluator", "Operator for evaluating a translocation or insertion move (3-opt) based on euclidean distances.")] 31 31 [StorableClass] 32 public class TSPT hreeOptEuclideanPathMoveEvaluator : TSPThreeOptPathMoveEvaluator {32 public class TSPTranslocationMoveEuclideanPathEvaluator : TSPTranslocationMovePathEvaluator { 33 33 public override Type EvaluatorType { 34 34 get { return typeof(TSPEuclideanPathEvaluator); } -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveGeoPathEvaluator.cs
r3229 r3232 26 26 namespace HeuristicLab.Problems.TravelingSalesman { 27 27 /// <summary> 28 /// An operator to evaluate 3-opt moves.28 /// An operator to evaluate translocation or insertion moves (3-opt). 29 29 /// </summary> 30 [Item("TSPT hreeOptGeoPathMoveEvaluator", "Operator for evaluating a 3-opt movebased on geo (world) distances.")]30 [Item("TSPTranslocationMoveGeoPathEvaluator", "Operator for evaluating a translocation or insertion move (3-opt) based on geo (world) distances.")] 31 31 [StorableClass] 32 public class TSPT hreeOptGeoPathMoveEvaluator : TSPThreeOptPathMoveEvaluator {32 public class TSPTranslocationMoveGeoPathEvaluator : TSPTranslocationMovePathEvaluator { 33 33 public override Type EvaluatorType { 34 34 get { return typeof(TSPGeoPathEvaluator); } -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMovePathEvaluator.cs
r3229 r3232 30 30 namespace HeuristicLab.Problems.TravelingSalesman { 31 31 /// <summary> 32 /// An operator to evaluate 3-opt moves.32 /// An operator to evaluate a translocation or insertion move. 33 33 /// </summary> 34 [Item("TSPT hreeOptPathMoveEvaluator", "Evaluates a 3-opt moveby summing up the length of all added edges and subtracting the length of all deleted edges.")]34 [Item("TSPTranslocationMovePathEvaluator", "Evaluates a translocation or insertion move (3-opt) by summing up the length of all added edges and subtracting the length of all deleted edges.")] 35 35 [StorableClass] 36 public abstract class TSPT hreeOptPathMoveEvaluator : TSPPathMoveEvaluator, IThreeOptPermutationMoveOperator {37 public ILookupParameter<T hreeOptMove> ThreeOptMoveParameter {38 get { return (ILookupParameter<T hreeOptMove>)Parameters["ThreeOptMove"]; }36 public abstract class TSPTranslocationMovePathEvaluator : TSPPathMoveEvaluator, IPermutationTranslocationMoveOperator { 37 public ILookupParameter<TranslocationMove> TranslocationMoveParameter { 38 get { return (ILookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; } 39 39 } 40 40 41 public TSPT hreeOptPathMoveEvaluator()41 public TSPTranslocationMovePathEvaluator() 42 42 : base() { 43 Parameters.Add(new LookupParameter<T hreeOptMove>("ThreeOptMove", "The move to evaluate."));43 Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate.")); 44 44 } 45 45 46 46 protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates) { 47 T hreeOptMove move = ThreeOptMoveParameter.ActualValue;47 TranslocationMove move = TranslocationMoveParameter.ActualValue; 48 48 int edge1source = permutation.GetCircular(move.Index1 - 1); 49 49 int edge1target = permutation[move.Index1]; … … 81 81 82 82 protected override double EvaluateByDistanceMatrix(Permutation permutation, DoubleMatrix distanceMatrix) { 83 T hreeOptMove move = ThreeOptMoveParameter.ActualValue;83 TranslocationMove move = TranslocationMoveParameter.ActualValue; 84 84 int edge1source = permutation.GetCircular(move.Index1 - 1); 85 85 int edge1target = permutation[move.Index1]; -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveRoundedEuclideanPathEvaluator.cs
r3229 r3232 26 26 namespace HeuristicLab.Problems.TravelingSalesman { 27 27 /// <summary> 28 /// An operator to evaluate 3-opt moves.28 /// An operator to evaluate translocation or insertion moves (3-opt). 29 29 /// </summary> 30 [Item("TSPT hreeOptRoundedEuclideanPathMoveEvaluator", "Operator for evaluating a 3-opt movebased on rounded euclidean distances.")]30 [Item("TSPTranslocationMoveRoundedEuclideanPathEvaluator", "Operator for evaluating a translocation or insertion move (3-opt) based on rounded euclidean distances.")] 31 31 [StorableClass] 32 public class TSPT hreeOptRoundedEuclideanPathMoveEvaluator : TSPThreeOptPathMoveEvaluator {32 public class TSPTranslocationMoveRoundedEuclideanPathEvaluator : TSPTranslocationMovePathEvaluator { 33 33 public override Type EvaluatorType { 34 34 get { return typeof(TSPRoundedEuclideanPathEvaluator); } -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveEuclideanPathEvaluator.cs
r3229 r3232 28 28 /// An operator to evaluate 2-opt moves. 29 29 /// </summary> 30 [Item("TSP TwoOptEuclideanPathMoveEvaluator", "Operator for evaluating a 2-opt movebased on euclidean distances.")]30 [Item("TSPInversionMoveEuclideanPathEvaluator", "Operator for evaluating an inversion move (2-opt) based on euclidean distances.")] 31 31 [StorableClass] 32 public class TSP TwoOptEuclideanPathMoveEvaluator : TSPTwoOptPathMoveEvaluator {32 public class TSPInversionMoveEuclideanPathEvaluator : TSPInversionMovePathEvaluator { 33 33 public override Type EvaluatorType { 34 34 get { return typeof(TSPEuclideanPathEvaluator); } -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveGeoPathEvaluator.cs
r3229 r3232 26 26 namespace HeuristicLab.Problems.TravelingSalesman { 27 27 /// <summary> 28 /// An operator to evaluate 2-opt moves.28 /// An operator to evaluate inversion moves (2-opt). 29 29 /// </summary> 30 [Item("TSP TwoOptGeoPathMoveEvaluator", "Operator for evaluating a 2-opt movebased on geo (world) distances.")]30 [Item("TSPInversionMoveGeoPathEvaluator", "Operator for evaluating an inversion move (2-opt) based on geo (world) distances.")] 31 31 [StorableClass] 32 public class TSP TwoOptGeoPathMoveEvaluator : TSPTwoOptPathMoveEvaluator {32 public class TSPInversionMoveGeoPathEvaluator : TSPInversionMovePathEvaluator { 33 33 public override Type EvaluatorType { 34 34 get { return typeof(TSPGeoPathEvaluator); } -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMovePathEvaluator.cs
r3229 r3232 30 30 namespace HeuristicLab.Problems.TravelingSalesman { 31 31 /// <summary> 32 /// An operator to evaluate 2-opt moves.32 /// An operator to evaluate inversion moves (2-opt). 33 33 /// </summary> 34 [Item("TSP TwoOptPathMoveEvaluator", "Evaluates a 2-opt moveby summing up the length of all added edges and subtracting the length of all deleted edges.")]34 [Item("TSPInversionMovePathEvaluator", "Evaluates an inversion move (2-opt) by summing up the length of all added edges and subtracting the length of all deleted edges.")] 35 35 [StorableClass] 36 public abstract class TSP TwoOptPathMoveEvaluator : TSPPathMoveEvaluator, ITwoOptPermutationMoveOperator {37 public ILookupParameter< TwoOptMove> TwoOptMoveParameter {38 get { return (ILookupParameter< TwoOptMove>)Parameters["TwoOptMove"]; }36 public abstract class TSPInversionMovePathEvaluator : TSPPathMoveEvaluator, IPermutationInversionMoveOperator { 37 public ILookupParameter<InversionMove> InversionMoveParameter { 38 get { return (ILookupParameter<InversionMove>)Parameters["InversionMove"]; } 39 39 } 40 40 41 public TSP TwoOptPathMoveEvaluator()41 public TSPInversionMovePathEvaluator() 42 42 : base() { 43 Parameters.Add(new LookupParameter< TwoOptMove>("TwoOptMove", "The move to evaluate."));43 Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate.")); 44 44 } 45 45 46 46 protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates) { 47 TwoOptMove move = TwoOptMoveParameter.ActualValue;47 InversionMove move = InversionMoveParameter.ActualValue; 48 48 int edge1source = permutation.GetCircular(move.Index1 - 1); 49 49 int edge1target = permutation[move.Index1]; … … 66 66 67 67 protected override double EvaluateByDistanceMatrix(Permutation permutation, DoubleMatrix distanceMatrix) { 68 TwoOptMove move = TwoOptMoveParameter.ActualValue;68 InversionMove move = InversionMoveParameter.ActualValue; 69 69 int edge1source = permutation.GetCircular(move.Index1 - 1); 70 70 int edge1target = permutation[move.Index1]; -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveRoundedEuclideanPathEvaluator.cs
r3229 r3232 26 26 namespace HeuristicLab.Problems.TravelingSalesman { 27 27 /// <summary> 28 /// An operator to evaluate 2-opt moves.28 /// An operator to evaluate inversion moves (2-opt). 29 29 /// </summary> 30 [Item("TSP TwoOptRoundedEuclideanPathMoveEvaluator", "Operator for evaluating a 2-opt movebased on rounded euclidean distances.")]30 [Item("TSPInversionMoveRoundedEuclideanPathEvaluator", "Operator for evaluating an inversion move (2-opt) based on rounded euclidean distances.")] 31 31 [StorableClass] 32 public class TSP TwoOptRoundedEuclideanPathMoveEvaluator : TSPTwoOptPathMoveEvaluator {32 public class TSPInversionMoveRoundedEuclideanPathEvaluator : TSPInversionMovePathEvaluator { 33 33 public override Type EvaluatorType { 34 34 get { return typeof(TSPRoundedEuclideanPathEvaluator); } -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
r3231 r3232 265 265 OnVisualizerChanged(); 266 266 } 267 private void MoveGenerator_ TwoOptMoveParameter_ActualNameChanged(object sender, EventArgs e) {268 string name = ((ILookupParameter< TwoOptMove>)sender).ActualName;269 foreach (I TwoOptPermutationMoveOperator op in Operators.OfType<ITwoOptPermutationMoveOperator>()) {270 op. TwoOptMoveParameter.ActualName = name;271 } 272 } 273 private void MoveGenerator_T hreeOptMoveParameter_ActualNameChanged(object sender, EventArgs e) {274 string name = ((ILookupParameter<T hreeOptMove>)sender).ActualName;275 foreach (I ThreeOptPermutationMoveOperator op in Operators.OfType<IThreeOptPermutationMoveOperator>()) {276 op.T hreeOptMoveParameter.ActualName = name;267 private void MoveGenerator_InversionMoveParameter_ActualNameChanged(object sender, EventArgs e) { 268 string name = ((ILookupParameter<InversionMove>)sender).ActualName; 269 foreach (IPermutationInversionMoveOperator op in Operators.OfType<IPermutationInversionMoveOperator>()) { 270 op.InversionMoveParameter.ActualName = name; 271 } 272 } 273 private void MoveGenerator_TranslocationMoveParameter_ActualNameChanged(object sender, EventArgs e) { 274 string name = ((ILookupParameter<TranslocationMove>)sender).ActualName; 275 foreach (IPermutationTranslocationMoveOperator op in Operators.OfType<IPermutationTranslocationMoveOperator>()) { 276 op.TranslocationMoveParameter.ActualName = name; 277 277 } 278 278 } … … 301 301 } 302 302 private void InitializeMoveGenerators() { 303 foreach (I TwoOptPermutationMoveOperator op in Operators.OfType<ITwoOptPermutationMoveOperator>()) {303 foreach (IPermutationInversionMoveOperator op in Operators.OfType<IPermutationInversionMoveOperator>()) { 304 304 if (op is IMoveGenerator) { 305 op. TwoOptMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_TwoOptMoveParameter_ActualNameChanged);305 op.InversionMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_InversionMoveParameter_ActualNameChanged); 306 306 } 307 307 } 308 foreach (I ThreeOptPermutationMoveOperator op in Operators.OfType<IThreeOptPermutationMoveOperator>()) {308 foreach (IPermutationTranslocationMoveOperator op in Operators.OfType<IPermutationTranslocationMoveOperator>()) { 309 309 if (op is IMoveGenerator) { 310 op.T hreeOptMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_ThreeOptMoveParameter_ActualNameChanged);310 op.TranslocationMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_TranslocationMoveParameter_ActualNameChanged); 311 311 } 312 312 }
Note: See TracChangeset
for help on using the changeset viewer.