Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/FunctionLibraryInjector.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/FunctionLibraryInjector.cs	(revision 1907)
+++ 	(revision )
@@ -1,221 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System.Collections.Generic;
-using Core = HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Constraints;
-
-namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
-  public class FunctionLibraryInjector : Core.OperatorBase {
-    private const string TARGETVARIABLE = "TargetVariable";
-    private const string AUTOREGRESSIVE = "Autoregressive";
-    private const string ALLOWEDFEATURES = "AllowedFeatures";
-    private const string MINTIMEOFFSET = "MinTimeOffset";
-    private const string MAXTIMEOFFSET = "MaxTimeOffset";
-    private const string FUNCTIONLIBRARY = "FunctionLibrary";
-
-    private Variable variable;
-    private Differential differential;
-    private GPOperatorLibrary operatorLibrary;
-
-    public override string Description {
-      get { return @"Injects a default function library for time series modeling."; }
-    }
-
-    public FunctionLibraryInjector()
-      : base() {
-      AddVariableInfo(new Core.VariableInfo(TARGETVARIABLE, "The target variable", typeof(IntData), Core.VariableKind.In));
-      AddVariableInfo(new Core.VariableInfo(AUTOREGRESSIVE, "Switch to turn on/off autoregressive modeling (wether to allow the target variable as input)", typeof(BoolData), Core.VariableKind.In));
-      AddVariableInfo(new Core.VariableInfo(ALLOWEDFEATURES, "List of indexes of allowed features", typeof(ItemList<IntData>), Core.VariableKind.In));
-      AddVariableInfo(new Core.VariableInfo(MINTIMEOFFSET, "Minimal time offset for all features", typeof(IntData), Core.VariableKind.In));
-      AddVariableInfo(new Core.VariableInfo(MAXTIMEOFFSET, "Maximal time offset for all feature", typeof(IntData), Core.VariableKind.In));
-      AddVariableInfo(new Core.VariableInfo(FUNCTIONLIBRARY, "Preconfigured default operator library", typeof(GPOperatorLibrary), Core.VariableKind.New));
-    }
-
-    public override Core.IOperation Apply(Core.IScope scope) {
-      IntData minTimeOffset = GetVariableValue<IntData>(MINTIMEOFFSET, scope, true);
-      IntData maxTimeOffset = GetVariableValue<IntData>(MAXTIMEOFFSET, scope, true);
-      ItemList<IntData> allowedFeatures = GetVariableValue<ItemList<IntData>>(ALLOWEDFEATURES, scope, true);
-      int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data;
-      bool autoregressive = GetVariableValue<BoolData>(AUTOREGRESSIVE, scope, true).Data;
-
-      if(autoregressive) {
-        // make sure the target-variable occures in list of allowed features
-        if(!allowedFeatures.Exists(d => d.Data == targetVariable)) allowedFeatures.Add(new IntData(targetVariable));
-      } else {
-        // remove the target-variable in case it occures in allowed features
-        List<IntData> ts = allowedFeatures.FindAll(d => d.Data == targetVariable);
-        foreach(IntData t in ts) allowedFeatures.Remove(t);
-      }
-
-      InitDefaultOperatorLibrary();
-
-      int[] allowedIndexes = new int[allowedFeatures.Count];
-      for(int i = 0; i < allowedIndexes.Length; i++) {
-        allowedIndexes[i] = allowedFeatures[i].Data;
-      }
-
-      variable.SetConstraints(allowedIndexes, minTimeOffset.Data, maxTimeOffset.Data);
-      differential.SetConstraints(allowedIndexes, minTimeOffset.Data, maxTimeOffset.Data);
-
-      scope.AddVariable(new Core.Variable(scope.TranslateName(FUNCTIONLIBRARY), operatorLibrary));
-      return null;
-    }
-
-    private void InitDefaultOperatorLibrary() {
-      variable = new Variable();
-      differential = new Differential();
-      Constant constant = new Constant();
-
-      Addition addition = new Addition();
-      And and = new And();
-      Average average = new Average();
-      Cosinus cosinus = new Cosinus();
-      Division division = new Division();
-      Equal equal = new Equal();
-      Exponential exponential = new Exponential();
-      GreaterThan greaterThan = new GreaterThan();
-      IfThenElse ifThenElse = new IfThenElse();
-      LessThan lessThan = new LessThan();
-      Logarithm logarithm = new Logarithm();
-      Multiplication multiplication = new Multiplication();
-      Not not = new Not();
-      Or or = new Or();
-      Power power = new Power();
-      Signum signum = new Signum();
-      Sinus sinus = new Sinus();
-      Sqrt sqrt = new Sqrt();
-      Subtraction subtraction = new Subtraction();
-      Tangens tangens = new Tangens();
-      Xor xor = new Xor();
-
-      IFunction[] booleanFunctions = new IFunction[] {
-        and,
-        equal,
-        greaterThan,
-        lessThan,
-        not,
-        or,
-        xor };
-      IFunction[] doubleFunctions = new IFunction[] {
-        variable,
-        differential,
-        constant,
-        addition,
-        average,
-        cosinus,
-        division,
-        exponential,
-        ifThenElse,
-        logarithm,
-        multiplication,
-        power,
-        signum,
-        sinus,
-        sqrt,
-        subtraction,
-        tangens};
-
-      SetAllowedSubOperators(and, booleanFunctions);
-      SetAllowedSubOperators(equal, doubleFunctions);
-      SetAllowedSubOperators(greaterThan, doubleFunctions);
-      SetAllowedSubOperators(lessThan, doubleFunctions);
-      SetAllowedSubOperators(not, booleanFunctions);
-      SetAllowedSubOperators(or, booleanFunctions);
-      SetAllowedSubOperators(xor, booleanFunctions);
-      SetAllowedSubOperators(addition, doubleFunctions);
-      SetAllowedSubOperators(average, doubleFunctions);
-      SetAllowedSubOperators(cosinus, doubleFunctions);
-      SetAllowedSubOperators(division, doubleFunctions);
-      SetAllowedSubOperators(exponential, doubleFunctions);
-      SetAllowedSubOperators(ifThenElse, 0, booleanFunctions);
-      SetAllowedSubOperators(ifThenElse, 1, doubleFunctions);
-      SetAllowedSubOperators(ifThenElse, 2, doubleFunctions);
-      SetAllowedSubOperators(logarithm, doubleFunctions);
-      SetAllowedSubOperators(multiplication, doubleFunctions);
-      SetAllowedSubOperators(power, doubleFunctions);
-      SetAllowedSubOperators(signum, doubleFunctions);
-      SetAllowedSubOperators(sinus, doubleFunctions);
-      SetAllowedSubOperators(sqrt, doubleFunctions);
-      SetAllowedSubOperators(subtraction, doubleFunctions);
-      SetAllowedSubOperators(tangens, doubleFunctions);
-
-      operatorLibrary = new GPOperatorLibrary();
-      operatorLibrary.GPOperatorGroup.AddOperator(variable);
-      operatorLibrary.GPOperatorGroup.AddOperator(differential);
-      operatorLibrary.GPOperatorGroup.AddOperator(constant);
-      operatorLibrary.GPOperatorGroup.AddOperator(addition);
-      operatorLibrary.GPOperatorGroup.AddOperator(average);
-      operatorLibrary.GPOperatorGroup.AddOperator(and);
-      operatorLibrary.GPOperatorGroup.AddOperator(cosinus);
-      operatorLibrary.GPOperatorGroup.AddOperator(division);
-      operatorLibrary.GPOperatorGroup.AddOperator(equal);
-      operatorLibrary.GPOperatorGroup.AddOperator(exponential);
-      operatorLibrary.GPOperatorGroup.AddOperator(greaterThan);
-      operatorLibrary.GPOperatorGroup.AddOperator(ifThenElse);
-      operatorLibrary.GPOperatorGroup.AddOperator(lessThan);
-      operatorLibrary.GPOperatorGroup.AddOperator(logarithm);
-      operatorLibrary.GPOperatorGroup.AddOperator(multiplication);
-      operatorLibrary.GPOperatorGroup.AddOperator(not);
-      operatorLibrary.GPOperatorGroup.AddOperator(power);
-      operatorLibrary.GPOperatorGroup.AddOperator(or);
-      operatorLibrary.GPOperatorGroup.AddOperator(signum);
-      operatorLibrary.GPOperatorGroup.AddOperator(sinus);
-      operatorLibrary.GPOperatorGroup.AddOperator(sqrt);
-      operatorLibrary.GPOperatorGroup.AddOperator(subtraction);
-      operatorLibrary.GPOperatorGroup.AddOperator(tangens);
-      operatorLibrary.GPOperatorGroup.AddOperator(xor);
-    }
-
-    private void SetAllowedSubOperators(IFunction f, IFunction[] gs) {
-      foreach(Core.IConstraint c in f.Constraints) {
-        if(c is SubOperatorTypeConstraint) {
-          SubOperatorTypeConstraint typeConstraint = c as SubOperatorTypeConstraint;
-          typeConstraint.Clear();
-          foreach(IFunction g in gs) {
-            typeConstraint.AddOperator(g);
-          }
-        } else if(c is AllSubOperatorsTypeConstraint) {
-          AllSubOperatorsTypeConstraint typeConstraint = c as AllSubOperatorsTypeConstraint;
-          typeConstraint.Clear();
-          foreach(IFunction g in gs) {
-            typeConstraint.AddOperator(g);
-          }
-        }
-      }
-    }
-
-    private void SetAllowedSubOperators(IFunction f, int p, IFunction[] gs) {
-      foreach(Core.IConstraint c in f.Constraints) {
-        if(c is SubOperatorTypeConstraint) {
-          SubOperatorTypeConstraint typeConstraint = c as SubOperatorTypeConstraint;
-          if(typeConstraint.SubOperatorIndex.Data == p) {
-            typeConstraint.Clear();
-            foreach(IFunction g in gs) {
-              typeConstraint.AddOperator(g);
-            }
-          }
-        }
-      }
-    }
-  }
-}
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLab.GP.StructureIdentification.TimeSeries-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLab.GP.StructureIdentification.TimeSeries-3.3.csproj	(revision 1907)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLab.GP.StructureIdentification.TimeSeries-3.3.csproj	(revision 1908)
@@ -83,7 +83,4 @@
   <ItemGroup>
     <Compile Include="AveragePercentageChangeEvaluator.cs" />
