Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/10 00:30:46 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on selection
File:
1 edited

Legend:

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

    r2805 r2817  
    3636    public LeftSelector() : base() { }
    3737
    38     protected override void Select(ScopeList source, ScopeList target) {
     38    protected override ScopeList Select(ScopeList scopes) {
    3939      int count = NumberOfSelectedSubScopesParameter.ActualValue.Value;
    4040      bool copy = CopySelectedParameter.Value.Value;
     41      ScopeList selected = new ScopeList();
    4142
    4243      int j = 0;
    4344      for (int i = 0; i < count; i++) {
    4445        if (copy) {
    45           target.Add((IScope)source[j].Clone());
     46          selected.Add((IScope)scopes[j].Clone());
    4647          j++;
    47           if (j >= source.Count) j = 0;
     48          if (j >= scopes.Count) j = 0;
    4849        } else {
    49           target.Add(source[0]);
    50           source.RemoveAt(0);
     50          selected.Add(scopes[0]);
     51          scopes.RemoveAt(0);
    5152        }
    5253      }
     54      return selected;
    5355    }
    5456  }
Note: See TracChangeset for help on using the changeset viewer.