Changeset 3099
- Timestamp:
- 03/18/10 11:56:42 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TSP/3.3/TSP.cs
r3080 r3099 202 202 string name = ((ILookupParameter<TwoOptMove>)sender).ActualName; 203 203 foreach (ITwoOptPermutationMoveOperator op in Operators.OfType<ITwoOptPermutationMoveOperator>()) { 204 if (!(op is IMoveGenerator))op.TwoOptMoveParameter.ActualName = name;204 op.TwoOptMoveParameter.ActualName = name; 205 205 } 206 206 } … … 208 208 string name = ((ILookupParameter<ThreeOptMove>)sender).ActualName; 209 209 foreach (IThreeOptPermutationMoveOperator op in Operators.OfType<IThreeOptPermutationMoveOperator>()) { 210 if (!(op is IMoveGenerator))op.ThreeOptMoveParameter.ActualName = name;210 op.ThreeOptMoveParameter.ActualName = name; 211 211 } 212 212 } … … 224 224 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged); 225 225 } 226 private void InitializeOperators() { 227 operators = new List<IPermutationOperator>(); 228 if (ApplicationManager.Manager != null) { 229 operators.AddRange(ApplicationManager.Manager.GetInstances<IPermutationOperator>()); 230 ParameterizeOperators(); 231 } 232 InitializeMoveGenerators(); 233 } 234 private void InitializeMoveGenerators() { 235 foreach (ITwoOptPermutationMoveOperator op in Operators.OfType<ITwoOptPermutationMoveOperator>()) { 236 if (op is IMoveGenerator) { 237 op.TwoOptMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_TwoOptMoveParameter_ActualNameChanged); 238 } 239 } 240 foreach (IThreeOptPermutationMoveOperator op in Operators.OfType<IThreeOptPermutationMoveOperator>()) { 241 if (op is IMoveGenerator) { 242 op.ThreeOptMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_ThreeOptMoveParameter_ActualNameChanged); 243 } 244 } 245 } 226 246 private void ParameterizeSolutionCreator() { 227 247 SolutionCreator.LengthParameter.Value = new IntValue(Coordinates.Rows); … … 237 257 } 238 258 } 239 private void InitializeOperators() {240 operators = new List<IPermutationOperator>();241 if (ApplicationManager.Manager != null) {242 operators.AddRange(ApplicationManager.Manager.GetInstances<IPermutationOperator>());243 ParameterizeOperators();244 }245 InitializeMoveGenerators();246 }247 259 private void ParameterizeOperators() { 248 260 foreach (IPermutationCrossover op in Operators.OfType<IPermutationCrossover>()) { … … 262 274 } 263 275 } 264 private void InitializeMoveGenerators() {265 foreach (ITwoOptPermutationMoveOperator op in Operators.OfType<ITwoOptPermutationMoveOperator>()) {266 if (op is IMoveGenerator) {267 op.TwoOptMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_TwoOptMoveParameter_ActualNameChanged);268 }269 }270 foreach (IThreeOptPermutationMoveOperator op in Operators.OfType<IThreeOptPermutationMoveOperator>()) {271 if (op is IMoveGenerator) {272 op.ThreeOptMoveParameter.ActualNameChanged += new EventHandler(MoveGenerator_ThreeOptMoveParameter_ActualNameChanged);273 }274 }275 }276 276 277 277 private void ClearDistanceMatrix() {
Note: See TracChangeset
for help on using the changeset viewer.