Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/11/12 16:43:09 (12 years ago)
Author:
gkronber
Message:

#1847 experimental changes to try to get TS to work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-MoveOperators/HeuristicLab.Optimization.Operators/3.3/TabuMaker.cs

    r7259 r8286  
    6565      ItemList<IItem> tabuList = TabuListParameter.ActualValue;
    6666      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        }
    6777
    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));
    7480      }
    75 
    76       tabuList.Add(GetTabuAttribute(MaximizationParameter.ActualValue.Value, QualityParameter.ActualValue.Value, MoveQualityParameter.ActualValue.Value));
    7781      return base.Apply();
    7882    }
Note: See TracChangeset for help on using the changeset viewer.