Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5376 for trunk/sources


Ignore:
Timestamp:
01/25/11 17:58:38 (14 years ago)
Author:
abeham
Message:

#1393

  • Replacer will use Random replacement when no other replacement is defined
File:
1 edited

Legend:

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

    r4722 r5376  
    8383      ISelector selectedSelector = SelectedSelectorParameter.ActualValue;
    8484
    85       if (replacedSelector != null) {
    86         replacedSelector.CopySelected = new BoolValue(false);
    87         replacedSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(Math.Min(remaining, selected));
     85      if (replacedSelector == null) {
     86        ReplacedSelectorParameter.Value = new RandomSelector();
     87        replacedSelector = ReplacedSelectorParameter.Value;
    8888      }
    89       if (selectedSelector != null) {
    90         selectedSelector.CopySelected = new BoolValue(false);
    91         selectedSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(Math.Min(remaining, selected));
     89      replacedSelector.CopySelected = new BoolValue(false);
     90      replacedSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(Math.Min(remaining, selected));
     91
     92      if (selectedSelector == null) {
     93        SelectedSelectorParameter.Value = new RandomSelector();
     94        selectedSelector = SelectedSelectorParameter.Value;
    9295      }
     96      selectedSelector.CopySelected = new BoolValue(false);
     97      selectedSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(Math.Min(remaining, selected));
    9398
    9499      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.