-    <Compile Include="FunctionLibraryInjector.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="HeuristicLabGPTimeSeriesPlugin.cs" />
     <Compile Include="OffspringSelectionGP.cs" />
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ConfigurableFunctionLibraryInjector.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ConfigurableFunctionLibraryInjector.cs	(revision 1907)
+++ 	(revision )
@@ -1,219 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.DataAnalysis;
-using HeuristicLab.Constraints;
-
-namespace HeuristicLab.GP.StructureIdentification {
-  public class ConfigurableFunctionLibraryInjector : FunctionLibraryInjector {
-    private const string VARIABLES_ALLOWED = "Variables";
-    private const string CONSTANTS_ALLOWED = "Constants";
-    private const string ADDITION_ALLOWED = "Addition";
-    private const string AVERAGE_ALLOWED = "Average";
-    private const string AND_ALLOWED = "And";
-    private const string COSINUS_ALLOWED = "Cosinus";
-    private const string DIVISION_ALLOWED = "Division";
-    private const string EQUAL_ALLOWED = "Equal";
-    private const string EXPONENTIAL_ALLOWED = "Exponential";
-    private const string GREATERTHAN_ALLOWED = "GreaterThan";
-    private const string IFTHENELSE_ALLOWED = "IfThenElse";
-    private const string LESSTHAN_ALLOWED = "LessThan";
-    private const string LOGARTIHM_ALLOWED = "Logarithm";
-    private const string MULTIPLICATION_ALLOWED = "Multiplication";
-    private const string NOT_ALLOWED = "Not";
-    private const string POWER_ALLOWED = "Power";
-    private const string OR_ALLOWED = "Or";
-    private const string SIGNUM_ALLOWED = "Signum";
-    private const string SINUS_ALLOWED = "Sinus";
-    private const string SQRT_ALLOWED = "SquareRoot";
-    private const string SUBTRACTION_ALLOWED = "Subtraction";
-    private const string TANGENS_ALLOWED = "Tangens";
-    private const string XOR_ALLOWED = "Xor";
-
-
-    public override string Description {
-      get { return @"Injects a configurable function library for regression and classification problems."; }
-    }
-
-    public ConfigurableFunctionLibraryInjector()
-      : base() {
-
-      AddVariableInfo(new Core.VariableInfo(VARIABLES_ALLOWED, VARIABLES_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(VARIABLES_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(VARIABLES_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(CONSTANTS_ALLOWED, CONSTANTS_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(CONSTANTS_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(CONSTANTS_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(ADDITION_ALLOWED, ADDITION_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(ADDITION_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(ADDITION_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(AVERAGE_ALLOWED, AVERAGE_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(AVERAGE_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(AVERAGE_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(AND_ALLOWED, AND_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(AND_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(AND_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(COSINUS_ALLOWED, COSINUS_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(COSINUS_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(COSINUS_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(DIVISION_ALLOWED, DIVISION_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(DIVISION_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(DIVISION_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(EQUAL_ALLOWED, EQUAL_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(EQUAL_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(EQUAL_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(EXPONENTIAL_ALLOWED, EXPONENTIAL_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(EXPONENTIAL_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(EXPONENTIAL_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(GREATERTHAN_ALLOWED, GREATERTHAN_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(GREATERTHAN_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(GREATERTHAN_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(IFTHENELSE_ALLOWED, IFTHENELSE_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(IFTHENELSE_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(IFTHENELSE_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(LESSTHAN_ALLOWED, LESSTHAN_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(LESSTHAN_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(LESSTHAN_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(LOGARTIHM_ALLOWED, LOGARTIHM_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(LOGARTIHM_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(LOGARTIHM_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(MULTIPLICATION_ALLOWED, MULTIPLICATION_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(MULTIPLICATION_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(MULTIPLICATION_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(NOT_ALLOWED, NOT_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(NOT_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(NOT_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(POWER_ALLOWED, POWER_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(POWER_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(POWER_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(OR_ALLOWED, OR_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(OR_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(OR_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(SIGNUM_ALLOWED, SIGNUM_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(SIGNUM_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(SIGNUM_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(SINUS_ALLOWED, SINUS_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(SINUS_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(SINUS_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(SQRT_ALLOWED, SQRT_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(SQRT_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(SQRT_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(SUBTRACTION_ALLOWED, SUBTRACTION_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(SUBTRACTION_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(SUBTRACTION_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(TANGENS_ALLOWED, TANGENS_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(TANGENS_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(TANGENS_ALLOWED, new BoolData(true)));
-
-      AddVariableInfo(new Core.VariableInfo(XOR_ALLOWED, XOR_ALLOWED + " allowed", typeof(BoolData), Core.VariableKind.New));
-      GetVariableInfo(XOR_ALLOWED).Local = true;
-      AddVariable(new Core.Variable(XOR_ALLOWED, new BoolData(true)));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      base.Apply(scope);
-
-      GPOperatorLibrary functionLibrary = (GPOperatorLibrary)scope.GetVariable(scope.TranslateName(FUNCTIONLIBRARY)).Value;
-
-      if (!((BoolData)GetVariable(VARIABLES_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Variable)));
-      if (!((BoolData)GetVariable(CONSTANTS_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Constant)));
-      if (!((BoolData)GetVariable(ADDITION_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Addition)));
-      if (!((BoolData)GetVariable(AVERAGE_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Average)));
-      if (!((BoolData)GetVariable(AND_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(And)));
-      if (!((BoolData)GetVariable(COSINUS_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Cosinus)));
-      if (!((BoolData)GetVariable(DIVISION_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Division)));
-      if (!((BoolData)GetVariable(EQUAL_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Equal)));
-      if (!((BoolData)GetVariable(EXPONENTIAL_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Exponential)));
-      if (!((BoolData)GetVariable(GREATERTHAN_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(GreaterThan)));
-      if (!((BoolData)GetVariable(IFTHENELSE_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(IfThenElse)));
-      if (!((BoolData)GetVariable(LESSTHAN_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(LessThan)));
-      if (!((BoolData)GetVariable(LOGARTIHM_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Logarithm)));
-      if (!((BoolData)GetVariable(MULTIPLICATION_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Multiplication)));
-      if (!((BoolData)GetVariable(NOT_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Not)));
-      if (!((BoolData)GetVariable(POWER_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Power)));
-      if (!((BoolData)GetVariable(OR_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Or)));
-      if (!((BoolData)GetVariable(SIGNUM_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Signum)));
-      if (!((BoolData)GetVariable(SINUS_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Sinus)));
-      if (!((BoolData)GetVariable(SQRT_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Sqrt)));
-      if (!((BoolData)GetVariable(SUBTRACTION_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Subtraction)));
-      if (!((BoolData)GetVariable(TANGENS_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Tangens)));
-      if (!((BoolData)GetVariable(XOR_ALLOWED).Value).Data)
-        functionLibrary.GPOperatorGroup.RemoveOperator(FindOperator(functionLibrary.GPOperatorGroup, typeof(Xor)));
-      return null;
-    }
-
-    private IFunction FindOperator(GPOperatorGroup g, Type t) {
-      foreach (IFunction func in g.Operators)
-        if (func.GetType() == t)
-          return func;
-      return null;
-    }
-  }
-}
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs	(revision 1907)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs	(revision 1908)
@@ -32,10 +32,39 @@
 namespace HeuristicLab.GP.StructureIdentification {
   public class FunctionLibraryInjector : OperatorBase {
+    private const string FUNCTIONLIBRARY = "FunctionLibrary";
     private const string TARGETVARIABLE = "TargetVariable";
     private const string ALLOWEDFEATURES = "AllowedFeatures";
-    protected const string FUNCTIONLIBRARY = "FunctionLibrary";
+    private const string AUTOREGRESSIVE = "Autoregressive";
+    private const string MINTIMEOFFSET = "MinTimeOffset";
+    private const string MAXTIMEOFFSET = "MaxTimeOffset";
+
+    private const string DIFFERENTIALS_ALLOWED = "Differentials";
+    private const string VARIABLES_ALLOWED = "Variables";
+    private const string CONSTANTS_ALLOWED = "Constants";
+    private const string ADDITION_ALLOWED = "Addition";
+    private const string AVERAGE_ALLOWED = "Average";
+    private const string AND_ALLOWED = "And";
+    private const string COSINUS_ALLOWED = "Cosinus";
+    private const string DIVISION_ALLOWED = "Division";
+    private const string EQUAL_ALLOWED = "Equal";
+    private const string EXPONENTIAL_ALLOWED = "Exponential";
+    private const string GREATERTHAN_ALLOWED = "GreaterThan";
+    private const string IFTHENELSE_ALLOWED = "IfThenElse";
+    private const string LESSTHAN_ALLOWED = "LessThan";
+    private const string LOGARTIHM_ALLOWED = "Logarithm";
+    private const string MULTIPLICATION_ALLOWED = "Multiplication";
+    private const string NOT_ALLOWED = "Not";
+    private const string POWER_ALLOWED = "Power";
+    private const string OR_ALLOWED = "Or";
+    private const string SIGNUM_ALLOWED = "Signum";
+    private const string SINUS_ALLOWED = "Sinus";
+    private const string SQRT_ALLOWED = "SquareRoot";
+    private const string SUBTRACTION_ALLOWED = "Subtraction";
+    private const string TANGENS_ALLOWED = "Tangens";
+    private const string XOR_ALLOWED = "Xor";
+
 
     public override string Description {
-      get { return @"Injects a default function library for regression and classification problems."; }
+      get { return @"Injects a configurable function library for regression and classification problems."; }
     }
 
@@ -44,5 +73,39 @@
       AddVariableInfo(new VariableInfo(TARGETVARIABLE, "The target variable", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo(ALLOWEDFEATURES, "List of indexes of allowed features", typeof(ItemList<IntData>), VariableKind.In));
+      AddVariableInfo(new Core.VariableInfo(AUTOREGRESSIVE, "Switch to turn on/off autoregressive modeling (wether to allow the target variable as input)", typeof(BoolData), Core.VariableKind.In));
+      AddVariableInfo(new Core.VariableInfo(MINTIMEOFFSET, "Minimal time offset for all features", typeof(IntData), Core.VariableKind.In));
+      AddVariableInfo(new Core.VariableInfo(MAXTIMEOFFSET, "Maximal time offset for all feature", typeof(IntData), Core.VariableKind.In));
       AddVariableInfo(new VariableInfo(FUNCTIONLIBRARY, "Preconfigured default operator library", typeof(GPOperatorLibrary), VariableKind.New));
+
+      AddVariable(DIFFERENTIALS_ALLOWED, false);
+      AddVariable(VARIABLES_ALLOWED, true);
+      AddVariable(CONSTANTS_ALLOWED, true);
+      AddVariable(ADDITION_ALLOWED, true);
+      AddVariable(AVERAGE_ALLOWED, false);
+      AddVariable(AND_ALLOWED, true);
+      AddVariable(COSINUS_ALLOWED, true);
+      AddVariable(DIVISION_ALLOWED, true);
+      AddVariable(EQUAL_ALLOWED, true);
+      AddVariable(EXPONENTIAL_ALLOWED, true);
+      AddVariable(GREATERTHAN_ALLOWED, true);
+      AddVariable(IFTHENELSE_ALLOWED, true);
+      AddVariable(LESSTHAN_ALLOWED, true);
+      AddVariable(LOGARTIHM_ALLOWED, true);
+      AddVariable(MULTIPLICATION_ALLOWED, true);
+      AddVariable(NOT_ALLOWED, true);
+      AddVariable(POWER_ALLOWED, true);
+      AddVariable(OR_ALLOWED, true);
+      AddVariable(SIGNUM_ALLOWED, true);
+      AddVariable(SINUS_ALLOWED, true);
+      AddVariable(SQRT_ALLOWED, true);
+      AddVariable(SUBTRACTION_ALLOWED, true);
+      AddVariable(TANGENS_ALLOWED, true);
+      AddVariable(XOR_ALLOWED, false);
+    }
+
+    private void AddVariable(string name, bool allowed) {
+      AddVariableInfo(new VariableInfo(name, name + " allowed", typeof(BoolData), Core.VariableKind.New));
+      GetVariableInfo(name).Local = true;
+      AddVariable(new Core.Variable(name, new BoolData(allowed)));
     }
 
@@ -53,12 +116,20 @@
       ItemList<IntData> allowedFeatures = GetVariableValue<ItemList<IntData>>(ALLOWEDFEATURES, scope, true);
       int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data;
-
-      // remove the target-variable in case it occures in allowed features
-      List<IntData> ts = allowedFeatures.FindAll(d => d.Data == targetVariable);
-      foreach (IntData t in ts) allowedFeatures.Remove(t);
+      int minTimeOffset = GetVariableValue<IntData>(MINTIMEOFFSET, scope, true).Data;
+      int maxTimeOffset = GetVariableValue<IntData>(MAXTIMEOFFSET, scope, true).Data;
+      bool autoregressive = GetVariableValue<BoolData>(AUTOREGRESSIVE, scope, true).Data;
+
+      if (autoregressive) {
+        // make sure the target-variable occures in list of allowed features
+        if (!allowedFeatures.Exists(d => d.Data == targetVariable)) allowedFeatures.Add(new IntData(targetVariable));
+      } else {
+        // remove the target-variable in case it occures in allowed features
+        List<IntData> ts = allowedFeatures.FindAll(d => d.Data == targetVariable);
+        foreach (IntData t in ts) allowedFeatures.Remove(t);
+      }
 
       variable = new StructId.Variable();
       StructId.Constant constant = new StructId.Constant();
-
+      StructId.Differential differential = new Differential();
       StructId.Addition addition = new StructId.Addition();
       StructId.And and = new StructId.And();
@@ -93,4 +164,5 @@
       };
       IFunction[] doubleFunctions = new IFunction[] {
+        differential,
         variable,
         constant,
@@ -136,27 +208,28 @@
 
       operatorLibrary = new GPOperatorLibrary();
-      operatorLibrary.GPOperatorGroup.AddOperator(variable);
-      operatorLibrary.GPOperatorGroup.AddOperator(constant);
-      operatorLibrary.GPOperatorGroup.AddOperator(addition);
-      operatorLibrary.GPOperatorGroup.AddOperator(average);
-      operatorLibrary.GPOperatorGroup.AddOperator(and);
-      operatorLibrary.GPOperatorGroup.AddOperator(cosinus);
-      operatorLibrary.GPOperatorGroup.AddOperator(division);
-      operatorLibrary.GPOperatorGroup.AddOperator(equal);
-      operatorLibrary.GPOperatorGroup.AddOperator(exponential);
-      operatorLibrary.GPOperatorGroup.AddOperator(greaterThan);
-      operatorLibrary.GPOperatorGroup.AddOperator(ifThenElse);
-      operatorLibrary.GPOperatorGroup.AddOperator(lessThan);
-      operatorLibrary.GPOperatorGroup.AddOperator(logarithm);
-      operatorLibrary.GPOperatorGroup.AddOperator(multiplication);
-      operatorLibrary.GPOperatorGroup.AddOperator(not);
-      operatorLibrary.GPOperatorGroup.AddOperator(power);
-      operatorLibrary.GPOperatorGroup.AddOperator(or);
-      operatorLibrary.GPOperatorGroup.AddOperator(signum);
-      operatorLibrary.GPOperatorGroup.AddOperator(sinus);
-      operatorLibrary.GPOperatorGroup.AddOperator(sqrt);
-      operatorLibrary.GPOperatorGroup.AddOperator(subtraction);
-      operatorLibrary.GPOperatorGroup.AddOperator(tangens);
-      operatorLibrary.GPOperatorGroup.AddOperator(xor);
+      ConditionalAddOperator(DIFFERENTIALS_ALLOWED, operatorLibrary, differential);
+      ConditionalAddOperator(VARIABLES_ALLOWED, operatorLibrary, variable);
+      ConditionalAddOperator(CONSTANTS_ALLOWED, operatorLibrary, constant);
+      ConditionalAddOperator(ADDITION_ALLOWED, operatorLibrary, addition);
+      ConditionalAddOperator(AVERAGE_ALLOWED, operatorLibrary, average);
+      ConditionalAddOperator(AND_ALLOWED, operatorLibrary, and);
+      ConditionalAddOperator(COSINUS_ALLOWED, operatorLibrary, cosinus);
+      ConditionalAddOperator(DIVISION_ALLOWED, operatorLibrary, division);
+      ConditionalAddOperator(EQUAL_ALLOWED, operatorLibrary, equal);
+      ConditionalAddOperator(EXPONENTIAL_ALLOWED, operatorLibrary, exponential);
+      ConditionalAddOperator(GREATERTHAN_ALLOWED, operatorLibrary, greaterThan);
+      ConditionalAddOperator(IFTHENELSE_ALLOWED, operatorLibrary, ifThenElse);
+      ConditionalAddOperator(LESSTHAN_ALLOWED, operatorLibrary, lessThan);
+      ConditionalAddOperator(LOGARTIHM_ALLOWED, operatorLibrary, logarithm);
+      ConditionalAddOperator(MULTIPLICATION_ALLOWED, operatorLibrary, multiplication);
+      ConditionalAddOperator(NOT_ALLOWED, operatorLibrary, not);
+      ConditionalAddOperator(POWER_ALLOWED, operatorLibrary, power);
+      ConditionalAddOperator(OR_ALLOWED, operatorLibrary, or);
+      ConditionalAddOperator(SIGNUM_ALLOWED, operatorLibrary, signum);
+      ConditionalAddOperator(SINUS_ALLOWED, operatorLibrary, sinus);
+      ConditionalAddOperator(SQRT_ALLOWED, operatorLibrary, sqrt);
+      ConditionalAddOperator(SUBTRACTION_ALLOWED, operatorLibrary, subtraction);
+      ConditionalAddOperator(TANGENS_ALLOWED, operatorLibrary, tangens);
+      ConditionalAddOperator(XOR_ALLOWED, operatorLibrary, xor);
 
       int[] allowedIndexes = new int[allowedFeatures.Count];
@@ -165,8 +238,14 @@
       }
 
-      variable.SetConstraints(allowedIndexes, 0, 0);
+      variable.SetConstraints(allowedIndexes, minTimeOffset, maxTimeOffset);
+      differential.SetConstraints(allowedIndexes, minTimeOffset, maxTimeOffset);
 
       scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(FUNCTIONLIBRARY), operatorLibrary));
+
       return null;
+    }
+
+    private void ConditionalAddOperator(string condName, GPOperatorLibrary operatorLibrary, IOperator op) {
+      if (GetVariableValue<BoolData>(condName, null, false).Data) operatorLibrary.GPOperatorGroup.AddOperator(op);
     }
 
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj	(revision 1907)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HeuristicLab.GP.StructureIdentification-3.3.csproj	(revision 1908)
@@ -86,5 +86,4 @@
     <Compile Include="Average.cs" />
     <Compile Include="BakedTreeEvaluator.cs" />
-    <Compile Include="ConfigurableFunctionLibraryInjector.cs" />
     <Compile Include="Constant.cs" />
     <Compile Include="AlgorithmBase.cs" />
Index: trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs	(revision 1907)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs	(revision 1908)
@@ -142,5 +142,5 @@
 
     protected internal override IOperator CreateFunctionLibraryInjector() {
-      ConfigurableFunctionLibraryInjector funLibInjector = new ConfigurableFunctionLibraryInjector();
+      FunctionLibraryInjector funLibInjector = new FunctionLibraryInjector();
       funLibInjector.GetVariableValue<BoolData>("Xor", null, false).Data = false;
       funLibInjector.GetVariableValue<BoolData>("Average", null, false).Data = false;
