Index: /trunk/tools/CedmaImporter/CedmaImporter.csproj
===================================================================
--- /trunk/tools/CedmaImporter/CedmaImporter.csproj	(revision 2259)
+++ /trunk/tools/CedmaImporter/CedmaImporter.csproj	(revision 2260)
@@ -31,6 +31,22 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
   <ItemGroup>
-    <Reference Include="HeuristicLab.CEDMA.Server-3.3, Version=3.3.0.2238, Culture=neutral, processorArchitecture=x86">
+    <Reference Include="HeuristicLab.CEDMA.Server-3.3, Version=3.3.0.2258, Culture=neutral, processorArchitecture=x86">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\sources\HeuristicLab\bin\x86\Release\plugins\HeuristicLab.CEDMA.Server-3.3.dll</HintPath>
@@ -75,4 +91,8 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\sources\HeuristicLab\bin\x86\Release\plugins\HeuristicLab.SupportVectorMachines-3.2.dll</HintPath>
+    </Reference>
+    <Reference Include="LibSVM, Version=2.84.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\sources\HeuristicLab\bin\x86\Release\plugins\LibSVM.dll</HintPath>
     </Reference>
     <Reference Include="System" />
Index: /trunk/tools/CedmaImporter/Importer.cs
===================================================================
--- /trunk/tools/CedmaImporter/Importer.cs	(revision 2259)
+++ /trunk/tools/CedmaImporter/Importer.cs	(revision 2260)
@@ -6,4 +6,8 @@
 using HeuristicLab.Modeling.Database;
 using HeuristicLab.Modeling.Database.SQLServerCompact;
+using HeuristicLab.GP;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.GP.StructureIdentification;
+using System.Diagnostics;
 
 namespace CedmaImporter {
@@ -33,5 +37,5 @@
       using (StreamReader reader = File.OpenText(fileName)) {
         ReadResultsAndInputVariables(reader);
-        ImportAllModels(reader, database);
+        ImportAllModels(dirName, reader, database);
       }
     }
@@ -56,13 +60,13 @@
     }
 
-    private void ImportAllModels(StreamReader reader, DatabaseService database) {
+    private void ImportAllModels(string dirName, StreamReader reader, DatabaseService database) {
       while (!reader.EndOfStream) {
         string modelLine = reader.ReadLine();
         string[] modelData = modelLine.Split(';');
         int id = int.Parse(modelData[ID_COLUMN]);
-        string fileName = modelData[FILENAME_COLUMN];
-        string targetVariableName = modelData[TARGETVARIABLE_COLUMN];
-        string algoName = modelData[ALGORITHM_COLUMN];
-        Variable targetVariable = new Variable(targetVariableName);
+        string targetVariableName = modelData[TARGETVARIABLE_COLUMN].Trim();
+        string algoName = modelData[ALGORITHM_COLUMN].Trim();
+        HeuristicLab.Core.IItem modelItem = ParseModel(dirName, modelData[FILENAME_COLUMN].Trim(), algoName);
+        HeuristicLab.Modeling.Database.SQLServerCompact.Variable targetVariable = new HeuristicLab.Modeling.Database.SQLServerCompact.Variable(targetVariableName);
         Algorithm algorithm = new Algorithm(algoName);
         Model model = new Model(targetVariable, algorithm);
@@ -83,5 +87,5 @@
         //foreach (InputVariableResult inputVariableResult in inputVariableResults)
         //  database.Persist(inputVariableResult);
-        
+
       }
     }
@@ -91,5 +95,5 @@
       return from i in Enumerable.Range(0, inputVariables.Count())
              where inputVariables[i] != null && results[i] != null && double.TryParse(modelData[i], out temp)
-             select new InputVariableResult(new InputVariable(model, new Variable(inputVariables[i])), results[i], double.Parse(modelData[i]));
+             select new InputVariableResult(new InputVariable(model, new HeuristicLab.Modeling.Database.SQLServerCompact.Variable(inputVariables[i])), results[i], double.Parse(modelData[i]));
     }
 
@@ -99,4 +103,153 @@
              select new ModelResult(model, results[i], double.Parse(modelData[i]));
     }
