Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/08 02:08:02 (16 years ago)
Author:
swagner
Message:

Worked on ticket #41

  • added generic ItemList<T>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/CombinedOperator.cs

    r2 r40  
    4747      GetVariableInfo("InjectSubOperators").Local = true;
    4848      AddVariable(new Variable("InjectSubOperators", new BoolData(false)));
    49       AddVariableInfo(new VariableInfo("SubOperatorNames", "Variable names for injecting the sub-operators", typeof(ItemList), VariableKind.In));
     49      AddVariableInfo(new VariableInfo("SubOperatorNames", "Variable names for injecting the sub-operators", typeof(ItemList<StringData>), VariableKind.In));
    5050      GetVariableInfo("SubOperatorNames").Local = true;
    51       ItemList subOperatorNames = new ItemList();
    52       subOperatorNames.ItemType = typeof(StringData);
     51      ItemList<StringData> subOperatorNames = new ItemList<StringData>();
    5352      AddVariable(new Variable("SubOperatorNames", subOperatorNames));
    5453    }
     
    7574        bool inject = GetVariableValue<BoolData>("InjectSubOperators", scope, false).Data;
    7675        if (inject) {
    77           ItemList names = GetVariableValue<ItemList>("SubOperatorNames", scope, false);
     76          ItemList<StringData> names = GetVariableValue<ItemList<StringData>>("SubOperatorNames", scope, false);
    7877          for (int i = 0; i < SubOperators.Count; i++) {
    79             if (scope.GetVariable(names[i].ToString()) != null)
    80               scope.RemoveVariable(names[i].ToString());
    81             scope.AddVariable(new Variable(names[i].ToString(), SubOperators[i]));
     78            if (scope.GetVariable(names[i].Data) != null)
     79              scope.RemoveVariable(names[i].Data);
     80            scope.AddVariable(new Variable(names[i].Data, SubOperators[i]));
    8281          }
    8382        }
Note: See TracChangeset for help on using the changeset viewer.