Changeset 11108 for trunk/sources/HeuristicLab.Algorithms.TabuSearch
- Timestamp:
- 07/07/14 14:17:15 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs ¶
r11096 r11108 352 352 if (Problem != null) { 353 353 // only add move generators that also have a corresponding tabu-checker and tabu-maker 354 //355 // 1. assumption: all tabu checkers and tabu makers also implement the IMoveOperator interface356 // 2. assumption: all move generators also implement the IMoveOperator interface357 // 3. assumption: if compatible all three operators implement the same (most specific) IMoveOperator interface358 354 foreach (IMoveGenerator generator in Problem.Operators.OfType<IMoveGenerator>().OrderBy(x => x.Name)) { 359 355 // get all interfaces equal to or derived from IMoveOperator that this move generator implements … … 364 360 if (moveTypes.Any(t => t != type && type.IsAssignableFrom(t))) moveTypes.Remove(type); 365 361 } 366 // keep move generator only if there is a tabu checker and a tabu maker that is derived from 367 // one of the most specific interfaces in moveTypes (e.g. IPermutationTranslocationMoveOperator) 362 // keep move generator only if there is a tabu checker and a tabu maker that is derived from the same move interface 368 363 if (Problem.Operators.OfType<ITabuChecker>().Any(op => moveTypes.Any(m => m.IsInstanceOfType(op))) 369 364 && Problem.Operators.OfType<ITabuMaker>().Any(op => moveTypes.Any(m => m.IsInstanceOfType(op))))
Note: See TracChangeset
for help on using the changeset viewer.