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

    r2818 r2830  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3334    public LeftSelector() : base() { }
    3435
    35     protected override ScopeList Select(ScopeList scopes) {
     36    protected override IScope[] Select(List<IScope> scopes) {
    3637      int count = NumberOfSelectedSubScopesParameter.ActualValue.Value;
    3738      bool copy = CopySelectedParameter.Value.Value;
    38       ScopeList selected = new ScopeList();
     39      IScope[] selected = new IScope[count];
    3940
    4041      int j = 0;
    4142      for (int i = 0; i < count; i++) {
    4243        if (copy) {
    43           selected.Add((IScope)scopes[j].Clone());
     44          selected[i] = (IScope)scopes[j].Clone();
    4445          j++;
    4546          if (j >= scopes.Count) j = 0;
    4647        } else {
    47           selected.Add(scopes[0]);
     48          selected[i] = scopes[0];
    4849          scopes.RemoveAt(0);
    4950        }
Note: See TracChangeset for help on using the changeset viewer.