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/LinearRankSelector.cs

    r2818 r2830  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using System.Linq;
    2324using HeuristicLab.Core;
     
    3839    }
    3940
    40     protected override ScopeList Select(ScopeList scopes) {
     41    protected override IScope[] Select(List<IScope> scopes) {
    4142      int count = NumberOfSelectedSubScopesParameter.ActualValue.Value;
    4243      bool copy = CopySelectedParameter.Value.Value;
     
    4445      bool maximization = MaximizationParameter.ActualValue.Value;
    4546      ItemArray<DoubleData> qualities = QualityParameter.ActualValue;
    46       ScopeList selected = new ScopeList();
     47      IScope[] selected = new IScope[count];
    4748
    4849      // create a list for each scope that contains the scope's index in the original scope list and its lots
     
    6465        }
    6566        if (copy)
    66           selected.Add((IScope)scopes[list[index].index].Clone());
     67          selected[i] = (IScope)scopes[list[index].index].Clone();
    6768        else {
    68           selected.Add(scopes[list[index].index]);
     69          selected[i] = scopes[list[index].index];
    6970          scopes.RemoveAt(list[index].index);
    7071          lotSum -= list[index].lots;
Note: See TracChangeset for help on using the changeset viewer.