- Timestamp:
- 07/11/12 16:43:09 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators/HeuristicLab.Optimization.Operators/3.3/TabuMaker.cs
r7259 r8286 65 65 ItemList<IItem> tabuList = TabuListParameter.ActualValue; 66 66 int tabuTenure = TabuTenureParameter.ActualValue.Value; 67 if (tabuTenure > 0) { 68 // overlength should always be zero 69 int overlength = tabuList.Count - tabuTenure; 70 // copy and remove from back for performance 71 if (overlength >= 0) { 72 for (int i = 0; i < tabuTenure - 1; i++) 73 tabuList[i] = tabuList[i + overlength + 1]; 74 while (tabuList.Count >= tabuTenure) 75 tabuList.RemoveAt(tabuList.Count - 1); 76 } 67 77 68 int overlength = tabuList.Count - tabuTenure; 69 if (overlength >= 0) { 70 for (int i = 0; i < tabuTenure - 1; i++) 71 tabuList[i] = tabuList[i + overlength + 1]; 72 while (tabuList.Count >= tabuTenure) 73 tabuList.RemoveAt(tabuList.Count - 1); 78 tabuList.Add(GetTabuAttribute(MaximizationParameter.ActualValue.Value, QualityParameter.ActualValue.Value, 79 MoveQualityParameter.ActualValue.Value)); 74 80 } 75 76 tabuList.Add(GetTabuAttribute(MaximizationParameter.ActualValue.Value, QualityParameter.ActualValue.Value, MoveQualityParameter.ActualValue.Value));77 81 return base.Apply(); 78 82 }
Note: See TracChangeset
for help on using the changeset viewer.