+
+    Dictionary<string, IFunction> knownFunctions = new Dictionary<string, IFunction>() {
+    {"+", new Addition()},
+    {"and", new And()},
+    {"mean", new Average()},
+    {"cos", new Cosinus()},
+    {"/", new Division()},
+    {"equ", new Equal()},
+    {"exp", new Exponential()},
+    {">", new GreaterThan()},
+    {"if", new IfThenElse()},
+    {"<", new LessThan()},
+    {"log", new Logarithm()},
+    {"*", new Multiplication()},
+    {"not", new Not()},
+    {"or", new Or()},
+    {"expt", new Power()},
+    {"sign", new Signum()},
+    {"sin",new Sinus()},
+    {"sqrt", new Sqrt()},
+    {"-", new Subtraction()},
+    {"tan", new Tangens()},
+    {"xor", new Xor()}
+    };
+    Constant constant = new Constant();
+    HeuristicLab.GP.StructureIdentification.Variable variable = new HeuristicLab.GP.StructureIdentification.Variable();
+    Differential differential = new Differential();
+
+    private HeuristicLab.Core.IItem ParseModel(string dirName, string modelFileName, string algoName) {
+      if (algoName == "SupportVectorRegression") {
+        HeuristicLab.Data.SVMModel model = new HeuristicLab.Data.SVMModel();
+        model.Model = SVM.Model.Read(Path.Combine(dirName, modelFileName) + ".svm.model.txt");
+        model.RangeTransform = SVM.RangeTransform.Read(Path.Combine(dirName, modelFileName) + ".svm.transform.txt");
+        return model;
+      } else {
+        GeneticProgrammingModel model = new GeneticProgrammingModel();
+        IEnumerable<Token> tokens = GetTokenStream(File.OpenText(Path.Combine(dirName, modelFileName) + ".gp.txt"));
+        model.FunctionTree = ParseSexp(new Queue<Token>(tokens));
+        return model;
+      }
+    }
+
+    private IEnumerable<Token> GetTokenStream(StreamReader reader) {
+      return from line in GetLineStream(reader)
+             let strTokens = line.Split(new string[] { " ", "\t", Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).AsEnumerable()
+             from strToken in strTokens
+             let t = Token.Parse(strToken)
+             where t != null
+             select t;
+    }
+
+    private IEnumerable<string> GetLineStream(StreamReader reader) {
+      while (!reader.EndOfStream) yield return reader.ReadLine().Replace("(", " ( ").Replace(")", " ) ");
+      yield break;
+    }
+
+    private HeuristicLab.GP.Interfaces.IFunctionTree ParseSexp(Queue<Token> tokens) {
+      Expect(Token.LPAR, tokens);
+
+      if (tokens.Peek().Symbol == TokenSymbol.SYMB) {
+        if (tokens.Peek().StringValue.Equals("variable")) {
+          return ParseVariable(tokens);
+        } else if (tokens.Peek().StringValue.Equals("differential")) {
+          return ParseDifferential(tokens);
+        } else {
+          Token curToken = tokens.Dequeue();
+          IFunctionTree tree = CreateTree(curToken);
+          while (!tokens.Peek().Equals(Token.RPAR)) {
+            tree.AddSubTree(ParseSexp(tokens));
+          }
+          Expect(Token.RPAR, tokens);
+          return tree;
+        }
+      } else if (tokens.Peek().Symbol == TokenSymbol.NUMBER) {
+        ConstantFunctionTree t = (ConstantFunctionTree)constant.GetTreeNode();
+        t.Value = tokens.Dequeue().DoubleValue;
+        return t;
+      } else {
+        throw new FormatException("Expected function or constant symbol");
+      }
+    }
+
+    private IFunctionTree ParseDifferential(Queue<Token> tokens) {
+      Debug.Assert(tokens.Dequeue().StringValue == "differential");
+      VariableFunctionTree t = (VariableFunctionTree)differential.GetTreeNode();
+      t.Weight = tokens.Dequeue().DoubleValue;
+      t.VariableName = tokens.Dequeue().StringValue;
+      t.SampleOffset = (int)tokens.Dequeue().DoubleValue;
+      Expect(Token.RPAR, tokens);
+      return t;
+    }
+
+    private IFunctionTree ParseVariable(Queue<Token> tokens) {
+      Debug.Assert(tokens.Dequeue().StringValue == "variable");
+      VariableFunctionTree t = (VariableFunctionTree)variable.GetTreeNode();
+      t.Weight = tokens.Dequeue().DoubleValue;
+      t.VariableName = tokens.Dequeue().StringValue;
+      t.SampleOffset = (int)tokens.Dequeue().DoubleValue;
+      Expect(Token.RPAR, tokens);
+      return t;
+    }
+
+    private IFunctionTree CreateTree(Token token) {
+      if (token.Symbol != TokenSymbol.SYMB) throw new FormatException("Expected function symbol, but got: " + token.StringValue);
+      return knownFunctions[token.StringValue].GetTreeNode();
+    }
+
+    private void Expect(Token token, Queue<Token> tokens) {
+      Token cur = tokens.Dequeue();
+      if (!token.Equals(cur)) throw new FormatException("Expected: " + token.StringValue + ", but got found: " + cur.StringValue);
+    }
+
+    private enum TokenSymbol { LPAR, RPAR, SYMB, NUMBER };
+    private class Token {
+      public static readonly Token LPAR = Token.Parse("(");
+      public static readonly Token RPAR = Token.Parse(")");
+
+      public TokenSymbol Symbol { get; set; }
+      public string StringValue { get; set; }
+      public double DoubleValue { get; set; }
+      public Token() { }
+
+      public override bool Equals(object obj) {
+        Token other = (obj as Token);
+        if (other == null) return false;
+        if (other.Symbol != Symbol) return false;
+        return other.StringValue == this.StringValue;
+      }
+
+      public static Token Parse(string strToken) {
+        strToken = strToken.Trim();
+        Token t = new Token();
+        t.StringValue = strToken.Trim();
+        double temp;
+        if (strToken == "") {
+          t = null;
+        } else if (strToken == "(") {
+          t.Symbol = TokenSymbol.LPAR;
+        } else if (strToken == ")") {
+          t.Symbol = TokenSymbol.RPAR;
+        } else if (double.TryParse(strToken, out temp)) {
+          t.Symbol = TokenSymbol.NUMBER;
+          t.DoubleValue = double.Parse(strToken);
+        } else {
+          t.Symbol = TokenSymbol.SYMB;
+        }
+        return t;
+      }
+    }
   }
 }
