Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/16/09 11:34:22 (15 years ago)
Author:
gkronber
Message:

Removed variable AllowedFeatures in all modeling algorithms. #709

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.Boolean/3.3/FunctionLibraryInjector.cs

    r1529 r2165  
    3232  public class FunctionLibraryInjector : OperatorBase {
    3333    private const string TARGETVARIABLE = "TargetVariable";
    34     private const string ALLOWEDFEATURES = "AllowedFeatures";
    3534    private const string OPERATORLIBRARY = "FunctionLibrary";
    3635
     
    4544      : base() {
    4645      AddVariableInfo(new VariableInfo(TARGETVARIABLE, "The target variable", typeof(IntData), VariableKind.In));
    47       AddVariableInfo(new VariableInfo(ALLOWEDFEATURES, "List of indexes of allowed features", typeof(ItemList<IntData>), VariableKind.In));
    4846      AddVariableInfo(new VariableInfo(OPERATORLIBRARY, "Preconfigured default operator library", typeof(GPOperatorLibrary), VariableKind.New));
    4947    }
    5048
    5149    public override IOperation Apply(IScope scope) {
    52       ItemList<IntData> allowedFeatures = GetVariableValue<ItemList<IntData>>(ALLOWEDFEATURES, scope, true);
    5350      int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data;
    5451
    55       // remove the target-variable in case it occures in allowed features
    56       List<IntData> ts = allowedFeatures.FindAll(d => d.Data == targetVariable);
    57       foreach (IntData t in ts) allowedFeatures.Remove(t);
    58 
    5952      InitDefaultOperatorLibrary();
    60 
    61       int[] allowedIndexes = new int[allowedFeatures.Count];
    62       for (int i = 0; i < allowedIndexes.Length; i++) {
    63         allowedIndexes[i] = allowedFeatures[i].Data;
    64       }
    65 
    66       variable.SetConstraints(allowedIndexes);
    6753
    6854      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(OPERATORLIBRARY), operatorLibrary));
Note: See TracChangeset for help on using the changeset viewer.