Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/19/10 02:15:10 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on operators and SGA
  • improved performance
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Selection/3.3/TournamentSelector.cs

    r2818 r2830  
    4444    }
    4545
    46     protected override ScopeList Select(ScopeList scopes) {
     46    protected override IScope[] Select(List<IScope> scopes) {
    4747      int count = NumberOfSelectedSubScopesParameter.ActualValue.Value;
    4848      bool copy = CopySelectedParameter.Value.Value;
     
    5151      List<double> qualities = QualityParameter.ActualValue.Select(x => x.Value).ToList();
    5252      int groupSize = GroupSizeParameter.ActualValue.Value;
    53       ScopeList selected = new ScopeList();
     53      IScope[] selected = new IScope[count];
    5454
    5555      for (int i = 0; i < count; i++) {
     
    6565
    6666        if (copy)
    67           selected.Add((IScope)scopes[best].Clone());
     67          selected[i] = (IScope)scopes[best].Clone();
    6868        else {
    69           selected.Add(scopes[best]);
     69          selected[i] = scopes[best];
    7070          scopes.RemoveAt(best);
    7171          qualities.RemoveAt(best);
Note: See TracChangeset for help on using the changeset viewer.