Index: /trunk/tools/ConfigMerger/ConfigMerger.csproj
===================================================================
--- /trunk/tools/ConfigMerger/ConfigMerger.csproj	(revision 2259)
+++ /trunk/tools/ConfigMerger/ConfigMerger.csproj	(revision 2260)
@@ -34,4 +34,21 @@
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\ConfigMerger.XML</DocumentationFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>bin\Release\ConfigMerger.XML</DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
   </PropertyGroup>
   <ItemGroup>
Index: /trunk/tools/Tools.sln
===================================================================
--- /trunk/tools/Tools.sln	(revision 2259)
+++ /trunk/tools/Tools.sln	(revision 2260)
@@ -17,19 +17,33 @@
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
+		Debug|x86 = Debug|x86
 		Release|Any CPU = Release|Any CPU
+		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{E94C5E71-3F29-408D-BCDF-23E096CA84CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E94C5E71-3F29-408D-BCDF-23E096CA84CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E94C5E71-3F29-408D-BCDF-23E096CA84CA}.Debug|x86.ActiveCfg = Debug|x86
+		{E94C5E71-3F29-408D-BCDF-23E096CA84CA}.Debug|x86.Build.0 = Debug|x86
 		{E94C5E71-3F29-408D-BCDF-23E096CA84CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E94C5E71-3F29-408D-BCDF-23E096CA84CA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E94C5E71-3F29-408D-BCDF-23E096CA84CA}.Release|x86.ActiveCfg = Release|Any CPU
+		{E94C5E71-3F29-408D-BCDF-23E096CA84CA}.Release|x86.Build.0 = Release|Any CPU
 		{1E4B971A-83BA-4C39-BE19-D09B13CF7242}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{1E4B971A-83BA-4C39-BE19-D09B13CF7242}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1E4B971A-83BA-4C39-BE19-D09B13CF7242}.Debug|x86.ActiveCfg = Debug|x86
+		{1E4B971A-83BA-4C39-BE19-D09B13CF7242}.Debug|x86.Build.0 = Debug|x86
 		{1E4B971A-83BA-4C39-BE19-D09B13CF7242}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{1E4B971A-83BA-4C39-BE19-D09B13CF7242}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1E4B971A-83BA-4C39-BE19-D09B13CF7242}.Release|x86.ActiveCfg = Release|Any CPU
+		{1E4B971A-83BA-4C39-BE19-D09B13CF7242}.Release|x86.Build.0 = Release|Any CPU
 		{F4818BCF-A57F-413C-8DEE-C0532C7F7C7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{F4818BCF-A57F-413C-8DEE-C0532C7F7C7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F4818BCF-A57F-413C-8DEE-C0532C7F7C7F}.Debug|x86.ActiveCfg = Debug|x86
+		{F4818BCF-A57F-413C-8DEE-C0532C7F7C7F}.Debug|x86.Build.0 = Debug|x86
 		{F4818BCF-A57F-413C-8DEE-C0532C7F7C7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{F4818BCF-A57F-413C-8DEE-C0532C7F7C7F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F4818BCF-A57F-413C-8DEE-C0532C7F7C7F}.Release|x86.ActiveCfg = Release|Any CPU
+		{F4818BCF-A57F-413C-8DEE-C0532C7F7C7F}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: /trunk/tools/Wizards/Wizards.csproj
===================================================================
--- /trunk/tools/Wizards/Wizards.csproj	(revision 2259)
+++ /trunk/tools/Wizards/Wizards.csproj	(revision 2260)
@@ -32,4 +32,20 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
   </PropertyGroup>
   <ItemGroup>
