Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols.sln
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols.sln	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols.sln	(revision 5026)
@@ -0,0 +1,88 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3", "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj", "{125D3006-67F5-48CB-913E-73C0548F17FA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis-3.3", "HeuristicLab.Problems.DataAnalysis\3.3\HeuristicLab.Problems.DataAnalysis-3.3.csproj", "{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Regression-3.3", "HeuristicLab.Problems.DataAnalysis.Regression\3.3\HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj", "{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Views-3.3", "HeuristicLab.Problems.DataAnalysis.Views\3.3\HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj", "{799B0B38-E384-4A17-A73C-F211EB854592}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GP.Symbols", "GP.Symbols\GP.Symbols.csproj", "{6BB69BAC-FB8F-4E57-881A-557F350B7611}"
+EndProject
+Global
+	GlobalSection(SubversionScc) = preSolution
+		Svn-Managed = True
+		Manager = AnkhSVN - Subversion Support for Visual Studio
+	EndGlobalSection
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Debug|x64.ActiveCfg = Debug|x64
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Debug|x64.Build.0 = Debug|x64
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Debug|x86.ActiveCfg = Debug|x86
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Debug|x86.Build.0 = Debug|x86
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Release|x64.ActiveCfg = Release|x64
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Release|x64.Build.0 = Release|x64
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Release|x86.ActiveCfg = Release|x86
+		{125D3006-67F5-48CB-913E-73C0548F17FA}.Release|x86.Build.0 = Release|x86
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|x64.ActiveCfg = Debug|x64
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|x64.Build.0 = Debug|x64
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|x86.ActiveCfg = Debug|x86
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Debug|x86.Build.0 = Debug|x86
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|x64.ActiveCfg = Release|x64
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|x64.Build.0 = Release|x64
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|x86.ActiveCfg = Release|x86
+		{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}.Release|x86.Build.0 = Release|x86
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Debug|x64.ActiveCfg = Debug|x64
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Debug|x64.Build.0 = Debug|x64
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Debug|x86.ActiveCfg = Debug|x86
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Debug|x86.Build.0 = Debug|x86
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Release|Any CPU.Build.0 = Release|Any CPU
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Release|x64.ActiveCfg = Release|x64
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Release|x64.Build.0 = Release|x64
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Release|x86.ActiveCfg = Release|x86
+		{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}.Release|x86.Build.0 = Release|x86
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|x64.ActiveCfg = Debug|x64
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|x64.Build.0 = Debug|x64
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|x86.ActiveCfg = Debug|x86
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Debug|x86.Build.0 = Debug|x86
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|Any CPU.Build.0 = Release|Any CPU
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|x64.ActiveCfg = Release|x64
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|x64.Build.0 = Release|x64
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|x86.ActiveCfg = Release|x86
+		{799B0B38-E384-4A17-A73C-F211EB854592}.Release|x86.Build.0 = Release|x86
+		{6BB69BAC-FB8F-4E57-881A-557F350B7611}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6BB69BAC-FB8F-4E57-881A-557F350B7611}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6BB69BAC-FB8F-4E57-881A-557F350B7611}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{6BB69BAC-FB8F-4E57-881A-557F350B7611}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{6BB69BAC-FB8F-4E57-881A-557F350B7611}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6BB69BAC-FB8F-4E57-881A-557F350B7611}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6BB69BAC-FB8F-4E57-881A-557F350B7611}.Release|x64.ActiveCfg = Release|Any CPU
+		{6BB69BAC-FB8F-4E57-881A-557F350B7611}.Release|x86.ActiveCfg = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols/CopyAssemblies.cmd
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols/CopyAssemblies.cmd	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols/CopyAssemblies.cmd	(revision 5026)
@@ -0,0 +1,7 @@
+set target=C:\Program Files\HeuristicLab 3.3
+
+@echo Copying assemblies
+copy "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.dll" "%target%"
+copy "HeuristicLab.Problems.DataAnalysis-3.3.dll" "%target%"
+copy "HeuristicLab.Problems.DataAnalysis.Regression-3.3.dll" "%target%"
+copy "HeuristicLab.Problems.DataAnalysis.Views-3.3.dll" "%target%"
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols/GP.Symbols.csproj
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols/GP.Symbols.csproj	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols/GP.Symbols.csproj	(revision 5026)
@@ -0,0 +1,85 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{6BB69BAC-FB8F-4E57-881A-557F350B7611}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>GP.Symbols</RootNamespace>
+    <AssemblyName>GP.Symbols</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <RunPostBuildEvent>Always</RunPostBuildEvent>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="CopyAssemblies.cmd" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj">
+      <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Problems.DataAnalysis.Regression\3.3\HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj">
+      <Project>{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Regression-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Problems.DataAnalysis.Views\3.3\HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj">
+      <Project>{799B0B38-E384-4A17-A73C-F211EB854592}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Views-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Problems.DataAnalysis\3.3\HeuristicLab.Problems.DataAnalysis-3.3.csproj">
+      <Project>{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+set Platform=$(PlatformName)
+set Configuration=$(ConfigurationName)
+call CopyAssemblies.cmd</PostBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols/Properties/AssemblyInfo.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols/Properties/AssemblyInfo.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/GP.Symbols/Properties/AssemblyInfo.cs	(revision 5026)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("GP.Symbols")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("GP.Symbols")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("1b9abf87-0214-441b-94c3-7bb4ba0e6334")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/MinAverageMaxSymbolicExpressionTreeSizeAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/MinAverageMaxSymbolicExpressionTreeSizeAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/MinAverageMaxSymbolicExpressionTreeSizeAnalyzer.cs	(revision 5026)
@@ -0,0 +1,130 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers {
+  /// <summary>
+  /// An operator that tracks the min average and max tree size.
+  /// </summary>
+  [Item("MinAverageMaxSymbolicExpressionTreeSizeAnalyzer", "An operator that tracks the min avgerage and max tree size.")]
+  [StorableClass]
+  public sealed class MinAverageMaxSymbolicExpressionTreeSizeAnalyzer : AlgorithmOperator, ISymbolicExpressionTreeAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string SymbolicExpressionTreeSizeParameterName = "SymbolicExpressionTreeSize";
+    private const string SymbolicExpressionTreeSizesParameterName = "Symbolic expression tree size";
+    private const string MinTreeSizeParameterName = "Min tree size";
+    private const string AverageTreeSizeParameterName = "Average tree size";
+    private const string MaxTreeSizeParameterName = "Max tree size";
+    private const string ResultsParameterName = "Results";
+
+    #region parameter properties
+    public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ScopeTreeLookupParameter<DoubleValue> SymbolicExpressionTreeSizeParameter {
+      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeSizeParameterName]; }
+    }
+    public ValueLookupParameter<DataTable> SymbolicExpressionTreeSizesParameter {
+      get { return (ValueLookupParameter<DataTable>)Parameters[SymbolicExpressionTreeSizesParameterName]; }
+    }
+    public ValueLookupParameter<VariableCollection> ResultsParameter {
+      get { return (ValueLookupParameter<VariableCollection>)Parameters[ResultsParameterName]; }
+    }
+
+    [Storable]
+    private MinAverageMaxValueAnalyzer valueAnalyzer;
+    [Storable]
+    private UniformSubScopesProcessor subScopesProcessor;
+
+    #endregion
+    [StorableConstructor]
+    private MinAverageMaxSymbolicExpressionTreeSizeAnalyzer(bool deserializing) : base() { }
+    private MinAverageMaxSymbolicExpressionTreeSizeAnalyzer(MinAverageMaxSymbolicExpressionTreeSizeAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+      AfterDeserialization();
+    }
+    public MinAverageMaxSymbolicExpressionTreeSizeAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose size should be calculated."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(SymbolicExpressionTreeSizeParameterName, "The tree size of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<DataTable>(SymbolicExpressionTreeSizesParameterName, "The data table to store the tree sizes."));
+      Parameters.Add(new ValueLookupParameter<VariableCollection>(ResultsParameterName, "The results collection where the analysis values should be stored."));
+
+      subScopesProcessor = new UniformSubScopesProcessor();
+      SymbolicExpressionTreeSizeCalculator sizeCalculator = new SymbolicExpressionTreeSizeCalculator();
+      valueAnalyzer = new MinAverageMaxValueAnalyzer();
+
+      subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
+      sizeCalculator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+      sizeCalculator.SymbolicExpressionTreeSizeParameter.ActualName = SymbolicExpressionTreeSizeParameter.Name;
+      valueAnalyzer.ValueParameter.ActualName = sizeCalculator.SymbolicExpressionTreeSizeParameter.Name;
+      valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeSizeParameter.Depth;
+      valueAnalyzer.AverageValueParameter.ActualName = AverageTreeSizeParameterName;
+      valueAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false);
+      valueAnalyzer.MaxValueParameter.ActualName = MaxTreeSizeParameterName;
+      valueAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false);
+      valueAnalyzer.MinValueParameter.ActualName = MinTreeSizeParameterName;
+      valueAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false);
+      valueAnalyzer.ValuesParameter.ActualName = SymbolicExpressionTreeSizesParameter.Name;
+
+      OperatorGraph.InitialOperator = subScopesProcessor;
+      subScopesProcessor.Operator = sizeCalculator;
+      sizeCalculator.Successor = null;
+      subScopesProcessor.Successor = valueAnalyzer;
+      valueAnalyzer.Successor = null;
+
+      AfterDeserialization();
+    }
+
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      SymbolicExpressionTreeParameter.DepthChanged += new EventHandler(SymbolicExpressionTreeParameter_DepthChanged);
+      SymbolicExpressionTreeSizeParameter.DepthChanged += new EventHandler(SymbolicExpressionTreeSizeParameter_DepthChanged);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MinAverageMaxSymbolicExpressionTreeSizeAnalyzer(this, cloner);
+    }
+
+    private void SymbolicExpressionTreeParameter_DepthChanged(object sender, EventArgs e) {
+      OnDepthParameterChanged();
+    }
+
+    private void SymbolicExpressionTreeSizeParameter_DepthChanged(object sender, EventArgs e) {
+      OnDepthParameterChanged();
+    }
+
+    private void OnDepthParameterChanged() {
+      valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+      subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/SymbolicExpressionTreeSizeCalculator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/SymbolicExpressionTreeSizeCalculator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/SymbolicExpressionTreeSizeCalculator.cs	(revision 5026)
@@ -0,0 +1,77 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers {
+  /// <summary>
+  /// An operator that outputs the tree size of a symbolic expression tree.
+  /// </summary>
+  [Item("SymbolicExpressionTreeSizeCalculator", "An operator that outputs the tree size of a symbolic expression tree.")]
+  [StorableClass]
+  public sealed class SymbolicExpressionTreeSizeCalculator : SingleSuccessorOperator {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string SymbolicExpressionTreeSizeParameterName = "SymbolicExpressionTreeSize";
+
+    #region parameter properties
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> SymbolicExpressionTreeSizeParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeSizeParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public DoubleValue SymbolicExpressionTreeSize {
+      get { return SymbolicExpressionTreeSizeParameter.ActualValue; }
+      set { SymbolicExpressionTreeSizeParameter.ActualValue = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicExpressionTreeSizeCalculator(bool deserializing) : base(deserializing) { }
+    private SymbolicExpressionTreeSizeCalculator(SymbolicExpressionTreeSizeCalculator original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicExpressionTreeSizeCalculator()
+      : base() {
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose size should be calculated."));
+      Parameters.Add(new LookupParameter<DoubleValue>(SymbolicExpressionTreeSizeParameterName, "The tree size of the symbolic expression tree."));
+    }
+
+    public override IOperation Apply() {
+      SymbolicExpressionTree tree = SymbolicExpressionTree;
+      SymbolicExpressionTreeSize = new DoubleValue(tree.Size);
+      return base.Apply();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeSizeCalculator(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentCreater.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentCreater.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentCreater.cs	(revision 5026)
@@ -0,0 +1,195 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Creates a new argument within one function-defining branch of a symbolic expression tree.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 106
+  /// </summary>
+  [Item("ArgumentCreater", "Manipulates a symbolic expression by creating a new argument within one function-defining branch.")]
+  [StorableClass]
+  public sealed class ArgumentCreater : SymbolicExpressionTreeArchitectureManipulator {
+    [StorableConstructor]
+    private ArgumentCreater(bool deserializing) : base(deserializing) { }
+    private ArgumentCreater(ArgumentCreater original, Cloner cloner) : base(original, cloner) { }
+    public ArgumentCreater() : base() { }
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = CreateNewArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ArgumentCreater(this, cloner);
+    }
+
+    public static bool CreateNewArgument(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      // work on a copy in case we find out later that the tree would be too big
+      // in this case it's easiest to simply return the original tree.
+      SymbolicExpressionTree clonedTree = (SymbolicExpressionTree)symbolicExpressionTree.Clone();
+
+      var functionDefiningBranches = clonedTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+      if (functionDefiningBranches.Count() == 0)
+        // no function defining branch found => abort
+        return false;
+
+      // select a random function defining branch
+      var selectedDefunBranch = functionDefiningBranches.SelectRandom(random);
+      var definedArguments = (from symbol in selectedDefunBranch.Grammar.Symbols.OfType<Argument>()
+                              select symbol.ArgumentIndex).Distinct();
+      if (definedArguments.Count() >= maxFunctionArguments)
+        // max number of arguments reached => abort
+        return false;
+
+      var allowedArgumentIndexes = Enumerable.Range(0, maxFunctionArguments);
+      var newArgumentIndex = allowedArgumentIndexes.Except(definedArguments).First();
+      ArgumentTreeNode newArgumentNode = MakeArgumentNode(newArgumentIndex);
+
+      // this operation potentially creates very big trees so the access to the size property might throw overflow exception
+      try {
+        if (CreateNewArgumentForDefun(random, clonedTree, selectedDefunBranch, newArgumentNode) && clonedTree.Size < maxTreeSize && clonedTree.Height < maxTreeHeight) {
+
+          // size constraints are fulfilled 
+          // replace root of original tree with root of manipulated tree
+          symbolicExpressionTree.Root = clonedTree.Root;
+          return true;
+        } else {
+          // keep originalTree
+          return false;
+        }
+      }
+      catch (OverflowException) {
+        // keep original tree
+        return false;
+      }
+    }
+
+    private static bool CreateNewArgumentForDefun(IRandom random, SymbolicExpressionTree tree, DefunTreeNode defunBranch, ArgumentTreeNode newArgumentNode) {
+      // select a random cut point in the function defining branch
+      // the branch at the cut point is to be replaced by a new argument node
+      var cutPoints = (from node in defunBranch.IterateNodesPrefix()
+                       where node.SubTrees.Count > 0
+                       from subtree in node.SubTrees
+                       select new { Parent = node, ReplacedChildIndex = node.SubTrees.IndexOf(subtree), ReplacedChild = subtree }).ToList();
+
+      if (cutPoints.Count() == 0)
+        // no cut point found => abort;
+        return false;
+      var selectedCutPoint = cutPoints[random.Next(cutPoints.Count)];
+      // replace the branch at the cut point with an argument node
+      var replacedBranch = selectedCutPoint.ReplacedChild;
+      selectedCutPoint.Parent.RemoveSubTree(selectedCutPoint.ReplacedChildIndex);
+      selectedCutPoint.Parent.InsertSubTree(selectedCutPoint.ReplacedChildIndex, newArgumentNode);
+
+      // find all old invocations of the selected ADF and attach a cloned version of the replaced branch (with all argument-nodes expanded)
+      // iterate in post-fix order to make sure that the subtrees of n are already adapted when n is processed
+      var invocationNodes = (from node in tree.IterateNodesPostfix().OfType<InvokeFunctionTreeNode>()
+                             where node.Symbol.FunctionName == defunBranch.FunctionName
+                             where node.SubTrees.Count == defunBranch.NumberOfArguments
+                             select node).ToList();
+      // do this repeatedly until no matching invocations are found      
+      while (invocationNodes.Count > 0) {
+        List<SymbolicExpressionTreeNode> newlyAddedBranches = new List<SymbolicExpressionTreeNode>();
+        foreach (var invocationNode in invocationNodes) {
+          // check that the invocation node really has the correct number of arguments
+          if (invocationNode.SubTrees.Count != defunBranch.NumberOfArguments) throw new InvalidOperationException();
+          // append a new argument branch after expanding all argument nodes
+          var clonedBranch = (SymbolicExpressionTreeNode)replacedBranch.Clone();
+          clonedBranch = ReplaceArgumentsInBranch(clonedBranch, invocationNode.SubTrees);
+          invocationNode.InsertSubTree(newArgumentNode.Symbol.ArgumentIndex, clonedBranch);
+          newlyAddedBranches.Add(clonedBranch);
+        }
+        // iterate in post-fix order to make sure that the subtrees of n are already adapted when n is processed
+        invocationNodes = (from newlyAddedBranch in newlyAddedBranches
+                           from node in newlyAddedBranch.IterateNodesPostfix().OfType<InvokeFunctionTreeNode>()
+                           where node.Symbol.FunctionName == defunBranch.FunctionName
+                           where node.SubTrees.Count == defunBranch.NumberOfArguments
+                           select node).ToList();
+      }
+      // increase expected number of arguments of function defining branch
+      // it's possible that the number of actually referenced arguments was reduced (all references were replaced by a single new argument)
+      // but the number of expected arguments is increased anyway
+      defunBranch.NumberOfArguments++;
+      defunBranch.Grammar.AddSymbol(newArgumentNode.Symbol);
+      defunBranch.Grammar.SetMinSubtreeCount(newArgumentNode.Symbol, 0);
+      defunBranch.Grammar.SetMaxSubtreeCount(newArgumentNode.Symbol, 0);
+      // allow the argument as child of any other symbol
+      foreach (var symb in defunBranch.Grammar.Symbols)
+        for (int i = 0; i < defunBranch.Grammar.GetMaxSubtreeCount(symb); i++) {
+          defunBranch.Grammar.SetAllowedChild(symb, newArgumentNode.Symbol, i);
+        }
+      foreach (var subtree in tree.Root.SubTrees) {
+        // when the changed function is known in the branch then update the number of arguments
+        var matchingSymbol = subtree.Grammar.Symbols.OfType<InvokeFunction>().Where(s => s.FunctionName == defunBranch.FunctionName).SingleOrDefault();
+        if (matchingSymbol != null) {
+          subtree.Grammar.SetMinSubtreeCount(matchingSymbol, defunBranch.NumberOfArguments);
+          subtree.Grammar.SetMaxSubtreeCount(matchingSymbol, defunBranch.NumberOfArguments);
+          foreach (var child in subtree.GetAllowedSymbols(0)) {
+            for (int i = 0; i < subtree.Grammar.GetMaxSubtreeCount(matchingSymbol); i++) {
+              subtree.Grammar.SetAllowedChild(matchingSymbol, child, i);
+            }
+          }
+        }
+      }
+
+      return true;
+    }
+
+    private static SymbolicExpressionTreeNode ReplaceArgumentsInBranch(SymbolicExpressionTreeNode branch, IList<SymbolicExpressionTreeNode> argumentTrees) {
+      ArgumentTreeNode argNode = branch as ArgumentTreeNode;
+      if (argNode != null) {
+        // replace argument nodes by a clone of the original subtree that provided the result for the argument node
+        return (SymbolicExpressionTreeNode)argumentTrees[argNode.Symbol.ArgumentIndex].Clone();
+      } else {
+        // call recursively for all subtree
+        List<SymbolicExpressionTreeNode> subtrees = new List<SymbolicExpressionTreeNode>(branch.SubTrees);
+        while (branch.SubTrees.Count > 0) branch.RemoveSubTree(0);
+        foreach (var subtree in subtrees) {
+          branch.AddSubTree(ReplaceArgumentsInBranch(subtree, argumentTrees));
+        }
+        return branch;
+      }
+    }
+
+    private static ArgumentTreeNode MakeArgumentNode(int argIndex) {
+      var node = (ArgumentTreeNode)(new Argument(argIndex)).CreateTreeNode();
+      return node;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDeleter.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDeleter.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDeleter.cs	(revision 5026)
@@ -0,0 +1,113 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 112
+  /// </summary>
+  [Item("ArgumentDeleter", "Manipulates a symbolic expression by deleting an argument from an existing function defining branch.")]
+  [StorableClass]
+  public sealed class ArgumentDeleter : SymbolicExpressionTreeArchitectureManipulator {
+    [StorableConstructor]
+    private ArgumentDeleter(bool deserializing) : base(deserializing) { }
+    private ArgumentDeleter(ArgumentDeleter original, Cloner cloner) : base(original, cloner) { }
+    public ArgumentDeleter() : base() { }
+
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = DeleteArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ArgumentDeleter(this, cloner);
+    }
+
+    public static bool DeleteArgument(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+      if (functionDefiningBranches.Count() == 0)
+        // no function defining branch => abort
+        return false;
+      var selectedDefunBranch = functionDefiningBranches.SelectRandom(random);
+      if (selectedDefunBranch.NumberOfArguments <= 1)
+        // argument deletion by consolidation is not possible => abort
+        return false;
+      // the argument to be removed is always the one with the largest index 
+      // (otherwise we would have to decrement the index of the larger argument symbols)
+      var removedArgument = (from sym in selectedDefunBranch.Grammar.Symbols.OfType<Argument>()
+                             select sym.ArgumentIndex).Distinct().OrderBy(x => x).Last();
+      // find invocations of the manipulated funcion and remove the specified argument tree
+      var invocationNodes = (from node in symbolicExpressionTree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
+                             where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                             select node).ToList();
+      foreach (var invokeNode in invocationNodes) {
+        invokeNode.RemoveSubTree(removedArgument);
+      }
+
+      DeleteArgumentByConsolidation(random, selectedDefunBranch, removedArgument);
+
+      // delete the dynamic argument symbol that matches the argument to be removed
+      var matchingSymbol = selectedDefunBranch.Grammar.Symbols.OfType<Argument>().Where(s => s.ArgumentIndex == removedArgument).Single();
+      selectedDefunBranch.Grammar.RemoveSymbol(matchingSymbol);
+      selectedDefunBranch.NumberOfArguments--;
+      // reduce arity in known functions of all root branches
+      foreach (var subtree in symbolicExpressionTree.Root.SubTrees) {
+        var matchingInvokeSymbol = subtree.Grammar.Symbols.OfType<InvokeFunction>().Where(s => s.FunctionName == selectedDefunBranch.FunctionName).SingleOrDefault();
+        if (matchingInvokeSymbol != null) {
+          subtree.Grammar.SetMinSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments);
+          subtree.Grammar.SetMaxSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments);
+        }
+      }
+      return true;
+    }
+
+    private static void DeleteArgumentByConsolidation(IRandom random, DefunTreeNode branch, int removedArgumentIndex) {
+      // replace references to the deleted argument with random references to existing arguments
+      var possibleArgumentSymbols = (from sym in branch.Grammar.Symbols.OfType<Argument>()
+                                     where sym.ArgumentIndex != removedArgumentIndex
+                                     select sym).ToList();
+      var argNodes = from node in branch.IterateNodesPrefix().OfType<ArgumentTreeNode>()
+                     where node.Symbol.ArgumentIndex == removedArgumentIndex
+                     select node;
+      foreach (var argNode in argNodes) {
+        var replacementSymbol = possibleArgumentSymbols.SelectRandom(random);
+        argNode.Symbol = replacementSymbol;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDuplicater.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDuplicater.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/ArgumentDuplicater.cs	(revision 5026)
@@ -0,0 +1,142 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Manipulates a symbolic expression by duplicating an existing argument node of a function-defining branch.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 94
+  /// </summary>
+  [Item("ArgumentDuplicater", "Manipulates a symbolic expression by duplicating an existing argument node of a function-defining branch.")]
+  [StorableClass]
+  public sealed class ArgumentDuplicater : SymbolicExpressionTreeArchitectureManipulator {
+    [StorableConstructor]
+    private ArgumentDuplicater(bool deserializing) : base(deserializing) { }
+    private ArgumentDuplicater(ArgumentDuplicater original, Cloner cloner) : base(original, cloner) { }
+    public ArgumentDuplicater() : base() { }
+
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = DuplicateArgument(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ArgumentDuplicater(this, cloner);
+    }
+
+    public static bool DuplicateArgument(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+
+      var allowedArgumentIndexes = Enumerable.Range(0, maxFunctionArguments);
+      if (functionDefiningBranches.Count() == 0)
+        // no function defining branches => abort
+        return false;
+
+      var selectedDefunBranch = functionDefiningBranches.SelectRandom(random);
+      var argumentSymbols = selectedDefunBranch.Grammar.Symbols.OfType<Argument>();
+      if (argumentSymbols.Count() == 0 || argumentSymbols.Count() >= maxFunctionArguments)
+        // when no argument or number of arguments is already at max allowed value => abort
+        return false;
+      var selectedArgumentSymbol = argumentSymbols.SelectRandom(random);
+      var takenIndexes = argumentSymbols.Select(s => s.ArgumentIndex);
+      var newArgumentIndex = allowedArgumentIndexes.Except(takenIndexes).First();
+
+      var newArgSymbol = new Argument(newArgumentIndex);
+
+      // replace existing references to the original argument with references to the new argument randomly in the selectedBranch
+      var argumentNodes = selectedDefunBranch.IterateNodesPrefix().OfType<ArgumentTreeNode>();
+      foreach (var argNode in argumentNodes) {
+        if (argNode.Symbol == selectedArgumentSymbol) {
+          if (random.NextDouble() < 0.5) {
+            argNode.Symbol = newArgSymbol;
+          }
+        }
+      }
+      // find invocations of the functions and duplicate the matching argument branch
+      var invocationNodes = (from node in symbolicExpressionTree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
+                             where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                             where node.SubTrees.Count == selectedDefunBranch.NumberOfArguments
+                             select node).ToList();
+      // do this repeatedly until no matching invocations are found      
+      while (invocationNodes.Count() > 0) {
+        List<SymbolicExpressionTreeNode> newlyAddedBranches = new List<SymbolicExpressionTreeNode>();
+        foreach (var invokeNode in invocationNodes) {
+          // check that the invocation node really has the correct number of arguments
+          if (invokeNode.SubTrees.Count != selectedDefunBranch.NumberOfArguments) throw new InvalidOperationException();
+          var argumentBranch = invokeNode.SubTrees[selectedArgumentSymbol.ArgumentIndex];
+          var clonedArgumentBranch = (SymbolicExpressionTreeNode)argumentBranch.Clone();
+          invokeNode.InsertSubTree(newArgumentIndex, clonedArgumentBranch);
+          newlyAddedBranches.Add(clonedArgumentBranch);
+        }
+        invocationNodes = (from newlyAddedBranch in newlyAddedBranches
+                           from node in newlyAddedBranch.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
+                           where node.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                           where node.SubTrees.Count == selectedDefunBranch.NumberOfArguments
+                           select node).ToList();
+      }
+      // register the new argument symbol and increase the number of arguments of the ADF
+      selectedDefunBranch.Grammar.AddSymbol(newArgSymbol);
+      selectedDefunBranch.Grammar.SetMinSubtreeCount(newArgSymbol, 0);
+      selectedDefunBranch.Grammar.SetMaxSubtreeCount(newArgSymbol, 0);
+      // allow the argument as child of any other symbol
+      foreach (var symb in selectedDefunBranch.Grammar.Symbols)
+        for (int i = 0; i < selectedDefunBranch.Grammar.GetMaxSubtreeCount(symb); i++) {
+          selectedDefunBranch.Grammar.SetAllowedChild(symb, newArgSymbol, i);
+        }
+      selectedDefunBranch.NumberOfArguments++;
+
+      // increase the arity of the changed ADF in all branches that can use this ADF
+      foreach (var subtree in symbolicExpressionTree.Root.SubTrees) {
+        var matchingInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                    where symb.FunctionName == selectedDefunBranch.FunctionName
+                                    select symb).SingleOrDefault();
+        if (matchingInvokeSymbol != null) {
+          subtree.Grammar.SetMinSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments);
+          subtree.Grammar.SetMaxSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments);
+          foreach (var child in subtree.GetAllowedSymbols(0)) {
+            for (int i = 0; i < subtree.Grammar.GetMaxSubtreeCount(matchingInvokeSymbol); i++) {
+              subtree.Grammar.SetAllowedChild(matchingInvokeSymbol, child, i);
+            }
+          }
+        }
+      }
+      return true;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/GrammarModifier.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/GrammarModifier.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/GrammarModifier.cs	(revision 5026)
@@ -0,0 +1,69 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  public static class GrammarModifier {
+    public static void AddDynamicSymbol(ISymbolicExpressionGrammar grammar, Symbol classRepresentative, string symbolName, int nArgs) {
+      var invokeSym = new InvokeFunction(symbolName);
+      grammar.AddSymbol(invokeSym);
+      grammar.SetMinSubtreeCount(invokeSym, nArgs);
+      grammar.SetMaxSubtreeCount(invokeSym, nArgs);
+      SetSyntaxConstraints(grammar, classRepresentative, invokeSym);
+    }
+
+
+    public static void AddDynamicArguments(ISymbolicExpressionGrammar grammar, Symbol classRepresentative, IEnumerable<int> argumentIndexes) {
+      foreach (int argIndex in argumentIndexes) {
+        var argSymbol = new Argument(argIndex);
+        grammar.AddSymbol(argSymbol);
+        grammar.SetMinSubtreeCount(argSymbol, 0);
+        grammar.SetMaxSubtreeCount(argSymbol, 0);
+        SetSyntaxConstraints(grammar, classRepresentative, argSymbol);
+      }
+    }
+
+    private static void SetSyntaxConstraints(ISymbolicExpressionGrammar grammar, Symbol classRepresentative, Symbol newSymbol) {
+      // allow symbol as child of the representative first to make sure that the symbol 
+      // is in the list of parents and children
+      for (int i = 0; i < grammar.GetMaxSubtreeCount(classRepresentative); i++) {
+        grammar.SetAllowedChild(classRepresentative, newSymbol, i);
+      }
+      // for all available symbols add the new symbol as allowed child iff the available symbol is an allowed child of the class representative
+      foreach (var parent in grammar.Symbols) {
+        if (grammar.IsAllowedChild(classRepresentative, parent, 0))
+          for (int arg = 0; arg < grammar.GetMaxSubtreeCount(parent); arg++) {
+            grammar.SetAllowedChild(parent, newSymbol, arg);
+          }
+      }
+      // for all available symbols add the new symbol as allowed parent iff the available symbol is an allowed child of the class representative
+      foreach (var child in grammar.Symbols) {
+        if (grammar.IsAllowedChild(classRepresentative, child, 0))
+          for (int arg = 0; arg < grammar.GetMaxSubtreeCount(newSymbol); arg++) {
+            grammar.SetAllowedChild(newSymbol, child, arg);
+          }
+      }
+    }
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs	(revision 5026)
@@ -0,0 +1,134 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  [Item("MultiSymbolicExpressionTreeArchitectureManipulator", "Randomly selects and applies one of its architecture manipulators every time it is called.")]
+  [StorableClass]
+  public sealed class MultiSymbolicExpressionTreeArchitectureManipulator : StochasticMultiBranch<ISymbolicExpressionTreeArchitectureManipulator>, ISymbolicExpressionTreeArchitectureManipulator, IStochasticOperator {
+    private const string MaxTreeSizeParameterName = "MaxTreeSize";
+    private const string MaxTreeHeightParameterName = "MaxTreeHeight";
+    private const string SymbolicExpressionGrammarParameterName = "SymbolicExpressionGrammar";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string MaxFunctionArgumentsParameterName = "MaxFunctionArguments";
+    private const string MaxFunctionDefiningBranchesParameterName = "MaxFunctionDefiningBranches";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    protected override bool CreateChildOperation {
+      get { return true; }
+    }
+    #region ISymbolicExpressionTreeArchitectureManipulator Members
+    public IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionDefiningBranchesParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; }
+    }
+    #endregion
+
+    #region ISymbolicExpressionTreeManipulator Members
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    #endregion
+
+    #region ISymbolicExpressionTreeOperator Members
+    public IValueLookupParameter<IntValue> MaxTreeSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeSizeParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxTreeHeightParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeHeightParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionGrammarParameter {
+      get { return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionGrammarParameterName]; }
+    }
+    #endregion
+
+
+    [StorableConstructor]
+    private MultiSymbolicExpressionTreeArchitectureManipulator(bool deserializing) : base(deserializing) { }
+    private MultiSymbolicExpressionTreeArchitectureManipulator(MultiSymbolicExpressionTreeArchitectureManipulator original, Cloner cloner) : base(original, cloner) { }
+    public MultiSymbolicExpressionTreeArchitectureManipulator()
+      : base() {
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionDefiningBranchesParameterName, "The maximal allowed number of function defining branches."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionArgumentsParameterName, "The maximal allowed number of arguments of a newly created function."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeSizeParameterName, "The maximal size (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeHeightParameterName, "The maximal height of the symbolic expression tree (a tree with one node has height = 0)."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionGrammarParameterName, "The grammar that defines the allowed symbols and syntax of the symbolic expression trees."));
+
+      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeArchitectureManipulator))) {
+        if (!typeof(MultiOperator<ISymbolicExpressionTreeArchitectureManipulator>).IsAssignableFrom(type))
+          Operators.Add((ISymbolicExpressionTreeArchitectureManipulator)Activator.CreateInstance(type), true);
+      }
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiSymbolicExpressionTreeArchitectureManipulator(this, cloner);
+    }
+
+    protected override void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeArchitectureManipulator>> e) {
+      base.Operators_ItemsReplaced(sender, e);
+      ParameterizeManipulators();
+    }
+
+    protected override void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeArchitectureManipulator>> e) {
+      base.Operators_ItemsAdded(sender, e);
+      ParameterizeManipulators();
+    }
+
+    private void ParameterizeManipulators() {
+      foreach (ISymbolicExpressionTreeArchitectureManipulator manipulator in Operators.OfType<ISymbolicExpressionTreeArchitectureManipulator>()) {
+        manipulator.MaxTreeSizeParameter.ActualName = MaxTreeSizeParameter.Name;
+        manipulator.MaxTreeHeightParameter.ActualName = MaxTreeHeightParameter.Name;
+        manipulator.SymbolicExpressionGrammarParameter.ActualName = SymbolicExpressionGrammarParameter.Name;
+        manipulator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+        manipulator.MaxFunctionDefinitionsParameter.ActualName = MaxFunctionDefinitionsParameter.Name;
+        manipulator.MaxFunctionArgumentsParameter.ActualName = MaxFunctionArgumentsParameter.Name;
+      }
+
+      foreach (IStochasticOperator manipulator in Operators.OfType<IStochasticOperator>()) {
+        manipulator.RandomParameter.ActualName = RandomParameter.Name;
+      }
+    }
+
+    #region ISymbolicExpressionTreeArchitectureManipulator Members
+    public void ModifyArchitecture(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments, out bool success) {
+      var op = Operators.SelectRandom(random);
+      op.ModifyArchitecture(random, symbolicExpressionTree, grammar, maxTreeSize, maxTreeHeight, maxFunctionDefiningBranches, maxFunctionArguments, out success);
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineCreater.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineCreater.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineCreater.cs	(revision 5026)
@@ -0,0 +1,230 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Manipulates a symbolic expression by adding one new function-defining branch containing
+  /// a proportion of a preexisting branch and by creating a reference to the new branch.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 97
+  /// </summary>
+  [Item("SubroutineCreater", "Manipulates a symbolic expression by adding one new function-defining branch containing a proportion of a preexisting branch and by creating a reference to the new branch.")]
+  [StorableClass]
+  public sealed class SubroutineCreater : SymbolicExpressionTreeArchitectureManipulator {
+    private const double ARGUMENT_CUTOFF_PROBABILITY = 0.05;
+
+    [StorableConstructor]
+    private SubroutineCreater(bool deserializing) : base(deserializing) { }
+    private SubroutineCreater(SubroutineCreater original, Cloner cloner) : base(original, cloner) { }
+    public SubroutineCreater() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SubroutineCreater(this, cloner);
+    }
+
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = CreateSubroutine(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool CreateSubroutine(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+      if (functionDefiningBranches.Count() >= maxFunctionDefiningBranches)
+        // allowed maximum number of ADF reached => abort
+        return false;
+      if (symbolicExpressionTree.Size + 4 > maxTreeSize)
+        // defining a new function causes an size increase by 4 nodes (max) if the max tree size is reached => abort
+        return false;
+      string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefiningBranches * 10 - 1)).ToString(); // >= 100 functions => ###
+      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefiningBranches)
+                                 select "ADF" + index.ToString(formatString);
+
+      // select a random body (either the result producing branch or an ADF branch)
+      var bodies = from node in symbolicExpressionTree.Root.SubTrees
+                   select new { Tree = node, Size = node.GetSize() };
+      var totalNumberOfBodyNodes = bodies.Select(x => x.Size).Sum();
+      int r = random.Next(totalNumberOfBodyNodes);
+      int aggregatedNumberOfBodyNodes = 0;
+      SymbolicExpressionTreeNode selectedBody = null;
+      foreach (var body in bodies) {
+        aggregatedNumberOfBodyNodes += body.Size;
+        if (aggregatedNumberOfBodyNodes > r)
+          selectedBody = body.Tree;
+      }
+      // sanity check
+      if (selectedBody == null) throw new InvalidOperationException();
+
+      // select a random cut point in the selected branch
+      var allCutPoints = from parent in selectedBody.IterateNodesPrefix()
+                         from subtree in parent.SubTrees
+                         select new { Parent = parent, ReplacedBranchIndex = parent.SubTrees.IndexOf(subtree), ReplacedBranch = subtree };
+      if (allCutPoints.Count() == 0)
+        // no cut points => abort
+        return false;
+      string newFunctionName = allowedFunctionNames.Except(functionDefiningBranches.Select(x => x.FunctionName)).First();
+      var selectedCutPoint = allCutPoints.SelectRandom(random);
+      // select random branches as argument cut-off points (replaced by argument terminal nodes in the function)
+      List<SymbolicExpressionTreeNode> argumentBranches = SelectRandomArgumentBranches(selectedCutPoint.ReplacedBranch, random, ARGUMENT_CUTOFF_PROBABILITY, maxFunctionArguments);
+      SymbolicExpressionTreeNode functionBody = selectedCutPoint.ReplacedBranch;
+      // disconnect the function body from the tree
+      selectedCutPoint.Parent.RemoveSubTree(selectedCutPoint.ReplacedBranchIndex);
+      // disconnect the argument branches from the function
+      functionBody = DisconnectBranches(functionBody, argumentBranches);
+      // insert a function invocation symbol instead
+      var invokeNode = (InvokeFunctionTreeNode)(new InvokeFunction(newFunctionName)).CreateTreeNode();
+      selectedCutPoint.Parent.InsertSubTree(selectedCutPoint.ReplacedBranchIndex, invokeNode);
+      // add the branches selected as argument as subtrees of the function invocation node
+      foreach (var argumentBranch in argumentBranches)
+        invokeNode.AddSubTree(argumentBranch);
+
+      // insert a new function defining branch
+      var defunNode = (DefunTreeNode)(new Defun()).CreateTreeNode();
+      defunNode.FunctionName = newFunctionName;
+      defunNode.AddSubTree(functionBody);
+      symbolicExpressionTree.Root.AddSubTree(defunNode);
+      // the grammar in the newly defined function is a clone of the grammar of the originating branch
+      defunNode.SetGrammar((ISymbolicExpressionGrammar)selectedBody.Grammar.Clone());
+      // remove all argument symbols from grammar
+      var oldArgumentSymbols = defunNode.Grammar.Symbols.OfType<Argument>().ToList();
+      foreach (var oldArgSymb in oldArgumentSymbols)
+        defunNode.Grammar.RemoveSymbol(oldArgSymb);
+      // find unique argument indexes and matching symbols in the function defining branch 
+      var newArgumentIndexes = (from node in defunNode.IterateNodesPrefix().OfType<ArgumentTreeNode>()
+                                select node.Symbol.ArgumentIndex).Distinct();
+      // add argument symbols to grammar of function defining branch
+      GrammarModifier.AddDynamicArguments(defunNode.Grammar, defunNode.Symbol, newArgumentIndexes);
+      defunNode.NumberOfArguments = newArgumentIndexes.Count();
+      if (defunNode.NumberOfArguments != argumentBranches.Count) throw new InvalidOperationException();
+      // add invoke symbol for newly defined function to the original branch 
+      var allowedParents = from symb in selectedBody.Grammar.Symbols
+                           where !(symb is ProgramRootSymbol)
+                           select symb;
+      var allowedChildren = from symb in selectedBody.Grammar.Symbols
+                            where selectedBody.Grammar.IsAllowedChild(selectedBody.Symbol, symb, 0)
+                            select symb;
+      GrammarModifier.AddDynamicSymbol(selectedBody.Grammar, selectedBody.Symbol, defunNode.FunctionName, defunNode.NumberOfArguments);
+
+      // when the new function body was taken from another function definition
+      // add invoke symbol for newly defined function to all branches that are allowed to invoke the original branch
+      if (selectedBody.Symbol is Defun) {
+        var originalFunctionDefinition = selectedBody as DefunTreeNode;
+        foreach (var subtree in symbolicExpressionTree.Root.SubTrees) {
+          var originalBranchInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                            where symb.FunctionName == originalFunctionDefinition.FunctionName
+                                            select symb).SingleOrDefault();
+          // when the original branch can be invoked from the subtree then also allow invocation of the function
+          if (originalBranchInvokeSymbol != null) {
+            allowedParents = from symb in subtree.Grammar.Symbols
+                             where !(symb is ProgramRootSymbol)
+                             select symb;
+            allowedChildren = from symb in subtree.Grammar.Symbols
+                              where subtree.Grammar.IsAllowedChild(subtree.Symbol, symb, 0)
+                              select symb;
+            GrammarModifier.AddDynamicSymbol(subtree.Grammar, subtree.Symbol, defunNode.FunctionName, defunNode.NumberOfArguments);
+          }
+        }
+      }
+      return true;
+    }
+
+    private static SymbolicExpressionTreeNode DisconnectBranches(SymbolicExpressionTreeNode node, List<SymbolicExpressionTreeNode> argumentBranches) {
+      if (argumentBranches.Contains(node)) {
+        var argumentIndex = argumentBranches.IndexOf(node);
+        var argSymbol = new Argument(argumentIndex);
+        return argSymbol.CreateTreeNode();
+      }
+      // remove the subtrees so that we can clone only the root node
+      List<SymbolicExpressionTreeNode> subtrees = new List<SymbolicExpressionTreeNode>(node.SubTrees);
+      while (node.SubTrees.Count > 0) node.RemoveSubTree(0);
+      // recursively apply function for subtrees or append a argument terminal node
+      foreach (var subtree in subtrees) {
+        node.AddSubTree(DisconnectBranches(subtree, argumentBranches));
+      }
+      return node;
+    }
+
+    private static List<SymbolicExpressionTreeNode> SelectRandomArgumentBranches(SymbolicExpressionTreeNode selectedRoot,
+      IRandom random,
+      double cutProbability,
+      int maxArguments) {
+      // breadth first determination of argument cut-off points
+      // we must make sure that we cut off all original argument nodes and that the number of new argument is smaller than the limit
+      List<SymbolicExpressionTreeNode> argumentBranches = new List<SymbolicExpressionTreeNode>();
+      if (selectedRoot is ArgumentTreeNode) {
+        argumentBranches.Add(selectedRoot);
+        return argumentBranches;
+      } else {
+        // get the number of argument nodes (which must be cut-off) in the sub-trees
+        var numberOfArgumentsInSubtrees = (from subtree in selectedRoot.SubTrees
+                                           let nArgumentsInTree = subtree.IterateNodesPrefix().OfType<ArgumentTreeNode>().Count()
+                                           select nArgumentsInTree).ToList();
+        // determine the minimal number of new argument nodes for each sub-tree
+        var minNewArgumentsForSubtrees = numberOfArgumentsInSubtrees.Select(x => x > 0 ? 1 : 0).ToList();
+        if (minNewArgumentsForSubtrees.Sum() > maxArguments) {
+          argumentBranches.Add(selectedRoot);
+          return argumentBranches;
+        }
+        // cut-off in the sub-trees in random order
+        var randomIndexes = (from index in Enumerable.Range(0, selectedRoot.SubTrees.Count)
+                             select new { Index = index, OrderValue = random.NextDouble() }).OrderBy(x => x.OrderValue).Select(x => x.Index);
+        foreach (var subtreeIndex in randomIndexes) {
+          var subtree = selectedRoot.SubTrees[subtreeIndex];
+          minNewArgumentsForSubtrees[subtreeIndex] = 0;
+          // => cut-off at 0..n points somewhere in the current sub-tree
+          // determine the maximum number of new arguments that should be created in the branch
+          // as the maximum for the whole branch minus already added arguments minus minimal number of arguments still left
+          int maxArgumentsFromBranch = maxArguments - argumentBranches.Count - minNewArgumentsForSubtrees.Sum();
+          // when no argument is allowed from the current branch then we have to include the whole branch into the function
+          // otherwise: choose randomly wether to cut off immediately or wether to extend the function body into the branch
+          if (maxArgumentsFromBranch == 0) {
+            // don't cut at all => the whole sub-tree branch is included in the function body
+            // (we already checked ahead of time that there are no arguments left over in the subtree)
+          } else if (random.NextDouble() >= cutProbability) {
+            argumentBranches.AddRange(SelectRandomArgumentBranches(subtree, random, cutProbability, maxArgumentsFromBranch));
+          } else {
+            // cut-off at current sub-tree
+            argumentBranches.Add(subtree);
+          }
+        }
+        return argumentBranches;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDeleter.cs	(revision 5026)
@@ -0,0 +1,121 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Manipulates a symbolic expression by deleting a preexisting function-defining branch.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 108
+  /// </summary>
+  [Item("SubroutineDeleter", "Manipulates a symbolic expression by deleting a preexisting function-defining branch.")]
+  [StorableClass]
+  public sealed class SubroutineDeleter : SymbolicExpressionTreeArchitectureManipulator {
+    [StorableConstructor]
+    private SubroutineDeleter(bool deserializing) : base(deserializing) { }
+    private SubroutineDeleter(SubroutineDeleter original, Cloner cloner) : base(original, cloner) { }
+    public SubroutineDeleter() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SubroutineDeleter(this, cloner);
+    }
+
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = DeleteSubroutine(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool DeleteSubroutine(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+
+      if (functionDefiningBranches.Count() == 0)
+        // no ADF to delete => abort
+        return false;
+      var selectedDefunBranch = functionDefiningBranches.SelectRandom(random);
+      // remove the selected defun
+      int defunSubtreeIndex = symbolicExpressionTree.Root.SubTrees.IndexOf(selectedDefunBranch);
+      symbolicExpressionTree.Root.RemoveSubTree(defunSubtreeIndex);
+
+      // remove references to deleted function
+      foreach (var subtree in symbolicExpressionTree.Root.SubTrees.OfType<SymbolicExpressionTreeTopLevelNode>()) {
+        var matchingInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                    where symb.FunctionName == selectedDefunBranch.FunctionName
+                                    select symb).SingleOrDefault();
+        if (matchingInvokeSymbol != null) {
+          subtree.Grammar.RemoveSymbol(matchingInvokeSymbol);
+        }
+      }
+
+      DeletionByRandomRegeneration(random, symbolicExpressionTree, selectedDefunBranch);
+      return true;
+    }
+
+    private static void DeletionByRandomRegeneration(IRandom random, SymbolicExpressionTree symbolicExpressionTree, DefunTreeNode selectedDefunBranch) {
+      // find first invocation and replace it with a randomly generated tree
+      // can't find all invocations in one step because once we replaced a top level invocation
+      // the invocations below it are removed already
+      var invocationCutPoint = (from node in symbolicExpressionTree.IterateNodesPrefix()
+                                from subtree in node.SubTrees.OfType<InvokeFunctionTreeNode>()
+                                where subtree.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                                select new { Parent = node, ReplacedChildIndex = node.SubTrees.IndexOf(subtree), ReplacedChild = subtree }).FirstOrDefault();
+      while (invocationCutPoint != null) {
+        // deletion by random regeneration
+        SymbolicExpressionTreeNode replacementTree = null;
+        // TODO: should weight symbols by tickets
+        var selectedSymbol = invocationCutPoint.Parent.GetAllowedSymbols(invocationCutPoint.ReplacedChildIndex).SelectRandom(random);
+
+        int minPossibleSize = invocationCutPoint.Parent.Grammar.GetMinExpressionLength(selectedSymbol);
+        int maxSize = Math.Max(minPossibleSize, invocationCutPoint.ReplacedChild.GetSize());
+        int minPossibleHeight = invocationCutPoint.Parent.Grammar.GetMinExpressionDepth(selectedSymbol);
+        int maxHeight = Math.Max(minPossibleHeight, invocationCutPoint.ReplacedChild.GetHeight());
+        replacementTree = selectedSymbol.CreateTreeNode();
+        if (replacementTree.HasLocalParameters)
+          replacementTree.ResetLocalParameters(random);
+        invocationCutPoint.Parent.RemoveSubTree(invocationCutPoint.ReplacedChildIndex);
+        invocationCutPoint.Parent.InsertSubTree(invocationCutPoint.ReplacedChildIndex, replacementTree);
+
+        ProbabilisticTreeCreator.PTC2(random, replacementTree, maxSize, maxHeight, 0, 0);
+
+        invocationCutPoint = (from node in symbolicExpressionTree.IterateNodesPrefix()
+                              from subtree in node.SubTrees.OfType<InvokeFunctionTreeNode>()
+                              where subtree.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                              select new { Parent = node, ReplacedChildIndex = node.SubTrees.IndexOf(subtree), ReplacedChild = subtree }).FirstOrDefault();
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDuplicater.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 5026)
@@ -0,0 +1,113 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Manipulates a symbolic expression by duplicating a preexisting function-defining branch.
+  /// As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 88
+  /// </summary>
+  [Item("SubroutineDuplicater", "Manipulates a symbolic expression by duplicating a preexisting function-defining branch.")]
+  [StorableClass]
+  public sealed class SubroutineDuplicater : SymbolicExpressionTreeArchitectureManipulator {
+    [StorableConstructor]
+    private SubroutineDuplicater(bool deserializing) : base(deserializing) { }
+    private SubroutineDuplicater(SubroutineDuplicater original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SubroutineDuplicater() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SubroutineDuplicater(this, cloner);
+    }
+
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success) {
+      success = DuplicateSubroutine(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefiningBranches.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool DuplicateSubroutine(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefiningBranches, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+      if (functionDefiningBranches.Count() == 0 || functionDefiningBranches.Count() == maxFunctionDefiningBranches)
+        // no function defining branches to duplicate or already reached the max number of ADFs
+        return false;
+
+      string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefiningBranches) + 1).ToString(); // >= 100 functions => ###
+      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefiningBranches)
+                                 select "ADF" + index.ToString(formatString);
+      var selectedBranch = functionDefiningBranches.SelectRandom(random);
+      var duplicatedDefunBranch = (DefunTreeNode)selectedBranch.Clone();
+      string newFunctionName = allowedFunctionNames.Except(UsedFunctionNames(symbolicExpressionTree)).First();
+      duplicatedDefunBranch.FunctionName = newFunctionName;
+      symbolicExpressionTree.Root.AddSubTree(duplicatedDefunBranch);
+      duplicatedDefunBranch.SetGrammar((ISymbolicExpressionGrammar)selectedBranch.Grammar.Clone());
+      // add an invoke symbol for each branch that is allowed to invoke the original function
+      foreach (var subtree in symbolicExpressionTree.Root.SubTrees.OfType<SymbolicExpressionTreeTopLevelNode>()) {
+        var matchingInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                    where symb.FunctionName == selectedBranch.FunctionName
+                                    select symb).SingleOrDefault();
+        if (matchingInvokeSymbol != null) {
+          GrammarModifier.AddDynamicSymbol(subtree.Grammar, subtree.Symbol, duplicatedDefunBranch.FunctionName, duplicatedDefunBranch.NumberOfArguments);
+        }
+        // in the current subtree:
+        // for all invoke nodes of the original function replace the invoke of the original function with an invoke of the new function randomly
+        var originalFunctionInvocations = from node in subtree.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>()
+                                          where node.Symbol.FunctionName == selectedBranch.FunctionName
+                                          select node;
+        foreach (var originalFunctionInvokeNode in originalFunctionInvocations) {
+          var newInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>()
+                                 where symb.FunctionName == duplicatedDefunBranch.FunctionName
+                                 select symb).Single();
+          // flip coin wether to replace with newly defined function
+          if (random.NextDouble() < 0.5) {
+            originalFunctionInvokeNode.Symbol = newInvokeSymbol;
+          }
+        }
+      }
+      return true;
+    }
+
+    private static IEnumerable<string> UsedFunctionNames(SymbolicExpressionTree symbolicExpressionTree) {
+      return from node in symbolicExpressionTree.IterateNodesPrefix()
+             where node.Symbol is Defun
+             select ((DefunTreeNode)node).FunctionName;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs	(revision 5026)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators {
+  /// <summary>
+  /// Base class for architecture altering operators for symbolic expression trees.
+  /// </summary>
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeArchitectureManipulator : SymbolicExpressionTreeManipulator, ISymbolicExpressionTreeArchitectureManipulator {
+    private const string MaxFunctionArgumentsParameterName = "MaxFunctionArguments";
+    private const string MaxFunctionDefiningBranchesParameterName = "MaxFunctionDefiningBranches";
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionDefiningBranchesParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; }
+    }
+    public IntValue MaxFunctionDefiningBranches {
+      get { return MaxFunctionDefinitionsParameter.ActualValue; }
+    }
+    public IntValue MaxFunctionArguments {
+      get { return MaxFunctionArgumentsParameter.ActualValue; }
+    }
+    [StorableConstructor]
+    protected SymbolicExpressionTreeArchitectureManipulator(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeArchitectureManipulator(SymbolicExpressionTreeArchitectureManipulator original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicExpressionTreeArchitectureManipulator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionDefiningBranchesParameterName, "The maximal allowed number of function defining branches."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionArgumentsParameterName, "The maximal allowed number of arguments of a newly created function."));
+    }
+
+    protected override sealed void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, out bool success) {
+      ModifyArchitecture(random, symbolicExpressionTree, grammar, maxTreeSize, maxTreeHeight, MaxFunctionDefiningBranches, MaxFunctionArguments, out success);
+    }
+
+    public abstract void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree tree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize,
+      IntValue maxTreeHeight,
+      IntValue maxFunctionDefinitions,
+      IntValue maxFunctionArguments,
+      out bool success
+      );
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Compiler/Instruction.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Compiler/Instruction.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Compiler/Instruction.cs	(revision 5026)
@@ -0,0 +1,37 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Compiler {
+  // total size of this struct should be small to improve cache access while executing the code
+  // should be aligned to 8/16/32 byte
+  // size = 4(8) + 1 + 1 + 2 = 8 (12)
+  public struct Instruction {
+    // the tree node can hold additional data that is necessary for the execution of this instruction
+    public SymbolicExpressionTreeNode dynamicNode;
+    // op code of the function that determines what operation should be executed
+    public byte opCode;
+    // number of arguments of the current instruction
+    public byte nArguments;
+    // an optional short value (addresses for calls, argument index for arguments)
+    public ushort iArg0;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Compiler/SymbolicExpressionTreeCompiler.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Compiler/SymbolicExpressionTreeCompiler.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Compiler/SymbolicExpressionTreeCompiler.cs	(revision 5026)
@@ -0,0 +1,89 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Compiler {
+  public class SymbolicExpressionTreeCompiler {
+    private Dictionary<string, ushort> entryPoint = new Dictionary<string, ushort>();
+    private List<Func<Instruction, Instruction>> postInstructionCompiledHooks = new List<Func<Instruction, Instruction>>();
+
+    public Instruction[] Compile(SymbolicExpressionTree tree, Func<SymbolicExpressionTreeNode, byte> opCodeMapper) {
+      List<Instruction> code = new List<Instruction>();
+      entryPoint.Clear();
+      // compile main body branches
+      foreach (var branch in tree.Root.SubTrees[0].SubTrees) {
+        code.AddRange(Compile(branch, opCodeMapper));
+      }
+      // compile function branches
+      var functionBranches = from node in tree.IterateNodesPrefix()
+                             where node.Symbol is Defun
+                             select node;
+      foreach (DefunTreeNode branch in functionBranches) {
+        if (code.Count > ushort.MaxValue) throw new ArgumentException("Code for the tree is too long (> ushort.MaxValue).");
+        entryPoint[branch.FunctionName] = (ushort)code.Count;
+        code.AddRange(Compile(branch.SubTrees[0], opCodeMapper));
+      }
+      // address of all functions is fixed now
+      // iterate through code again and fill in the jump locations
+      for (int i = 0; i < code.Count; i++) {
+        Instruction instr = code[i];
+        if (instr.dynamicNode.Symbol is InvokeFunction) {
+          var invokeNode = (InvokeFunctionTreeNode)instr.dynamicNode;
+          instr.iArg0 = entryPoint[invokeNode.Symbol.FunctionName];
+          code[i] = instr;
+        }
+      }
+
+      return code.ToArray();
+    }
+
+    private IEnumerable<Instruction> Compile(SymbolicExpressionTreeNode branch, Func<SymbolicExpressionTreeNode, byte> opCodeMapper) {
+      foreach (var node in branch.IterateNodesPrefix()) {
+        Instruction instr = new Instruction();
+        if (node.SubTrees.Count > 255) throw new ArgumentException("Number of subtrees is too big (>255)");
+        instr.nArguments = (byte)node.SubTrees.Count;
+        instr.opCode = opCodeMapper(node);
+        if (node.Symbol is Argument) {
+          var argNode = (ArgumentTreeNode)node;
+          instr.iArg0 = (ushort)argNode.Symbol.ArgumentIndex;
+        }
+        instr.dynamicNode = node;
+        foreach (var hook in postInstructionCompiledHooks) {
+          instr = hook(instr);
+        }
+        yield return instr;
+      }
+    }
+
+    /// <summary>
+    /// Adds a function that will be called every time an instruction is compiled.
+    /// The compiled will insert the instruction returned by the hook into the code.
+    /// </summary>
+    /// <param name="hook">The hook that should be called for each compiled instruction.</param>
+    public void AddInstructionPostProcessingHook(Func<Instruction, Instruction> hook) {
+      postInstructionCompiledHooks.Add(hook);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/ProbabilisticTreeCreator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/ProbabilisticTreeCreator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/ProbabilisticTreeCreator.cs	(revision 5026)
@@ -0,0 +1,284 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators {
+  [StorableClass]
+  [Item("ProbabilisticTreeCreator", "An operator that creates new symbolic expression trees with uniformly distributed size")]
+  public sealed class ProbabilisticTreeCreator : SymbolicExpressionTreeCreator {
+    private const int MAX_TRIES = 100;
+    [StorableConstructor]
+    private ProbabilisticTreeCreator(bool deserializing) : base(deserializing) { }
+    private ProbabilisticTreeCreator(ProbabilisticTreeCreator original, Cloner cloner) : base(original, cloner) { }
+    public ProbabilisticTreeCreator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ProbabilisticTreeCreator(this, cloner);
+    }
+
+    protected override SymbolicExpressionTree Create(
+      IRandom random,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      return Create(random, grammar, maxTreeSize.Value, maxTreeHeight.Value, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
+    }
+
+    public static SymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar,
+      int maxTreeSize, int maxTreeHeight,
+      int maxFunctionDefinitions, int maxFunctionArguments
+      ) {
+      SymbolicExpressionTree tree = new SymbolicExpressionTree();
+      var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
+      if (rootNode.HasLocalParameters) rootNode.ResetLocalParameters(random);
+      rootNode.SetGrammar(new SymbolicExpressionTreeGrammar(grammar));
+      tree.Root = PTC2(random, rootNode, maxTreeSize, maxTreeHeight, maxFunctionDefinitions, maxFunctionArguments);
+      return tree;
+    }
+
+    private class TreeExtensionPoint {
+      public SymbolicExpressionTreeNode Parent { get; set; }
+      public int ChildIndex { get; set; }
+      public int ExtensionPointDepth { get; set; }
+    }
+
+    public static SymbolicExpressionTreeNode PTC2(IRandom random, SymbolicExpressionTreeNode seedNode,
+      int maxTreeSize, int maxDepth, int maxFunctionDefinitions, int maxFunctionArguments) {
+      // tree size is limited by the grammar and by the explicit size constraints
+      int allowedMinSize = seedNode.Grammar.GetMinExpressionLength(seedNode.Symbol);
+      int allowedMaxSize = Math.Min(maxTreeSize, seedNode.Grammar.GetMaxExpressionLength(seedNode.Symbol));
+      int tries = 0;
+      while (tries++ < MAX_TRIES) {
+        // select a target tree size uniformly in the possible range (as determined by explicit limits and limits of the grammar)
+        int treeSize = random.Next(allowedMinSize, allowedMaxSize + 1);
+        if (treeSize <= 1 || maxDepth <= 1) return seedNode;
+
+        bool success = CreateFullTreeFromSeed(random, seedNode, seedNode.Grammar, treeSize, maxDepth, maxFunctionDefinitions, maxFunctionArguments);
+
+        // if successful => check constraints and return the tree if everything looks ok        
+        if (success && seedNode.GetSize() <= maxTreeSize && seedNode.GetHeight() <= maxDepth) {
+          return seedNode;
+        } else {
+          // clean seedNode
+          while (seedNode.SubTrees.Count > 0) seedNode.RemoveSubTree(0);
+        }
+        // try a different size MAX_TRIES times
+      }
+      throw new ArgumentException("Couldn't create a random valid tree.");
+    }
+
+    private static bool CreateFullTreeFromSeed(IRandom random, SymbolicExpressionTreeNode root, ISymbolicExpressionGrammar globalGrammar,
+      int size, int maxDepth, int maxFunctionDefinitions, int maxFunctionArguments) {
+      try {
+        TryCreateFullTreeFromSeed(random, root, globalGrammar, size, maxDepth, maxFunctionDefinitions, maxFunctionArguments);
+        return true;
+      }
+      catch (ArgumentException) { return false; }
+    }
+
+    private static void TryCreateFullTreeFromSeed(IRandom random, SymbolicExpressionTreeNode root, ISymbolicExpressionGrammar globalGrammar,
+      int size, int maxDepth, int maxFunctionDefinitions, int maxFunctionArguments) {
+      List<TreeExtensionPoint> extensionPoints = new List<TreeExtensionPoint>();
+      int currentSize = 1;
+      int totalListMinSize = globalGrammar.GetMinExpressionLength(root.Symbol) - 1;
+      int actualArity = SampleArity(random, root, size);
+      for (int i = 0; i < actualArity; i++) {
+        // insert a dummy sub-tree and add the pending extension to the list
+        var dummy = new SymbolicExpressionTreeNode();
+        root.AddSubTree(dummy);
+        extensionPoints.Add(new TreeExtensionPoint { Parent = root, ChildIndex = i, ExtensionPointDepth = 0 });
+      }
+      // while there are pending extension points and we have not reached the limit of adding new extension points
+      while (extensionPoints.Count > 0 && totalListMinSize + currentSize < size) {
+        int randomIndex = random.Next(extensionPoints.Count);
+        TreeExtensionPoint nextExtension = extensionPoints[randomIndex];
+        extensionPoints.RemoveAt(randomIndex);
+        SymbolicExpressionTreeNode parent = nextExtension.Parent;
+        int argumentIndex = nextExtension.ChildIndex;
+        int extensionDepth = nextExtension.ExtensionPointDepth;
+        if (extensionDepth + parent.Grammar.GetMinExpressionDepth(parent.Symbol) >= maxDepth) {
+          ReplaceWithMinimalTree(random, root, parent, argumentIndex, maxFunctionDefinitions, maxFunctionArguments);
+        } else {
+          var allowedSymbols = from s in parent.Grammar.Symbols
+                               where parent.Grammar.IsAllowedChild(parent.Symbol, s, argumentIndex)
+                               where parent.Grammar.GetMinExpressionDepth(s) + extensionDepth - 1 < maxDepth
+                               where parent.Grammar.GetMaxExpressionLength(s) > size - totalListMinSize - currentSize
+                               select s;
+          Symbol selectedSymbol = SelectRandomSymbol(random, allowedSymbols);
+          SymbolicExpressionTreeNode newTree = selectedSymbol.CreateTreeNode();
+          if (newTree.HasLocalParameters) newTree.ResetLocalParameters(random);
+          parent.RemoveSubTree(argumentIndex);
+          parent.InsertSubTree(argumentIndex, newTree);
+
+          InitializeNewTreeNode(random, root, newTree, maxFunctionDefinitions, maxFunctionArguments);
+
+          currentSize++;
+          totalListMinSize--;
+
+          actualArity = SampleArity(random, newTree, size - currentSize);
+          for (int i = 0; i < actualArity; i++) {
+            // insert a dummy sub-tree and add the pending extension to the list
+            var dummy = new SymbolicExpressionTreeNode();
+            newTree.AddSubTree(dummy);
+            extensionPoints.Add(new TreeExtensionPoint { Parent = newTree, ChildIndex = i, ExtensionPointDepth = extensionDepth + 1 });
+          }
+          totalListMinSize += newTree.Grammar.GetMinExpressionLength(newTree.Symbol);
+        }
+      }
+      // fill all pending extension points
+      while (extensionPoints.Count > 0) {
+        int randomIndex = random.Next(extensionPoints.Count);
+        TreeExtensionPoint nextExtension = extensionPoints[randomIndex];
+        extensionPoints.RemoveAt(randomIndex);
+        SymbolicExpressionTreeNode parent = nextExtension.Parent;
+        int a = nextExtension.ChildIndex;
+        int d = nextExtension.ExtensionPointDepth;
+        ReplaceWithMinimalTree(random, root, parent, a, maxFunctionDefinitions, maxFunctionArguments);
+      }
+    }
+
+    private static void ReplaceWithMinimalTree(IRandom random, SymbolicExpressionTreeNode root, SymbolicExpressionTreeNode parent, int argumentIndex, int maxFunctionDefinitions, int maxFunctionArguments) {
+      // determine possible symbols that will lead to the smallest possible tree
+      var possibleSymbols = (from s in parent.GetAllowedSymbols(argumentIndex)
+                             group s by parent.Grammar.GetMinExpressionLength(s) into g
+                             orderby g.Key
+                             select g).First();
+      var selectedSymbol = SelectRandomSymbol(random, possibleSymbols);
+      var tree = selectedSymbol.CreateTreeNode();
+      if (tree.HasLocalParameters) tree.ResetLocalParameters(random);
+      parent.RemoveSubTree(argumentIndex);
+      parent.InsertSubTree(argumentIndex, tree);
+      InitializeNewTreeNode(random, root, tree, maxFunctionDefinitions, maxFunctionArguments);
+      for (int i = 0; i < tree.GetMinSubtreeCount(); i++) {
+        // insert a dummy sub-tree and add the pending extension to the list
+        var dummy = new SymbolicExpressionTreeNode();
+        tree.AddSubTree(dummy);
+        // replace the just inserted dummy by recursive application
+        ReplaceWithMinimalTree(random, root, tree, i, maxFunctionDefinitions, maxFunctionArguments);
+      }
+    }
+
+    private static void InitializeNewTreeNode(IRandom random, SymbolicExpressionTreeNode root, SymbolicExpressionTreeNode newTree, int maxFunctionDefinitions, int maxFunctionArguments) {
+      // NB it is assumed that defuns are only allowed as children of root and nowhere else
+      // also assumes that newTree is already attached to root somewhere
+      if (IsTopLevelBranch(root, newTree)) {
+        ((SymbolicExpressionTreeTopLevelNode)newTree).SetGrammar((ISymbolicExpressionGrammar)root.Grammar.Clone());
+
+        // allow invokes of existing ADFs with higher index
+        int argIndex = root.SubTrees.IndexOf(newTree);
+        for (int i = argIndex + 1; i < root.SubTrees.Count; i++) {
+          var otherDefunNode = root.SubTrees[i] as DefunTreeNode;
+          if (otherDefunNode != null) {
+            GrammarModifier.AddDynamicSymbol(newTree.Grammar, newTree.Symbol, otherDefunNode.FunctionName, otherDefunNode.NumberOfArguments);
+          }
+        }
+      }
+      if (newTree.Symbol is Defun) {
+        var defunTree = newTree as DefunTreeNode;
+        string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefinitions * 10 - 1)).ToString(); // >= 100 functions => ###
+        var allowedNames = from index in Enumerable.Range(0, maxFunctionDefinitions)
+                           select "ADF" + index.ToString(formatString);
+        var takenNames = (from node in root.IterateNodesPrefix().OfType<DefunTreeNode>()
+                          select node.FunctionName).Distinct();
+        var remainingNames = allowedNames.Except(takenNames).ToList();
+        string functionName = remainingNames[random.Next(remainingNames.Count)];
+        // set name and number of arguments of the ADF
+        int nArgs = random.Next(maxFunctionArguments);
+        defunTree.FunctionName = functionName;
+        defunTree.NumberOfArguments = nArgs;
+        if (nArgs > 0) {
+          GrammarModifier.AddDynamicArguments(defunTree.Grammar, defunTree.Symbol, Enumerable.Range(0, nArgs));
+        }
+        // in existing branches with smaller index allow invoke of current function
+        int argIndex = root.SubTrees.IndexOf(newTree);
+        for (int i = 0; i < argIndex; i++) {
+          // if not dummy node
+          if (root.SubTrees[i].Symbol != null) {
+            var existingBranch = root.SubTrees[i];
+            GrammarModifier.AddDynamicSymbol(existingBranch.Grammar, existingBranch.Symbol, functionName, nArgs);
+          }
+        }
+      }
+    }
+
+    private static bool IsTopLevelBranch(SymbolicExpressionTreeNode root, SymbolicExpressionTreeNode branch) {
+      return branch is SymbolicExpressionTreeTopLevelNode;
+    }
+
+    private static Symbol SelectRandomSymbol(IRandom random, IEnumerable<Symbol> symbols) {
+      var symbolList = symbols.ToList();
+      var ticketsSum = symbolList.Select(x => x.InitialFrequency).Sum();
+      if (ticketsSum == 0.0) throw new ArgumentException("The initial frequency of all allowed symbols is zero.");
+      var r = random.NextDouble() * ticketsSum;
+      double aggregatedTickets = 0;
+      for (int i = 0; i < symbolList.Count; i++) {
+        aggregatedTickets += symbolList[i].InitialFrequency;
+        if (aggregatedTickets > r) {
+          return symbolList[i];
+        }
+      }
+      // this should never happen
+      throw new ArgumentException("There is a problem with the initial frequency setting of allowed symbols.");
+    }
+
+    private static int SampleArity(IRandom random, SymbolicExpressionTreeNode node, int targetSize) {
+      // select actualArity randomly with the constraint that the sub-trees in the minimal arity can become large enough
+      int minArity = node.GetMinSubtreeCount();
+      int maxArity = node.GetMaxSubtreeCount();
+      if (maxArity > targetSize) {
+        maxArity = targetSize;
+      }
+      // the min number of sub-trees has to be set to a value that is large enough so that the largest possible tree is at least tree size
+      // if 1..3 trees are possible and the largest possible first sub-tree is smaller larger than the target size then minArity should be at least 2
+      long aggregatedLongestExpressionLength = 0;
+      for (int i = 0; i < maxArity; i++) {
+        aggregatedLongestExpressionLength += (from s in node.GetAllowedSymbols(i)
+                                              select node.Grammar.GetMaxExpressionLength(s)).Max();
+        if (aggregatedLongestExpressionLength < targetSize) minArity = i;
+        else break;
+      }
+
+      // the max number of sub-trees has to be set to a value that is small enough so that the smallest possible tree is at most tree size 
+      // if 1..3 trees are possible and the smallest possible first sub-tree is already larger than the target size then maxArity should be at most 0
+      long aggregatedShortestExpressionLength = 0;
+      for (int i = 0; i < maxArity; i++) {
+        aggregatedShortestExpressionLength += (from s in node.GetAllowedSymbols(i)
+                                               select node.Grammar.GetMinExpressionLength(s)).Min();
+        if (aggregatedShortestExpressionLength > targetSize) {
+          maxArity = i;
+          break;
+        }
+      }
+      if (minArity > maxArity) throw new ArgumentException();
+      return random.Next(minArity, maxArity + 1);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/SymbolicExpressionTreeCreator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/SymbolicExpressionTreeCreator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Creators/SymbolicExpressionTreeCreator.cs	(revision 5026)
@@ -0,0 +1,87 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators {
+  /// <summary>
+  /// A base class for operators creating symbolic expression trees.
+  /// </summary>
+  [Item("SymbolicExpressionTreeCreator", "A base class for operators creating symbolic expression trees.")]
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeCreator : SymbolicExpressionTreeOperator, ISymbolicExpressionTreeCreator {
+    private const string MaxFunctionDefinitionsParameterName = "MaxFunctionDefinitions";
+    private const string MaxFunctionArgumentsParameterName = "MaxFunctionArguments";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    #region Parameter Properties
+    public IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionDefinitionsParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxFunctionArgumentsParameterName]; }
+    }
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    #endregion
+
+    #region Propeties
+    public IntValue MaxFunctionDefinitions {
+      get { return MaxFunctionDefinitionsParameter.ActualValue; }
+    }
+    public IntValue MaxFunctionArguments {
+      get { return MaxFunctionArgumentsParameter.ActualValue; }
+    }
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+      set { SymbolicExpressionTreeParameter.ActualValue = value; }
+    }
+
+    #endregion
+    [StorableConstructor]
+    protected SymbolicExpressionTreeCreator(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeCreator(SymbolicExpressionTreeCreator original, Cloner cloner) : base(original, cloner) { }
+    protected SymbolicExpressionTreeCreator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionDefinitionsParameterName, "Maximal number of function definitions in the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxFunctionArgumentsParameterName, "Maximal number of arguments of automatically defined functions in the symbolic expression tree."));
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree that should be created."));
+    }
+
+    public sealed override IOperation Apply() {
+      SymbolicExpressionTree = Create(Random, SymbolicExpressionGrammar,
+        MaxTreeSize, MaxTreeHeight, MaxFunctionDefinitions, MaxFunctionArguments);
+      return base.Apply();
+    }
+
+    protected abstract SymbolicExpressionTree Create(
+      IRandom random,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments
+      );
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/CrossoverPoint.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/CrossoverPoint.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/CrossoverPoint.cs	(revision 5026)
@@ -0,0 +1,35 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Crossovers {
+  public class CrossoverPoint {
+    public SymbolicExpressionTreeNode Parent { get; set; }
+    public SymbolicExpressionTreeNode Child { get; set; }
+    public int SubtreeIndex {
+      get { return Parent.SubTrees.IndexOf(Child); }
+    }
+    public CrossoverPoint(SymbolicExpressionTreeNode parent, SymbolicExpressionTreeNode child) {
+      this.Parent = parent;
+      this.Child = child;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SubtreeCrossover.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SubtreeCrossover.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SubtreeCrossover.cs	(revision 5026)
@@ -0,0 +1,201 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Crossovers {
+  /// <summary>
+  /// Takes two parent individuals P0 and P1 each. Selects a random node N0 of P0 and a random node N1 of P1.
+  /// And replaces the branch with root0 N0 in P0 with N1 from P1 if the tree-size limits are not violated.
+  /// When recombination with N0 and N1 would create a tree that is too large or invalid the operator randomly selects new N0 and N1 
+  /// until a valid configuration is found.
+  /// </summary>  
+  [Item("SubtreeCrossover", "An operator which performs subtree swapping crossover.")]
+  [StorableClass]
+  public sealed class SubtreeCrossover : SymbolicExpressionTreeCrossover {
+    public IValueLookupParameter<PercentValue> InternalCrossoverPointProbabilityParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters["InternalCrossoverPointProbability"]; }
+    }
+    [StorableConstructor]
+    private SubtreeCrossover(bool deserializing) : base(deserializing) { }
+    private SubtreeCrossover(SubtreeCrossover original, Cloner cloner) : base(original, cloner) { }
+    public SubtreeCrossover()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<PercentValue>("InternalCrossoverPointProbability", "The probability to select an internal crossover point (instead of a leaf node).", new PercentValue(0.9)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SubtreeCrossover(this, cloner);
+    }
+
+    protected override SymbolicExpressionTree Cross(IRandom random,
+      SymbolicExpressionTree parent0, SymbolicExpressionTree parent1,
+      IntValue maxTreeSize, IntValue maxTreeHeight, out bool success) {
+      return Cross(random, parent0, parent1, InternalCrossoverPointProbabilityParameter.ActualValue.Value, maxTreeSize.Value, maxTreeHeight.Value, out success);
+    }
+
+    public static SymbolicExpressionTree Cross(IRandom random,
+      SymbolicExpressionTree parent0, SymbolicExpressionTree parent1,
+      double internalCrossoverPointProbability, int maxTreeSize, int maxTreeHeight, out bool success) {
+      // select a random crossover point in the first parent 
+      SymbolicExpressionTreeNode crossoverPoint0;
+      int replacedSubtreeIndex;
+      SelectCrossoverPoint(random, parent0, internalCrossoverPointProbability, maxTreeSize, maxTreeHeight, out crossoverPoint0, out replacedSubtreeIndex);
+
+      // calculate the max size and height that the inserted branch can have 
+      int maxInsertedBranchSize = maxTreeSize - (parent0.Size - crossoverPoint0.SubTrees[replacedSubtreeIndex].GetSize());
+      int maxInsertedBranchHeight = maxTreeHeight - GetBranchLevel(parent0.Root, crossoverPoint0);
+
+      List<SymbolicExpressionTreeNode> allowedBranches = new List<SymbolicExpressionTreeNode>();
+      parent1.Root.ForEachNodePostfix((n) => {
+        if (n.GetSize() < maxInsertedBranchSize &&
+          n.GetHeight() < maxInsertedBranchHeight &&
+          IsMatchingPointType(crossoverPoint0, replacedSubtreeIndex, n))
+          allowedBranches.Add(n);
+      });
+
+      if (allowedBranches.Count == 0) {
+        success = false;
+        return parent0;
+      } else {
+        var selectedBranch = SelectRandomBranch(random, allowedBranches, internalCrossoverPointProbability);
+
+        // manipulate the tree of parent0 in place
+        // replace the branch in tree0 with the selected branch from tree1
+        crossoverPoint0.RemoveSubTree(replacedSubtreeIndex);
+        crossoverPoint0.InsertSubTree(replacedSubtreeIndex, selectedBranch);
+        success = true;
+        return parent0;
+      }
+    }
+
+    private static bool IsMatchingPointType(SymbolicExpressionTreeNode parent, int replacedSubtreeIndex, SymbolicExpressionTreeNode branch) {
+      // check syntax constraints of direct parent - child relation
+      if (!parent.Grammar.ContainsSymbol(branch.Symbol) ||
+          !parent.Grammar.IsAllowedChild(parent.Symbol, branch.Symbol, replacedSubtreeIndex)) return false;
+
+      bool result = true;
+      // check point type for the whole branch
+      branch.ForEachNodePostfix((n) => {
+        result =
+          result &&
+          parent.Grammar.ContainsSymbol(n.Symbol) &&
+          n.SubTrees.Count >= parent.Grammar.GetMinSubtreeCount(n.Symbol) &&
+          n.SubTrees.Count <= parent.Grammar.GetMaxSubtreeCount(n.Symbol);
+      });
+      return result;
+    }
+
+    private static void SelectCrossoverPoint(IRandom random, SymbolicExpressionTree parent0, double internalNodeProbability, int maxBranchSize, int maxBranchHeight, out SymbolicExpressionTreeNode crossoverPoint, out int subtreeIndex) {
+      if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");
+      List<CrossoverPoint> internalCrossoverPoints = new List<CrossoverPoint>();
+      List<CrossoverPoint> leafCrossoverPoints = new List<CrossoverPoint>();
+      parent0.Root.ForEachNodePostfix((n) => {
+        if (n.SubTrees.Count > 0 &&
+          n.GetSize() < maxBranchSize &&
+          n.GetHeight() < maxBranchHeight &&
+          n != parent0.Root
+          ) {
+          foreach (var child in n.SubTrees) {
+            if (child.SubTrees.Count > 0)
+              internalCrossoverPoints.Add(new CrossoverPoint(n, child));
+            else
+              leafCrossoverPoints.Add(new CrossoverPoint(n, child));
+          }
+        }
+      });
+      if (random.NextDouble() < internalNodeProbability) {
+        // select from internal node if possible
+        if (internalCrossoverPoints.Count > 0) {
+          // select internal crossover point or leaf
+          var selectedCrossoverPoint = internalCrossoverPoints[random.Next(internalCrossoverPoints.Count)];
+          crossoverPoint = selectedCrossoverPoint.Parent;
+          subtreeIndex = selectedCrossoverPoint.SubtreeIndex;
+        } else {
+          // otherwise select external node
+          var selectedCrossoverPoint = leafCrossoverPoints[random.Next(leafCrossoverPoints.Count)];
+          crossoverPoint = selectedCrossoverPoint.Parent;
+          subtreeIndex = selectedCrossoverPoint.SubtreeIndex;
+        }
+      } else if (leafCrossoverPoints.Count > 0) {
+        // select from leaf crossover point if possible
+        var selectedCrossoverPoint = leafCrossoverPoints[random.Next(leafCrossoverPoints.Count)];
+        crossoverPoint = selectedCrossoverPoint.Parent;
+        subtreeIndex = selectedCrossoverPoint.SubtreeIndex;
+      } else {
+        // otherwise select internal crossover point
+        var selectedCrossoverPoint = internalCrossoverPoints[random.Next(internalCrossoverPoints.Count)];
+        crossoverPoint = selectedCrossoverPoint.Parent;
+        subtreeIndex = selectedCrossoverPoint.SubtreeIndex;
+      }
+    }
+
+    private static SymbolicExpressionTreeNode SelectRandomBranch(IRandom random, IEnumerable<SymbolicExpressionTreeNode> branches, double internalNodeProbability) {
+      if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");
+      List<SymbolicExpressionTreeNode> allowedInternalBranches;
+      List<SymbolicExpressionTreeNode> allowedLeafBranches;
+      if (random.NextDouble() < internalNodeProbability) {
+        // select internal node if possible
+        allowedInternalBranches = (from branch in branches
+                                   where branch.SubTrees.Count > 0
+                                   select branch).ToList();
+        if (allowedInternalBranches.Count > 0) {
+          return allowedInternalBranches.SelectRandom(random);
+        } else {
+          // no internal nodes allowed => select leaf nodes
+          allowedLeafBranches = (from branch in branches
+                                 where branch.SubTrees.Count == 0
+                                 select branch).ToList();
+          return allowedLeafBranches.SelectRandom(random);
+        }
+      } else {
+        // select leaf node if possible
+        allowedLeafBranches = (from branch in branches
+                               where branch.SubTrees.Count == 0
+                               select branch).ToList();
+        if (allowedLeafBranches.Count > 0) {
+          return allowedLeafBranches.SelectRandom(random);
+        } else {
+          allowedInternalBranches = (from branch in branches
+                                     where branch.SubTrees.Count > 0
+                                     select branch).ToList();
+          return allowedInternalBranches.SelectRandom(random);
+        }
+      }
+    }
+
+    private static int GetBranchLevel(SymbolicExpressionTreeNode root, SymbolicExpressionTreeNode point) {
+      if (root == point) return 0;
+      foreach (var subtree in root.SubTrees) {
+        int branchLevel = GetBranchLevel(subtree, point);
+        if (branchLevel < int.MaxValue) return 1 + branchLevel;
+      }
+      return int.MaxValue;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SymbolicExpressionTreeCrossover.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SymbolicExpressionTreeCrossover.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Crossovers/SymbolicExpressionTreeCrossover.cs	(revision 5026)
@@ -0,0 +1,86 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Crossovers {
+  /// <summary>
+  /// A base class for operators that perform a crossover of symbolic expression trees.
+  /// </summary>
+  [Item("SymbolicExpressionTreeCrossover", "A base class for operators that perform a crossover of symbolic expression trees.")]
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeCrossover : SymbolicExpressionTreeOperator, ISymbolicExpressionTreeCrossover {
+    private const string ParentsParameterName = "Parents";
+    private const string ChildParameterName = "Child";
+    private const string FailedCrossoverEventsParameterName = "FailedCrossoverEvents";
+    public ILookupParameter<ItemArray<SymbolicExpressionTree>> ParentsParameter {
+      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[ParentsParameterName]; }
+    }
+    public ILookupParameter<SymbolicExpressionTree> ChildParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[ChildParameterName]; }
+    }
+    public IValueParameter<IntValue> FailedCrossoverEventsParameter {
+      get { return (ValueParameter<IntValue>)Parameters[FailedCrossoverEventsParameterName]; }
+    }
+
+    public IntValue FailedCrossoverEvents {
+      get { return FailedCrossoverEventsParameter.Value; }
+    }
+    [StorableConstructor]
+    protected SymbolicExpressionTreeCrossover(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeCrossover(SymbolicExpressionTreeCrossover original, Cloner cloner) : base(original, cloner) { }
+    protected SymbolicExpressionTreeCrossover()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed."));
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(ChildParameterName, "The child symbolic expression tree resulting from the crossover."));
+      Parameters.Add(new ValueParameter<IntValue>(FailedCrossoverEventsParameterName, "The number of failed crossover events (child is an exact copy of a parent)", new IntValue()));
+    }
+
+    public sealed override IOperation Apply() {
+      if (ParentsParameter.ActualValue.Length != 2)
+        throw new ArgumentException("Number of parents must be exactly two for symbolic expression tree crossover operators.");
+
+      SymbolicExpressionTree parent0 = ParentsParameter.ActualValue[0];
+      SymbolicExpressionTree parent1 = ParentsParameter.ActualValue[1];
+
+      IRandom random = RandomParameter.ActualValue;
+
+      bool success;
+      SymbolicExpressionTree result = Cross(random, parent0, parent1,
+        MaxTreeSizeParameter.ActualValue, MaxTreeHeightParameter.ActualValue, out success);
+
+      if (!success) FailedCrossoverEvents.Value++;
+
+      ChildParameter.ActualValue = result;
+      return base.Apply();
+    }
+
+    protected abstract SymbolicExpressionTree Cross(IRandom random,
+      SymbolicExpressionTree parent0, SymbolicExpressionTree parent1,
+      IntValue maxTreeSize, IntValue maxTreeHeight, out bool success);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/DefaultSymbolicExpressionGrammar.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/DefaultSymbolicExpressionGrammar.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/DefaultSymbolicExpressionGrammar.cs	(revision 5026)
@@ -0,0 +1,328 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <summary>
+  /// The default symbolic expression grammar stores symbols and syntactic constraints for symbols.
+  /// Symbols are treated as equvivalent if they have the same name.
+  /// Syntactic constraints limit the number of allowed sub trees for a node with a symbol and which symbols are allowed 
+  /// in the sub-trees of a symbol (can be specified for each sub-tree index separately).
+  /// </summary>
+  [StorableClass]
+  [Item("DefaultSymbolicExpressionGrammar", "Represents a grammar that defines the syntax of symbolic expression trees.")]
+  public abstract class DefaultSymbolicExpressionGrammar : Item, ISymbolicExpressionGrammar {
+
+    #region properties for separation between implementation and persistence
+    [Storable]
+    private IEnumerable<KeyValuePair<string, int>> MinSubTreeCount {
+      get { return minSubTreeCount.AsEnumerable(); }
+      set { minSubTreeCount = value.ToDictionary(x => x.Key, x => x.Value); }
+    }
+
+    [Storable]
+    private IEnumerable<KeyValuePair<string, int>> MaxSubTreeCount {
+      get { return maxSubTreeCount.AsEnumerable(); }
+      set { maxSubTreeCount = value.ToDictionary(x => x.Key, x => x.Value); }
+    }
+
+    [Storable]
+    private IEnumerable<KeyValuePair<string, IEnumerable<IEnumerable<string>>>> AllowedChildSymbols {
+      get {
+        return (from parentEntry in allowedChildSymbols
+                let setEnumeration = parentEntry.Value.Select(set => set.AsEnumerable()).ToList()
+                select new KeyValuePair<string, IEnumerable<IEnumerable<string>>>(parentEntry.Key, setEnumeration))
+                .ToList();
+      }
+      set {
+        allowedChildSymbols = new Dictionary<string, List<List<string>>>();
+        foreach (var pair in value) {
+          allowedChildSymbols[pair.Key] = new List<List<string>>();
+          foreach (var entry in pair.Value) {
+            var hashSet = new List<string>();
+            foreach (string child in entry) {
+              hashSet.Add(child);
+            }
+            allowedChildSymbols[pair.Key].Add(hashSet);
+          }
+        }
+      }
+    }
+    [Storable]
+    private IEnumerable<KeyValuePair<string, Symbol>> AllSymbols {
+      get { return allSymbols.AsEnumerable(); }
+      set { allSymbols = value.ToDictionary(x => x.Key, x => x.Value); }
+    }
+    #endregion
+
+    private Dictionary<string, int> minSubTreeCount;
+    private Dictionary<string, int> maxSubTreeCount;
+    private Dictionary<string, List<List<string>>> allowedChildSymbols;
+    private Dictionary<string, Symbol> allSymbols;
+    [Storable]
+    private Symbol startSymbol;
+
+    [StorableConstructor]
+    protected DefaultSymbolicExpressionGrammar(bool deserializing)
+      : base(deserializing) {
+      cachedMinExpressionLength = new Dictionary<string, int>();
+      cachedMaxExpressionLength = new Dictionary<string, int>();
+      cachedMinExpressionDepth = new Dictionary<string, int>();
+    }
+    // cloning ctor
+    protected DefaultSymbolicExpressionGrammar(DefaultSymbolicExpressionGrammar original, Cloner cloner)
+      : base(original, cloner) {
+      this.cachedMinExpressionLength = new Dictionary<string, int>();
+      this.cachedMaxExpressionLength = new Dictionary<string, int>();
+      this.cachedMinExpressionDepth = new Dictionary<string, int>();
+      minSubTreeCount = new Dictionary<string, int>(original.minSubTreeCount);
+      maxSubTreeCount = new Dictionary<string, int>(original.maxSubTreeCount);
+
+      allSymbols = new Dictionary<string, Symbol>();
+      foreach (Symbol symbol in original.allSymbols.Values.Select(s => cloner.Clone(s)))
+        allSymbols.Add(symbol.Name, symbol);
+
+      startSymbol = cloner.Clone<Symbol>(original.startSymbol);
+      allowedChildSymbols = new Dictionary<string, List<List<string>>>();
+      foreach (var entry in original.allowedChildSymbols) {
+        allowedChildSymbols[entry.Key] = new List<List<string>>(entry.Value.Count);
+        foreach (var set in entry.Value) {
+          allowedChildSymbols[entry.Key].Add(new List<string>(set));
+        }
+      }
+    }
+    protected DefaultSymbolicExpressionGrammar()
+      : base() {
+      this.minSubTreeCount = new Dictionary<string, int>();
+      this.maxSubTreeCount = new Dictionary<string, int>();
+      this.allowedChildSymbols = new Dictionary<string, List<List<string>>>();
+      this.allSymbols = new Dictionary<string, Symbol>();
+      this.cachedMinExpressionLength = new Dictionary<string, int>();
+      this.cachedMaxExpressionLength = new Dictionary<string, int>();
+      this.cachedMinExpressionDepth = new Dictionary<string, int>();
+
+      this.startSymbol = new StartSymbol();
+      this.AddSymbol(startSymbol);
+      this.SetMinSubtreeCount(startSymbol, 1);
+      this.SetMaxSubtreeCount(startSymbol, 1);
+    }
+
+    protected DefaultSymbolicExpressionGrammar(ISymbolicExpressionGrammar grammar)
+      : base() {
+      Cloner cloner = new Cloner();
+      this.cachedMinExpressionLength = new Dictionary<string, int>();
+      this.cachedMaxExpressionLength = new Dictionary<string, int>();
+      this.cachedMinExpressionDepth = new Dictionary<string, int>();
+
+      this.minSubTreeCount = new Dictionary<string, int>();
+      this.maxSubTreeCount = new Dictionary<string, int>();
+      this.allowedChildSymbols = new Dictionary<string, List<List<string>>>();
+      this.allSymbols = new Dictionary<string, Symbol>();
+
+      this.StartSymbol = (Symbol)cloner.Clone(grammar.StartSymbol);
+
+      foreach (Symbol symbol in grammar.Symbols) {
+        Symbol clonedSymbol = (Symbol)cloner.Clone(symbol);
+        this.AddSymbol(clonedSymbol);
+        this.SetMinSubtreeCount(clonedSymbol, grammar.GetMinSubtreeCount(symbol));
+        this.SetMaxSubtreeCount(clonedSymbol, grammar.GetMaxSubtreeCount(symbol));
+      }
+
+      foreach (Symbol parent in grammar.Symbols) {
+        for (int i = 0; i < grammar.GetMaxSubtreeCount(parent); i++) {
+          foreach (Symbol child in grammar.Symbols) {
+            if (grammar.IsAllowedChild(parent, child, i)) {
+              this.SetAllowedChild((Symbol)cloner.Clone(parent), (Symbol)cloner.Clone(child), i);
+            }
+          }
+        }
+      }
+    }
+
+    public void Clear() {
+      minSubTreeCount.Clear();
+      maxSubTreeCount.Clear();
+      allowedChildSymbols.Clear();
+      allSymbols.Clear();
+
+      cachedMaxExpressionLength.Clear();
+      cachedMinExpressionLength.Clear();
+      cachedMinExpressionDepth.Clear();
+
+      startSymbol = new StartSymbol();
+      AddSymbol(startSymbol);
+      SetMinSubtreeCount(startSymbol, 1);
+      SetMaxSubtreeCount(startSymbol, 1);
+    }
+
+    #region ISymbolicExpressionGrammar Members
+    public Symbol StartSymbol {
+      get { return startSymbol; }
+      set { startSymbol = value; }
+    }
+
+    public void AddSymbol(Symbol symbol) {
+      if (ContainsSymbol(symbol)) throw new ArgumentException("Symbol " + symbol + " is already defined.");
+      allSymbols.Add(symbol.Name, symbol);
+      allowedChildSymbols[symbol.Name] = new List<List<string>>();
+      ClearCaches();
+    }
+
+    public void RemoveSymbol(Symbol symbol) {
+      foreach (var parent in Symbols) {
+        for (int i = 0; i < GetMaxSubtreeCount(parent); i++)
+          if (IsAllowedChild(parent, symbol, i))
+            allowedChildSymbols[parent.Name][i].Remove(symbol.Name);
+      }
+      allSymbols.Remove(symbol.Name);
+      minSubTreeCount.Remove(symbol.Name);
+      maxSubTreeCount.Remove(symbol.Name);
+      allowedChildSymbols.Remove(symbol.Name);
+      ClearCaches();
+    }
+
+    public IEnumerable<Symbol> Symbols {
+      get { return allSymbols.Values.AsEnumerable(); }
+    }
+
+    public bool ContainsSymbol(Symbol symbol) {
+      return allSymbols.ContainsKey(symbol.Name);
+    }
+
+    public void SetAllowedChild(Symbol parent, Symbol child, int argumentIndex) {
+      if (!ContainsSymbol(parent)) throw new ArgumentException("Unknown symbol: " + parent, "parent");
+      if (!ContainsSymbol(child)) throw new ArgumentException("Unknown symbol: " + child, "child");
+      if (argumentIndex >= GetMaxSubtreeCount(parent)) throw new ArgumentException("Symbol " + parent + " can have only " + GetMaxSubtreeCount(parent) + " subtrees.");
+      allowedChildSymbols[parent.Name][argumentIndex].Add(child.Name);
+      ClearCaches();
+    }
+
+    public bool IsAllowedChild(Symbol parent, Symbol child, int argumentIndex) {
+      if (!ContainsSymbol(parent)) throw new ArgumentException("Unknown symbol: " + parent, "parent");
+      if (!ContainsSymbol(child)) throw new ArgumentException("Unknown symbol: " + child, "child");
+      if (argumentIndex >= GetMaxSubtreeCount(parent)) throw new ArgumentException("Symbol " + parent + " can have only " + GetMaxSubtreeCount(parent) + " subtrees.");
+      return allowedChildSymbols[parent.Name][argumentIndex].Contains(child.Name);
+    }
+
+    private Dictionary<string, int> cachedMinExpressionLength;
+    public int GetMinExpressionLength(Symbol symbol) {
+      if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
+      if (!cachedMinExpressionLength.ContainsKey(symbol.Name)) {
+        cachedMinExpressionLength[symbol.Name] = int.MaxValue; // prevent infinite recursion
+        long sumOfMinExpressionLengths = 1 + (from argIndex in Enumerable.Range(0, GetMinSubtreeCount(symbol))
+                                              let minForSlot = (long)(from s in Symbols
+                                                                      where IsAllowedChild(symbol, s, argIndex)
+                                                                      select GetMinExpressionLength(s)).DefaultIfEmpty(0).Min()
+                                              select minForSlot).DefaultIfEmpty(0).Sum();
+
+        cachedMinExpressionLength[symbol.Name] = (int)Math.Min(sumOfMinExpressionLengths, int.MaxValue);
+      }
+      return cachedMinExpressionLength[symbol.Name];
+    }
+
+    private Dictionary<string, int> cachedMaxExpressionLength;
+    public int GetMaxExpressionLength(Symbol symbol) {
+      if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
+      if (!cachedMaxExpressionLength.ContainsKey(symbol.Name)) {
+        cachedMaxExpressionLength[symbol.Name] = int.MaxValue; // prevent infinite recursion
+        long sumOfMaxTrees = 1 + (from argIndex in Enumerable.Range(0, GetMaxSubtreeCount(symbol))
+                                  let maxForSlot = (long)(from s in Symbols
+                                                          where IsAllowedChild(symbol, s, argIndex)
+                                                          select GetMaxExpressionLength(s)).DefaultIfEmpty(0).Max()
+                                  select maxForSlot).DefaultIfEmpty(0).Sum();
+        long limit = int.MaxValue;
+        cachedMaxExpressionLength[symbol.Name] = (int)Math.Min(sumOfMaxTrees, limit);
+      }
+      return cachedMaxExpressionLength[symbol.Name];
+    }
+
+    private Dictionary<string, int> cachedMinExpressionDepth;
+    public int GetMinExpressionDepth(Symbol symbol) {
+      if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
+      if (!cachedMinExpressionDepth.ContainsKey(symbol.Name)) {
+        cachedMinExpressionDepth[symbol.Name] = int.MaxValue; // prevent infinite recursion
+        cachedMinExpressionDepth[symbol.Name] = 1 + (from argIndex in Enumerable.Range(0, GetMinSubtreeCount(symbol))
+                                                     let minForSlot = (from s in Symbols
+                                                                       where IsAllowedChild(symbol, s, argIndex)
+                                                                       select GetMinExpressionDepth(s)).DefaultIfEmpty(0).Min()
+                                                     select minForSlot).DefaultIfEmpty(0).Max();
+      }
+      return cachedMinExpressionDepth[symbol.Name];
+    }
+
+    public void SetMaxSubtreeCount(Symbol symbol, int nSubTrees) {
+      if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
+      maxSubTreeCount[symbol.Name] = nSubTrees;
+      while (allowedChildSymbols[symbol.Name].Count <= nSubTrees)
+        allowedChildSymbols[symbol.Name].Add(new List<string>());
+      while (allowedChildSymbols[symbol.Name].Count > nSubTrees) {
+        allowedChildSymbols[symbol.Name].RemoveAt(allowedChildSymbols[symbol.Name].Count - 1);
+      }
+      ClearCaches();
+    }
+
+    public void SetMinSubtreeCount(Symbol symbol, int nSubTrees) {
+      if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
+      minSubTreeCount[symbol.Name] = nSubTrees;
+      ClearCaches();
+    }
+
+    public int GetMinSubtreeCount(Symbol symbol) {
+      if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
+      return minSubTreeCount[symbol.Name];
+    }
+
+    public int GetMaxSubtreeCount(Symbol symbol) {
+      if (!ContainsSymbol(symbol)) throw new ArgumentException("Unknown symbol: " + symbol);
+      return maxSubTreeCount[symbol.Name];
+    }
+    #endregion
+
+    private void ClearCaches() {
+      cachedMinExpressionLength.Clear();
+      cachedMaxExpressionLength.Clear();
+      cachedMinExpressionDepth.Clear();
+    }
+
+    protected void InitializeShallowClone(DefaultSymbolicExpressionGrammar original) {
+      minSubTreeCount = new Dictionary<string, int>(original.minSubTreeCount);
+      maxSubTreeCount = new Dictionary<string, int>(original.maxSubTreeCount);
+
+      allSymbols = new Dictionary<string, Symbol>(original.allSymbols);
+      startSymbol = original.startSymbol;
+      allowedChildSymbols = new Dictionary<string, List<List<string>>>(original.allowedChildSymbols.Count);
+      foreach (var entry in original.allowedChildSymbols) {
+        allowedChildSymbols[entry.Key] = new List<List<string>>(entry.Value.Count);
+        foreach (var set in entry.Value) {
+          allowedChildSymbols[entry.Key].Add(new List<string>(set));
+        }
+      }
+    }
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/EnumerableExtensions.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/EnumerableExtensions.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/EnumerableExtensions.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public static class EnumerableExtensions {
+    public static T SelectRandom<T>(this IEnumerable<T> xs, IRandom random) {
+      var list = xs as IList<T>;
+      if (list != null) {
+        return list[random.Next(list.Count)];
+      } else {
+        list = xs.ToList();
+        return list[random.Next(list.Count)];
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/GlobalSymbolicExpressionGrammar.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/GlobalSymbolicExpressionGrammar.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/GlobalSymbolicExpressionGrammar.cs	(revision 5026)
@@ -0,0 +1,188 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  [Item("GlobalSymbolicExpressionGrammar", "Represents a grammar that defines the syntax of symbolic expression trees.")]
+  public sealed class GlobalSymbolicExpressionGrammar : DefaultSymbolicExpressionGrammar {
+    [Storable]
+    private int minFunctionDefinitions;
+    public int MinFunctionDefinitions {
+      get { return minFunctionDefinitions; }
+      set {
+        minFunctionDefinitions = value;
+        UpdateAdfConstraints();
+      }
+    }
+    [Storable]
+    private int maxFunctionDefinitions;
+    public int MaxFunctionDefinitions {
+      get { return maxFunctionDefinitions; }
+      set {
+        maxFunctionDefinitions = value;
+        UpdateAdfConstraints();
+      }
+    }
+    [Storable]
+    private int minFunctionArguments;
+    public int MinFunctionArguments {
+      get { return minFunctionArguments; }
+      set {
+        minFunctionArguments = value;
+      }
+    }
+    [Storable]
+    private int maxFunctionArguments;
+    public int MaxFunctionArguments {
+      get { return maxFunctionArguments; }
+      set {
+        maxFunctionArguments = value;
+      }
+    }
+
+    [Storable]
+    private Defun defunSymbol;
+
+    [StorableConstructor]
+    private GlobalSymbolicExpressionGrammar(bool deserializing) : base(deserializing) { }
+    private GlobalSymbolicExpressionGrammar(GlobalSymbolicExpressionGrammar original, Cloner cloner)
+      : base(original, cloner) {
+      defunSymbol = (Defun)cloner.Clone(original.defunSymbol);
+      maxFunctionArguments = original.maxFunctionArguments;
+      minFunctionArguments = original.minFunctionArguments;
+      maxFunctionDefinitions = original.maxFunctionDefinitions;
+      minFunctionDefinitions = original.minFunctionDefinitions;
+    }
+
+    public GlobalSymbolicExpressionGrammar(ISymbolicExpressionGrammar mainBranchGrammar)
+      : base(mainBranchGrammar) {
+      maxFunctionArguments = 3;
+      maxFunctionDefinitions = 3;
+
+      ProgramRootSymbol programRootSymbol = Symbols.OfType<ProgramRootSymbol>().FirstOrDefault();
+      if (programRootSymbol == null) {
+        programRootSymbol = new ProgramRootSymbol();
+        AddSymbol(programRootSymbol);
+      }
+      StartSymbol = programRootSymbol;
+
+      defunSymbol = Symbols.OfType<Defun>().FirstOrDefault();
+      if (defunSymbol == null) {
+        defunSymbol = new Defun();
+        AddSymbol(defunSymbol);
+      }
+
+      SetMinSubtreeCount(StartSymbol, minFunctionDefinitions + 1); // min number of ADF + 1 for RPB
+      SetMaxSubtreeCount(StartSymbol, maxFunctionDefinitions + 1); // max number of ADF + 1 for RPB
+      // defun can have only one child
+      SetMinSubtreeCount(defunSymbol, 1); 
+      SetMaxSubtreeCount(defunSymbol, 1);
+
+
+      // the start symbol of the mainBranchGrammar is allowed as the result producing branch
+      SetAllowedChild(StartSymbol, Symbols.Where(s => s.Name == mainBranchGrammar.StartSymbol.Name).First(), 0);
+
+      // defuns are allowed as children on the same level and after RPB
+      for (int i = 0; i < maxFunctionDefinitions; i++) {
+        // +1 because RPB has index 0
+        SetAllowedChild(StartSymbol, defunSymbol, i + 1); 
+      }
+
+      // every symbol of the mainBranchGrammar that is allowed as child of the start symbol is also allowed as direct child of defun
+      foreach (var symb in mainBranchGrammar.Symbols) {
+        if (mainBranchGrammar.IsAllowedChild(mainBranchGrammar.StartSymbol, symb, 0))
+          SetAllowedChild(defunSymbol, Symbols.Where(s => s.Name == symb.Name).First(), 0);
+      }
+    }
+
+    [Obsolete]
+    private void Initialize(ISymbolicExpressionGrammar mainBranchGrammar) {
+      base.Clear();
+
+      // remove the start symbol of the default grammar
+      RemoveSymbol(StartSymbol);
+
+      StartSymbol = new ProgramRootSymbol();
+      defunSymbol = new Defun();
+      AddSymbol(StartSymbol);
+      AddSymbol(defunSymbol);
+
+      SetMinSubtreeCount(StartSymbol, minFunctionDefinitions + 1);
+      SetMaxSubtreeCount(StartSymbol, maxFunctionDefinitions + 1);
+      SetMinSubtreeCount(defunSymbol, 1);
+      SetMaxSubtreeCount(defunSymbol, 1);
+
+      // ADF branches maxFunctionDefinitions 
+      for (int argumentIndex = 1; argumentIndex < maxFunctionDefinitions + 1; argumentIndex++) {
+        SetAllowedChild(StartSymbol, defunSymbol, argumentIndex);
+      }
+
+      if (mainBranchGrammar != null) {
+        // copy symbols from mainBranchGrammar
+        foreach (var symb in mainBranchGrammar.Symbols) {
+          AddSymbol(symb);
+          SetMinSubtreeCount(symb, mainBranchGrammar.GetMinSubtreeCount(symb));
+          SetMaxSubtreeCount(symb, mainBranchGrammar.GetMaxSubtreeCount(symb));
+        }
+
+        // the start symbol of the mainBranchGrammar is allowed as the result producing branch
+        SetAllowedChild(StartSymbol, mainBranchGrammar.StartSymbol, 0);
+
+        // copy syntax constraints from mainBranchGrammar
+        foreach (var parent in mainBranchGrammar.Symbols) {
+          for (int i = 0; i < mainBranchGrammar.GetMaxSubtreeCount(parent); i++) {
+            foreach (var child in mainBranchGrammar.Symbols) {
+              if (mainBranchGrammar.IsAllowedChild(parent, child, i)) {
+                SetAllowedChild(parent, child, i);
+              }
+            }
+          }
+        }
+
+        // every symbol of the mainBranchGrammar that is allowed as child of the start symbol is also allowed as direct child of defun
+        foreach (var symb in mainBranchGrammar.Symbols) {
+          if (mainBranchGrammar.IsAllowedChild(mainBranchGrammar.StartSymbol, symb, 0))
+            SetAllowedChild(defunSymbol, symb, 0);
+        }
+      }
+    }
+    private void UpdateAdfConstraints() {
+      SetMinSubtreeCount(StartSymbol, minFunctionDefinitions + 1);
+      SetMaxSubtreeCount(StartSymbol, maxFunctionDefinitions + 1);
+
+      // ADF branches maxFunctionDefinitions 
+      for (int argumentIndex = 1; argumentIndex < maxFunctionDefinitions + 1; argumentIndex++) {
+        SetAllowedChild(StartSymbol, defunSymbol, argumentIndex);
+      }
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GlobalSymbolicExpressionGrammar(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj	(revision 5026)
@@ -0,0 +1,247 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{125D3006-67F5-48CB-913E-73C0548F17FA}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding</RootNamespace>
+    <AssemblyName>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Analysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionTreeSizeAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicExpressionTreeSizeCalculator.cs" />
+    <Compile Include="ArchitectureManipulators\ArgumentCreater.cs" />
+    <Compile Include="ArchitectureManipulators\ArgumentDeleter.cs" />
+    <Compile Include="ArchitectureManipulators\ArgumentDuplicater.cs" />
+    <Compile Include="ArchitectureManipulators\GrammarModifier.cs" />
+    <Compile Include="ArchitectureManipulators\MultiSymbolicExpressionTreeArchitectureManipulator.cs" />
+    <Compile Include="ArchitectureManipulators\SubroutineCreater.cs" />
+    <Compile Include="ArchitectureManipulators\SubroutineDeleter.cs" />
+    <Compile Include="ArchitectureManipulators\SubroutineDuplicater.cs" />
+    <Compile Include="ArchitectureManipulators\SymbolicExpressionTreeArchitectureManipulator.cs" />
+    <Compile Include="Compiler\Instruction.cs" />
+    <Compile Include="Compiler\SymbolicExpressionTreeCompiler.cs" />
+    <Compile Include="Creators\SymbolicExpressionTreeCreator.cs" />
+    <Compile Include="Crossovers\CrossoverPoint.cs" />
+    <Compile Include="Crossovers\SymbolicExpressionTreeCrossover.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeAnalyzer.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeArchitectureManipulator.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeCreator.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeCrossover.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeNode.cs" />
+    <Compile Include="Manipulators\ChangeNodeTypeManipulation.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeManipulator.cs" />
+    <Compile Include="Manipulators\ReplaceBranchManipulation.cs" />
+    <Compile Include="Manipulators\FullTreeShaker.cs" />
+    <Compile Include="Manipulators\MultiSymbolicExpressionTreeManipulator.cs" />
+    <Compile Include="Manipulators\OnePointShaker.cs" />
+    <Compile Include="Manipulators\SymbolicExpressionTreeManipulator.cs" />
+    <Compile Include="SymbolicExpressionTreeGrammar.cs" />
+    <Compile Include="SymbolicExpressionTreeStringFormatter.cs" />
+    <Compile Include="SymbolicExpressionTreeTopLevelNode.cs" />
+    <Compile Include="Crossovers\SubtreeCrossover.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="GlobalSymbolicExpressionGrammar.cs" />
+    <Compile Include="EnumerableExtensions.cs" />
+    <Compile Include="DefaultSymbolicExpressionGrammar.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionTreeOperator.cs" />
+    <Compile Include="SymbolicExpressionTreeTerminalNode.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionGrammar.cs" />
+    <Compile Include="Creators\ProbabilisticTreeCreator.cs" />
+    <Compile Include="HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeOperator.cs" />
+    <Compile Include="SymbolicExpressionTree.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SymbolicExpressionTreeNode.cs" />
+    <Compile Include="Symbols\Argument.cs" />
+    <Compile Include="Symbols\ArgumentTreeNode.cs" />
+    <Compile Include="Symbols\ReadOnlySymbol.cs" />
+    <Compile Include="Symbols\StartSymbol.cs" />
+    <Compile Include="Symbols\InvokeFunction.cs" />
+    <Compile Include="Symbols\InvokeFunctionTreeNode.cs" />
+    <Compile Include="Symbols\DefunTreeNode.cs" />
+    <Compile Include="Symbols\Defun.cs" />
+    <Compile Include="Symbols\ProgramRootSymbol.cs" />
+    <Compile Include="Symbols\Symbol.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs"</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs.frame
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs.frame	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs.frame	(revision 5026)
@@ -0,0 +1,42 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.3.2.$WCREV$")]
+  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Analysis", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Collections", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Common", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Core", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Data", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Operators", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3.2.0")]
+  public class HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin : PluginBase {
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionGrammar.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionGrammar.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionGrammar.cs	(revision 5026)
@@ -0,0 +1,43 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionGrammar : IItem {
+    Symbol StartSymbol { get; }
+    void AddSymbol(Symbol symbol);
+    void RemoveSymbol(Symbol symbol);
+    IEnumerable<Symbol> Symbols { get; }
+    bool ContainsSymbol(Symbol symbol);
+    void SetAllowedChild(Symbol parent, Symbol child, int argumentIndex);
+    bool IsAllowedChild(Symbol parent, Symbol child, int argumentIndex);
+    int GetMinExpressionLength(Symbol start);
+    int GetMaxExpressionLength(Symbol start);
+    int GetMinExpressionDepth(Symbol start);
+    int GetMinSubtreeCount(Symbol symbol);
+    void SetMinSubtreeCount(Symbol symbol, int value);
+    int GetMaxSubtreeCount(Symbol symbol);
+    void SetMaxSubtreeCount(Symbol symbol, int value);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeAnalyzer.cs	(revision 5026)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
+  /// <summary>
+  /// Interface for analyzers that can be applied to symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeAnalyzer : IAnalyzer {
+    ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeArchitectureManipulator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeArchitectureManipulator.cs	(revision 5026)
@@ -0,0 +1,41 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
+  /// <summary>
+  /// Interface for operators that manipulate symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeArchitectureManipulator : ISymbolicExpressionTreeManipulator {
+    IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter { get; }
+    IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter { get; }
+
+    void ModifyArchitecture(
+      IRandom random,
+      SymbolicExpressionTree symbolicExpressionTree,
+      ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight,
+      IntValue maxFunctionDefiningBranches, IntValue maxFunctionArguments,
+      out bool success);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeCreator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeCreator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeCreator.cs	(revision 5026)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
+  /// <summary>
+  /// Interface for operators that create symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeCreator : ISymbolicExpressionTreeOperator, ISolutionCreator {
+    ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+    IValueLookupParameter<IntValue> MaxFunctionDefinitionsParameter { get; }
+    IValueLookupParameter<IntValue> MaxFunctionArgumentsParameter { get; }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeCrossover.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeCrossover.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeCrossover.cs	(revision 5026)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
+  /// <summary>
+  /// Interface for crossover operators that can be applied to symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeCrossover : ISymbolicExpressionTreeOperator, ICrossover {
+    ILookupParameter<ItemArray<SymbolicExpressionTree>> ParentsParameter { get; }
+    ILookupParameter<SymbolicExpressionTree> ChildParameter { get; }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeManipulator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeManipulator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeManipulator.cs	(revision 5026)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
+  /// <summary>
+  /// Interface for operators that manipulate symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeManipulator : ISymbolicExpressionTreeOperator, IManipulator {
+    ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 5026)
@@ -0,0 +1,50 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionTreeNode {
+    ISymbolicExpressionGrammar Grammar { get; }
+
+    Symbol Symbol { get; }
+    bool HasLocalParameters { get; }
+    IEnumerable<Symbol> GetAllowedSymbols(int argumentIndex);
+
+    int GetHeight();
+    int GetSize();
+    int GetMinSubtreeCount();
+    int GetMaxSubtreeCount();
+
+    IEnumerable<SymbolicExpressionTreeNode> IterateNodesPostfix();
+    IEnumerable<SymbolicExpressionTreeNode> IterateNodesPrefix();
+
+    IList<SymbolicExpressionTreeNode> SubTrees { get; }
+    void AddSubTree(SymbolicExpressionTreeNode tree);
+    void InsertSubTree(int index, SymbolicExpressionTreeNode tree);
+    void RemoveSubTree(int index);
+
+    void ResetLocalParameters(IRandom random);
+    void ShakeLocalParameters(IRandom random, double shakingFactor);
+
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeOperator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeOperator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Interfaces/ISymbolicExpressionTreeOperator.cs	(revision 5026)
@@ -0,0 +1,34 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces {
+  /// <summary>
+  /// Interface for operators that can be applied to symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeOperator : IOperator {
+    IValueLookupParameter<IntValue> MaxTreeSizeParameter { get; }
+    IValueLookupParameter<IntValue> MaxTreeHeightParameter { get; }
+    ILookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionGrammarParameter { get; }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ChangeNodeTypeManipulation.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ChangeNodeTypeManipulation.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ChangeNodeTypeManipulation.cs	(revision 5026)
@@ -0,0 +1,107 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators {
+  [StorableClass]
+  [Item("ChangeNodeTypeManipulation", "Selects a random tree node and changes the symbol.")]
+  public sealed class ChangeNodeTypeManipulation : SymbolicExpressionTreeManipulator {
+
+    [StorableConstructor]
+    private ChangeNodeTypeManipulation(bool deserializing) : base(deserializing) { }
+    private ChangeNodeTypeManipulation(ChangeNodeTypeManipulation original, Cloner cloner) : base(original, cloner) { }
+    public ChangeNodeTypeManipulation() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ChangeNodeTypeManipulation(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, out bool success) {
+      ChangeNodeType(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, out success);
+    }
+
+    public static void ChangeNodeType(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, int maxTreeSize, int maxTreeHeight, out bool success) {
+
+      // select any node as parent (except the root node)
+      var manipulationPoint = (from parent in symbolicExpressionTree.Root.IterateNodesPrefix().Skip(1)
+                               from subtree in parent.SubTrees
+                               select new { Parent = parent, Node = subtree, Index = parent.SubTrees.IndexOf(subtree) }).SelectRandom(random);
+      // find possible symbols for the node (also considering the existing branches below it)
+      var allowedSymbols = from symbol in manipulationPoint.Parent.GetAllowedSymbols(manipulationPoint.Index)
+                           where manipulationPoint.Node.SubTrees.Count <= manipulationPoint.Node.Grammar.GetMaxSubtreeCount(symbol)
+                           where manipulationPoint.Node.SubTrees.Count >= manipulationPoint.Node.Grammar.GetMinSubtreeCount(symbol)
+                           select symbol;
+
+      if (allowedSymbols.Count() <= 1) {
+        success = false;
+        return;
+      }
+      var node = manipulationPoint.Node;
+      // keep only symbols that are still possible considering the existing sub-trees
+      var constrainedSymbols = from symbol in allowedSymbols
+                               let disallowedSubtrees =
+                                     from subtree in node.SubTrees
+                                     where !node.Grammar.IsAllowedChild(symbol, subtree.Symbol, node.SubTrees.IndexOf(subtree))
+                                     select subtree
+                               where disallowedSubtrees.Count() == 0
+                               select symbol;
+      if (constrainedSymbols.Count() <= 1) {
+        success = false;
+        return;
+      }
+      var newSymbol = SelectRandomSymbol(random, constrainedSymbols);
+
+      // replace the old node with the new node
+      var newNode = newSymbol.CreateTreeNode();
+      if (newNode.HasLocalParameters)
+        newNode.ResetLocalParameters(random);
+      foreach (var subtree in node.SubTrees)
+        newNode.AddSubTree(subtree);
+      manipulationPoint.Parent.RemoveSubTree(manipulationPoint.Index);
+      manipulationPoint.Parent.InsertSubTree(manipulationPoint.Index, newNode);
+      success = true;
+    }
+
+    private static Symbol SelectRandomSymbol(IRandom random, IEnumerable<Symbol> symbols) {
+      var symbolList = symbols.ToList();
+      var ticketsSum = symbolList.Select(x => x.InitialFrequency).Sum();
+      if (ticketsSum == 0.0) throw new ArgumentException("The initial frequency of all allowed symbols is zero.");
+      var r = random.NextDouble() * ticketsSum;
+      double aggregatedTickets = 0;
+      for (int i = 0; i < symbolList.Count; i++) {
+        aggregatedTickets += symbolList[i].InitialFrequency;
+        if (aggregatedTickets > r) {
+          return symbolList[i];
+        }
+      }
+      // this should never happen
+      throw new ArgumentException("There is a problem with the initial frequency setting of allowed symbols.");
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/FullTreeShaker.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/FullTreeShaker.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/FullTreeShaker.cs	(revision 5026)
@@ -0,0 +1,50 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators {
+  [StorableClass]
+  [Item("FullTreeShaker", "Manipulates all nodes that have local parameters.")]
+  public sealed class FullTreeShaker : SymbolicExpressionTreeManipulator {
+
+    [StorableConstructor]
+    private FullTreeShaker(bool deserializing) : base(deserializing) { }
+    private FullTreeShaker(FullTreeShaker original, Cloner cloner) : base(original, cloner) { }
+    public FullTreeShaker() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FullTreeShaker(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, out bool success) {
+      foreach (var node in symbolicExpressionTree.IterateNodesPrefix()) {
+        if (node.HasLocalParameters) {
+          node.ShakeLocalParameters(random, 1.0);
+        }
+      }
+      success = true;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/MultiSymbolicExpressionTreeManipulator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/MultiSymbolicExpressionTreeManipulator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/MultiSymbolicExpressionTreeManipulator.cs	(revision 5026)
@@ -0,0 +1,112 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators {
+  [Item("MultiSymbolicExpressionTreeManipulator", "Randomly selects and applies one of its manipulators every time it is called.")]
+  [StorableClass]
+  public sealed class MultiSymbolicExpressionTreeManipulator : StochasticMultiBranch<ISymbolicExpressionTreeManipulator>, ISymbolicExpressionTreeManipulator, IStochasticOperator {
+    private const string MaxTreeSizeParameterName = "MaxTreeSize";
+    private const string MaxTreeHeightParameterName = "MaxTreeHeight";
+    private const string SymbolicExpressionGrammarParameterName = "SymbolicExpressionGrammar";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    protected override bool CreateChildOperation {
+      get { return true; }
+    }
+
+    #region ISymbolicExpressionTreeManipulator Members
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    #endregion
+
+    #region ISymbolicExpressionTreeOperator Members
+    public IValueLookupParameter<IntValue> MaxTreeSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeSizeParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxTreeHeightParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeHeightParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionGrammarParameter {
+      get { return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionGrammarParameterName]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private MultiSymbolicExpressionTreeManipulator(bool deserializing) : base(deserializing) { }
+    private MultiSymbolicExpressionTreeManipulator(MultiSymbolicExpressionTreeManipulator original, Cloner cloner) : base(original, cloner) { }
+    public MultiSymbolicExpressionTreeManipulator()
+      : base() {
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeSizeParameterName, "The maximal size (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeHeightParameterName, "The maximal height of the symbolic expression tree (a tree with one node has height = 0)."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionGrammarParameterName, "The grammar that defines the allowed symbols and syntax of the symbolic expression trees."));
+
+      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator))) {
+        if (!typeof(MultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type) && !typeof(ISymbolicExpressionTreeArchitectureManipulator).IsAssignableFrom(type))
+          Operators.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type), true);
+      }
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiSymbolicExpressionTreeManipulator(this, cloner);
+    }
+
+    protected override void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>> e) {
+      base.Operators_ItemsReplaced(sender, e);
+      ParameterizeManipulators();
+    }
+
+    protected override void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>> e) {
+      base.Operators_ItemsAdded(sender, e);
+      ParameterizeManipulators();
+    }
+
+    private void ParameterizeManipulators() {
+      foreach (ISymbolicExpressionTreeManipulator manipulator in Operators.OfType<ISymbolicExpressionTreeManipulator>()) {
+        manipulator.MaxTreeSizeParameter.ActualName = MaxTreeSizeParameter.Name;
+        manipulator.MaxTreeHeightParameter.ActualName = MaxTreeHeightParameter.Name;
+        manipulator.SymbolicExpressionGrammarParameter.ActualName = SymbolicExpressionGrammarParameter.Name;
+        manipulator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+      }
+
+      foreach (IStochasticOperator manipulator in Operators.OfType<IStochasticOperator>()) {
+        manipulator.RandomParameter.ActualName = RandomParameter.Name;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/OnePointShaker.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/OnePointShaker.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/OnePointShaker.cs	(revision 5026)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators {
+  [StorableClass]
+  [Item("OnePointShaker", "Selects a random node with local parameters and manipulates the selected node.")]
+  public sealed class OnePointShaker : SymbolicExpressionTreeManipulator {
+    [StorableConstructor]
+    private OnePointShaker(bool deserializing) : base(deserializing) { }
+    private OnePointShaker(OnePointShaker original, Cloner cloner) : base(original, cloner) { }
+    public OnePointShaker() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new OnePointShaker(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, out bool success) {
+      var parametricNodes = from node in symbolicExpressionTree.IterateNodesPrefix()
+                            where node.HasLocalParameters
+                            select node;
+      if (parametricNodes.Count() > 0) {
+        SymbolicExpressionTreeNode selectedPoint = parametricNodes.SelectRandom(random);
+
+        selectedPoint.ShakeLocalParameters(random, 1.0);
+        success = true;
+      } else {
+        success = false;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ReplaceBranchManipulation.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ReplaceBranchManipulation.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ReplaceBranchManipulation.cs	(revision 5026)
@@ -0,0 +1,92 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators {
+  [StorableClass]
+  [Item("ReplaceBranchManipulation", "Selects a branch of the tree randomly and replaces it with a newly initialized branch (using PTC2).")]
+  public sealed class ReplaceBranchManipulation : SymbolicExpressionTreeManipulator {
+    [StorableConstructor]
+    private ReplaceBranchManipulation(bool deserializing) : base(deserializing) { }
+    private ReplaceBranchManipulation(ReplaceBranchManipulation original, Cloner cloner) : base(original, cloner) { }
+    public ReplaceBranchManipulation() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ReplaceBranchManipulation(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, out bool success) {
+      ReplaceRandomBranch(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, out success);
+    }
+
+    public static void ReplaceRandomBranch(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, int maxTreeSize, int maxTreeHeight, out bool success) {
+      success = false;
+      // select any node as parent (except the root node)
+      var manipulationPoint = (from parent in symbolicExpressionTree.Root.IterateNodesPrefix().Skip(1)
+                               from subtree in parent.SubTrees
+                               select new { Parent = parent, Node = subtree, Index = parent.SubTrees.IndexOf(subtree) }).SelectRandom(random);
+
+      int maxSize = maxTreeSize - symbolicExpressionTree.Size + manipulationPoint.Node.GetSize();
+      int maxHeight = maxTreeHeight - symbolicExpressionTree.Height + manipulationPoint.Node.GetHeight();
+      // find possible symbols for the node (also considering the existing branches below it)
+      var allowedSymbols = from symbol in manipulationPoint.Parent.GetAllowedSymbols(manipulationPoint.Index)
+                           where manipulationPoint.Node.Grammar.GetMinExpressionDepth(symbol) <= maxHeight
+                           where manipulationPoint.Node.Grammar.GetMinExpressionLength(symbol) <= maxSize
+                           select symbol;
+      if (allowedSymbols.Count() <= 1) return;
+
+      var seedSymbol = SelectRandomSymbol(random, allowedSymbols);  // replace the old node with the new node
+      var seedNode = seedSymbol.CreateTreeNode();
+      if (seedNode.HasLocalParameters)
+        seedNode.ResetLocalParameters(random);
+
+      manipulationPoint.Parent.RemoveSubTree(manipulationPoint.Index);
+      manipulationPoint.Parent.InsertSubTree(manipulationPoint.Index, seedNode);
+      seedNode = ProbabilisticTreeCreator.PTC2(random, seedNode, maxSize, maxHeight, 0, 0);
+      success = true;
+    }
+
+    private static Symbol SelectRandomSymbol(IRandom random, IEnumerable<Symbol> symbols) {
+      var symbolList = symbols.ToList();
+      var ticketsSum = symbolList.Select(x => x.InitialFrequency).Sum();
+      if (ticketsSum == 0.0) throw new ArgumentException("The initial frequency of all allowed symbols is zero.");
+      var r = random.NextDouble() * ticketsSum;
+      double aggregatedTickets = 0;
+      for (int i = 0; i < symbolList.Count; i++) {
+        aggregatedTickets += symbolList[i].InitialFrequency;
+        if (aggregatedTickets > r) {
+          return symbolList[i];
+        }
+      }
+      // this should never happen
+      throw new ArgumentException("There is a problem with the initial frequency setting of allowed symbols.");
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/SymbolicExpressionTreeManipulator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/SymbolicExpressionTreeManipulator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/SymbolicExpressionTreeManipulator.cs	(revision 5026)
@@ -0,0 +1,79 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators {
+  /// <summary>
+  /// A base class for operators that manipulate real-valued vectors.
+  /// </summary>
+  [Item("SymbolicExpressionTreeManipulator", "A base class for operators that manipulate symbolic expression trees.")]
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeManipulator : SymbolicExpressionTreeOperator, ISymbolicExpressionTreeManipulator {
+    private const string FailedManipulationEventsParameterName = "FailedManipulationEvents";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+
+    #region Parameter Properties
+    public IValueParameter<IntValue> FailedManipulationEventsParameter {
+      get { return (IValueParameter<IntValue>)Parameters[FailedManipulationEventsParameterName]; }
+    }
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public IntValue FailedManipulationEvents {
+      get { return FailedManipulationEventsParameter.Value; }
+    }
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeManipulator(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeManipulator(SymbolicExpressionTreeManipulator original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicExpressionTreeManipulator()
+      : base() {
+      Parameters.Add(new ValueParameter<IntValue>(FailedManipulationEventsParameterName, "The number of failed manipulation events.", new IntValue()));
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+    }
+
+    public sealed override IOperation Apply() {
+      SymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
+      bool success;
+      Manipulate(RandomParameter.ActualValue, tree, SymbolicExpressionGrammarParameter.ActualValue,
+        MaxTreeSizeParameter.ActualValue, MaxTreeHeightParameter.ActualValue, out success);
+
+      if (!success) FailedManipulationEvents.Value++;
+      return base.Apply();
+    }
+
+    protected abstract void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar,
+      IntValue maxTreeSize, IntValue maxTreeHeight, out bool success);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Properties/AssemblyInfo.frame	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Properties/AssemblyInfo.frame	(revision 5026)
@@ -0,0 +1,47 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding")]
+[assembly: AssemblyDescription("HeuristicLab symbolic expression tree encoding and related operators")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2010 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6f0b963e-ff24-4396-b7bd-f8997b6eda55")]
+
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.2.$WCREV$")]
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs	(revision 5026)
@@ -0,0 +1,92 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Drawing;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  [Item("SymbolicExpressionTree", "Represents a symbolic expression tree.")]
+  public class SymbolicExpressionTree : Item {
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; }
+    }
+    [Storable]
+    private SymbolicExpressionTreeNode root;
+    public SymbolicExpressionTreeNode Root {
+      get { return root; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        else if (value != root) {
+          root = value;
+          OnToStringChanged();
+        }
+      }
+    }
+
+    public int Size {
+      get {
+        if (root == null)
+          return 0;
+        return root.GetSize();
+      }
+    }
+
+    public int Height {
+      get {
+        if (root == null)
+          return 0;
+        return root.GetHeight();
+      }
+    }
+
+    [StorableConstructor]
+    protected SymbolicExpressionTree(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTree(SymbolicExpressionTree original, Cloner cloner)
+      : base(original, cloner) {
+      root = cloner.Clone(original.Root);
+    }
+    public SymbolicExpressionTree() : base() { }
+    public SymbolicExpressionTree(SymbolicExpressionTreeNode root)
+      : base() {
+      this.Root = root;
+    }
+
+    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPrefix() {
+      if (root == null)
+        return new SymbolicExpressionTreeNode[0];
+      return root.IterateNodesPrefix();
+    }
+    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPostfix() {
+      if (root == null)
+        return new SymbolicExpressionTreeNode[0];
+      return root.IterateNodesPostfix();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTree(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeGrammar.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeGrammar.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeGrammar.cs	(revision 5026)
@@ -0,0 +1,45 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public sealed class SymbolicExpressionTreeGrammar : DefaultSymbolicExpressionGrammar {
+    public SymbolicExpressionTreeGrammar(ISymbolicExpressionGrammar grammar)
+      : base(grammar) {
+    }
+    [StorableConstructor]
+    private SymbolicExpressionTreeGrammar(bool deserializing) : base(deserializing) { }
+    // don't call storable ctor of base class to prevent full cloning
+    // instead use storable ctor to initialize an empty grammar and fill with InizializeShallowClone
+    private SymbolicExpressionTreeGrammar(SymbolicExpressionTreeGrammar original, Cloner cloner)
+      : base(false) {
+      cloner.RegisterClonedObject(original, this);
+      InitializeShallowClone(original);
+    }
+    private SymbolicExpressionTreeGrammar() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeGrammar(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeNode.cs	(revision 5026)
@@ -0,0 +1,196 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public class SymbolicExpressionTreeNode : DeepCloneable {
+    [Storable]
+    private IList<SymbolicExpressionTreeNode> subTrees;
+    [Storable]
+    private Symbol symbol;
+
+    // cached values to prevent unnecessary tree iterations
+    private short size;
+    private short height;
+
+    public Symbol Symbol {
+      get { return symbol; }
+      protected set { symbol = value; }
+    }
+
+    // parent relation is not persisted or cloned (will be set on AddSubtree or RemoveSubtree)
+    private SymbolicExpressionTreeNode parent;
+    internal SymbolicExpressionTreeNode Parent {
+      get { return parent; }
+      set { parent = value; }
+    }
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeNode(bool deserializing) { }
+    protected SymbolicExpressionTreeNode(SymbolicExpressionTreeNode original, Cloner cloner)
+      : base() {
+      symbol = original.symbol; // symbols are reused
+      subTrees = new List<SymbolicExpressionTreeNode>(original.SubTrees.Count);
+      foreach (var subtree in original.SubTrees) {
+        var clonedSubTree = cloner.Clone(subtree);
+        subTrees.Add(clonedSubTree);
+        clonedSubTree.Parent = this;
+      }
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeNode(this, cloner);
+    }
+
+    internal SymbolicExpressionTreeNode()
+      : base() {
+      // don't allocate subtrees list here!
+      // because we don't want to allocate it in terminal nodes
+    }
+
+    public SymbolicExpressionTreeNode(Symbol symbol)
+      : base() {
+      subTrees = new List<SymbolicExpressionTreeNode>(3);
+      this.symbol = symbol;
+    }
+
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      foreach (var subtree in SubTrees) {
+        subtree.Parent = this;
+      }
+    }
+
+    public virtual bool HasLocalParameters {
+      get { return false; }
+    }
+
+    public virtual IList<SymbolicExpressionTreeNode> SubTrees {
+      get { return subTrees; }
+    }
+
+    public virtual ISymbolicExpressionGrammar Grammar {
+      get { return parent.Grammar; }
+    }
+
+    public int GetSize() {
+      if (size > 0) return size;
+      else {
+        size = 1;
+        if (SubTrees != null) {
+          for (int i = 0; i < SubTrees.Count; i++) {
+            checked { size += (short)SubTrees[i].GetSize(); }
+          }
+        }
+        return size;
+      }
+    }
+
+    public int GetHeight() {
+      if (height > 0) return height;
+      else {
+        if (SubTrees != null) {
+          for (int i = 0; i < SubTrees.Count; i++) height = Math.Max(height, (short)SubTrees[i].GetHeight());
+        }
+        height++;
+        return height;
+      }
+    }
+
+    public virtual void ResetLocalParameters(IRandom random) { }
+    public virtual void ShakeLocalParameters(IRandom random, double shakingFactor) { }
+
+    public virtual void AddSubTree(SymbolicExpressionTreeNode tree) {
+      SubTrees.Add(tree);
+      tree.Parent = this;
+      ResetCachedValues();
+    }
+
+    public virtual void InsertSubTree(int index, SymbolicExpressionTreeNode tree) {
+      SubTrees.Insert(index, tree);
+      tree.Parent = this;
+      ResetCachedValues();
+    }
+
+    public virtual void RemoveSubTree(int index) {
+      SubTrees[index].Parent = null;
+      SubTrees.RemoveAt(index);
+      ResetCachedValues();
+    }
+
+    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPrefix() {
+      List<SymbolicExpressionTreeNode> list = new List<SymbolicExpressionTreeNode>();
+      ForEachNodePrefix((n) => list.Add(n));
+      return list;
+    }
+
+    public void ForEachNodePrefix(Action<SymbolicExpressionTreeNode> a) {
+      a(this);
+      if (SubTrees != null) {
+        for (int i = 0; i < SubTrees.Count; i++) {
+          SubTrees[i].ForEachNodePrefix(a);
+        }
+      }
+    }
+
+    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPostfix() {
+      List<SymbolicExpressionTreeNode> list = new List<SymbolicExpressionTreeNode>();
+      ForEachNodePostfix((n) => list.Add(n));
+      return list;
+    }
+
+    public void ForEachNodePostfix(Action<SymbolicExpressionTreeNode> a) {
+      if (SubTrees != null) {
+        for (int i = 0; i < SubTrees.Count; i++) {
+          SubTrees[i].ForEachNodePostfix(a);
+        }
+      }
+      a(this);
+    }
+
+    public IEnumerable<Symbol> GetAllowedSymbols(int argumentIndex) {
+      return Grammar.Symbols.Where(s => Grammar.IsAllowedChild(Symbol, s, argumentIndex));
+    }
+
+    public int GetMinSubtreeCount() {
+      return Grammar.GetMinSubtreeCount(Symbol);
+    }
+    public int GetMaxSubtreeCount() {
+      return Grammar.GetMaxSubtreeCount(Symbol);
+    }
+    public override string ToString() {
+      return Symbol.Name;
+    }
+
+    private void ResetCachedValues() {
+      size = 0; height = 0;
+      if (parent != null) parent.ResetCachedValues();
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeOperator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeOperator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeOperator.cs	(revision 5026)
@@ -0,0 +1,88 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <summary>
+  /// A base class for operators for symbolic expression trees.
+  /// </summary>
+  [Item("SymbolicExpressionTreeOperator", "A base class for operators for symbolic expression trees.")]
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeOperator : SingleSuccessorOperator, IStochasticOperator, ISymbolicExpressionTreeOperator {
+    private const string RandomParameterName = "Random";
+    private const string MaxTreeSizeParameterName = "MaxTreeSize";
+    private const string MaxTreeHeightParameterName = "MaxTreeHeight";
+    private const string SymbolicExpressionGrammarParameterName = "SymbolicExpressionGrammar";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    #region Parameter Properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (LookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxTreeSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeSizeParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaxTreeHeightParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaxTreeHeightParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionGrammarParameter {
+      get { return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionGrammarParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public IRandom Random {
+      get { return RandomParameter.ActualValue; }
+    }
+    public IntValue MaxTreeSize {
+      get { return MaxTreeSizeParameter.ActualValue; }
+    }
+    public IntValue MaxTreeHeight {
+      get { return MaxTreeHeightParameter.ActualValue; }
+    }
+    public ISymbolicExpressionGrammar SymbolicExpressionGrammar {
+      get { return SymbolicExpressionGrammarParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeOperator(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeOperator(SymbolicExpressionTreeOperator original, Cloner cloner) : base(original, cloner) { }
+    protected SymbolicExpressionTreeOperator()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The pseudo random number generator which should be used for symbolic expression tree operators."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeSizeParameterName, "The maximal size (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaxTreeHeightParameterName, "The maximal height of the symbolic expression tree (a tree with one node has height = 0)."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionGrammarParameterName, "The grammar that defines the allowed symbols and syntax of the symbolic expression trees."));
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeStringFormatter.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeStringFormatter.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeStringFormatter.cs	(revision 5026)
@@ -0,0 +1,62 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Text;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  
+  public class SymbolicExpressionTreeStringFormatter {
+    
+    public bool Indent { get; set; }
+    
+    public SymbolicExpressionTreeStringFormatter()
+      : base() {
+      Indent = true;
+    }
+
+    public string Format(SymbolicExpressionTree symbolicExpressionTree) {
+      return FormatRecursively(symbolicExpressionTree.Root, 0);
+    }
+
+    private string FormatRecursively(SymbolicExpressionTreeNode node, int indentLength) {
+      StringBuilder strBuilder = new StringBuilder();
+      if (Indent) strBuilder.Append(' ', indentLength);
+      strBuilder.Append("(");
+      // internal nodes or leaf nodes?
+      if (node.SubTrees.Count > 0) {
+        // symbol on same line as '('
+        strBuilder.AppendLine(node.ToString());
+        // each subtree expression on a new line
+        // and closing ')' also on new line
+        foreach (var subtree in node.SubTrees) {
+          strBuilder.AppendLine(FormatRecursively(subtree, indentLength + 2));
+        }
+        if (Indent) strBuilder.Append(' ', indentLength);
+        strBuilder.Append(")");
+      } else {
+        // symbol in the same line with as '(' and ')'
+        strBuilder.Append(node.ToString());
+        strBuilder.Append(")");
+      }
+      return strBuilder.ToString();
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeTerminalNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeTerminalNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeTerminalNode.cs	(revision 5026)
@@ -0,0 +1,64 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeTerminalNode : SymbolicExpressionTreeNode {
+    private static List<SymbolicExpressionTreeNode> emptyList = new List<SymbolicExpressionTreeNode>();
+    public override IList<SymbolicExpressionTreeNode> SubTrees {
+      get {
+        return SymbolicExpressionTreeTerminalNode.emptyList;
+      }
+    }
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeTerminalNode(bool deserializing) : base(deserializing) { }
+    // don't call storable constructor of base to prevent allocation of sub-trees list in base!
+    protected SymbolicExpressionTreeTerminalNode(SymbolicExpressionTreeTerminalNode original, Cloner cloner)
+      : base() {
+      // symbols are reused
+      this.Symbol = original.Symbol;
+    }
+    protected SymbolicExpressionTreeTerminalNode() : base() { }
+
+    protected SymbolicExpressionTreeTerminalNode(Symbol symbol)
+      : base() {
+      // symbols are reused
+      this.Symbol = symbol;
+    }
+
+    public override void AddSubTree(SymbolicExpressionTreeNode tree) {
+      throw new NotSupportedException();
+    }
+    public override void InsertSubTree(int index, SymbolicExpressionTreeNode tree) {
+      throw new NotSupportedException();
+    }
+    public override void RemoveSubTree(int index) {
+      throw new NotSupportedException();
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeTopLevelNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeTopLevelNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeTopLevelNode.cs	(revision 5026)
@@ -0,0 +1,52 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public class SymbolicExpressionTreeTopLevelNode : SymbolicExpressionTreeNode {
+    [Storable]
+    private ISymbolicExpressionGrammar grammar;
+    public override ISymbolicExpressionGrammar Grammar {
+      get { return grammar; }
+    }
+    public void SetGrammar(ISymbolicExpressionGrammar grammar) {
+      this.grammar = grammar;
+    }
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeTopLevelNode(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeTopLevelNode(SymbolicExpressionTreeTopLevelNode original, Cloner cloner)
+      : base(original, cloner) {
+      grammar = cloner.Clone(original.Grammar);
+    }
+    public SymbolicExpressionTreeTopLevelNode() : base() { }
+    public SymbolicExpressionTreeTopLevelNode(Symbol symbol) : base(symbol) { }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeTopLevelNode(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Argument.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Argument.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Argument.cs	(revision 5026)
@@ -0,0 +1,65 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  /// <summary>
+  /// Symbol for function arguments
+  /// </summary>
+  [StorableClass]
+  [Item(Argument.ArgumentName, Argument.ArgumentDescription)]
+  public sealed class Argument : ReadOnlySymbol {
+    public const string ArgumentName = "Argument";
+    public const string ArgumentDescription = "Symbol that represents a function argument.";
+    [Storable]
+    private int argumentIndex;
+    public int ArgumentIndex {
+      get { return argumentIndex; }
+    }
+
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    [StorableConstructor]
+    private Argument(bool deserializing) : base(deserializing) { }
+    private Argument(Argument original, Cloner cloner)
+      : base(original, cloner) {
+      argumentIndex = original.argumentIndex;
+      name = "ARG" + original.argumentIndex;
+    }
+    public Argument(int argumentIndex)
+      : base("ARG" + argumentIndex, Argument.ArgumentDescription) {
+      this.argumentIndex = argumentIndex;
+      this.name = "ARG" + argumentIndex;
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new ArgumentTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Argument(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ArgumentTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ArgumentTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ArgumentTreeNode.cs	(revision 5026)
@@ -0,0 +1,46 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  [StorableClass]
+  public sealed class ArgumentTreeNode : SymbolicExpressionTreeTerminalNode {
+    internal new Argument Symbol {
+      get { return (Argument)base.Symbol; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        if (!(value is Argument)) throw new ArgumentException();
+        base.Symbol = value;
+      }
+    }
+
+    [StorableConstructor]
+    private ArgumentTreeNode(bool deserializing) : base(deserializing) { }
+    private ArgumentTreeNode(ArgumentTreeNode original, Cloner cloner) : base(original, cloner) { }
+    public ArgumentTreeNode(Argument argSymbol) : base(argSymbol) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ArgumentTreeNode(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Defun.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Defun.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Defun.cs	(revision 5026)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  /// <summary>
+  /// Symbol for function defining branches
+  /// </summary>
+  [StorableClass]
+  [Item(Defun.DefunName, Defun.DefunDescription)]
+  public sealed class Defun : ReadOnlySymbol {
+    public const string DefunName = "Defun";
+    public const string DefunDescription = "Symbol that represents a function defining node.";
+
+    [StorableConstructor]
+    private Defun(bool deserializing) : base(deserializing) { }
+    private Defun(Defun original, Cloner cloner) : base(original, cloner) { }
+    public Defun() : base(Defun.DefunName, Defun.DefunDescription) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Defun(this, cloner);
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new DefunTreeNode(this);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/DefunTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/DefunTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/DefunTreeNode.cs	(revision 5026)
@@ -0,0 +1,58 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  [StorableClass]
+  public sealed class DefunTreeNode : SymbolicExpressionTreeTopLevelNode {
+    private int numberOfArguments;
+    [Storable]
+    public int NumberOfArguments {
+      get { return numberOfArguments; }
+      set { numberOfArguments = value; }
+    }
+    private string functionName;
+    [Storable]
+    public string FunctionName {
+      get { return functionName; }
+      set { this.functionName = value; }
+    }
+
+    [StorableConstructor]
+    private DefunTreeNode(bool deserializing) : base(deserializing) { }
+    private DefunTreeNode(DefunTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      functionName = original.functionName;
+      numberOfArguments = original.numberOfArguments;
+    }
+
+    public DefunTreeNode(Defun defunSymbol) : base(defunSymbol) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DefunTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      return FunctionName;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunction.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunction.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunction.cs	(revision 5026)
@@ -0,0 +1,70 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  /// <summary>
+  /// Symbol for invoking automatically defined functions
+  /// </summary>
+  [StorableClass]
+  [Item(InvokeFunction.InvokeFunctionName, InvokeFunction.InvokeFunctionDescription)]
+  public sealed class InvokeFunction : ReadOnlySymbol {
+    public const string InvokeFunctionName = "InvokeFunction";
+    public const string InvokeFunctionDescription = "Symbol that the invocation of another function.";
+    public override bool CanChangeName {
+      get {
+        return false;
+      }
+    }
+    [Storable]
+    private string functionName;
+    public string FunctionName {
+      get { return functionName; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        functionName = value;
+      }
+    }
+
+    [StorableConstructor]
+    private InvokeFunction(bool deserializing) : base(deserializing) { }
+    private InvokeFunction(InvokeFunction original, Cloner cloner)
+      : base(original, cloner) {
+      functionName = original.functionName;
+      name = "Invoke: " + original.functionName;
+    }
+    public InvokeFunction(string functionName)
+      : base("Invoke: " + functionName, InvokeFunction.InvokeFunctionDescription) {
+      this.FunctionName = functionName;
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new InvokeFunctionTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new InvokeFunction(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunctionTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunctionTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunctionTreeNode.cs	(revision 5026)
@@ -0,0 +1,46 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  [StorableClass]
+  public sealed class InvokeFunctionTreeNode : SymbolicExpressionTreeNode {
+    public new InvokeFunction Symbol {
+      get { return (InvokeFunction)base.Symbol; }
+      internal set {
+        if (value == null) throw new ArgumentNullException();
+        if (!(value is InvokeFunction)) throw new ArgumentNullException();
+        base.Symbol = value;
+      }
+    }
+
+    [StorableConstructor]
+    private InvokeFunctionTreeNode(bool deserializing) : base(deserializing) { }
+    private InvokeFunctionTreeNode(InvokeFunctionTreeNode original, Cloner cloner) : base(original, cloner) { }
+    public InvokeFunctionTreeNode(InvokeFunction invokeSymbol) : base(invokeSymbol) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new InvokeFunctionTreeNode(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ProgramRootSymbol.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ProgramRootSymbol.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ProgramRootSymbol.cs	(revision 5026)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  [StorableClass]
+  [Item(ProgramRootSymbol.ProgramRootSymbolName, ProgramRootSymbol.ProgramRootSymbolDescription)]
+  public sealed class ProgramRootSymbol : ReadOnlySymbol {
+    public const string ProgramRootSymbolName = "ProgramRootSymbol";
+    public const string ProgramRootSymbolDescription = "Special symbol that represents the program root node of a symbolic expression tree.";
+
+    [StorableConstructor]
+    private ProgramRootSymbol(bool deserializing) : base(deserializing) { }
+    private ProgramRootSymbol(ProgramRootSymbol original, Cloner cloner) : base(original, cloner) { }
+    public ProgramRootSymbol() : base(ProgramRootSymbol.ProgramRootSymbolName, ProgramRootSymbol.ProgramRootSymbolDescription) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ProgramRootSymbol(this, cloner);
+    }
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new SymbolicExpressionTreeTopLevelNode(this);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ReadOnlySymbol.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ReadOnlySymbol.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ReadOnlySymbol.cs	(revision 5026)
@@ -0,0 +1,43 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  [StorableClass]
+  [Item("ReadOnlySymbol", "Represents a symbol in a symbolic function tree that cannot be modified.")]
+  public abstract class ReadOnlySymbol : Symbol {
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    [StorableConstructor]
+    protected ReadOnlySymbol(bool deserializing) : base(deserializing) { }
+    protected ReadOnlySymbol(ReadOnlySymbol original, Cloner cloner) : base(original, cloner) { }
+    protected ReadOnlySymbol(string name, string description) : base(name, description) { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/StartSymbol.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/StartSymbol.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/StartSymbol.cs	(revision 5026)
@@ -0,0 +1,45 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  [StorableClass]
+  [Item(StartSymbol.StartSymbolName, StartSymbol.StartSymbolDescription)]
+  public sealed class StartSymbol : ReadOnlySymbol {
+    public const string StartSymbolName = "StartSymbol";
+    public const string StartSymbolDescription = "Special symbol that represents the starting node of the result producing branch of a symbolic expression tree.";
+
+    [StorableConstructor]
+    private StartSymbol(bool deserializing) : base(deserializing) { }
+    private StartSymbol(StartSymbol original, Cloner cloner) : base(original, cloner) { }
+    public StartSymbol() : base(StartSymbol.StartSymbolName, StartSymbol.StartSymbolDescription) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new StartSymbol(this, cloner);
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new SymbolicExpressionTreeTopLevelNode(this);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/StartSymbolTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/StartSymbolTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/StartSymbolTreeNode.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.GeneralSymbols {
+  [StorableClass]
+  public sealed class StartSymbolTreeNode : SymbolicExpressionTreeTopLevelNode {
+    // copy constructor
+    private StartSymbolTreeNode(StartSymbolTreeNode original)
+      : base(original) {
+    }
+
+    public StartSymbolTreeNode(StartSymbol startSymbol) : base(startSymbol) { }
+
+    public override object Clone() {
+      return new StartSymbolTreeNode(this);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Symbol.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Symbol.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Symbol.cs	(revision 5026)
@@ -0,0 +1,79 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols {
+  [StorableClass]
+  [Item("Symbol", "Represents a symbol in a symbolic function tree.")]
+  public abstract class Symbol : NamedItem {
+    #region Properties
+    [Storable]
+    private double initialFrequency;
+    public double InitialFrequency {
+      get { return initialFrequency; }
+      set {
+        if (value < 0.0) throw new ArgumentException("InitialFrequency must be positive");
+        if (value != initialFrequency) {
+          initialFrequency = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected Symbol(bool deserializing) : base(deserializing) { }
+    protected Symbol(Symbol original, Cloner cloner)
+      : base(original, cloner) {
+      initialFrequency = original.initialFrequency;
+    }
+    protected Symbol()
+      : base() {
+      initialFrequency = 1.0;
+    }
+
+    protected Symbol(string name, string description)
+      : base(name, description) {
+      initialFrequency = 1.0;
+    }
+
+
+    public virtual SymbolicExpressionTreeNode CreateTreeNode() {
+      return new SymbolicExpressionTreeNode(this);
+    }
+
+    #region events
+    public event EventHandler Changed;
+    protected void OnChanged(EventArgs e) {
+      EventHandler handlers = Changed;
+      if (handlers != null)
+        handlers(this, e);
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/AllArchitectureAlteringOperatorsTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/AllArchitectureAlteringOperatorsTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/AllArchitectureAlteringOperatorsTest.cs	(revision 5026)
@@ -0,0 +1,108 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Diagnostics;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Crossovers;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class AllArchitectureAlteringOperatorsTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int N_ITERATIONS = 20;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void AllArchitectureAlteringOperatorsDistributionTest() {
+      var trees = new List<SymbolicExpressionTree>();
+      var newTrees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister(31415);
+      int failedEvents = 0;
+      IntValue maxTreeSize = new IntValue(100);
+      IntValue maxTreeHeigth = new IntValue(10);
+      IntValue maxDefuns = new IntValue(3);
+      IntValue maxArgs = new IntValue(3);
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        Util.IsValid(tree);
+        trees.Add(tree);
+      }
+      Stopwatch stopwatch = new Stopwatch();
+      stopwatch.Start();
+      var combinedAAOperator = new MultiSymbolicExpressionTreeArchitectureManipulator();
+      for (int g = 0; g < N_ITERATIONS; g++) {
+        for (int i = 0; i < POPULATION_SIZE; i++) {
+          if (random.NextDouble() < 0.5) {
+            // manipulate
+            var selectedTree = (SymbolicExpressionTree)trees.SelectRandom(random).Clone();
+            var op = combinedAAOperator.Operators.SelectRandom(random);
+            bool success = false;
+            op.ModifyArchitecture(random, selectedTree, grammar, maxTreeSize, maxTreeHeigth, maxDefuns, maxArgs, out success);
+            if (!success) failedEvents++;
+            Util.IsValid(selectedTree);
+            newTrees.Add(selectedTree);
+          } else {
+            // crossover
+            var par0 = (SymbolicExpressionTree)trees.SelectRandom(random).Clone();
+            var par1 = (SymbolicExpressionTree)trees.SelectRandom(random).Clone();
+            bool success;
+            newTrees.Add(SubtreeCrossover.Cross(random, par0, par1, 0.9, 100, 10, out success));
+            if (!success) failedEvents++;
+          }
+        }
+        trees = newTrees;
+      }
+      stopwatch.Stop();
+      var msPerOperation = stopwatch.ElapsedMilliseconds / (double)POPULATION_SIZE / (double)N_ITERATIONS;
+      Assert.Inconclusive("AllArchitectureAlteringOperators: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE / N_ITERATIONS * 100 + " %" + Environment.NewLine +
+        "Operations / s: ~" + Math.Round(1000.0 / (msPerOperation)) + "operations / s)" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 200, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentCreaterTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentCreaterTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentCreaterTest.cs	(revision 5026)
@@ -0,0 +1,73 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class ArgumentCreaterTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void ArgumentCreaterDistributionsTest() {
+      var trees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister(31415);
+      int failedEvents = 0;
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        if (!ArgumentCreater.CreateNewArgument(random, tree, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3))
+          failedEvents++;
+        Util.IsValid(tree);
+        trees.Add(tree);
+      }
+      Assert.Inconclusive("ArgumentCreator: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE * 100 + " %" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 200, 20) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDeleterTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDeleterTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDeleterTest.cs	(revision 5026)
@@ -0,0 +1,73 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class ArgumentDeleterTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void ArgumentDeleterDistributionsTest() {
+      var trees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister(31415);
+      int failedEvents = 0;
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        if (!ArgumentDeleter.DeleteArgument(random, tree, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3))
+          failedEvents++;
+        Util.IsValid(tree);
+        trees.Add(tree);
+      }
+      Assert.Inconclusive("ArgumentDeleter: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE * 100 + " %" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 105, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDuplicaterTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDuplicaterTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ArgumentDuplicaterTest.cs	(revision 5026)
@@ -0,0 +1,73 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class ArgumentDuplicaterTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void ArgumentDuplicaterDistributionsTest() {
+      var trees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister();
+      int failedEvents = 0;
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        if (!ArgumentDuplicater.DuplicateArgument(random, tree, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3))
+          failedEvents++;
+        Util.IsValid(tree);
+        trees.Add(tree);
+      }
+      Assert.Inconclusive("ArgumentDuplicater: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE * 100 + " %" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 200, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ChangeNodeTypeManipulationTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ChangeNodeTypeManipulationTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ChangeNodeTypeManipulationTest.cs	(revision 5026)
@@ -0,0 +1,75 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class ChangeNodeTypeManipulationTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void ChangeNodeTypeManipulationDistributionsTest() {
+      var trees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister();
+      int failedEvents = 0;
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        bool success;
+        ChangeNodeTypeManipulation.ChangeNodeType(random, tree, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, out success);
+        if (!success)
+          failedEvents++;
+        Util.IsValid(tree);
+        trees.Add(tree);
+      }
+      Assert.Inconclusive("ChangeNodeTypeManipulation: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE * 100 + " %" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 105, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Grammars.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Grammars.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Grammars.cs	(revision 5026)
@@ -0,0 +1,128 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  public static class Grammars {
+    private class Addition : Symbol {
+      protected Addition(Addition original, Cloner cloner) : base(original, cloner) { }
+      public Addition() : base("Addition", "") { }
+      public override IDeepCloneable Clone(Cloner cloner) {
+        return new Addition(this, cloner);
+      }
+    }
+    private class Subtraction : Symbol {
+      protected Subtraction(Subtraction original, Cloner cloner) : base(original, cloner) { }
+      public Subtraction() : base("Subtraction", "") { }
+      public override IDeepCloneable Clone(Cloner cloner) {
+        return new Subtraction(this, cloner);
+      }
+    }
+    private class Multiplication : Symbol {
+      protected Multiplication(Multiplication original, Cloner cloner) : base(original, cloner) { }
+      public Multiplication() : base("Multiplication", "") { }
+      public override IDeepCloneable Clone(Cloner cloner) {
+        return new Multiplication(this, cloner);
+      }
+    }
+    private class Division : Symbol {
+      protected Division(Division original, Cloner cloner) : base(original, cloner) { }
+      public Division() : base("Division", "") { }
+      public override IDeepCloneable Clone(Cloner cloner) {
+        return new Division(this, cloner);
+      }
+    }
+    private class Terminal : Symbol {
+      protected Terminal(Terminal original, Cloner cloner) : base(original, cloner) { }
+      public Terminal() : base("Terminal", "") { }
+      public override IDeepCloneable Clone(Cloner cloner) {
+        return new Terminal(this, cloner);
+      }
+    }
+
+    private class SimpleArithmeticGrammar : DefaultSymbolicExpressionGrammar {
+      protected SimpleArithmeticGrammar(SimpleArithmeticGrammar original, Cloner cloner) : base(original, cloner) { }
+      public SimpleArithmeticGrammar()
+        : base() {
+        Initialize();
+      }
+
+      public override IDeepCloneable Clone(Cloner cloner) {
+        return new SimpleArithmeticGrammar(this, cloner);
+      }
+
+      private void Initialize() {
+        var add = new Addition();
+        var sub = new Subtraction();
+        var mul = new Multiplication();
+        var div = new Division();
+        var terminal = new Terminal();
+
+        var allSymbols = new List<Symbol>() { add, sub, mul, div, terminal };
+        var functionSymbols = new List<Symbol>() { add, sub, mul, div };
+        foreach (var symb in allSymbols)
+          AddSymbol(symb);
+
+        foreach (var funSymb in functionSymbols) {
+          SetMinSubtreeCount(funSymb, 1);
+          SetMaxSubtreeCount(funSymb, 3);
+        }
+        SetMinSubtreeCount(terminal, 0);
+        SetMaxSubtreeCount(terminal, 0);
+
+        // allow each symbol as child of the start symbol
+        foreach (var symb in allSymbols) {
+          SetAllowedChild(StartSymbol, symb, 0);
+        }
+
+        // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
+        foreach (var parent in allSymbols) {
+          for (int i = 0; i < GetMaxSubtreeCount(parent); i++)
+            foreach (var child in allSymbols) {
+              SetAllowedChild(parent, child, i);
+            }
+        }
+      }
+    }
+
+    public static ISymbolicExpressionGrammar CreateSimpleArithmeticGrammar() {
+      var g = new GlobalSymbolicExpressionGrammar(new SimpleArithmeticGrammar());
+      g.MaxFunctionArguments = 0;
+      g.MinFunctionArguments = 0;
+      g.MaxFunctionDefinitions = 0;
+      g.MinFunctionDefinitions = 0;
+      return g;
+    }
+
+    public static ISymbolicExpressionGrammar CreateArithmeticAndAdfGrammar() {
+      var g = new GlobalSymbolicExpressionGrammar(new SimpleArithmeticGrammar());
+      g.MaxFunctionArguments = 3;
+      g.MinFunctionArguments = 0;
+      g.MaxFunctionDefinitions = 3;
+      g.MinFunctionDefinitions = 0;
+      return g;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.Tests.csproj
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.Tests.csproj	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.Tests.csproj	(revision 5026)
@@ -0,0 +1,190 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{8824925E-3E00-4543-8293-7DDACE4737F8}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests</RootNamespace>
+    <AssemblyName>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.Tests</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ArgumentCreaterTest.cs" />
+    <Compile Include="ArgumentDeleterTest.cs" />
+    <Compile Include="ArgumentDuplicaterTest.cs" />
+    <Compile Include="AllArchitectureAlteringOperatorsTest.cs" />
+    <Compile Include="ChangeNodeTypeManipulationTest.cs" />
+    <Compile Include="ReplaceBranchManipulationTest.cs" />
+    <Compile Include="SubroutineDeleterTest.cs" />
+    <Compile Include="SubroutineDuplicaterTest.cs" />
+    <Compile Include="Grammars.cs" />
+    <Compile Include="SubroutineCreaterTest.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="SubtreeCrossoverTest.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Util.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ProbabilisticTreeCreaterTest.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
+      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
+      <Name>HeuristicLab.Collections-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
+      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
+      <Name>HeuristicLab.Common-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
+      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
+      <Name>HeuristicLab.Core-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
+      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
+      <Name>HeuristicLab.Data-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
+      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
+      <Name>HeuristicLab.Operators-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
+      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
+      <Name>HeuristicLab.Optimization-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
+      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
+      <Name>HeuristicLab.Persistence-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
+      <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
+      <Name>HeuristicLab.Random-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj">
+      <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ProbabilisticTreeCreaterTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ProbabilisticTreeCreaterTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ProbabilisticTreeCreaterTest.cs	(revision 5026)
@@ -0,0 +1,89 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class ProbabilisticTreeCreaterTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void ProbabilisticTreeCreaterDistributionsTest() {
+      var randomTrees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateSimpleArithmeticGrammar();
+      var random = new MersenneTwister(31415);
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        randomTrees.Add(ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 0, 0));
+      }
+
+      foreach (var tree in randomTrees) {
+        Util.IsValid(tree);
+      }
+      Assert.Inconclusive("ProbabilisticTreeCreator: " + Environment.NewLine +
+        Util.GetSizeDistributionString(randomTrees, 105, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(randomTrees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(randomTrees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(randomTrees) + Environment.NewLine
+        );
+    }
+
+
+    [TestMethod()]
+    public void ProbabilisticTreeCreaterWithAdfDistributionsTest() {
+      var randomTrees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister(31415);
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        Util.IsValid(tree);
+        randomTrees.Add(tree);
+      }
+      Assert.Inconclusive("ProbabilisticTreeCreator: " + Environment.NewLine +
+        Util.GetSizeDistributionString(randomTrees, 105, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(randomTrees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(randomTrees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(randomTrees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Properties/AssemblyInfo.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Properties/AssemblyInfo.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Properties/AssemblyInfo.cs	(revision 5026)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.Tests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.Tests")]
+[assembly: AssemblyCopyright("Copyright ©  2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM componenets.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("e232a6a8-a54f-4629-8962-98c1597f1b8d")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.2.0")]
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ReplaceBranchManipulationTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ReplaceBranchManipulationTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ReplaceBranchManipulationTest.cs	(revision 5026)
@@ -0,0 +1,77 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class ReplaceBranchManipulationTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void ReplaceBranchManipulationDistributionsTest() {
+      var trees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister(31415);
+      int failedEvents = 0;
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        bool success;
+        ReplaceBranchManipulation.ReplaceRandomBranch(random, tree, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, out success);
+        if (!success) {
+          failedEvents++;
+        } else {
+          Util.IsValid(tree);
+          trees.Add(tree);
+        }
+      }
+      Assert.Inconclusive("ReplaceBranchManipulation: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE * 100 + " %" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 105, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineCreaterTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineCreaterTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineCreaterTest.cs	(revision 5026)
@@ -0,0 +1,73 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class SubroutineCreaterTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void SubroutineCreaterDistributionsTest() {
+      var trees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister(31415);
+      int failedEvents = 0;
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        if (!SubroutineCreater.CreateSubroutine(random, tree, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3))
+          failedEvents++;
+        Util.IsValid(tree);
+        trees.Add(tree);
+      }
+      Assert.Inconclusive("SubroutineCreator: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE * 100 + " %" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 105, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDeleterTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDeleterTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDeleterTest.cs	(revision 5026)
@@ -0,0 +1,73 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class SubroutineDeleterTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void SubroutineDeleterDistributionsTest() {
+      var trees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister(31415);
+      int failedEvents = 0;
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        if (!SubroutineDeleter.DeleteSubroutine(random, tree, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3))
+          failedEvents++;
+        Util.IsValid(tree);
+        trees.Add(tree);
+      }
+      Assert.Inconclusive("SubroutineDeleter: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE * 100 + " %" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 105, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDuplicaterTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDuplicaterTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubroutineDuplicaterTest.cs	(revision 5026)
@@ -0,0 +1,73 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ArchitectureManipulators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class SubroutineDuplicaterTest {
+    private const int POPULATION_SIZE = 1000;
+    private const int MAX_TREE_SIZE = 100;
+    private const int MAX_TREE_HEIGHT = 10;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void SubroutineDuplicaterDistributionsTest() {
+      var trees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister();
+      int failedEvents = 0;
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3);
+        if (!SubroutineDuplicater.DuplicateSubroutine(random, tree, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3))
+          failedEvents++;
+        Util.IsValid(tree);
+        trees.Add(tree);
+      }
+      Assert.Inconclusive("SubroutineDuplicater: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE * 100 + " %" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 105, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubtreeCrossoverTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubtreeCrossoverTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/SubtreeCrossoverTest.cs	(revision 5026)
@@ -0,0 +1,92 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Diagnostics;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Crossovers;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  [TestClass]
+  public class SubtreeCrossoverTest {
+    private const int POPULATION_SIZE = 1000;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [TestMethod()]
+    public void SubtreeCrossoverDistributionsTest() {
+      int generations = 5;
+      var trees = new List<SymbolicExpressionTree>();
+      var grammar = Grammars.CreateArithmeticAndAdfGrammar();
+      var random = new MersenneTwister();
+      int failedEvents = 0;
+      List<SymbolicExpressionTree> crossoverTrees;
+      double msPerCrossoverEvent;
+
+      for (int i = 0; i < POPULATION_SIZE; i++) {
+        trees.Add(ProbabilisticTreeCreator.Create(random, grammar, 100, 10, 3, 3));
+      }
+      Stopwatch stopwatch = new Stopwatch();
+      stopwatch.Start();
+      for (int gCount = 0; gCount < generations; gCount++) {
+        var newPopulation = new List<SymbolicExpressionTree>();
+        for (int i = 0; i < POPULATION_SIZE; i++) {
+          var par0 = (SymbolicExpressionTree)trees.SelectRandom(random).Clone();
+          var par1 = (SymbolicExpressionTree)trees.SelectRandom(random).Clone();
+          bool success;
+          newPopulation.Add(SubtreeCrossover.Cross(random, par0, par1, 0.9, 100, 10, out success));
+          if (!success) failedEvents++;
+        }
+        crossoverTrees = newPopulation;
+      }
+      stopwatch.Stop();
+      foreach (var tree in trees)
+        Util.IsValid(tree);
+
+      msPerCrossoverEvent = stopwatch.ElapsedMilliseconds / (double)POPULATION_SIZE / (double)generations;
+
+      Assert.Inconclusive("SubtreeCrossover: " + Environment.NewLine +
+        "Failed events: " + failedEvents / (double)POPULATION_SIZE * 100 + " %" + Environment.NewLine +
+        msPerCrossoverEvent + " ms per crossover event (~" + Math.Round(1000.0 / (msPerCrossoverEvent)) + "crossovers / s)" + Environment.NewLine +
+        Util.GetSizeDistributionString(trees, 105, 5) + Environment.NewLine +
+        Util.GetFunctionDistributionString(trees) + Environment.NewLine +
+        Util.GetNumberOfSubTreesDistributionString(trees) + Environment.NewLine +
+        Util.GetTerminalDistributionString(trees) + Environment.NewLine
+        );
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Util.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Util.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Util.cs	(revision 5026)
@@ -0,0 +1,149 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Text;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
+  public static class Util {
+    public static string GetSizeDistributionString(IList<SymbolicExpressionTree> trees, int maxTreeSize, int binSize) {
+      int[] histogram = new int[maxTreeSize / binSize];
+      for (int i = 0; i < trees.Count; i++) {
+        int binIndex = Math.Min(histogram.Length - 1, trees[i].Size / binSize);
+        histogram[binIndex]++;
+      }
+      StringBuilder strBuilder = new StringBuilder();
+      for (int i = 0; i < histogram.Length - 1; i++) {
+        strBuilder.Append(Environment.NewLine);
+        strBuilder.Append("< "); strBuilder.Append((i + 1) * binSize);
+        strBuilder.Append(": "); strBuilder.AppendFormat("{0:#0.00%}", histogram[i] / (double)trees.Count);
+      }
+      strBuilder.Append(Environment.NewLine);
+      strBuilder.Append(">= "); strBuilder.Append(histogram.Length * binSize);
+      strBuilder.Append(": "); strBuilder.AppendFormat("{0:#0.00%}", histogram[histogram.Length - 1] / (double)trees.Count);
+
+      return "Size distribution: " + strBuilder;
+    }
+
+    public static string GetFunctionDistributionString(IList<SymbolicExpressionTree> trees) {
+      Dictionary<string, int> occurances = new Dictionary<string, int>();
+      double n = 0.0;
+      for (int i = 0; i < trees.Count; i++) {
+        foreach (var node in trees[i].IterateNodesPrefix()) {
+          if (node.SubTrees.Count > 0) {
+            if (!occurances.ContainsKey(node.Symbol.Name))
+              occurances[node.Symbol.Name] = 0;
+            occurances[node.Symbol.Name]++;
+            n++;
+          }
+        }
+      }
+      StringBuilder strBuilder = new StringBuilder();
+      foreach (var function in occurances.Keys) {
+        strBuilder.Append(Environment.NewLine);
+        strBuilder.Append(function); strBuilder.Append(": ");
+        strBuilder.AppendFormat("{0:#0.00%}", occurances[function] / n);
+      }
+      return "Function distribution: " + strBuilder;
+    }
+
+    public static string GetNumberOfSubTreesDistributionString(IList<SymbolicExpressionTree> trees) {
+      Dictionary<int, int> occurances = new Dictionary<int, int>();
+      double n = 0.0;
+      for (int i = 0; i < trees.Count; i++) {
+        foreach (var node in trees[i].IterateNodesPrefix()) {
+          if (!occurances.ContainsKey(node.SubTrees.Count))
+            occurances[node.SubTrees.Count] = 0;
+          occurances[node.SubTrees.Count]++;
+          n++;
+        }
+      }
+      StringBuilder strBuilder = new StringBuilder();
+      foreach (var arity in occurances.Keys) {
+        strBuilder.Append(Environment.NewLine);
+        strBuilder.Append(arity); strBuilder.Append(": ");
+        strBuilder.AppendFormat("{0:#0.00%}", occurances[arity] / n);
+      }
+      return "Distribution of function arities: " + strBuilder;
+    }
+
+
+    public static string GetTerminalDistributionString(IList<SymbolicExpressionTree> trees) {
+      Dictionary<string, int> occurances = new Dictionary<string, int>();
+      double n = 0.0;
+      for (int i = 0; i < trees.Count; i++) {
+        foreach (var node in trees[i].IterateNodesPrefix()) {
+          if (node.SubTrees.Count == 0) {
+            if (!occurances.ContainsKey(node.Symbol.Name))
+              occurances[node.Symbol.Name] = 0;
+            occurances[node.Symbol.Name]++;
+            n++;
+          }
+        }
+      }
+      StringBuilder strBuilder = new StringBuilder();
+      foreach (var function in occurances.Keys) {
+        strBuilder.Append(Environment.NewLine);
+        strBuilder.Append(function); strBuilder.Append(": ");
+        strBuilder.AppendFormat("{0:#0.00%}", occurances[function] / n);
+      }
+      return "Terminal distribution: " + strBuilder;
+    }
+
+    public static void IsValid(SymbolicExpressionTree tree) {
+      int reportedSize = tree.Size;
+      int actualSize = tree.IterateNodesPostfix().Count();
+      Assert.AreEqual(actualSize, reportedSize);
+
+      foreach (var defunTreeNode in tree.Root.SubTrees.OfType<DefunTreeNode>()) {
+        int arity = defunTreeNode.NumberOfArguments;
+        var invoke = new InvokeFunction(defunTreeNode.FunctionName);
+        foreach (var otherRootNode in tree.Root.SubTrees) {
+          if (otherRootNode.Grammar.ContainsSymbol(invoke)) {
+            Assert.IsTrue(otherRootNode.Grammar.GetMinSubtreeCount(invoke) == arity);
+            Assert.IsTrue(otherRootNode.Grammar.GetMaxSubtreeCount(invoke) == arity);
+          }
+        }
+      }
+      //Assert.AreEqual(tree.Root.Symbol, tree.Root.Grammar.StartSymbol);
+      //foreach (var subtree in tree.Root.SubTrees)
+      //  Assert.AreNotSame(subtree.Grammar, tree.Root.Grammar);
+      IsValid(tree.Root);
+    }
+
+    public static void IsValid(SymbolicExpressionTreeNode treeNode) {
+      var matchingSymbol = (from symb in treeNode.Grammar.Symbols
+                            where symb.Name == treeNode.Symbol.Name
+                            select symb).SingleOrDefault();
+      Assert.IsTrue(treeNode.SubTrees.Count >= treeNode.Grammar.GetMinSubtreeCount(matchingSymbol));
+      Assert.IsTrue(treeNode.SubTrees.Count <= treeNode.Grammar.GetMaxSubtreeCount(matchingSymbol));
+      for (int i = 0; i < treeNode.SubTrees.Count; i++) {
+        Assert.IsTrue(treeNode.GetAllowedSymbols(i).Select(x => x.Name).Contains(treeNode.SubTrees[i].Symbol.Name));
+        IsValid(treeNode.SubTrees[i]);
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Analyzers/RegressionSolutionAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Analyzers/RegressionSolutionAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Analyzers/RegressionSolutionAnalyzer.cs	(revision 5026)
@@ -0,0 +1,190 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
+  [StorableClass]
+  public abstract class RegressionSolutionAnalyzer : SingleSuccessorOperator {
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string QualityParameterName = "Quality";
+    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
+    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
+    private const string BestSolutionQualityParameterName = "BestSolutionQuality";
+    private const string GenerationsParameterName = "Generations";
+    private const string ResultsParameterName = "Results";
+    private const string BestSolutionResultName = "Best solution (on validiation set)";
+    private const string BestSolutionTrainingRSquared = "Best solution R² (training)";
+    private const string BestSolutionTestRSquared = "Best solution R² (test)";
+    private const string BestSolutionTrainingMse = "Best solution mean squared error (training)";
+    private const string BestSolutionTestMse = "Best solution mean squared error (test)";
+    private const string BestSolutionTrainingRelativeError = "Best solution average relative error (training)";
+    private const string BestSolutionTestRelativeError = "Best solution average relative error (test)";
+    private const string BestSolutionGeneration = "Best solution generation";
+
+    #region parameter properties
+    public IValueLookupParameter<DataAnalysisProblemData> ProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> BestSolutionQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[BestSolutionQualityParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    public ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DoubleValue UpperEstimationLimit {
+      get { return UpperEstimationLimitParameter.ActualValue; }
+    }
+    public DoubleValue LowerEstimationLimit {
+      get { return LowerEstimationLimitParameter.ActualValue; }
+    }
+    public ItemArray<DoubleValue> Quality {
+      get { return QualityParameter.ActualValue; }
+    }
+    public ResultCollection Results {
+      get { return ResultsParameter.ActualValue; }
+    }
+    public DataAnalysisProblemData ProblemData {
+      get { return ProblemDataParameter.ActualValue; }
+    }
+    #endregion
+
+
+    [StorableConstructor]
+    protected RegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    protected RegressionSolutionAnalyzer(RegressionSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public RegressionSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(ProblemDataParameterName, "The problem data for which the symbolic expression tree is a solution."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper estimation limit that was set for the evaluation of the symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower estimation limit that was set for the evaluation of the symbolic expression trees."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The qualities of the symbolic regression trees which should be analyzed."));
+      Parameters.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameterName, "The quality of the best regression solution."));
+      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations calculated so far."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored."));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // backwards compatibility
+      if (!Parameters.ContainsKey(GenerationsParameterName)) {
+        Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations calculated so far."));
+      }
+    }
+
+    public override IOperation Apply() {
+      DoubleValue prevBestSolutionQuality = BestSolutionQualityParameter.ActualValue;
+      var bestSolution = UpdateBestSolution();
+      if (prevBestSolutionQuality == null || prevBestSolutionQuality.Value > BestSolutionQualityParameter.ActualValue.Value) {
+        RegressionSolutionAnalyzer.UpdateBestSolutionResults(bestSolution, ProblemData, Results, GenerationsParameter.ActualValue);
+      }
+
+      return base.Apply();
+    }
+
+    public static void UpdateBestSolutionResults(DataAnalysisSolution bestSolution, DataAnalysisProblemData problemData, ResultCollection results, IntValue CurrentGeneration) {
+      var solution = bestSolution;
+      #region update R2,MSE, Rel Error
+      IEnumerable<double> trainingValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable.Value, problemData.TrainingIndizes);
+      IEnumerable<double> testValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable.Value, problemData.TestIndizes);
+      OnlineMeanSquaredErrorEvaluator mseEvaluator = new OnlineMeanSquaredErrorEvaluator();
+      OnlineMeanAbsolutePercentageErrorEvaluator relErrorEvaluator = new OnlineMeanAbsolutePercentageErrorEvaluator();
+      OnlinePearsonsRSquaredEvaluator r2Evaluator = new OnlinePearsonsRSquaredEvaluator();
+
+      #region training
+      var originalEnumerator = trainingValues.GetEnumerator();
+      var estimatedEnumerator = solution.EstimatedTrainingValues.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        mseEvaluator.Add(originalEnumerator.Current, estimatedEnumerator.Current);
+        r2Evaluator.Add(originalEnumerator.Current, estimatedEnumerator.Current);
+        relErrorEvaluator.Add(originalEnumerator.Current, estimatedEnumerator.Current);
+      }
+      double trainingR2 = r2Evaluator.RSquared;
+      double trainingMse = mseEvaluator.MeanSquaredError;
+      double trainingRelError = relErrorEvaluator.MeanAbsolutePercentageError;
+      #endregion
+
+      mseEvaluator.Reset();
+      relErrorEvaluator.Reset();
+      r2Evaluator.Reset();
+
+      #region test
+      originalEnumerator = testValues.GetEnumerator();
+      estimatedEnumerator = solution.EstimatedTestValues.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        mseEvaluator.Add(originalEnumerator.Current, estimatedEnumerator.Current);
+        r2Evaluator.Add(originalEnumerator.Current, estimatedEnumerator.Current);
+        relErrorEvaluator.Add(originalEnumerator.Current, estimatedEnumerator.Current);
+      }
+      double testR2 = r2Evaluator.RSquared;
+      double testMse = mseEvaluator.MeanSquaredError;
+      double testRelError = relErrorEvaluator.MeanAbsolutePercentageError;
+      #endregion
+
+      if (results.ContainsKey(BestSolutionResultName)) {
+        results[BestSolutionResultName].Value = solution;
+        results[BestSolutionTrainingRSquared].Value = new DoubleValue(trainingR2);
+        results[BestSolutionTestRSquared].Value = new DoubleValue(testR2);
+        results[BestSolutionTrainingMse].Value = new DoubleValue(trainingMse);
+        results[BestSolutionTestMse].Value = new DoubleValue(testMse);
+        results[BestSolutionTrainingRelativeError].Value = new DoubleValue(trainingRelError);
+        results[BestSolutionTestRelativeError].Value = new DoubleValue(testRelError);
+        if (CurrentGeneration != null) // this check is needed because linear regression solutions do not have a generations parameter
+          results[BestSolutionGeneration].Value = new IntValue(CurrentGeneration.Value);
+      } else {
+        results.Add(new Result(BestSolutionResultName, solution));
+        results.Add(new Result(BestSolutionTrainingRSquared, new DoubleValue(trainingR2)));
+        results.Add(new Result(BestSolutionTestRSquared, new DoubleValue(testR2)));
+        results.Add(new Result(BestSolutionTrainingMse, new DoubleValue(trainingMse)));
+        results.Add(new Result(BestSolutionTestMse, new DoubleValue(testMse)));
+        results.Add(new Result(BestSolutionTrainingRelativeError, new DoubleValue(trainingRelError)));
+        results.Add(new Result(BestSolutionTestRelativeError, new DoubleValue(testRelError)));
+        if (CurrentGeneration != null)
+          results.Add(new Result(BestSolutionGeneration, new IntValue(CurrentGeneration.Value)));
+      }
+      #endregion
+    }
+
+    protected abstract DataAnalysisSolution UpdateBestSolution();
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj	(revision 5026)
@@ -0,0 +1,245 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Regression</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Regression-3.3</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-3.1.0, Version=3.1.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\ALGLIB-3.1.0.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.ALGLIB-3.1.0, Version=2.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.ALGLIB-3.1.0.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Analysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.LibSVM-1.6.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\LibSVM-1.6.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="HeuristicLabProblemsDataAnalysisRegressionPlugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.frame" />
+    <Compile Include="Analyzers\RegressionSolutionAnalyzer.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="HeuristicLabProblemsDataAnalysisRegressionPlugin.cs" />
+    <Compile Include="LinearRegression\LinearRegressionSolutionCreator.cs" />
+    <Compile Include="LinearRegression\LinearRegressionUtil.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SupportVectorRegression\BestSupportVectorRegressionSolutionAnalyzer.cs" />
+    <Compile Include="SupportVectorRegression\SupportVectorRegressionSolution.cs" />
+    <Compile Include="Symbolic\Analyzers\BestSymbolicRegressionSolutionAnalyzer.cs" />
+    <Compile Include="Symbolic\Analyzers\FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs" />
+    <Compile Include="Symbolic\Analyzers\ISymbolicRegressionAnalyzer.cs" />
+    <Compile Include="Symbolic\Analyzers\SymbolicRegressionModelQualityAnalyzer.cs" />
+    <Compile Include="Symbolic\Analyzers\SymbolicRegressionModelQualityCalculator.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Symbolic\Analyzers\SymbolicRegressionSolutionLinearScaler.cs" />
+    <Compile Include="Symbolic\Analyzers\SymbolicRegressionVariableFrequencyAnalyzer.cs" />
+    <Compile Include="Symbolic\Analyzers\ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs" />
+    <Compile Include="Symbolic\Evaluators\MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator.cs" />
+    <Compile Include="Symbolic\Evaluators\MultiObjectiveSymbolicRegressionEvaluator.cs" />
+    <Compile Include="Symbolic\Evaluators\MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator.cs" />
+    <Compile Include="Symbolic\Evaluators\SingleObjectiveSymbolicRegressionEvaluator.cs" />
+    <Compile Include="Symbolic\Evaluators\SymbolicRegressionMeanSquaredErrorEvaluator.cs" />
+    <Compile Include="Symbolic\Evaluators\SymbolicRegressionPearsonsRSquaredEvaluator.cs" />
+    <Compile Include="Symbolic\Evaluators\SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator.cs" />
+    <Compile Include="Symbolic\Evaluators\SymbolicRegressionScaledMeanSquaredErrorEvaluator.cs" />
+    <Compile Include="Symbolic\Interfaces\IMultiObjectiveSymbolicRegressionEvaluator.cs" />
+    <Compile Include="Symbolic\Interfaces\ISymbolicRegressionEvaluator.cs" />
+    <Compile Include="Symbolic\SymbolicRegressionProblem.cs" />
+    <Compile Include="Symbolic\MultiObjectiveSymbolicRegressionProblem.cs" />
+    <Compile Include="Symbolic\SimpleSymbolicRegressionEvaluator.cs" />
+    <Compile Include="Symbolic\SymbolicRegressionSolution.cs" />
+    <Compile Include="Symbolic\SymbolicRegressionModel.cs" />
+    <Compile Include="Symbolic\SymbolicRegressionProblemBase.cs">
+      <SubType>Code</SubType>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj">
+      <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.3\HeuristicLab.Problems.DataAnalysis-3.3.csproj">
+      <Project>{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisRegressionPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisRegressionPlugin.cs"</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/HeuristicLabProblemsDataAnalysisRegressionPlugin.cs.frame
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/HeuristicLabProblemsDataAnalysisRegressionPlugin.cs.frame	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/HeuristicLabProblemsDataAnalysisRegressionPlugin.cs.frame	(revision 5026)
@@ -0,0 +1,47 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression {
+  [Plugin("HeuristicLab.Problems.DataAnalysis.Regression", "3.3.2.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis.Regression-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.ALGLIB", "3.1")]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","3.3")]
+  [PluginDependency("HeuristicLab.LibSVM", "1.6.3.0")]
+  [PluginDependency("HeuristicLab.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.3")]
+  public class HeuristicLabProblemsDataAnalysisRegressionPlugin : PluginBase {
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/LinearRegression/LinearRegressionSolutionCreator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/LinearRegression/LinearRegressionSolutionCreator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/LinearRegression/LinearRegressionSolutionCreator.cs	(revision 5026)
@@ -0,0 +1,143 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.LinearRegression {
+  /// <summary>
+  /// A base class for operators which evaluates OneMax solutions given in BinaryVector encoding.
+  /// </summary>
+  [Item("LinearRegressionSolutionCreator", "Uses linear regression to create a structure tree.")]
+  [StorableClass]
+  public sealed class LinearRegressionSolutionCreator : SingleSuccessorOperator, ISolutionCreator {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+
+    [StorableConstructor]
+    private LinearRegressionSolutionCreator(bool deserializing) : base(deserializing) { }
+    private LinearRegressionSolutionCreator(LinearRegressionSolutionCreator original, Cloner cloner) : base(original, cloner) { }
+    public LinearRegressionSolutionCreator() {
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The resulting solution encoded as a symbolic expression tree."));
+      Parameters.Add(new LookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The problem data on which the linear regression should be calculated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start of the samples on which the linear regression should be applied."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end of the samples on which the linear regression should be applied."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LinearRegressionSolutionCreator(this, cloner);
+    }
+
+    #region parameter properties
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+      set { SymbolicExpressionTreeParameter.ActualValue = value; }
+    }
+
+    public ILookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (ILookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+      set { DataAnalysisProblemDataParameter.ActualValue = value; }
+    }
+
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+      set { SamplesStartParameter.ActualValue = value; }
+    }
+
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+      set { SamplesEndParameter.ActualValue = value; }
+    }
+    #endregion
+
+
+    public override IOperation Apply() {
+      double rmsError, cvRmsError;
+      SymbolicExpressionTree = CreateSymbolicExpressionTree(DataAnalysisProblemData.Dataset, DataAnalysisProblemData.TargetVariable.Value, DataAnalysisProblemData.InputVariables.CheckedItems.Select(x => x.Value.Value), SamplesStart.Value, SamplesEnd.Value, out rmsError, out cvRmsError);
+      return base.Apply();
+    }
+
+    public static SymbolicExpressionTree CreateSymbolicExpressionTree(Dataset dataset, string targetVariable, IEnumerable<string> allowedInputVariables, int start, int end, out double rmsError, out double cvRmsError) {
+      double[,] inputMatrix = LinearRegressionUtil.PrepareInputMatrix(dataset, targetVariable, allowedInputVariables, start, end);
+
+      alglib.linreg.linearmodel lm = new alglib.linreg.linearmodel();
+      alglib.linreg.lrreport ar = new alglib.linreg.lrreport();
+      int nRows = inputMatrix.GetLength(0);
+      int nFeatures = inputMatrix.GetLength(1) - 1;
+      double[] coefficients = new double[nFeatures + 1]; //last coefficient is for the constant
+
+      int retVal = 1;
+      alglib.linreg.lrbuild(inputMatrix, nRows, nFeatures, ref retVal, lm, ar);
+      if (retVal != 1) throw new ArgumentException("Error in calculation of linear regression model");
+      rmsError = ar.rmserror;
+      cvRmsError = ar.cvrmserror;
+
+      for (int i = 0; i < nFeatures + 1; i++)
+        coefficients[i] = lm.w[i + 4];
+
+      SymbolicExpressionTree tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode());
+      SymbolicExpressionTreeNode startNode = new StartSymbol().CreateTreeNode();
+      tree.Root.AddSubTree(startNode);
+      SymbolicExpressionTreeNode addition = new Addition().CreateTreeNode();
+      startNode.AddSubTree(addition);
+
+      int col = 0;
+      foreach (string column in allowedInputVariables) {
+        VariableTreeNode vNode = (VariableTreeNode)new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable().CreateTreeNode();
+        vNode.VariableName = column;
+        vNode.Weight = coefficients[col];
+        addition.AddSubTree(vNode);
+        col++;
+      }
+
+      ConstantTreeNode cNode = (ConstantTreeNode)new Constant().CreateTreeNode();
+      cNode.Value = coefficients[coefficients.Length - 1];
+      addition.AddSubTree(cNode);
+
+      return tree;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/LinearRegression/LinearRegressionUtil.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/LinearRegression/LinearRegressionUtil.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/LinearRegression/LinearRegressionUtil.cs	(revision 5026)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.LinearRegression {
+  public static class LinearRegressionUtil {
+    public static double[,] PrepareInputMatrix(Dataset dataset, string targetVariable, IEnumerable<string> allowedInputVariables, int start, int end) {
+      List<int> allowedRows = CalculateAllowedRows(dataset, targetVariable, allowedInputVariables, start, end);
+
+      double[,] matrix = new double[allowedRows.Count, allowedInputVariables.Count() + 1];
+      for (int row = 0; row < allowedRows.Count; row++) {
+        int col = 0;
+        foreach (string column in allowedInputVariables) {
+          matrix[row, col] = dataset[column, row];
+          col++;
+        }
+        matrix[row, allowedInputVariables.Count()] = dataset[targetVariable, row];
+      }
+      return matrix;
+    }
+
+    private static List<int> CalculateAllowedRows(Dataset dataset, string targetVariable, IEnumerable<string> allowedInputVariables, int start, int end) {
+      List<int> allowedRows = new List<int>();
+      bool add = false;
+
+      for (int row = start; row < end; row++) {
+        add = true;
+        foreach (string column in allowedInputVariables) {
+          double value = dataset[column, row];
+          if (double.IsInfinity(value) ||
+            double.IsNaN(value))
+            add = false;
+        }
+        if (double.IsNaN(dataset[targetVariable, row]))
+          add = false;
+        if (add)
+          allowedRows.Add(row);
+        add = true;
+      }
+      return allowedRows;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Properties/AssemblyInfo.frame	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Properties/AssemblyInfo.frame	(revision 5026)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Regression")]
+[assembly: AssemblyDescription("HeuristicLab regression (data analysis) problem classes")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2010 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("0cb4421a-d9ff-4ad1-a116-cca316cacc8b")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.2.$WCREV$")]
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/BestSupportVectorRegressionSolutionAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/BestSupportVectorRegressionSolutionAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/BestSupportVectorRegressionSolutionAnalyzer.cs	(revision 5026)
@@ -0,0 +1,92 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers;
+using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.SupportVectorRegression {
+  [Item("BestSupportVectorRegressionSolutionAnalyzer", "An operator for analyzing the best solution of support vector regression problems.")]
+  [StorableClass]
+  public sealed class BestSupportVectorRegressionSolutionAnalyzer : RegressionSolutionAnalyzer {
+    private const string SupportVectorRegressionModelParameterName = "SupportVectorRegressionModel";
+    private const string BestSolutionInputvariableCountResultName = "Variables used by best solution";
+    private const string BestSolutionParameterName = "BestSolution";
+
+    #region parameter properties
+    public ScopeTreeLookupParameter<SupportVectorMachineModel> SupportVectorRegressionModelParameter {
+      get { return (ScopeTreeLookupParameter<SupportVectorMachineModel>)Parameters[SupportVectorRegressionModelParameterName]; }
+    }
+    public ILookupParameter<SupportVectorRegressionSolution> BestSolutionParameter {
+      get { return (ILookupParameter<SupportVectorRegressionSolution>)Parameters[BestSolutionParameterName]; }
+    }
+    #endregion
+    #region properties
+    public ItemArray<SupportVectorMachineModel> SupportVectorMachineModel {
+      get { return SupportVectorRegressionModelParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private BestSupportVectorRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    private BestSupportVectorRegressionSolutionAnalyzer(BestSupportVectorRegressionSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public BestSupportVectorRegressionSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<SupportVectorMachineModel>(SupportVectorRegressionModelParameterName, "The support vector regression models to analyze."));
+      Parameters.Add(new LookupParameter<SupportVectorRegressionSolution>(BestSolutionParameterName, "The best support vector regression solution."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BestSupportVectorRegressionSolutionAnalyzer(this, cloner);
+    }
+
+    protected override DataAnalysisSolution UpdateBestSolution() {
+      double upperEstimationLimit = UpperEstimationLimit != null ? UpperEstimationLimit.Value : double.PositiveInfinity;
+      double lowerEstimationLimit = LowerEstimationLimit != null ? LowerEstimationLimit.Value : double.NegativeInfinity;
+
+      int i = Quality.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+
+      if (BestSolutionQualityParameter.ActualValue == null || BestSolutionQualityParameter.ActualValue.Value > Quality[i].Value) {
+        IEnumerable<string> inputVariables = from var in ProblemData.InputVariables
+                                             where ProblemData.InputVariables.ItemChecked(var)
+                                             select var.Value;
+        var solution = new SupportVectorRegressionSolution((DataAnalysisProblemData)ProblemData.Clone(), SupportVectorMachineModel[i], inputVariables, lowerEstimationLimit, upperEstimationLimit);
+
+        BestSolutionParameter.ActualValue = solution;
+        BestSolutionQualityParameter.ActualValue = Quality[i];
+
+        if (Results.ContainsKey(BestSolutionInputvariableCountResultName)) {
+          Results[BestSolutionInputvariableCountResultName].Value = new IntValue(inputVariables.Count());
+        } else {
+          Results.Add(new Result(BestSolutionInputvariableCountResultName, new IntValue(inputVariables.Count())));
+        }
+      }
+      return BestSolutionParameter.ActualValue;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs	(revision 5026)
@@ -0,0 +1,120 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Drawing;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
+using SVM;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.SupportVectorRegression {
+  /// <summary>
+  /// Represents a support vector solution for a regression problem which can be visualized in the GUI.
+  /// </summary>
+  [Item("SupportVectorRegressionSolution", "Represents a support vector solution for a regression problem which can be visualized in the GUI.")]
+  [StorableClass]
+  public sealed class SupportVectorRegressionSolution : DataAnalysisSolution {
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; }
+    }
+
+    public new SupportVectorMachineModel Model {
+      get { return (SupportVectorMachineModel)base.Model; }
+      set { base.Model = value; }
+    }
+
+    public Dataset SupportVectors {
+      get { return CalculateSupportVectors(); }
+    }
+
+    private List<double> estimatedValues;
+    public override IEnumerable<double> EstimatedValues {
+      get {
+        if (estimatedValues == null) RecalculateEstimatedValues();
+        return estimatedValues;
+      }
+    }
+
+    public override IEnumerable<double> EstimatedTrainingValues {
+      get {
+        return GetEstimatedValues(ProblemData.TrainingIndizes);
+      }
+    }
+
+    public override IEnumerable<double> EstimatedTestValues {
+      get {
+        return GetEstimatedValues(ProblemData.TestIndizes);
+      }
+    }
+
+    [StorableConstructor]
+    private SupportVectorRegressionSolution(bool deserializing) : base(deserializing) { }
+    private SupportVectorRegressionSolution(SupportVectorRegressionSolution original, Cloner cloner) : base(original, cloner) { }
+    public SupportVectorRegressionSolution() : base() { }
+    public SupportVectorRegressionSolution(DataAnalysisProblemData problemData, SupportVectorMachineModel model, IEnumerable<string> inputVariables, double lowerEstimationLimit, double upperEstimationLimit)
+      : base(problemData, lowerEstimationLimit, upperEstimationLimit) {
+      this.Model = model;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorRegressionSolution(this, cloner);
+    }
+
+    protected override void OnProblemDataChanged() {
+      Model.Model.SupportVectorIndizes = new int[0];
+      base.OnProblemDataChanged();
+    }
+
+    private Dataset CalculateSupportVectors() {
+      if (Model.Model.SupportVectorIndizes.Length == 0)
+        return new Dataset(new List<string>(), new double[0, 0]);
+
+      double[,] data = new double[Model.Model.SupportVectorIndizes.Length, ProblemData.Dataset.Columns];
+      for (int i = 0; i < Model.Model.SupportVectorIndizes.Length; i++) {
+        for (int column = 0; column < ProblemData.Dataset.Columns; column++)
+          data[i, column] = ProblemData.Dataset[Model.Model.SupportVectorIndizes[i], column];
+      }
+      return new Dataset(ProblemData.Dataset.VariableNames, data);
+    }
+
+    protected override void RecalculateEstimatedValues() {
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(ProblemData, Enumerable.Range(0, ProblemData.Dataset.Rows));
+      SVM.Problem scaledProblem = Scaling.Scale(Model.RangeTransform, problem);
+
+      estimatedValues = (from row in Enumerable.Range(0, scaledProblem.Count)
+                         let prediction = SVM.Prediction.Predict(Model.Model, scaledProblem.X[row])
+                         let boundedX = Math.Min(UpperEstimationLimit, Math.Max(LowerEstimationLimit, prediction))
+                         select double.IsNaN(boundedX) ? UpperEstimationLimit : boundedX).ToList();
+      OnEstimatedValuesChanged();
+    }
+
+
+    private IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows) {
+      if (estimatedValues == null) RecalculateEstimatedValues();
+      foreach (int row in rows)
+        yield return estimatedValues[row];
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs	(revision 5026)
@@ -0,0 +1,141 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
+  [Item("BestSymbolicRegressionSolutionAnalyzer", "An operator for analyzing the best solution of symbolic regression problems given in symbolic expression tree encoding.")]
+  [StorableClass]
+  public sealed class BestSymbolicRegressionSolutionAnalyzer : RegressionSolutionAnalyzer, ISymbolicRegressionAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string BestSolutionInputvariableCountResultName = "Variables used by best solution";
+    private const string VariableFrequenciesParameterName = "VariableFrequencies";
+    private const string VariableImpactsResultName = "Integrated variable frequencies";
+    private const string BestSolutionParameterName = "BestSolution";
+
+    #region parameter properties
+    public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public IValueLookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (IValueLookupParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
+    }
+    public ILookupParameter<SymbolicRegressionSolution> BestSolutionParameter {
+      get { return (ILookupParameter<SymbolicRegressionSolution>)Parameters[BestSolutionParameterName]; }
+    }
+    public ILookupParameter<DataTable> VariableFrequenciesParameter {
+      get { return (ILookupParameter<DataTable>)Parameters[VariableFrequenciesParameterName]; }
+    }
+    #endregion
+    #region properties
+    public ISymbolicExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
+      get { return SymbolicExpressionTreeInterpreterParameter.ActualValue; }
+    }
+    public ItemArray<SymbolicExpressionTree> SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public DataTable VariableFrequencies {
+      get { return VariableFrequenciesParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private BestSymbolicRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    private BestSymbolicRegressionSolutionAnalyzer(BestSymbolicRegressionSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public BestSymbolicRegressionSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used for the analysis of symbolic expression trees."));
+      Parameters.Add(new LookupParameter<DataTable>(VariableFrequenciesParameterName, "The variable frequencies table to use for the calculation of variable impacts"));
+      Parameters.Add(new LookupParameter<SymbolicRegressionSolution>(BestSolutionParameterName, "The best symbolic regression solution."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BestSymbolicRegressionSolutionAnalyzer(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(VariableFrequenciesParameterName)) {
+        Parameters.Add(new LookupParameter<DataTable>(VariableFrequenciesParameterName, "The variable frequencies table to use for the calculation of variable impacts"));
+      }
+    }
+
+    protected override DataAnalysisSolution UpdateBestSolution() {
+      double upperEstimationLimit = UpperEstimationLimit != null ? UpperEstimationLimit.Value : double.PositiveInfinity;
+      double lowerEstimationLimit = LowerEstimationLimit != null ? LowerEstimationLimit.Value : double.NegativeInfinity;
+
+      int i = Quality.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+
+      if (BestSolutionQualityParameter.ActualValue == null || BestSolutionQualityParameter.ActualValue.Value > Quality[i].Value) {
+        var model = new SymbolicRegressionModel((ISymbolicExpressionTreeInterpreter)SymbolicExpressionTreeInterpreter.Clone(),
+          SymbolicExpressionTree[i]);
+        DataAnalysisProblemData problemDataClone = (DataAnalysisProblemData)ProblemData.Clone();
+        var solution = new SymbolicRegressionSolution(problemDataClone, model, lowerEstimationLimit, upperEstimationLimit);
+        solution.Name = BestSolutionParameterName;
+        solution.Description = "Best solution on validation partition found over the whole run.";
+        BestSolutionParameter.ActualValue = solution;
+        BestSolutionQualityParameter.ActualValue = Quality[i];
+        BestSymbolicRegressionSolutionAnalyzer.UpdateSymbolicRegressionBestSolutionResults(solution, problemDataClone, Results, VariableFrequencies);
+      }
+      return BestSolutionParameter.ActualValue;
+    }
+
+    public static void UpdateBestSolutionResults(SymbolicRegressionSolution bestSolution, DataAnalysisProblemData problemData, ResultCollection results, IntValue currentGeneration, DataTable variableFrequencies) {
+      RegressionSolutionAnalyzer.UpdateBestSolutionResults(bestSolution, problemData, results, currentGeneration);
+      UpdateSymbolicRegressionBestSolutionResults(bestSolution, problemData, results, variableFrequencies);
+    }
+
+    private static void UpdateSymbolicRegressionBestSolutionResults(SymbolicRegressionSolution bestSolution, DataAnalysisProblemData problemData, ResultCollection results, DataTable variableFrequencies) {
+      if (results.ContainsKey(BestSolutionInputvariableCountResultName)) {
+        results[BestSolutionInputvariableCountResultName].Value = new IntValue(bestSolution.Model.InputVariables.Count());
+        results[VariableImpactsResultName].Value = CalculateVariableImpacts(variableFrequencies);
+      } else {
+        results.Add(new Result(BestSolutionInputvariableCountResultName, new IntValue(bestSolution.Model.InputVariables.Count())));
+        results.Add(new Result(VariableImpactsResultName, CalculateVariableImpacts(variableFrequencies)));
+      }
+    }
+
+
+    private static DoubleMatrix CalculateVariableImpacts(DataTable variableFrequencies) {
+      if (variableFrequencies != null) {
+        var impacts = new DoubleMatrix(variableFrequencies.Rows.Count, 1, new string[] { "Impact" }, variableFrequencies.Rows.Select(x => x.Name));
+        impacts.SortableView = true;
+        int rowIndex = 0;
+        foreach (var dataRow in variableFrequencies.Rows) {
+          string variableName = dataRow.Name;
+          impacts[rowIndex++, 0] = dataRow.Values.Average();
+        }
+        return impacts;
+      } else return new DoubleMatrix(1, 1);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 5026)
@@ -0,0 +1,298 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
+  /// <summary>
+  /// An operator that analyzes the validation best scaled symbolic regression solution.
+  /// </summary>
+  [Item("FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer", "An operator that analyzes the validation best scaled symbolic regression solution.")]
+  [StorableClass]
+  public sealed class FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer : SingleSuccessorOperator, ISymbolicRegressionAnalyzer {
+    private const string RandomParameterName = "Random";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string ValidationSamplesStartParameterName = "SamplesStart";
+    private const string ValidationSamplesEndParameterName = "SamplesEnd";
+    // private const string QualityParameterName = "Quality";
+    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
+    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
+    private const string EvaluatorParameterName = "Evaluator";
+    private const string MaximizationParameterName = "Maximization";
+    private const string BestSolutionParameterName = "Best solution (validation)";
+    private const string BestSolutionQualityParameterName = "Best solution quality (validation)";
+    private const string CurrentBestValidationQualityParameterName = "Current best validation quality";
+    private const string BestSolutionQualityValuesParameterName = "Validation Quality";
+    private const string ResultsParameterName = "Results";
+    private const string VariableFrequenciesParameterName = "VariableFrequencies";
+    private const string BestKnownQualityParameterName = "BestKnownQuality";
+    private const string GenerationsParameterName = "Generations";
+    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+
+    #region parameter properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public IValueLookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (IValueLookupParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
+    }
+    public ILookupParameter<ISymbolicRegressionEvaluator> EvaluatorParameter {
+      get { return (ILookupParameter<ISymbolicRegressionEvaluator>)Parameters[EvaluatorParameterName]; }
+    }
+    public ILookupParameter<BoolValue> MaximizationParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[MaximizationParameterName]; }
+    }
+    public IValueLookupParameter<DataAnalysisProblemData> ProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> ValidationSamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[ValidationSamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> ValidationSamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[ValidationSamplesEndParameterName]; }
+    }
+    public IValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+      get { return (IValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+    }
+
+    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
+    }
+    public ILookupParameter<SymbolicRegressionSolution> BestSolutionParameter {
+      get { return (ILookupParameter<SymbolicRegressionSolution>)Parameters[BestSolutionParameterName]; }
+    }
+    public ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> BestSolutionQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[BestSolutionQualityParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[BestKnownQualityParameterName]; }
+    }
+    public ILookupParameter<DataTable> VariableFrequenciesParameter {
+      get { return (ILookupParameter<DataTable>)Parameters[VariableFrequenciesParameterName]; }
+    }
+
+    #endregion
+    #region properties
+    public IRandom Random {
+      get { return RandomParameter.ActualValue; }
+    }
+    public ItemArray<SymbolicExpressionTree> SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public ISymbolicExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
+      get { return SymbolicExpressionTreeInterpreterParameter.ActualValue; }
+    }
+    public ISymbolicRegressionEvaluator Evaluator {
+      get { return EvaluatorParameter.ActualValue; }
+    }
+    public BoolValue Maximization {
+      get { return MaximizationParameter.ActualValue; }
+    }
+    public DataAnalysisProblemData ProblemData {
+      get { return ProblemDataParameter.ActualValue; }
+    }
+    public IntValue ValidiationSamplesStart {
+      get { return ValidationSamplesStartParameter.ActualValue; }
+    }
+    public IntValue ValidationSamplesEnd {
+      get { return ValidationSamplesEndParameter.ActualValue; }
+    }
+    public PercentValue RelativeNumberOfEvaluatedSamples {
+      get { return RelativeNumberOfEvaluatedSamplesParameter.Value; }
+    }
+
+    public DoubleValue UpperEstimationLimit {
+      get { return UpperEstimationLimitParameter.ActualValue; }
+    }
+    public DoubleValue LowerEstimationLimit {
+      get { return LowerEstimationLimitParameter.ActualValue; }
+    }
+    public ResultCollection Results {
+      get { return ResultsParameter.ActualValue; }
+    }
+    public DataTable VariableFrequencies {
+      get { return VariableFrequenciesParameter.ActualValue; }
+    }
+    public IntValue Generations {
+      get { return GenerationsParameter.ActualValue; }
+    }
+    public DoubleValue BestSolutionQuality {
+      get { return BestSolutionQualityParameter.ActualValue; }
+    }
+
+    #endregion
+
+    [StorableConstructor]
+    private FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    private FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer(FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
+      Parameters.Add(new LookupParameter<ISymbolicRegressionEvaluator>(EvaluatorParameterName, "The evaluator which should be used to evaluate the solution on the validation set."));
+      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze."));
+      Parameters.Add(new LookupParameter<BoolValue>(MaximizationParameterName, "The direction of optimization."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used for the analysis of symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(ProblemDataParameterName, "The problem data for which the symbolic expression tree is a solution."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(ValidationSamplesStartParameterName, "The first index of the validation partition of the data set."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(ValidationSamplesEndParameterName, "The last index of the validation partition of the data set."));
+      Parameters.Add(new ValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index.", new PercentValue(1)));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper estimation limit that was set for the evaluation of the symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower estimation limit that was set for the evaluation of the symbolic expression trees."));
+      Parameters.Add(new LookupParameter<SymbolicRegressionSolution>(BestSolutionParameterName, "The best symbolic regression solution."));
+      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations calculated so far."));
+      Parameters.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameterName, "The quality of the best symbolic regression solution."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored."));
+      Parameters.Add(new LookupParameter<DoubleValue>(BestKnownQualityParameterName, "The best known (validation) quality achieved on the data set."));
+      Parameters.Add(new LookupParameter<DataTable>(VariableFrequenciesParameterName, "The variable frequencies table to use for the calculation of variable impacts"));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      #region compatibility remove before releasing 3.4
+      if (!Parameters.ContainsKey(EvaluatorParameterName)) {
+        Parameters.Add(new LookupParameter<ISymbolicRegressionEvaluator>(EvaluatorParameterName, "The evaluator which should be used to evaluate the solution on the validation set."));
+      }
+      if (!Parameters.ContainsKey(MaximizationParameterName)) {
+        Parameters.Add(new LookupParameter<BoolValue>(MaximizationParameterName, "The direction of optimization."));
+      }
+      #endregion
+    }
+
+    public override IOperation Apply() {
+      var trees = SymbolicExpressionTree;
+
+      string targetVariable = ProblemData.TargetVariable.Value;
+
+      // select a random subset of rows in the validation set
+      int validationStart = ValidiationSamplesStart.Value;
+      int validationEnd = ValidationSamplesEnd.Value;
+      int seed = Random.Next();
+      int count = (int)((validationEnd - validationStart) * RelativeNumberOfEvaluatedSamples.Value);
+      if (count == 0) count = 1;
+      IEnumerable<int> rows = RandomEnumerable.SampleRandomNumbers(seed, validationStart, validationEnd, count)
+        .Where(row => row < ProblemData.TestSamplesStart.Value || ProblemData.TestSamplesEnd.Value <= row);
+
+      double upperEstimationLimit = UpperEstimationLimit != null ? UpperEstimationLimit.Value : double.PositiveInfinity;
+      double lowerEstimationLimit = LowerEstimationLimit != null ? LowerEstimationLimit.Value : double.NegativeInfinity;
+
+      double bestQuality = Maximization.Value ? double.NegativeInfinity : double.PositiveInfinity;
+      SymbolicExpressionTree bestTree = null;
+
+      foreach (var tree in trees) {
+        double quality = Evaluator.Evaluate(SymbolicExpressionTreeInterpreter, tree,
+          lowerEstimationLimit, upperEstimationLimit,
+          ProblemData.Dataset, targetVariable,
+         rows);
+
+        if ((Maximization.Value && quality > bestQuality) ||
+            (!Maximization.Value && quality < bestQuality)) {
+          bestQuality = quality;
+          bestTree = tree;
+        }
+      }
+
+      // if the best validation tree is better than the current best solution => update
+      bool newBest =
+        BestSolutionQuality == null ||
+        (Maximization.Value && bestQuality > BestSolutionQuality.Value) ||
+        (!Maximization.Value && bestQuality < BestSolutionQuality.Value);
+      if (newBest) {
+        // calculate scaling parameters and only for the best tree using the full training set
+        double alpha, beta;
+        SymbolicRegressionScaledMeanSquaredErrorEvaluator.Calculate(SymbolicExpressionTreeInterpreter, bestTree,
+          lowerEstimationLimit, upperEstimationLimit,
+          ProblemData.Dataset, targetVariable,
+          ProblemData.TrainingIndizes, out beta, out alpha);
+
+        // scale tree for solution
+        var scaledTree = SymbolicRegressionSolutionLinearScaler.Scale(bestTree, alpha, beta);
+        var model = new SymbolicRegressionModel((ISymbolicExpressionTreeInterpreter)SymbolicExpressionTreeInterpreter.Clone(),
+          scaledTree);
+        var solution = new SymbolicRegressionSolution((DataAnalysisProblemData)ProblemData.Clone(), model, lowerEstimationLimit, upperEstimationLimit);
+        solution.Name = BestSolutionParameterName;
+        solution.Description = "Best solution on validation partition found over the whole run.";
+
+        BestSolutionParameter.ActualValue = solution;
+        BestSolutionQualityParameter.ActualValue = new DoubleValue(bestQuality);
+
+        BestSymbolicRegressionSolutionAnalyzer.UpdateBestSolutionResults(solution, ProblemData, Results, Generations, VariableFrequencies);
+      }
+
+
+      if (!Results.ContainsKey(BestSolutionQualityValuesParameterName)) {
+        Results.Add(new Result(BestSolutionQualityValuesParameterName, new DataTable(BestSolutionQualityValuesParameterName, BestSolutionQualityValuesParameterName)));
+        Results.Add(new Result(BestSolutionQualityParameterName, new DoubleValue()));
+        Results.Add(new Result(CurrentBestValidationQualityParameterName, new DoubleValue()));
+      }
+      Results[BestSolutionQualityParameterName].Value = new DoubleValue(BestSolutionQualityParameter.ActualValue.Value);
+      Results[CurrentBestValidationQualityParameterName].Value = new DoubleValue(bestQuality);
+
+      DataTable validationValues = (DataTable)Results[BestSolutionQualityValuesParameterName].Value;
+      AddValue(validationValues, BestSolutionQualityParameter.ActualValue.Value, BestSolutionQualityParameterName, BestSolutionQualityParameterName);
+      AddValue(validationValues, bestQuality, CurrentBestValidationQualityParameterName, CurrentBestValidationQualityParameterName);
+      return base.Apply();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void Initialize() { }
+
+    private static void AddValue(DataTable table, double data, string name, string description) {
+      DataRow row;
+      table.Rows.TryGetValue(name, out row);
+      if (row == null) {
+        row = new DataRow(name, description);
+        row.Values.Add(data);
+        table.Rows.Add(row);
+      } else {
+        row.Values.Add(data);
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ISymbolicRegressionAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ISymbolicRegressionAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ISymbolicRegressionAnalyzer.cs	(revision 5026)
@@ -0,0 +1,33 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
+  public interface ISymbolicRegressionAnalyzer : IAnalyzer {
+    ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+    ILookupParameter<ResultCollection> ResultsParameter { get; }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityAnalyzer.cs	(revision 5026)
@@ -0,0 +1,251 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
+  /// <summary>
+  /// "An operator for analyzing the quality of symbolic regression solutions symbolic expression tree encoding."
+  /// </summary>
+  [Item("SymbolicRegressionModelQualityAnalyzer", "An operator for analyzing the quality of symbolic regression solutions symbolic expression tree encoding.")]
+  [StorableClass]
+  public sealed class SymbolicRegressionModelQualityAnalyzer : SingleSuccessorOperator, ISymbolicRegressionAnalyzer {
+    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string ResultsParameterName = "Results";
+
+    private const string TrainingMeanSquaredErrorQualityParameterName = "Mean squared error (training)";
+    private const string MinTrainingMeanSquaredErrorQualityParameterName = "Min mean squared error (training)";
+    private const string MaxTrainingMeanSquaredErrorQualityParameterName = "Max mean squared error (training)";
+    private const string AverageTrainingMeanSquaredErrorQualityParameterName = "Average mean squared error (training)";
+    private const string BestTrainingMeanSquaredErrorQualityParameterName = "Best mean squared error (training)";
+
+    private const string TrainingAverageRelativeErrorQualityParameterName = "Average relative error (training)";
+    private const string MinTrainingAverageRelativeErrorQualityParameterName = "Min average relative error (training)";
+    private const string MaxTrainingAverageRelativeErrorQualityParameterName = "Max average relative error (training)";
+    private const string AverageTrainingAverageRelativeErrorQualityParameterName = "Average average relative error (training)";
+    private const string BestTrainingAverageRelativeErrorQualityParameterName = "Best average relative error (training)";
+
+    private const string TrainingRSquaredQualityParameterName = "R² (training)";
+    private const string MinTrainingRSquaredQualityParameterName = "Min R² (training)";
+    private const string MaxTrainingRSquaredQualityParameterName = "Max R² (training)";
+    private const string AverageTrainingRSquaredQualityParameterName = "Average R² (training)";
+    private const string BestTrainingRSquaredQualityParameterName = "Best R² (training)";
+
+    private const string TestMeanSquaredErrorQualityParameterName = "Mean squared error (test)";
+    private const string MinTestMeanSquaredErrorQualityParameterName = "Min mean squared error (test)";
+    private const string MaxTestMeanSquaredErrorQualityParameterName = "Max mean squared error (test)";
+    private const string AverageTestMeanSquaredErrorQualityParameterName = "Average mean squared error (test)";
+    private const string BestTestMeanSquaredErrorQualityParameterName = "Best mean squared error (test)";
+
+    private const string TestAverageRelativeErrorQualityParameterName = "Average relative error (test)";
+    private const string MinTestAverageRelativeErrorQualityParameterName = "Min average relative error (test)";
+    private const string MaxTestAverageRelativeErrorQualityParameterName = "Max average relative error (test)";
+    private const string AverageTestAverageRelativeErrorQualityParameterName = "Average average relative error (test)";
+    private const string BestTestAverageRelativeErrorQualityParameterName = "Best average relative error (test)";
+
+    private const string TestRSquaredQualityParameterName = "R² (test)";
+    private const string MinTestRSquaredQualityParameterName = "Min R² (test)";
+    private const string MaxTestRSquaredQualityParameterName = "Max R² (test)";
+    private const string AverageTestRSquaredQualityParameterName = "Average R² (test)";
+    private const string BestTestRSquaredQualityParameterName = "Best R² (test)";
+
+    private const string RSquaredValuesParameterName = "R²";
+    private const string MeanSquaredErrorValuesParameterName = "Mean squared error";
+    private const string RelativeErrorValuesParameterName = "Average relative error";
+
+    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
+    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
+
+    #region parameter properties
+    public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public IValueLookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (IValueLookupParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
+    }
+    public IValueLookupParameter<DataAnalysisProblemData> ProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DoubleValue UpperEstimationLimit {
+      get { return UpperEstimationLimitParameter.ActualValue; }
+    }
+    public DoubleValue LowerEstimationLimit {
+      get { return LowerEstimationLimitParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicRegressionModelQualityAnalyzer(bool deserializing) : base(deserializing) { }
+    private SymbolicRegressionModelQualityAnalyzer(SymbolicRegressionModelQualityAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicRegressionModelQualityAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(ProblemDataParameterName, "The problem data containing the input varaibles for the symbolic regression problem."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DataTable>(MeanSquaredErrorValuesParameterName, "The data table to collect mean squared error values."));
+      Parameters.Add(new ValueLookupParameter<DataTable>(RSquaredValuesParameterName, "The data table to collect R² correlation coefficient values."));
+      Parameters.Add(new ValueLookupParameter<DataTable>(RelativeErrorValuesParameterName, "The data table to collect relative error values."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionModelQualityAnalyzer(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      Analyze(SymbolicExpressionTreeParameter.ActualValue, SymbolicExpressionTreeInterpreterParameter.ActualValue,
+        UpperEstimationLimit.Value, LowerEstimationLimit.Value, ProblemDataParameter.ActualValue,
+        ResultsParameter.ActualValue);
+      return base.Apply();
+    }
+
+    public static void Analyze(IEnumerable<SymbolicExpressionTree> trees, ISymbolicExpressionTreeInterpreter interpreter,
+      double upperEstimationLimit, double lowerEstimationLimit,
+      DataAnalysisProblemData problemData, ResultCollection results) {
+      int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
+      IEnumerable<double> originalTrainingValues = problemData.Dataset.GetEnumeratedVariableValues(targetVariableIndex, problemData.TrainingIndizes);
+      IEnumerable<double> originalTestValues = problemData.Dataset.GetEnumeratedVariableValues(targetVariableIndex, problemData.TestIndizes);
+      List<double> trainingMse = new List<double>();
+      List<double> trainingR2 = new List<double>();
+      List<double> trainingRelErr = new List<double>();
+      List<double> testMse = new List<double>();
+      List<double> testR2 = new List<double>();
+      List<double> testRelErr = new List<double>();
+
+      OnlineMeanSquaredErrorEvaluator mseEvaluator = new OnlineMeanSquaredErrorEvaluator();
+      OnlineMeanAbsolutePercentageErrorEvaluator relErrEvaluator = new OnlineMeanAbsolutePercentageErrorEvaluator();
+      OnlinePearsonsRSquaredEvaluator r2Evaluator = new OnlinePearsonsRSquaredEvaluator();
+
+      foreach (var tree in trees) {
+        #region training
+        var estimatedTrainingValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, problemData.TrainingIndizes);
+        mseEvaluator.Reset();
+        r2Evaluator.Reset();
+        relErrEvaluator.Reset();
+        var estimatedEnumerator = estimatedTrainingValues.GetEnumerator();
+        var originalEnumerator = originalTrainingValues.GetEnumerator();
+        while (estimatedEnumerator.MoveNext() & originalEnumerator.MoveNext()) {
+          double estimated = estimatedEnumerator.Current;
+          if (double.IsNaN(estimated)) estimated = upperEstimationLimit;
+          else estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated));
+          mseEvaluator.Add(originalEnumerator.Current, estimated);
+          r2Evaluator.Add(originalEnumerator.Current, estimated);
+          relErrEvaluator.Add(originalEnumerator.Current, estimated);
+        }
+        if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+          throw new InvalidOperationException("Number of elements in estimated and original enumeration doesn't match.");
+        }
+        trainingMse.Add(mseEvaluator.MeanSquaredError);
+        trainingR2.Add(r2Evaluator.RSquared);
+        trainingRelErr.Add(relErrEvaluator.MeanAbsolutePercentageError);
+        #endregion
+        #region test
+        var estimatedTestValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, problemData.TestIndizes);
+
+        mseEvaluator.Reset();
+        r2Evaluator.Reset();
+        relErrEvaluator.Reset();
+        estimatedEnumerator = estimatedTestValues.GetEnumerator();
+        originalEnumerator = originalTestValues.GetEnumerator();
+        while (estimatedEnumerator.MoveNext() & originalEnumerator.MoveNext()) {
+          double estimated = estimatedEnumerator.Current;
+          if (double.IsNaN(estimated)) estimated = upperEstimationLimit;
+          else estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated));
+          mseEvaluator.Add(originalEnumerator.Current, estimated);
+          r2Evaluator.Add(originalEnumerator.Current, estimated);
+          relErrEvaluator.Add(originalEnumerator.Current, estimated);
+        }
+        if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+          throw new InvalidOperationException("Number of elements in estimated and original enumeration doesn't match.");
+        }
+        testMse.Add(mseEvaluator.MeanSquaredError);
+        testR2.Add(r2Evaluator.RSquared);
+        testRelErr.Add(relErrEvaluator.MeanAbsolutePercentageError);
+        #endregion
+      }
+
+      AddResultTableValues(results, MeanSquaredErrorValuesParameterName, "mean squared error (training)", trainingMse.Min(), trainingMse.Average(), trainingMse.Max());
+      AddResultTableValues(results, MeanSquaredErrorValuesParameterName, "mean squared error (test)", testMse.Min(), testMse.Average(), testMse.Max());
+      AddResultTableValues(results, RelativeErrorValuesParameterName, "mean relative error (training)", trainingRelErr.Min(), trainingRelErr.Average(), trainingRelErr.Max());
+      AddResultTableValues(results, RelativeErrorValuesParameterName, "mean relative error (test)", testRelErr.Min(), testRelErr.Average(), testRelErr.Max());
+      AddResultTableValues(results, RSquaredValuesParameterName, "Pearson's R² (training)", trainingR2.Min(), trainingR2.Average(), trainingR2.Max());
+      AddResultTableValues(results, RSquaredValuesParameterName, "Pearson's R² (test)", testR2.Min(), testR2.Average(), testR2.Max());
+    }
+
+    private static void AddResultTableValues(ResultCollection results, string tableName, string valueName, double minValue, double avgValue, double maxValue) {
+      if (!results.ContainsKey(tableName)) {
+        results.Add(new Result(tableName, new DataTable(tableName)));
+      }
+      DataTable table = (DataTable)results[tableName].Value;
+      AddValue(table, minValue, "Min. " + valueName, string.Empty);
+      AddValue(table, avgValue, "Avg. " + valueName, string.Empty);
+      AddValue(table, maxValue, "Max. " + valueName, string.Empty);
+    }
+
+    private static void AddValue(DataTable table, double data, string name, string description) {
+      DataRow row;
+      table.Rows.TryGetValue(name, out row);
+      if (row == null) {
+        row = new DataRow(name, description);
+        row.Values.Add(data);
+        table.Rows.Add(row);
+      } else {
+        row.Values.Add(data);
+      }
+    }
+
+
+    private static void SetResultValue(ResultCollection results, string name, double value) {
+      if (results.ContainsKey(name))
+        results[name].Value = new DoubleValue(value);
+      else
+        results.Add(new Result(name, new DoubleValue(value)));
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityCalculator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityCalculator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityCalculator.cs	(revision 5026)
@@ -0,0 +1,148 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
+  /// <summary>
+  /// "An operator to calculate the quality values of a symbolic regression solution symbolic expression tree encoding."
+  /// </summary>
+  [Item("SymbolicRegressionModelQualityCalculator", "An operator to calculate the quality values of a symbolic regression solution symbolic expression tree encoding.")]
+  [StorableClass]
+  [Obsolete("This class should not be used anymore because of performance reasons and will therefore not be updated.")]
+  public sealed class SymbolicRegressionModelQualityCalculator : AlgorithmOperator {
+    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string ValuesParameterName = "Values";
+    private const string RSQuaredQualityParameterName = "R-squared";
+    private const string MeanSquaredErrorQualityParameterName = "Mean Squared Error";
+    private const string RelativeErrorQualityParameterName = "Relative Error";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
+    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
+
+    #region parameter properties
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public IValueLookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (IValueLookupParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
+    }
+    public IValueLookupParameter<DataAnalysisProblemData> ProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> RSquaredQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[RSQuaredQualityParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> AverageRelativeErrorQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[RelativeErrorQualityParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> MeanSquaredErrorQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[MeanSquaredErrorQualityParameterName]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicRegressionModelQualityCalculator(bool deserializing) : base(deserializing) { }
+    private SymbolicRegressionModelQualityCalculator(SymbolicRegressionModelQualityCalculator original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicRegressionModelQualityCalculator()
+      : base() {
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree to analyze."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(ProblemDataParameterName, "The problem data containing the input varaibles for the symbolic regression problem."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition on which the model quality values should be calculated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The first index of the data set partition on which the model quality values should be calculated."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new ValueParameter<DoubleMatrix>(ValuesParameterName, "The matrix of original target values and estimated values of the model."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(MeanSquaredErrorQualityParameterName, "The mean squared error value of the output of the model."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(RSQuaredQualityParameterName, "The R² correlation coefficient of the output of the model and the original target values."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(RelativeErrorQualityParameterName, "The average relative percentage error of the output of the model."));
+
+      #region operator initialization
+      SimpleSymbolicRegressionEvaluator simpleEvaluator = new SimpleSymbolicRegressionEvaluator();
+      SimpleRSquaredEvaluator simpleR2Evalator = new SimpleRSquaredEvaluator();
+      SimpleMeanAbsolutePercentageErrorEvaluator simpleRelErrorEvaluator = new SimpleMeanAbsolutePercentageErrorEvaluator();
+      SimpleMSEEvaluator simpleMseEvaluator = new SimpleMSEEvaluator();
+      Assigner clearValues = new Assigner();
+      #endregion
+
+      #region parameter wiring
+      simpleEvaluator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+      simpleEvaluator.RegressionProblemDataParameter.ActualName = ProblemDataParameter.Name;
+      simpleEvaluator.SamplesStartParameter.ActualName = SamplesStartParameter.Name;
+      simpleEvaluator.SamplesEndParameter.ActualName = SamplesEndParameter.Name;
+      simpleEvaluator.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
+      simpleEvaluator.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
+      simpleEvaluator.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
+      simpleEvaluator.ValuesParameter.ActualName = ValuesParameterName;
+
+      simpleR2Evalator.ValuesParameter.ActualName = ValuesParameterName;
+      simpleR2Evalator.RSquaredParameter.ActualName = RSquaredQualityParameter.Name;
+
+      simpleMseEvaluator.ValuesParameter.ActualName = ValuesParameterName;
+      simpleMseEvaluator.MeanSquaredErrorParameter.ActualName = MeanSquaredErrorQualityParameter.Name;
+
+      simpleRelErrorEvaluator.ValuesParameter.ActualName = ValuesParameterName;
+      simpleRelErrorEvaluator.AverageRelativeErrorParameter.ActualName = AverageRelativeErrorQualityParameter.Name;
+
+      clearValues.LeftSideParameter.ActualName = ValuesParameterName;
+      clearValues.RightSideParameter.Value = new DoubleMatrix();
+      #endregion
+
+      #region operator graph
+      OperatorGraph.InitialOperator = simpleEvaluator;
+      simpleEvaluator.Successor = simpleR2Evalator;
+      simpleR2Evalator.Successor = simpleRelErrorEvaluator;
+      simpleRelErrorEvaluator.Successor = simpleMseEvaluator;
+      simpleMseEvaluator.Successor = clearValues;
+      clearValues.Successor = null;
+      #endregion
+
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionModelQualityCalculator(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionSolutionLinearScaler.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionSolutionLinearScaler.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionSolutionLinearScaler.cs	(revision 5026)
@@ -0,0 +1,121 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
+  /// <summary>
+  /// An operator that creates a linearly transformed symbolic regression solution (given alpha and beta).
+  /// </summary>
+  [Item("SymbolicRegressionSolutionLinearScaler", "An operator that creates a linearly transformed symbolic regression solution (given alpha and beta).")]
+  [StorableClass]
+  public sealed class SymbolicRegressionSolutionLinearScaler : SingleSuccessorOperator {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ScaledSymbolicExpressionTreeParameterName = "ScaledSymbolicExpressionTree";
+    private const string AlphaParameterName = "Alpha";
+    private const string BetaParameterName = "Beta";
+
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<SymbolicExpressionTree> ScaledSymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[ScaledSymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> AlphaParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[AlphaParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> BetaParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[BetaParameterName]; }
+    }
+
+    [StorableConstructor]
+    private SymbolicRegressionSolutionLinearScaler(bool deserializing) : base(deserializing) { }
+    private SymbolicRegressionSolutionLinearScaler(SymbolicRegressionSolutionLinearScaler original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicRegressionSolutionLinearScaler()
+      : base() {
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to transform."));
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(ScaledSymbolicExpressionTreeParameterName, "The resulting symbolic expression trees after transformation."));
+      Parameters.Add(new LookupParameter<DoubleValue>(AlphaParameterName, "Alpha parameter for linear transformation."));
+      Parameters.Add(new LookupParameter<DoubleValue>(BetaParameterName, "Beta parameter for linear transformation."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionSolutionLinearScaler(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      SymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
+      DoubleValue alpha = AlphaParameter.ActualValue;
+      DoubleValue beta = BetaParameter.ActualValue;
+      if (alpha != null && beta != null) {
+        ScaledSymbolicExpressionTreeParameter.ActualValue = Scale(tree, alpha.Value, beta.Value);
+      } else {
+        // alpha or beta parameter not available => do not scale tree
+        ScaledSymbolicExpressionTreeParameter.ActualValue = tree;
+      }
+
+      return base.Apply();
+    }
+
+    public static SymbolicExpressionTree Scale(SymbolicExpressionTree original, double alpha, double beta) {
+      var mainBranch = original.Root.SubTrees[0].SubTrees[0];
+      var scaledMainBranch = MakeSum(MakeProduct(beta, mainBranch), alpha);
+
+      // remove the main branch before cloning to prevent cloning of sub-trees
+      original.Root.SubTrees[0].RemoveSubTree(0);
+      var scaledTree = (SymbolicExpressionTree)original.Clone();
+      // insert main branch into the original tree again 
+      original.Root.SubTrees[0].InsertSubTree(0, mainBranch);
+      // insert the scaled main branch into the cloned tree
+      scaledTree.Root.SubTrees[0].InsertSubTree(0, scaledMainBranch);
+      return scaledTree;
+    }
+
+    private static SymbolicExpressionTreeNode MakeSum(SymbolicExpressionTreeNode treeNode, double alpha) {
+      var node = (new Addition()).CreateTreeNode();
+      var alphaConst = MakeConstant(alpha);
+      node.AddSubTree(treeNode);
+      node.AddSubTree(alphaConst);
+      return node;
+    }
+
+    private static SymbolicExpressionTreeNode MakeProduct(double beta, SymbolicExpressionTreeNode treeNode) {
+      var node = (new Multiplication()).CreateTreeNode();
+      var betaConst = MakeConstant(beta);
+      node.AddSubTree(treeNode);
+      node.AddSubTree(betaConst);
+      return node;
+    }
+
+    private static SymbolicExpressionTreeNode MakeConstant(double c) {
+      var node = (ConstantTreeNode)(new Constant()).CreateTreeNode();
+      node.Value = c;
+      return node;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionVariableFrequencyAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionVariableFrequencyAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionVariableFrequencyAnalyzer.cs	(revision 5026)
@@ -0,0 +1,104 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
+  [Item("SymbolicRegressionVariableFrequencyAnalyzer", "An operator for analyzing the variable frequencies of symbolic regression solutions given in symbolic expression tree encoding.")]
+  [StorableClass]
+  public sealed class SymbolicRegressionVariableFrequencyAnalyzer : SingleSuccessorOperator, ISymbolicRegressionAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string VariableFrequenciesParameterName = "VariableFrequencies";
+    private const string ResultsParameterName = "Results";
+
+    #region parameter properties
+    public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<DataTable> VariableFrequenciesParameter {
+      get { return (ILookupParameter<DataTable>)Parameters[VariableFrequenciesParameterName]; }
+    }
+    public ILookupParameter<DataAnalysisProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<DataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataTable VariableFrequencies {
+      get { return VariableFrequenciesParameter.ActualValue; }
+      set { VariableFrequenciesParameter.ActualValue = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicRegressionVariableFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
+    private SymbolicRegressionVariableFrequencyAnalyzer(SymbolicRegressionVariableFrequencyAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicRegressionVariableFrequencyAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze."));
+      Parameters.Add(new LookupParameter<DataAnalysisProblemData>(ProblemDataParameterName, "The problem data containing the input varaibles for the symbolic regression problem."));
+      Parameters.Add(new ValueLookupParameter<DataTable>(VariableFrequenciesParameterName, "The data table to store the variable frequencies."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionVariableFrequencyAnalyzer(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      ItemArray<SymbolicExpressionTree> expressions = SymbolicExpressionTreeParameter.ActualValue;
+      DataAnalysisProblemData problemData = ProblemDataParameter.ActualValue;
+      var inputVariables = problemData.InputVariables.CheckedItems.Select(x => x.Value.Value);
+      ResultCollection results = ResultsParameter.ActualValue;
+
+      if (VariableFrequencies == null) {
+        VariableFrequencies = new DataTable("Variable frequencies", "Relative frequency of variable references aggregated over the whole population.");
+        VariableFrequencies.VisualProperties.XAxisTitle = "Generation";
+        VariableFrequencies.VisualProperties.YAxisTitle = "Relative Variable Frequency";
+        // add a data row for each input variable
+        foreach (var inputVariable in inputVariables) {
+          DataRow row = new DataRow(inputVariable);
+          row.VisualProperties.StartIndexZero = true;
+          VariableFrequencies.Rows.Add(row);
+        }
+        results.Add(new Result("Variable frequencies", VariableFrequencies));
+      }
+      foreach (var pair in VariableFrequencyAnalyser.CalculateVariableFrequencies(expressions, inputVariables)) {
+        VariableFrequencies.Rows[pair.Key].Values.Add(pair.Value);
+        results["Variable frequencies"].Value = VariableFrequencies;
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 5026)
@@ -0,0 +1,280 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
+  /// <summary>
+  /// An operator that analyzes the validation best scaled symbolic regression solution.
+  /// </summary>
+  [Item("ValidationBestScaledSymbolicRegressionSolutionAnalyzer", "An operator that analyzes the validation best scaled symbolic regression solution.")]
+  [StorableClass]
+  [Obsolete("This class should not be used anymore because of performance reasons and will therefore not be updated.")]
+  public sealed class ValidationBestScaledSymbolicRegressionSolutionAnalyzer : AlgorithmOperator, ISymbolicRegressionAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ScaledSymbolicExpressionTreeParameterName = "ScaledSymbolicExpressionTree";
+    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string TrainingSamplesStartParameterName = "TrainingSamplesStart";
+    private const string TrainingSamplesEndParameterName = "TrainingSamplesEnd";
+    private const string ValidationSamplesStartParameterName = "ValidationSamplesStart";
+    private const string ValidationSamplesEndParameterName = "ValidationSamplesEnd";
+    private const string TestSamplesStartParameterName = "TestSamplesStart";
+    private const string TestSamplesEndParameterName = "TestSamplesEnd";
+    private const string QualityParameterName = "Quality";
+    private const string ScaledQualityParameterName = "ScaledQuality";
+    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
+    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
+    private const string AlphaParameterName = "Alpha";
+    private const string BetaParameterName = "Beta";
+    private const string BestSolutionParameterName = "Best solution (validation)";
+    private const string BestSolutionQualityParameterName = "Best solution quality (validation)";
+    private const string CurrentBestValidationQualityParameterName = "Current best validation quality";
+    private const string ResultsParameterName = "Results";
+    private const string BestKnownQualityParameterName = "BestKnownQuality";
+
+    public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    public IValueLookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (IValueLookupParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
+    }
+    public IValueLookupParameter<DataAnalysisProblemData> ProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> TrainingSamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[TrainingSamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> TrainingSamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[TrainingSamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> ValidationSamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[ValidationSamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> ValidationSamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[ValidationSamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> TestSamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[TestSamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> TestSamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[TestSamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
+    }
+    public ILookupParameter<SymbolicRegressionSolution> BestSolutionParameter {
+      get { return (ILookupParameter<SymbolicRegressionSolution>)Parameters[BestSolutionParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> BestSolutionQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[BestSolutionQualityParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[BestKnownQualityParameterName]; }
+    }
+
+    [Storable]
+    private UniformSubScopesProcessor subScopesProcessor;
+    [Storable]
+    private SymbolicRegressionSolutionLinearScaler linearScaler;
+    [Storable]
+    private SymbolicRegressionModelQualityAnalyzer modelQualityAnalyzer;
+    [Storable]
+    private SymbolicRegressionMeanSquaredErrorEvaluator validationMseEvaluator;
+    [Storable]
+    private BestSymbolicRegressionSolutionAnalyzer bestSolutionAnalyzer;
+    [Storable]
+    private UniformSubScopesProcessor cleaningSubScopesProcessor;
+    [Storable]
+    private Assigner removeScaledExpressionTreeAssigner;
+    [Storable]
+    private BestQualityMemorizer bestKnownQualityMemorizer;
+    [Storable]
+    private BestAverageWorstQualityCalculator bestAvgWorstValidationQualityCalculator;
+    [Storable]
+    private DataTableValuesCollector validationValuesCollector;
+    [Storable]
+    private ResultsCollector resultsCollector;
+
+    [StorableConstructor]
+    private ValidationBestScaledSymbolicRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    private ValidationBestScaledSymbolicRegressionSolutionAnalyzer(ValidationBestScaledSymbolicRegressionSolutionAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+      Initialize();
+    }
+    public ValidationBestScaledSymbolicRegressionSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The quality of the symbolic expression trees to analyze."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used for the analysis of symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(ProblemDataParameterName, "The problem data for which the symbolic expression tree is a solution."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(TrainingSamplesStartParameterName, "The first index of the training partition of the data set."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(TrainingSamplesEndParameterName, "The last index of the training partition of the data set."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(ValidationSamplesStartParameterName, "The first index of the validation partition of the data set."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(ValidationSamplesEndParameterName, "The last index of the validation partition of the data set."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(TestSamplesStartParameterName, "The first index of the test partition of the data set."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(TestSamplesEndParameterName, "The last index of the test partition of the data set."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper estimation limit that was set for the evaluation of the symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower estimation limit that was set for the evaluation of the symbolic expression trees."));
+      Parameters.Add(new LookupParameter<SymbolicRegressionSolution>(BestSolutionParameterName, "The best symbolic regression solution."));
+      Parameters.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameterName, "The quality of the best symbolic regression solution."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored."));
+      Parameters.Add(new LookupParameter<DoubleValue>(BestKnownQualityParameterName, "The best known (validation) quality achieved on the data set."));
+
+      #region operator initialization
+      subScopesProcessor = new UniformSubScopesProcessor();
+      linearScaler = new SymbolicRegressionSolutionLinearScaler();
+      modelQualityAnalyzer = new SymbolicRegressionModelQualityAnalyzer();
+      validationMseEvaluator = new SymbolicRegressionMeanSquaredErrorEvaluator();
+      bestSolutionAnalyzer = new BestSymbolicRegressionSolutionAnalyzer();
+      cleaningSubScopesProcessor = new UniformSubScopesProcessor();
+      removeScaledExpressionTreeAssigner = new Assigner();
+      bestKnownQualityMemorizer = new BestQualityMemorizer();
+      bestAvgWorstValidationQualityCalculator = new BestAverageWorstQualityCalculator();
+      validationValuesCollector = new DataTableValuesCollector();
+      resultsCollector = new ResultsCollector();
+      #endregion
+
+      #region parameter wiring
+      subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
+
+      linearScaler.AlphaParameter.ActualName = AlphaParameterName;
+      linearScaler.BetaParameter.ActualName = BetaParameterName;
+      linearScaler.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+      linearScaler.ScaledSymbolicExpressionTreeParameter.ActualName = ScaledSymbolicExpressionTreeParameterName;
+
+      modelQualityAnalyzer.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
+      modelQualityAnalyzer.SymbolicExpressionTreeParameter.ActualName = ScaledSymbolicExpressionTreeParameterName;
+      modelQualityAnalyzer.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+      modelQualityAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
+      modelQualityAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
+      modelQualityAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
+
+      validationMseEvaluator.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
+      validationMseEvaluator.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
+      validationMseEvaluator.SymbolicExpressionTreeParameter.ActualName = ScaledSymbolicExpressionTreeParameterName;
+      validationMseEvaluator.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
+      validationMseEvaluator.QualityParameter.ActualName = ScaledQualityParameterName;
+      validationMseEvaluator.RegressionProblemDataParameter.ActualName = ProblemDataParameter.Name;
+      validationMseEvaluator.SamplesStartParameter.ActualName = ValidationSamplesStartParameter.Name;
+      validationMseEvaluator.SamplesEndParameter.ActualName = ValidationSamplesEndParameter.Name;
+
+      bestSolutionAnalyzer.BestSolutionParameter.ActualName = BestSolutionParameter.Name;
+      bestSolutionAnalyzer.BestSolutionQualityParameter.ActualName = BestSolutionQualityParameter.Name;
+      bestSolutionAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
+      bestSolutionAnalyzer.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
+      bestSolutionAnalyzer.QualityParameter.ActualName = ScaledQualityParameterName;
+      bestSolutionAnalyzer.ResultsParameter.ActualName = ResultsParameter.Name;
+      bestSolutionAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
+      bestSolutionAnalyzer.SymbolicExpressionTreeParameter.ActualName = ScaledSymbolicExpressionTreeParameterName;
+      bestSolutionAnalyzer.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+      bestSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
+
+      cleaningSubScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
+
+      removeScaledExpressionTreeAssigner.LeftSideParameter.ActualName = ScaledSymbolicExpressionTreeParameterName;
+      removeScaledExpressionTreeAssigner.RightSideParameter.Value = new SymbolicExpressionTree();
+
+      bestAvgWorstValidationQualityCalculator.AverageQualityParameter.ActualName = "Current average validation quality";
+      bestAvgWorstValidationQualityCalculator.BestQualityParameter.ActualName = CurrentBestValidationQualityParameterName;
+      bestAvgWorstValidationQualityCalculator.MaximizationParameter.Value = new BoolValue(false);
+      bestAvgWorstValidationQualityCalculator.QualityParameter.ActualName = ScaledQualityParameterName;
+      bestAvgWorstValidationQualityCalculator.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+      bestAvgWorstValidationQualityCalculator.WorstQualityParameter.ActualName = "Current worst validation quality";
+
+      bestKnownQualityMemorizer.BestQualityParameter.ActualName = BestKnownQualityParameterName;
+      bestKnownQualityMemorizer.MaximizationParameter.Value = new BoolValue(false);
+      bestKnownQualityMemorizer.QualityParameter.ActualName = QualityParameter.Name;
+      bestKnownQualityMemorizer.QualityParameter.Depth = QualityParameter.Depth;
+
+      validationValuesCollector.DataTableParameter.ActualName = "Validation quality";
+      validationValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(CurrentBestValidationQualityParameterName, null, CurrentBestValidationQualityParameterName));
+      validationValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameter.Name, null, BestSolutionQualityParameter.Name));
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(CurrentBestValidationQualityParameterName, null, CurrentBestValidationQualityParameterName));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameter.Name, null, BestSolutionQualityParameter.Name));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Validation quality"));
+      resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
+      #endregion
+
+      #region operator graph
+      OperatorGraph.InitialOperator = subScopesProcessor;
+      subScopesProcessor.Operator = linearScaler;
+      linearScaler.Successor = validationMseEvaluator;
+      validationMseEvaluator.Successor = null;
+      subScopesProcessor.Successor = modelQualityAnalyzer;
+      modelQualityAnalyzer.Successor = bestSolutionAnalyzer;
+      bestSolutionAnalyzer.Successor = cleaningSubScopesProcessor;
+      cleaningSubScopesProcessor.Operator = removeScaledExpressionTreeAssigner;
+      cleaningSubScopesProcessor.Successor = bestAvgWorstValidationQualityCalculator;
+      bestAvgWorstValidationQualityCalculator.Successor = bestKnownQualityMemorizer;
+      bestKnownQualityMemorizer.Successor = validationValuesCollector;
+      validationValuesCollector.Successor = resultsCollector;
+      resultsCollector.Successor = null;
+      #endregion
+
+      Initialize();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ValidationBestScaledSymbolicRegressionSolutionAnalyzer(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      Initialize();
+    }
+    private void Initialize() {
+      SymbolicExpressionTreeParameter.DepthChanged += new EventHandler(SymbolicExpressionTreeParameter_DepthChanged);
+    }
+
+
+    private void SymbolicExpressionTreeParameter_DepthChanged(object sender, EventArgs e) {
+      subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
+      cleaningSubScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
+      bestSolutionAnalyzer.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+      bestSolutionAnalyzer.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+      bestAvgWorstValidationQualityCalculator.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+      bestKnownQualityMemorizer.QualityParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+      modelQualityAnalyzer.SymbolicExpressionTreeParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionEvaluator.cs	(revision 5026)
@@ -0,0 +1,137 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("MultiObjectiveSymbolicRegressionEvaluator", "Evaluates a symbolic regression solution.")]
+  [StorableClass]
+  public abstract class MultiObjectiveSymbolicRegressionEvaluator : SingleSuccessorOperator, IMultiObjectiveSymbolicRegressionEvaluator {
+    private const string RandomParameterName = "Random";
+    private const string QualitiesParameterName = "Qualities";
+    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string FunctionTreeParameterName = "FunctionTree";
+    private const string RegressionProblemDataParameterName = "RegressionProblemData";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+    #region ISymbolicRegressionEvaluator Members
+
+    public ILookupParameter<DoubleArray> QualitiesParameter {
+      get { return (ILookupParameter<DoubleArray>)Parameters[QualitiesParameterName]; }
+    }
+
+    public ILookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
+    }
+
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[FunctionTreeParameterName]; }
+    }
+
+    public ILookupParameter<DataAnalysisProblemData> RegressionProblemDataParameter {
+      get { return (ILookupParameter<DataAnalysisProblemData>)Parameters[RegressionProblemDataParameterName]; }
+    }
+
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+
+    public IValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+      get { return (IValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+    }
+
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+
+    #endregion
+    #region properties
+    public IRandom Random {
+      get { return RandomParameter.ActualValue; }
+    }
+    public ISymbolicExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
+      get { return SymbolicExpressionTreeInterpreterParameter.ActualValue; }
+    }
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public DataAnalysisProblemData RegressionProblemData {
+      get { return RegressionProblemDataParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+
+    public PercentValue RelativeNumberOfEvaluatedSamples {
+      get { return RelativeNumberOfEvaluatedSamplesParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected MultiObjectiveSymbolicRegressionEvaluator(bool deserializing) : base(deserializing) { }
+    protected MultiObjectiveSymbolicRegressionEvaluator(MultiObjectiveSymbolicRegressionEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public MultiObjectiveSymbolicRegressionEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
+      Parameters.Add(new LookupParameter<DoubleArray>(QualitiesParameterName, "The qualities of the evaluated symbolic regression solution."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic expression tree."));
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(FunctionTreeParameterName, "The symbolic regression solution encoded as a symbolic expression tree."));
+      Parameters.Add(new LookupParameter<DataAnalysisProblemData>(RegressionProblemDataParameterName, "The problem data on which the symbolic regression solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start index of the dataset partition on which the symbolic regression solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end index of the dataset partition on which the symbolic regression solution should be evaluated."));
+      Parameters.Add(new ValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index.", new PercentValue(1)));
+    }
+
+    public override IOperation Apply() {
+      int seed = Random.Next();
+      IEnumerable<int> rows = SingleObjectiveSymbolicRegressionEvaluator.GenerateRowsToEvaluate(seed, RelativeNumberOfEvaluatedSamples.Value, SamplesStart.Value, SamplesEnd.Value)
+         .Where(i => i < RegressionProblemData.TestSamplesStart.Value || RegressionProblemData.TestSamplesEnd.Value <= i);
+      double[] qualities = Evaluate(SymbolicExpressionTreeInterpreter, SymbolicExpressionTree, RegressionProblemData.Dataset,
+        RegressionProblemData.TargetVariable, rows);
+      QualitiesParameter.ActualValue = new DoubleArray(qualities);
+      return base.Apply();
+    }
+
+
+    protected abstract double[] Evaluate(ISymbolicExpressionTreeInterpreter interpreter,
+      SymbolicExpressionTree solution,
+      Dataset dataset,
+      StringValue targetVariable,
+      IEnumerable<int> rows);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator.cs	(revision 5026)
@@ -0,0 +1,82 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator", "Calculates the mean squared error and the number of variables of a symbolic regression solution.")]
+  [StorableClass]
+  public sealed class MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator : MultiObjectiveSymbolicRegressionEvaluator {
+    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
+    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
+
+    #region parameter properties
+    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DoubleValue UpperEstimationLimit {
+      get { return UpperEstimationLimitParameter.ActualValue; }
+    }
+    public DoubleValue LowerEstimationLimit {
+      get { return LowerEstimationLimitParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    private MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator(bool deserializing) : base(deserializing) { }
+    private MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator(MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic expression trees."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator(this, cloner);
+    }
+
+    protected override double[] Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, Dataset dataset, StringValue targetVariable, IEnumerable<int> rows) {
+      double mse = SymbolicRegressionMeanSquaredErrorEvaluator.Calculate(interpreter, solution, LowerEstimationLimit.Value, UpperEstimationLimit.Value, dataset, targetVariable.Value, rows);
+      List<string> vars = new List<string>();
+      solution.Root.ForEachNodePostfix(n => {
+        var varNode = n as VariableTreeNode;
+        if (varNode != null && !vars.Contains(varNode.VariableName)) {
+          vars.Add(varNode.VariableName);
+        }
+      });
+      return new double[2] { mse, vars.Count };
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator.cs	(revision 5026)
@@ -0,0 +1,82 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator", "Calculates the correlation coefficient r² and the number of variables of a symbolic regression solution.")]
+  [StorableClass]
+  public sealed class MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator : MultiObjectiveSymbolicRegressionEvaluator {
+    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
+    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
+
+    #region parameter properties
+    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DoubleValue UpperEstimationLimit {
+      get { return UpperEstimationLimitParameter.ActualValue; }
+    }
+    public DoubleValue LowerEstimationLimit {
+      get { return LowerEstimationLimitParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    private MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator(bool deserializing) : base(deserializing) { }
+    private MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator(MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic expression trees."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveSymbolicRegressionPearsonsRSquaredEvaluator(this, cloner);
+    }
+
+    protected override double[] Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, Dataset dataset, StringValue targetVariable, IEnumerable<int> rows) {
+      double r2 = SymbolicRegressionPearsonsRSquaredEvaluator.Calculate(interpreter, solution, LowerEstimationLimit.Value, UpperEstimationLimit.Value, dataset, targetVariable.Value, rows);
+      List<string> vars = new List<string>();
+      solution.Root.ForEachNodePostfix(n => {
+        var varNode = n as VariableTreeNode;
+        if (varNode != null && !vars.Contains(varNode.VariableName)) {
+          vars.Add(varNode.VariableName);
+        }
+      });
+      return new double[2] { r2, vars.Count };
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicRegressionEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicRegressionEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicRegressionEvaluator.cs	(revision 5026)
@@ -0,0 +1,171 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("SingleObjectiveSymbolicRegressionEvaluator", "Evaluates a symbolic regression solution.")]
+  [StorableClass]
+  public abstract class SingleObjectiveSymbolicRegressionEvaluator : SingleSuccessorOperator, ISymbolicRegressionEvaluator {
+    private const string RandomParameterName = "Random";
+    private const string QualityParameterName = "Quality";
+    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string FunctionTreeParameterName = "FunctionTree";
+    private const string RegressionProblemDataParameterName = "RegressionProblemData";
+    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
+    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+    #region ISymbolicRegressionEvaluator Members
+
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+
+    public ILookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
+    }
+
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[FunctionTreeParameterName]; }
+    }
+
+    public ILookupParameter<DataAnalysisProblemData> RegressionProblemDataParameter {
+      get { return (ILookupParameter<DataAnalysisProblemData>)Parameters[RegressionProblemDataParameterName]; }
+    }
+
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
+    }
+    public IValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+      get { return (IValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+    }
+
+
+    #endregion
+    #region properties
+    public IRandom Random {
+      get { return RandomParameter.ActualValue; }
+    }
+    public ISymbolicExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
+      get { return SymbolicExpressionTreeInterpreterParameter.ActualValue; }
+    }
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public DataAnalysisProblemData RegressionProblemData {
+      get { return RegressionProblemDataParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    public DoubleValue UpperEstimationLimit {
+      get { return UpperEstimationLimitParameter.ActualValue; }
+    }
+    public DoubleValue LowerEstimationLimit {
+      get { return LowerEstimationLimitParameter.ActualValue; }
+    }
+    public PercentValue RelativeNumberOfEvaluatedSamples {
+      get { return RelativeNumberOfEvaluatedSamplesParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SingleObjectiveSymbolicRegressionEvaluator(bool deserializing) : base(deserializing) { }
+    protected SingleObjectiveSymbolicRegressionEvaluator(SingleObjectiveSymbolicRegressionEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SingleObjectiveSymbolicRegressionEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
+      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The quality of the evaluated symbolic regression solution."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic expression tree."));
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(FunctionTreeParameterName, "The symbolic regression solution encoded as a symbolic expression tree."));
+      Parameters.Add(new LookupParameter<DataAnalysisProblemData>(RegressionProblemDataParameterName, "The problem data on which the symbolic regression solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start index of the dataset partition on which the symbolic regression solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end index of the dataset partition on which the symbolic regression solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new ValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index.", new PercentValue(1)));
+    }
+
+
+    [StorableHook(Persistence.Default.CompositeSerializers.Storable.HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(RelativeNumberOfEvaluatedSamplesParameterName))
+        Parameters.Add(new ValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index.", new PercentValue(1)));
+      if (!Parameters.ContainsKey(RandomParameterName))
+        Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
+    }
+
+    public override IOperation Apply() {
+      int seed = Random.Next();
+      IEnumerable<int> rows = GenerateRowsToEvaluate(seed, RelativeNumberOfEvaluatedSamples.Value, SamplesStart.Value, SamplesEnd.Value)
+          .Where(i => i < RegressionProblemData.TestSamplesStart.Value || RegressionProblemData.TestSamplesEnd.Value <= i);
+      double quality = Evaluate(SymbolicExpressionTreeInterpreter, SymbolicExpressionTree, LowerEstimationLimit.Value, UpperEstimationLimit.Value,
+        RegressionProblemData.Dataset,
+        RegressionProblemData.TargetVariable.Value, rows);
+      QualityParameter.ActualValue = new DoubleValue(quality);
+      return base.Apply();
+    }
+
+
+    internal static IEnumerable<int> GenerateRowsToEvaluate(int seed, double relativeAmount, int start, int end) {
+      if (end < start) throw new ArgumentException("Start value is larger than end value.");
+      int count = (int)((end - start) * relativeAmount);
+      if (count == 0) count = 1;
+      return RandomEnumerable.SampleRandomNumbers(seed, start, end, count);
+    }
+
+    public abstract double Evaluate(ISymbolicExpressionTreeInterpreter interpreter,
+      SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit,
+      Dataset dataset,
+      string targetVariable,
+      IEnumerable<int> rows);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionMeanSquaredErrorEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionMeanSquaredErrorEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionMeanSquaredErrorEvaluator.cs	(revision 5026)
@@ -0,0 +1,76 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("SymbolicRegressionMeanSquaredErrorEvaluator", "Calculates the mean squared error of a symbolic regression solution.")]
+  [StorableClass]
+  public class SymbolicRegressionMeanSquaredErrorEvaluator : SingleObjectiveSymbolicRegressionEvaluator {
+
+    [StorableConstructor]
+    protected SymbolicRegressionMeanSquaredErrorEvaluator(bool deserializing) : base(deserializing) { }
+    protected SymbolicRegressionMeanSquaredErrorEvaluator(SymbolicRegressionMeanSquaredErrorEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicRegressionMeanSquaredErrorEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionMeanSquaredErrorEvaluator(this, cloner);
+    }
+
+    public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) {
+      double mse = Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows);
+      return mse;
+    }
+
+    public static double Calculate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) {
+      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows);
+      IEnumerable<double> originalValues = dataset.GetEnumeratedVariableValues(targetVariable, rows);
+      IEnumerator<double> originalEnumerator = originalValues.GetEnumerator();
+      IEnumerator<double> estimatedEnumerator = estimatedValues.GetEnumerator();
+      OnlineMeanSquaredErrorEvaluator mseEvaluator = new OnlineMeanSquaredErrorEvaluator();
+
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double estimated = estimatedEnumerator.Current;
+        double original = originalEnumerator.Current;
+        if (double.IsNaN(estimated))
+          estimated = upperEstimationLimit;
+        else
+          estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated));
+        mseEvaluator.Add(original, estimated);
+      }
+
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        return mseEvaluator.MeanSquaredError;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionPearsonsRSquaredEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionPearsonsRSquaredEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionPearsonsRSquaredEvaluator.cs	(revision 5026)
@@ -0,0 +1,74 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("SymbolicRegressionPearsonsRSquaredEvaluator", "Calculates the pearson r² correlation coefficient of a symbolic regression solution.")]
+  [StorableClass]
+  public class SymbolicRegressionPearsonsRSquaredEvaluator : SingleObjectiveSymbolicRegressionEvaluator {
+    [StorableConstructor]
+    protected SymbolicRegressionPearsonsRSquaredEvaluator(bool deserializing) : base(deserializing) { }
+    protected SymbolicRegressionPearsonsRSquaredEvaluator(SymbolicRegressionPearsonsRSquaredEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicRegressionPearsonsRSquaredEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionPearsonsRSquaredEvaluator(this, cloner);
+    }
+    public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) {
+      double mse = Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows);
+      return mse;
+    }
+
+    public static double Calculate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) {
+      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows);
+      IEnumerable<double> originalValues = dataset.GetEnumeratedVariableValues(targetVariable, rows);
+      IEnumerator<double> originalEnumerator = originalValues.GetEnumerator();
+      IEnumerator<double> estimatedEnumerator = estimatedValues.GetEnumerator();
+      OnlinePearsonsRSquaredEvaluator r2Evaluator = new OnlinePearsonsRSquaredEvaluator();
+
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double estimated = estimatedEnumerator.Current;
+        double original = originalEnumerator.Current;
+        if (double.IsNaN(estimated))
+          estimated = upperEstimationLimit;
+        else
+          estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated));
+        r2Evaluator.Add(original, estimated);
+      }
+
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        return r2Evaluator.RSquared;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator.cs	(revision 5026)
@@ -0,0 +1,228 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator", "Calculates the mean and the variance of the squared errors of a linearly scaled symbolic regression solution.")]
+  [StorableClass]
+  public sealed class SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator : SymbolicRegressionMeanSquaredErrorEvaluator {
+    private const string QualityVarianceParameterName = "QualityVariance";
+    private const string QualitySamplesParameterName = "QualitySamples";
+    private const string DecompositionBiasParameterName = "QualityDecompositionBias";
+    private const string DecompositionVarianceParameterName = "QualityDecompositionVariance";
+    private const string DecompositionCovarianceParameterName = "QualityDecompositionCovariance";
+    private const string ApplyScalingParameterName = "ApplyScaling";
+
+    #region parameter properties
+    public IValueLookupParameter<BoolValue> ApplyScalingParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters[ApplyScalingParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> AlphaParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Alpha"]; }
+    }
+    public ILookupParameter<DoubleValue> BetaParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Beta"]; }
+    }
+    public ILookupParameter<DoubleValue> QualityVarianceParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[QualityVarianceParameterName]; }
+    }
+    public ILookupParameter<IntValue> QualitySamplesParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[QualitySamplesParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> DecompositionBiasParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[DecompositionBiasParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> DecompositionVarianceParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[DecompositionVarianceParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> DecompositionCovarianceParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[DecompositionCovarianceParameterName]; }
+    }
+
+    #endregion
+    #region properties
+    public BoolValue ApplyScaling {
+      get { return ApplyScalingParameter.ActualValue; }
+    }
+    public DoubleValue Alpha {
+      get { return AlphaParameter.ActualValue; }
+      set { AlphaParameter.ActualValue = value; }
+    }
+    public DoubleValue Beta {
+      get { return BetaParameter.ActualValue; }
+      set { BetaParameter.ActualValue = value; }
+    }
+    public DoubleValue QualityVariance {
+      get { return QualityVarianceParameter.ActualValue; }
+      set { QualityVarianceParameter.ActualValue = value; }
+    }
+    public IntValue QualitySamples {
+      get { return QualitySamplesParameter.ActualValue; }
+      set { QualitySamplesParameter.ActualValue = value; }
+    }
+    #endregion
+    [StorableConstructor]
+    private SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator(bool deserializing) : base(deserializing) { }
+    private SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator(SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<BoolValue>(ApplyScalingParameterName, "Determines if the estimated values should be scaled.", new BoolValue(true)));
+      Parameters.Add(new LookupParameter<DoubleValue>("Alpha", "Alpha parameter for linear scaling of the estimated values."));
+      Parameters.Add(new LookupParameter<DoubleValue>("Beta", "Beta parameter for linear scaling of the estimated values."));
+      Parameters.Add(new LookupParameter<DoubleValue>(QualityVarianceParameterName, "A parameter which stores the variance of the squared errors."));
+      Parameters.Add(new LookupParameter<IntValue>(QualitySamplesParameterName, " The number of evaluated samples."));
+      Parameters.Add(new LookupParameter<DoubleValue>(DecompositionBiasParameterName, "A parameter which stores the relativ bias of the MSE."));
+      Parameters.Add(new LookupParameter<DoubleValue>(DecompositionVarianceParameterName, "A parameter which stores the relativ bias of the MSE."));
+      Parameters.Add(new LookupParameter<DoubleValue>(DecompositionCovarianceParameterName, "A parameter which stores the relativ bias of the MSE."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionScaledMeanAndVarianceSquaredErrorEvaluator(this, cloner);
+    }
+
+    public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) {
+      double alpha, beta;
+      double meanSE, varianceSE;
+      int count;
+      double bias, variance, covariance;
+      double mse;
+      if (ApplyScaling.Value) {
+        mse = Calculate(interpreter, solution, LowerEstimationLimit.Value, UpperEstimationLimit.Value, dataset, targetVariable, rows, out beta, out alpha, out meanSE, out varianceSE, out count, out bias, out variance, out covariance);
+        Alpha = new DoubleValue(alpha);
+        Beta = new DoubleValue(beta);
+      } else {
+        mse = CalculateWithScaling(interpreter, solution, LowerEstimationLimit.Value, UpperEstimationLimit.Value, dataset, targetVariable, rows, 1, 0, out meanSE, out varianceSE, out count, out bias, out variance, out covariance);
+      }
+      QualityVariance = new DoubleValue(varianceSE);
+      QualitySamples = new IntValue(count);
+      DecompositionBiasParameter.ActualValue = new DoubleValue(bias / meanSE);
+      DecompositionVarianceParameter.ActualValue = new DoubleValue(variance / meanSE);
+      DecompositionCovarianceParameter.ActualValue = new DoubleValue(covariance / meanSE);
+      return mse;
+    }
+
+    public static double Calculate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows, out double beta, out double alpha, out double meanSE, out double varianceSE, out int count, out double bias, out double variance, out double covariance) {
+      IEnumerable<double> originalValues = dataset.GetEnumeratedVariableValues(targetVariable, rows);
+      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows);
+      CalculateScalingParameters(originalValues, estimatedValues, out beta, out alpha);
+
+      return CalculateWithScaling(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows, beta, alpha, out meanSE, out varianceSE, out count, out bias, out variance, out covariance);
+    }
+
+    public static double CalculateWithScaling(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows, double beta, double alpha, out double meanSE, out double varianceSE, out int count, out double bias, out double variance, out double covariance) {
+      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows);
+      IEnumerable<double> originalValues = dataset.GetEnumeratedVariableValues(targetVariable, rows);
+      IEnumerator<double> originalEnumerator = originalValues.GetEnumerator();
+      IEnumerator<double> estimatedEnumerator = estimatedValues.GetEnumerator();
+      OnlineMeanAndVarianceCalculator seEvaluator = new OnlineMeanAndVarianceCalculator();
+      OnlineMeanAndVarianceCalculator originalMeanEvaluator = new OnlineMeanAndVarianceCalculator();
+      OnlineMeanAndVarianceCalculator estimatedMeanEvaluator = new OnlineMeanAndVarianceCalculator();
+      OnlinePearsonsRSquaredEvaluator r2Evaluator = new OnlinePearsonsRSquaredEvaluator();
+
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double estimated = estimatedEnumerator.Current * beta + alpha;
+        double original = originalEnumerator.Current;
+        if (double.IsNaN(estimated))
+          estimated = upperEstimationLimit;
+        else
+          estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated));
+        double error = estimated - original;
+        error *= error;
+        seEvaluator.Add(error);
+        originalMeanEvaluator.Add(original);
+        estimatedMeanEvaluator.Add(estimated);
+        r2Evaluator.Add(original, estimated);
+      }
+
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        meanSE = seEvaluator.Mean;
+        varianceSE = seEvaluator.Variance;
+        count = seEvaluator.Count;
+        bias = (originalMeanEvaluator.Mean - estimatedMeanEvaluator.Mean);
+        bias *= bias;
+
+        double sO = Math.Sqrt(originalMeanEvaluator.Variance);
+        double sE = Math.Sqrt(estimatedMeanEvaluator.Variance);
+        variance = sO - sE;
+        variance *= variance;
+        double r = Math.Sqrt(r2Evaluator.RSquared);
+        covariance = 2 * sO * sE * (1 - r);
+        return seEvaluator.Mean;
+      }
+    }
+
+    /// <summary>
+    /// Calculates linear scaling parameters in one pass.
+    /// The formulas to calculate the scaling parameters were taken from Scaled Symblic Regression by Maarten Keijzer.
+    /// http://www.springerlink.com/content/x035121165125175/
+    /// </summary>
+    public static void CalculateScalingParameters(IEnumerable<double> original, IEnumerable<double> estimated, out double beta, out double alpha) {
+      IEnumerator<double> originalEnumerator = original.GetEnumerator();
+      IEnumerator<double> estimatedEnumerator = estimated.GetEnumerator();
+      OnlineMeanAndVarianceCalculator yVarianceCalculator = new OnlineMeanAndVarianceCalculator();
+      OnlineMeanAndVarianceCalculator tMeanCalculator = new OnlineMeanAndVarianceCalculator();
+      OnlineCovarianceEvaluator ytCovarianceEvaluator = new OnlineCovarianceEvaluator();
+      int cnt = 0;
+
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double y = estimatedEnumerator.Current;
+        double t = originalEnumerator.Current;
+        if (IsValidValue(t) && IsValidValue(y)) {
+          tMeanCalculator.Add(t);
+          yVarianceCalculator.Add(y);
+          ytCovarianceEvaluator.Add(y, t);
+
+          cnt++;
+        }
+      }
+
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext())
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      if (cnt < 2) {
+        alpha = 0;
+        beta = 1;
+      } else {
+        if (yVarianceCalculator.Variance.IsAlmost(0.0))
+          beta = 1;
+        else
+          beta = ytCovarianceEvaluator.Covariance / yVarianceCalculator.Variance;
+
+        alpha = tMeanCalculator.Mean - beta * yVarianceCalculator.Mean;
+      }
+    }
+
+    private static bool IsValidValue(double d) {
+      return !double.IsInfinity(d) && !double.IsNaN(d) && d > -1.0E07 && d < 1.0E07;  // don't consider very large or very small values for scaling
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionScaledMeanSquaredErrorEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionScaledMeanSquaredErrorEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionScaledMeanSquaredErrorEvaluator.cs	(revision 5026)
@@ -0,0 +1,153 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("SymbolicRegressionScaledMeanSquaredErrorEvaluator", "Calculates the mean squared error of a linearly scaled symbolic regression solution.")]
+  [StorableClass]
+  public sealed class SymbolicRegressionScaledMeanSquaredErrorEvaluator : SymbolicRegressionMeanSquaredErrorEvaluator {
+
+    #region parameter properties
+    public ILookupParameter<DoubleValue> AlphaParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Alpha"]; }
+    }
+    public ILookupParameter<DoubleValue> BetaParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Beta"]; }
+    }
+    #endregion
+    #region properties
+    public DoubleValue Alpha {
+      get { return AlphaParameter.ActualValue; }
+      set { AlphaParameter.ActualValue = value; }
+    }
+    public DoubleValue Beta {
+      get { return BetaParameter.ActualValue; }
+      set { BetaParameter.ActualValue = value; }
+    }
+    #endregion
+    [StorableConstructor]
+    private SymbolicRegressionScaledMeanSquaredErrorEvaluator(bool deserializing) : base(deserializing) { }
+    private SymbolicRegressionScaledMeanSquaredErrorEvaluator(SymbolicRegressionScaledMeanSquaredErrorEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicRegressionScaledMeanSquaredErrorEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleValue>("Alpha", "Alpha parameter for linear scaling of the estimated values."));
+      Parameters.Add(new LookupParameter<DoubleValue>("Beta", "Beta parameter for linear scaling of the estimated values."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionScaledMeanSquaredErrorEvaluator(this, cloner);
+    }
+
+    public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) {
+      double alpha, beta;
+      double mse = Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows, out beta, out alpha);
+      AlphaParameter.ActualValue = new DoubleValue(alpha);
+      BetaParameter.ActualValue = new DoubleValue(beta);
+      return mse;
+    }
+
+    public static double Calculate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows, out double beta, out double alpha) {
+      IEnumerable<double> originalValues = dataset.GetEnumeratedVariableValues(targetVariable, rows);
+      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows);
+      CalculateScalingParameters(originalValues, estimatedValues, out beta, out alpha);
+
+      return CalculateWithScaling(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows, beta, alpha);
+    }
+
+    public static double CalculateWithScaling(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows, double beta, double alpha) {
+      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, dataset, rows);
+      IEnumerable<double> originalValues = dataset.GetEnumeratedVariableValues(targetVariable, rows);
+      IEnumerator<double> originalEnumerator = originalValues.GetEnumerator();
+      IEnumerator<double> estimatedEnumerator = estimatedValues.GetEnumerator();
+      OnlineMeanSquaredErrorEvaluator mseEvaluator = new OnlineMeanSquaredErrorEvaluator();
+
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double estimated = estimatedEnumerator.Current * beta + alpha;
+        double original = originalEnumerator.Current;
+        if (double.IsNaN(estimated))
+          estimated = upperEstimationLimit;
+        else
+          estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated));
+        mseEvaluator.Add(original, estimated);
+      }
+
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        return mseEvaluator.MeanSquaredError;
+      }
+    }
+
+    /// <summary>
+    /// Calculates linear scaling parameters in one pass.
+    /// The formulas to calculate the scaling parameters were taken from Scaled Symblic Regression by Maarten Keijzer.
+    /// http://www.springerlink.com/content/x035121165125175/
+    /// </summary>
+    public static void CalculateScalingParameters(IEnumerable<double> original, IEnumerable<double> estimated, out double beta, out double alpha) {
+      IEnumerator<double> originalEnumerator = original.GetEnumerator();
+      IEnumerator<double> estimatedEnumerator = estimated.GetEnumerator();
+      OnlineMeanAndVarianceCalculator yVarianceCalculator = new OnlineMeanAndVarianceCalculator();
+      OnlineMeanAndVarianceCalculator tMeanCalculator = new OnlineMeanAndVarianceCalculator();
+      OnlineCovarianceEvaluator ytCovarianceEvaluator = new OnlineCovarianceEvaluator();
+      int cnt = 0;
+
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double y = estimatedEnumerator.Current;
+        double t = originalEnumerator.Current;
+        if (IsValidValue(t) && IsValidValue(y)) {
+          tMeanCalculator.Add(t);
+          yVarianceCalculator.Add(y);
+          ytCovarianceEvaluator.Add(y, t);
+
+          cnt++;
+        }
+      }
+
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext())
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      if (cnt < 2) {
+        alpha = 0;
+        beta = 1;
+      } else {
+        if (yVarianceCalculator.PopulationVariance.IsAlmost(0.0))
+          beta = 1;
+        else
+          beta = ytCovarianceEvaluator.Covariance / yVarianceCalculator.PopulationVariance;
+
+        alpha = tMeanCalculator.Mean - beta * yVarianceCalculator.Mean;
+      }
+    }
+
+    private static bool IsValidValue(double d) {
+      return !double.IsInfinity(d) && !double.IsNaN(d) && d > -1.0E07 && d < 1.0E07;  // don't consider very large or very small values for scaling
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Interfaces/IMultiObjectiveSymbolicRegressionEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Interfaces/IMultiObjectiveSymbolicRegressionEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Interfaces/IMultiObjectiveSymbolicRegressionEvaluator.cs	(revision 5026)
@@ -0,0 +1,34 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  public interface IMultiObjectiveSymbolicRegressionEvaluator : IMultiObjectiveEvaluator {
+    ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+    ILookupParameter<DataAnalysisProblemData> RegressionProblemDataParameter { get; }
+    IValueLookupParameter<IntValue> SamplesStartParameter { get; }
+    IValueLookupParameter<IntValue> SamplesEndParameter { get; }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Interfaces/ISymbolicRegressionEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Interfaces/ISymbolicRegressionEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Interfaces/ISymbolicRegressionEvaluator.cs	(revision 5026)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  public interface ISymbolicRegressionEvaluator : ISingleObjectiveEvaluator {
+    ILookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter { get; }
+    ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+    ILookupParameter<DataAnalysisProblemData> RegressionProblemDataParameter { get; }
+    IValueLookupParameter<IntValue> SamplesStartParameter { get; }
+    IValueLookupParameter<IntValue> SamplesEndParameter { get; }
+    IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { get; }
+    IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { get; }
+
+
+    double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree tree,
+          double lowerEstimationLimit, double upperEstimationLimit,
+          Dataset dataset, string targetVariable, IEnumerable<int> rows);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/MultiObjectiveSymbolicRegressionProblem.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/MultiObjectiveSymbolicRegressionProblem.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/MultiObjectiveSymbolicRegressionProblem.cs	(revision 5026)
@@ -0,0 +1,134 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("Symbolic Regression Problem (multi objective)", "Represents a multi objective symbolic regression problem.")]
+  [Creatable("Problems")]
+  [StorableClass]
+  public class MultiObjectiveSymbolicRegressionProblem : SymbolicRegressionProblemBase, IMultiObjectiveProblem {
+
+    #region Parameter Properties
+    public ValueParameter<BoolArray> MaximizationParameter {
+      get { return (ValueParameter<BoolArray>)Parameters["Maximization"]; }
+    }
+    IParameter IMultiObjectiveProblem.MaximizationParameter {
+      get { return MaximizationParameter; }
+    }
+    public new ValueParameter<IMultiObjectiveSymbolicRegressionEvaluator> EvaluatorParameter {
+      get { return (ValueParameter<IMultiObjectiveSymbolicRegressionEvaluator>)Parameters["Evaluator"]; }
+    }
+    IParameter IProblem.EvaluatorParameter {
+      get { return EvaluatorParameter; }
+    }
+    #endregion
+
+    #region Properties
+    public new IMultiObjectiveSymbolicRegressionEvaluator Evaluator {
+      get { return EvaluatorParameter.Value; }
+      set { EvaluatorParameter.Value = value; }
+    }
+    IMultiObjectiveEvaluator IMultiObjectiveProblem.Evaluator {
+      get { return EvaluatorParameter.Value; }
+    }
+    IEvaluator IProblem.Evaluator {
+      get { return EvaluatorParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected MultiObjectiveSymbolicRegressionProblem(bool deserializing) : base(deserializing) { }
+    protected MultiObjectiveSymbolicRegressionProblem(MultiObjectiveSymbolicRegressionProblem original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+    public MultiObjectiveSymbolicRegressionProblem()
+      : base() {
+      var evaluator = new MultiObjectiveSymbolicRegressionMeanSquaredErrorEvaluator();
+      Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false as the error of the regression model should be minimized.", new BoolArray(new bool[] { false, false })));
+      Parameters.Add(new ValueParameter<IMultiObjectiveSymbolicRegressionEvaluator>("Evaluator", "The operator which should be used to evaluate symbolic regression solutions.", evaluator));
+
+      evaluator.QualitiesParameter.ActualName = "TrainingRSquared/Size";
+
+      ParameterizeEvaluator();
+
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiObjectiveSymbolicRegressionProblem(this, cloner);
+    }
+
+    private void RegisterParameterValueEvents() {
+      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
+    }
+
+    private void RegisterParameterEvents() {
+    }
+
+    #region event handling
+    protected override void OnDataAnalysisProblemChanged(EventArgs e) {
+      base.OnDataAnalysisProblemChanged(e);
+      // paritions could be changed
+      ParameterizeEvaluator();
+    }
+    protected override void OnSolutionParameterNameChanged(EventArgs e) {
+      ParameterizeEvaluator();
+    }
+
+    protected override void OnEvaluatorChanged(EventArgs e) {
+      base.OnEvaluatorChanged(e);
+      ParameterizeEvaluator();
+      RaiseEvaluatorChanged(e);
+    }
+    #endregion
+
+    #region event handlers
+    private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
+      OnEvaluatorChanged(e);
+    }
+    #endregion
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserializationHook() {
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    private void ParameterizeEvaluator() {
+      Evaluator.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      Evaluator.RegressionProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
+      Evaluator.SamplesStartParameter.Value = TrainingSamplesStart;
+      Evaluator.SamplesEndParameter.Value = TrainingSamplesEnd;
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SimpleSymbolicRegressionEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SimpleSymbolicRegressionEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SimpleSymbolicRegressionEvaluator.cs	(revision 5026)
@@ -0,0 +1,141 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("SimpleSymbolicRegressionEvaluator", "Evaluates a symbolic regression solution and outputs a matrix of target and estimated values.")]
+  [StorableClass]
+  public sealed class SimpleSymbolicRegressionEvaluator : SingleSuccessorOperator {
+    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string FunctionTreeParameterName = "FunctionTree";
+    private const string RegressionProblemDataParameterName = "RegressionProblemData";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string ValuesParameterName = "Values";
+    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
+    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
+
+    #region ISymbolicRegressionEvaluator Members
+    public ILookupParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
+    }
+
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[FunctionTreeParameterName]; }
+    }
+
+    public ILookupParameter<DataAnalysisProblemData> RegressionProblemDataParameter {
+      get { return (ILookupParameter<DataAnalysisProblemData>)Parameters[RegressionProblemDataParameterName]; }
+    }
+
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }
+    }
+
+    public ILookupParameter<DoubleMatrix> ValuesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters[ValuesParameterName]; }
+    }
+
+    #endregion
+    #region properties
+    public ISymbolicExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
+      get { return SymbolicExpressionTreeInterpreterParameter.ActualValue; }
+    }
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public DataAnalysisProblemData RegressionProblemData {
+      get { return RegressionProblemDataParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    public DoubleValue UpperEstimationLimit {
+      get { return UpperEstimationLimitParameter.ActualValue; }
+    }
+    public DoubleValue LowerEstimationLimit {
+      get { return LowerEstimationLimitParameter.ActualValue; }
+    }
+
+    #endregion
+
+    [StorableConstructor]
+    private SimpleSymbolicRegressionEvaluator(bool deserializing) : base(deserializing) { }
+    private SimpleSymbolicRegressionEvaluator(SimpleSymbolicRegressionEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public SimpleSymbolicRegressionEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic expression tree."));
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(FunctionTreeParameterName, "The symbolic regression solution encoded as a symbolic expression tree."));
+      Parameters.Add(new LookupParameter<DataAnalysisProblemData>(RegressionProblemDataParameterName, "The problem data on which the symbolic regression solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start index of the dataset partition on which the symbolic regression solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end index of the dataset partition on which the symbolic regression solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic expression trees."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>(ValuesParameterName, "The matrix of target and estimated values as generated by the symbolic regression solution."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleSymbolicRegressionEvaluator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      Dataset dataset = RegressionProblemData.Dataset;
+      string targetVariable = RegressionProblemData.TargetVariable.Value;
+      ISymbolicExpressionTreeInterpreter interpreter = SymbolicExpressionTreeInterpreter;
+      SymbolicExpressionTree tree = SymbolicExpressionTree;
+      int start = SamplesStart.Value;
+      int end = SamplesEnd.Value;
+      double lowerEstimationLimit = LowerEstimationLimit != null ? LowerEstimationLimit.Value : double.NegativeInfinity;
+      double upperEstimationLimit = UpperEstimationLimit != null ? UpperEstimationLimit.Value : double.PositiveInfinity;
+      int targetVariableIndex = dataset.GetVariableIndex(targetVariable);
+      var estimatedValues = from x in interpreter.GetSymbolicExpressionTreeValues(tree, dataset, Enumerable.Range(start, end - start))
+                            let boundedX = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, x))
+                            select double.IsNaN(boundedX) ? upperEstimationLimit : boundedX;
+      var originalValues = from row in Enumerable.Range(start, end - start) select dataset[row, targetVariableIndex];
+      // NB: indexes must match SimpleEvaluator.ORIGINAL_INDEX and SimpleEvaluator.ESTIMATED_INDEX
+      ValuesParameter.ActualValue = new DoubleMatrix(MatrixExtensions<double>.Create(originalValues.ToArray(), estimatedValues.ToArray()));
+      return base.Apply();
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs	(revision 5026)
@@ -0,0 +1,84 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [StorableClass]
+  [Item("SymbolicRegressionModel", "A symbolic regression model represents an entity that provides estimated values based on input values.")]
+  public sealed class SymbolicRegressionModel : NamedItem, IDataAnalysisModel {
+    [StorableConstructor]
+    private SymbolicRegressionModel(bool deserializing) : base(deserializing) { }
+    private SymbolicRegressionModel(SymbolicRegressionModel original, Cloner cloner)
+      : base(original, cloner) {
+      tree = (SymbolicExpressionTree)cloner.Clone(original.tree);
+      interpreter = (ISymbolicExpressionTreeInterpreter)cloner.Clone(original.interpreter);
+      inputVariables = new List<string>(original.inputVariables);
+    }
+
+    public SymbolicRegressionModel(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree tree)
+      : base() {
+      this.tree = tree;
+      this.interpreter = interpreter;
+      this.inputVariables = tree.IterateNodesPrefix().OfType<VariableTreeNode>().Select(var => var.VariableName).Distinct().ToList();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionModel(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (inputVariables == null)
+        this.inputVariables = tree.IterateNodesPrefix().OfType<VariableTreeNode>().Select(var => var.VariableName).Distinct().ToList();
+    }
+
+    [Storable]
+    private SymbolicExpressionTree tree;
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return tree; }
+    }
+    [Storable]
+    private ISymbolicExpressionTreeInterpreter interpreter;
+    public ISymbolicExpressionTreeInterpreter Interpreter {
+      get { return interpreter; }
+    }
+    [Storable]
+    private List<string> inputVariables;
+    public IEnumerable<string> InputVariables {
+      get { return inputVariables.AsEnumerable(); }
+    }
+
+    public IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end) {
+      return GetEstimatedValues(problemData, Enumerable.Range(start, end - start));
+    }
+    public IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, IEnumerable<int> rows) {
+      return interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, rows);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs	(revision 5026)
@@ -0,0 +1,192 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [Item("Symbolic Regression Problem (single objective)", "Represents a single objective symbolic regression problem.")]
+  [Creatable("Problems")]
+  [StorableClass]
+  public sealed class SymbolicRegressionProblem : SymbolicRegressionProblemBase, ISingleObjectiveDataAnalysisProblem {
+
+    #region Parameter Properties
+    public ValueParameter<BoolValue> MaximizationParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    IParameter ISingleObjectiveProblem.MaximizationParameter {
+      get { return MaximizationParameter; }
+    }
+    public new ValueParameter<ISymbolicRegressionEvaluator> EvaluatorParameter {
+      get { return (ValueParameter<ISymbolicRegressionEvaluator>)Parameters["Evaluator"]; }
+    }
+    IParameter IProblem.EvaluatorParameter {
+      get { return EvaluatorParameter; }
+    }
+    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
+    IParameter ISingleObjectiveProblem.BestKnownQualityParameter {
+      get { return BestKnownQualityParameter; }
+    }
+    #endregion
+
+    #region Properties
+    public new ISymbolicRegressionEvaluator Evaluator {
+      get { return EvaluatorParameter.Value; }
+      set { EvaluatorParameter.Value = value; }
+    }
+    ISingleObjectiveEvaluator ISingleObjectiveProblem.Evaluator {
+      get { return EvaluatorParameter.Value; }
+    }
+    IEvaluator IProblem.Evaluator {
+      get { return EvaluatorParameter.Value; }
+    }
+    public DoubleValue BestKnownQuality {
+      get { return BestKnownQualityParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicRegressionProblem(bool deserializing) : base(deserializing) { }
+    private SymbolicRegressionProblem(SymbolicRegressionProblem original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    public SymbolicRegressionProblem()
+      : base() {
+      var evaluator = new SymbolicRegressionPearsonsRSquaredEvaluator();
+      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to false as the error of the regression model should be minimized.", (BoolValue)new BoolValue(true)));
+      Parameters.Add(new ValueParameter<ISymbolicRegressionEvaluator>("Evaluator", "The operator which should be used to evaluate symbolic regression solutions.", evaluator));
+      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The minimal error value that reached by symbolic regression solutions for the problem."));
+
+      evaluator.QualityParameter.ActualName = "TrainingPearsonR2";
+
+      InitializeOperators();
+      ParameterizeEvaluator();
+
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionProblem(this, cloner);
+    }
+
+    private void RegisterParameterValueEvents() {
+      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
+    }
+
+    private void RegisterParameterEvents() { }
+
+    #region event handling
+    protected override void OnDataAnalysisProblemChanged(EventArgs e) {
+      base.OnDataAnalysisProblemChanged(e);
+      BestKnownQualityParameter.Value = null;
+      // paritions could be changed
+      ParameterizeEvaluator();
+      ParameterizeAnalyzers();
+    }
+
+    protected override void OnSolutionParameterNameChanged(EventArgs e) {
+      base.OnSolutionParameterNameChanged(e);
+      ParameterizeEvaluator();
+      ParameterizeAnalyzers();
+    }
+
+    protected override void OnEvaluatorChanged(EventArgs e) {
+      base.OnEvaluatorChanged(e);
+      ParameterizeEvaluator();
+      ParameterizeAnalyzers();
+      RaiseEvaluatorChanged(e);
+    }
+    #endregion
+
+    #region event handlers
+    private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
+      OnEvaluatorChanged(e);
+    }
+    #endregion
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserializationHook() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code (remove with 3.4)
+      if (Operators == null || Operators.Count() == 0) InitializeOperators();
+      #endregion
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    private void InitializeOperators() {
+      AddOperator(new FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer());
+      ParameterizeAnalyzers();
+    }
+
+    private void ParameterizeEvaluator() {
+      Evaluator.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      Evaluator.RegressionProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
+      Evaluator.SamplesStartParameter.Value = TrainingSamplesStart;
+      Evaluator.SamplesEndParameter.Value = TrainingSamplesEnd;
+    }
+
+    private void ParameterizeAnalyzers() {
+      foreach (var analyzer in Analyzers) {
+        analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+        var fixedBestValidationSolutionAnalyzer = analyzer as FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer;
+        if (fixedBestValidationSolutionAnalyzer != null) {
+          fixedBestValidationSolutionAnalyzer.ProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
+          fixedBestValidationSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
+          fixedBestValidationSolutionAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
+          fixedBestValidationSolutionAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
+          fixedBestValidationSolutionAnalyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+          fixedBestValidationSolutionAnalyzer.ValidationSamplesStartParameter.Value = ValidationSamplesStart;
+          fixedBestValidationSolutionAnalyzer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd;
+          fixedBestValidationSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
+        }
+
+        var bestValidationSolutionAnalyzer = analyzer as ValidationBestScaledSymbolicRegressionSolutionAnalyzer;
+        if (bestValidationSolutionAnalyzer != null) {
+          bestValidationSolutionAnalyzer.ProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
+          bestValidationSolutionAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
+          bestValidationSolutionAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
+          bestValidationSolutionAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
+          bestValidationSolutionAnalyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+          bestValidationSolutionAnalyzer.ValidationSamplesStartParameter.Value = ValidationSamplesStart;
+          bestValidationSolutionAnalyzer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd;
+          bestValidationSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
+          bestValidationSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        }
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs	(revision 5026)
@@ -0,0 +1,363 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Interfaces;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  [StorableClass]
+  public abstract class SymbolicRegressionProblemBase : DataAnalysisProblem, IProblem {
+
+    #region Parameter Properties
+    public new ValueParameter<SymbolicExpressionTreeCreator> SolutionCreatorParameter {
+      get { return (ValueParameter<SymbolicExpressionTreeCreator>)Parameters["SolutionCreator"]; }
+    }
+    IParameter IProblem.SolutionCreatorParameter {
+      get { return SolutionCreatorParameter; }
+    }
+    public ValueParameter<DoubleValue> LowerEstimationLimitParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters["LowerEstimationLimit"]; }
+    }
+    public ValueParameter<DoubleValue> UpperEstimationLimitParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters["UpperEstimationLimit"]; }
+    }
+    public ValueParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (ValueParameter<ISymbolicExpressionTreeInterpreter>)Parameters["SymbolicExpressionTreeInterpreter"]; }
+    }
+    public ValueParameter<ISymbolicExpressionGrammar> FunctionTreeGrammarParameter {
+      get { return (ValueParameter<ISymbolicExpressionGrammar>)Parameters["FunctionTreeGrammar"]; }
+    }
+    public ValueParameter<IntValue> MaxExpressionLengthParameter {
+      get { return (ValueParameter<IntValue>)Parameters["MaxExpressionLength"]; }
+    }
+    public ValueParameter<IntValue> MaxExpressionDepthParameter {
+      get { return (ValueParameter<IntValue>)Parameters["MaxExpressionDepth"]; }
+    }
+    public ValueParameter<IntValue> MaxFunctionDefiningBranchesParameter {
+      get { return (ValueParameter<IntValue>)Parameters["MaxFunctionDefiningBranches"]; }
+    }
+    public ValueParameter<IntValue> MaxFunctionArgumentsParameter {
+      get { return (ValueParameter<IntValue>)Parameters["MaxFunctionArguments"]; }
+    }
+    #endregion
+
+    #region Properties
+    public IntValue MaxExpressionLength {
+      get { return MaxExpressionLengthParameter.Value; }
+      set { MaxExpressionLengthParameter.Value = value; }
+    }
+    public IntValue MaxExpressionDepth {
+      get { return MaxExpressionDepthParameter.Value; }
+      set { MaxExpressionDepthParameter.Value = value; }
+    }
+    public IntValue MaxFunctionDefiningBranches {
+      get { return MaxFunctionDefiningBranchesParameter.Value; }
+      set { MaxFunctionDefiningBranchesParameter.Value = value; }
+    }
+    public IntValue MaxFunctionArguments {
+      get { return MaxFunctionArgumentsParameter.Value; }
+      set { MaxFunctionArgumentsParameter.Value = value; }
+    }
+    public new SymbolicExpressionTreeCreator SolutionCreator {
+      get { return SolutionCreatorParameter.Value; }
+      set { SolutionCreatorParameter.Value = value; }
+    }
+    ISolutionCreator IProblem.SolutionCreator {
+      get { return SolutionCreatorParameter.Value; }
+    }
+    public ISymbolicExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
+      get { return SymbolicExpressionTreeInterpreterParameter.Value; }
+      set { SymbolicExpressionTreeInterpreterParameter.Value = value; }
+    }
+    public DoubleValue LowerEstimationLimit {
+      get { return LowerEstimationLimitParameter.Value; }
+      set { LowerEstimationLimitParameter.Value = value; }
+    }
+    public DoubleValue UpperEstimationLimit {
+      get { return UpperEstimationLimitParameter.Value; }
+      set { UpperEstimationLimitParameter.Value = value; }
+    }
+
+    public ISymbolicExpressionGrammar FunctionTreeGrammar {
+      get { return (ISymbolicExpressionGrammar)FunctionTreeGrammarParameter.Value; }
+      private set { FunctionTreeGrammarParameter.Value = value; }
+    }
+    public override IEnumerable<IOperator> Operators {
+      get { return operators; }
+    }
+    public IEnumerable<ISymbolicRegressionAnalyzer> Analyzers {
+      get { return operators.OfType<ISymbolicRegressionAnalyzer>(); }
+    }
+    public DoubleValue PunishmentFactor {
+      get { return new DoubleValue(10.0); }
+    }
+    public IntValue TrainingSamplesStart {
+      get { return new IntValue(DataAnalysisProblemData.TrainingIndizes.First()); }
+    }
+    public IntValue TrainingSamplesEnd {
+      get {
+        int endIndex = (int)(DataAnalysisProblemData.TrainingIndizes.Count() * (1.0 - DataAnalysisProblemData.ValidationPercentage.Value) - 1);
+        if (endIndex < 0) endIndex = 0;
+        return new IntValue(DataAnalysisProblemData.TrainingIndizes.ElementAt(endIndex));
+      }
+    }
+    public IntValue ValidationSamplesStart {
+      get { return TrainingSamplesEnd; }
+    }
+    public IntValue ValidationSamplesEnd {
+      get { return new IntValue(DataAnalysisProblemData.TrainingIndizes.Last() + 1); }
+    }
+    public IntValue TestSamplesStart {
+      get { return DataAnalysisProblemData.TestSamplesStart; }
+    }
+    public IntValue TestSamplesEnd {
+      get { return DataAnalysisProblemData.TestSamplesEnd; }
+    }
+    #endregion
+
+    [Storable]
+    private List<IOperator> operators;
+
+    [StorableConstructor]
+    protected SymbolicRegressionProblemBase(bool deserializing) : base(deserializing) { }
+    protected SymbolicRegressionProblemBase(SymbolicRegressionProblemBase original, Cloner cloner)
+      : base(original, cloner) {
+      operators = original.operators.Select(x => (IOperator)cloner.Clone(x)).ToList();
+      RegisterParameterValueEvents();
+      RegisterParameterEvents();
+    }
+    public SymbolicRegressionProblemBase()
+      : base() {
+      SymbolicExpressionTreeCreator creator = new ProbabilisticTreeCreator();
+      var grammar = new FullFunctionalExpressionGrammar();
+      var globalGrammar = new GlobalSymbolicExpressionGrammar(grammar);
+      var interpreter = new SimpleArithmeticExpressionInterpreter();
+      Parameters.Add(new ValueParameter<SymbolicExpressionTreeCreator>("SolutionCreator", "The operator which should be used to create new symbolic regression solutions.", creator));
+      Parameters.Add(new ValueParameter<ISymbolicExpressionTreeInterpreter>("SymbolicExpressionTreeInterpreter", "The interpreter that should be used to evaluate the symbolic expression tree.", interpreter));
+      Parameters.Add(new ValueParameter<DoubleValue>("LowerEstimationLimit", "The lower limit for the estimated value that can be returned by the symbolic regression model.", new DoubleValue(double.NegativeInfinity)));
+      Parameters.Add(new ValueParameter<DoubleValue>("UpperEstimationLimit", "The upper limit for the estimated value that can be returned by the symbolic regression model.", new DoubleValue(double.PositiveInfinity)));
+      Parameters.Add(new ValueParameter<ISymbolicExpressionGrammar>("FunctionTreeGrammar", "The grammar that should be used for symbolic regression models.", globalGrammar));
+      Parameters.Add(new ValueParameter<IntValue>("MaxExpressionLength", "Maximal length of the symbolic expression.", new IntValue(100)));
+      Parameters.Add(new ValueParameter<IntValue>("MaxExpressionDepth", "Maximal depth of the symbolic expression. The minimum depth needed for the algorithm is 3 because two levels are reserved for the ProgramRoot and the Start symbol.", new IntValue(10)));
+      Parameters.Add(new ValueParameter<IntValue>("MaxFunctionDefiningBranches", "Maximal number of automatically defined functions.", (IntValue)new IntValue(0).AsReadOnly()));
+      Parameters.Add(new ValueParameter<IntValue>("MaxFunctionArguments", "Maximal number of arguments of automatically defined functions.", (IntValue)new IntValue(0).AsReadOnly()));
+
+      creator.SymbolicExpressionTreeParameter.ActualName = "SymbolicRegressionModel";
+
+      ParameterizeSolutionCreator();
+
+      UpdateGrammar();
+      UpdateEstimationLimits();
+      InitializeOperators();
+      RegisterParameterValueEvents();
+      RegisterParameterEvents();
+    }
+
+    private void RegisterParameterEvents() {
+      MaxFunctionArgumentsParameter.ValueChanged += new EventHandler(ArchitectureParameter_ValueChanged);
+      MaxFunctionDefiningBranchesParameter.ValueChanged += new EventHandler(ArchitectureParameter_ValueChanged);
+      MaxExpressionDepthParameter.ValueChanged += new EventHandler(MaxExpressionDepthParameter_ValueChanged);
+      SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged);
+      FunctionTreeGrammarParameter.ValueChanged += new EventHandler(FunctionTreeGrammarParameter_ValueChanged);
+      SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);
+    }
+
+    private void RegisterParameterValueEvents() {
+      MaxFunctionArgumentsParameter.Value.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
+      MaxFunctionDefiningBranchesParameter.Value.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
+      MaxExpressionDepthParameter.Value.ValueChanged += new EventHandler(MaxExpressionDepthParameterValue_ValueChanged);
+    }
+
+    #region event handling
+    protected override void OnDataAnalysisProblemChanged(EventArgs e) {
+      base.OnDataAnalysisProblemChanged(e);
+      // paritions could be changed
+      ParameterizeAnalyzers();
+      // input variables could have been changed
+      UpdateGrammar();
+      // estimation limits have to be recalculated
+      UpdateEstimationLimits();
+    }
+    protected virtual void OnArchitectureParameterChanged(EventArgs e) {
+      UpdateGrammar();
+    }
+    protected virtual void OnGrammarChanged() { UpdateGrammar(); }
+    protected virtual void OnOperatorsChanged(EventArgs e) { RaiseOperatorsChanged(e); }
+    protected virtual void OnSolutionCreatorChanged(EventArgs e) {
+      SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);
+      ParameterizeSolutionCreator();
+      OnSolutionParameterNameChanged(e);
+      RaiseSolutionCreatorChanged(e);
+    }
+
+    protected virtual void OnSolutionParameterNameChanged(EventArgs e) {
+      ParameterizeAnalyzers();
+      ParameterizeOperators();
+    }
+
+    protected virtual void OnEvaluatorChanged(EventArgs e) {
+      RaiseEvaluatorChanged(e);
+    }
+    #endregion
+
+    #region event handlers
+    private void FunctionTreeGrammarParameter_ValueChanged(object sender, EventArgs e) {
+      if (!(FunctionTreeGrammar is GlobalSymbolicExpressionGrammar))
+        FunctionTreeGrammar = new GlobalSymbolicExpressionGrammar(FunctionTreeGrammar);
+      OnGrammarChanged();
+    }
+
+    private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
+      OnSolutionCreatorChanged(e);
+    }
+    private void SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged(object sender, EventArgs e) {
+      OnSolutionParameterNameChanged(e);
+    }
+    private void ArchitectureParameter_ValueChanged(object sender, EventArgs e) {
+      MaxFunctionArgumentsParameter.Value.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
+      MaxFunctionDefiningBranchesParameter.Value.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
+      OnArchitectureParameterChanged(e);
+    }
+    private void ArchitectureParameterValue_ValueChanged(object sender, EventArgs e) {
+      OnArchitectureParameterChanged(e);
+    }
+
+    private void MaxExpressionDepthParameter_ValueChanged(object sender, EventArgs e) {
+      MaxExpressionDepthParameterValue_ValueChanged(sender, e);
+      MaxExpressionDepthParameter.Value.ValueChanged += MaxExpressionDepthParameterValue_ValueChanged;
+    }
+    private void MaxExpressionDepthParameterValue_ValueChanged(object sender, EventArgs e) {
+      if (MaxExpressionDepth != null && MaxExpressionDepth.Value < 3)
+        MaxExpressionDepth.Value = 3;
+    }
+    #endregion
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserializationHook() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code (remove with 3.4)
+      if (operators == null) InitializeOperators();
+      #endregion
+      RegisterParameterValueEvents();
+      RegisterParameterEvents();
+    }
+
+    protected void AddOperator(IOperator op) {
+      operators.Add(op);
+    }
+
+    private void UpdateGrammar() {
+      foreach (var varSymbol in FunctionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable>()) {
+        varSymbol.VariableNames = DataAnalysisProblemData.InputVariables.CheckedItems.Select(x => x.Value.Value);
+      }
+      var globalGrammar = FunctionTreeGrammar as GlobalSymbolicExpressionGrammar;
+      if (globalGrammar != null) {
+        globalGrammar.MaxFunctionArguments = MaxFunctionArguments.Value;
+        globalGrammar.MaxFunctionDefinitions = MaxFunctionDefiningBranches.Value;
+      }
+    }
+
+    private void UpdateEstimationLimits() {
+      if (TrainingSamplesStart.Value < TrainingSamplesEnd.Value &&
+        DataAnalysisProblemData.Dataset.VariableNames.Contains(DataAnalysisProblemData.TargetVariable.Value)) {
+        var targetValues = DataAnalysisProblemData.Dataset.GetVariableValues(DataAnalysisProblemData.TargetVariable.Value, TrainingSamplesStart.Value, TrainingSamplesEnd.Value);
+        var mean = targetValues.Average();
+        var range = targetValues.Max() - targetValues.Min();
+        UpperEstimationLimit = new DoubleValue(mean + PunishmentFactor.Value * range);
+        LowerEstimationLimit = new DoubleValue(mean - PunishmentFactor.Value * range);
+      }
+    }
+
+    private void InitializeOperators() {
+      operators = new List<IOperator>();
+      operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>().OfType<IOperator>());
+      operators.Add(new SymbolicRegressionVariableFrequencyAnalyzer());
+      operators.Add(new MinAverageMaxSymbolicExpressionTreeSizeAnalyzer());
+      operators.Add(new SymbolicRegressionModelQualityAnalyzer());
+      ParameterizeOperators();
+      ParameterizeAnalyzers();
+    }
+
+    private void ParameterizeSolutionCreator() {
+      SolutionCreator.SymbolicExpressionGrammarParameter.ActualName = FunctionTreeGrammarParameter.Name;
+      SolutionCreator.MaxTreeHeightParameter.ActualName = MaxExpressionDepthParameter.Name;
+      SolutionCreator.MaxTreeSizeParameter.ActualName = MaxExpressionLengthParameter.Name;
+      SolutionCreator.MaxFunctionArgumentsParameter.ActualName = MaxFunctionArgumentsParameter.Name;
+      SolutionCreator.MaxFunctionDefinitionsParameter.ActualName = MaxFunctionDefiningBranchesParameter.Name;
+    }
+
+    private void ParameterizeAnalyzers() {
+      foreach (var analyzer in Analyzers) {
+        analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+        var symbolicRegressionModelQualityAnalyzer = analyzer as SymbolicRegressionModelQualityAnalyzer;
+        if (symbolicRegressionModelQualityAnalyzer != null) {
+          symbolicRegressionModelQualityAnalyzer.ProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
+          symbolicRegressionModelQualityAnalyzer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;
+          symbolicRegressionModelQualityAnalyzer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;
+          symbolicRegressionModelQualityAnalyzer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
+          symbolicRegressionModelQualityAnalyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+        }
+        var varFreqAnalyzer = analyzer as SymbolicRegressionVariableFrequencyAnalyzer;
+        if (varFreqAnalyzer != null) {
+          varFreqAnalyzer.ProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
+        }
+      }
+      foreach (ISymbolicExpressionTreeAnalyzer analyzer in Operators.OfType<ISymbolicExpressionTreeAnalyzer>()) {
+        analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+    }
+
+    private void ParameterizeOperators() {
+      foreach (ISymbolicExpressionTreeOperator op in Operators.OfType<ISymbolicExpressionTreeOperator>()) {
+        op.MaxTreeHeightParameter.ActualName = MaxExpressionDepthParameter.Name;
+        op.MaxTreeSizeParameter.ActualName = MaxExpressionLengthParameter.Name;
+        op.SymbolicExpressionGrammarParameter.ActualName = FunctionTreeGrammarParameter.Name;
+      }
+      foreach (ISymbolicExpressionTreeCrossover op in Operators.OfType<ISymbolicExpressionTreeCrossover>()) {
+        op.ParentsParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+        op.ChildParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+      foreach (ISymbolicExpressionTreeManipulator op in Operators.OfType<ISymbolicExpressionTreeManipulator>()) {
+        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+      foreach (ISymbolicExpressionTreeArchitectureManipulator op in Operators.OfType<ISymbolicExpressionTreeArchitectureManipulator>()) {
+        op.MaxFunctionArgumentsParameter.ActualName = MaxFunctionArgumentsParameter.Name;
+        op.MaxFunctionDefinitionsParameter.ActualName = MaxFunctionDefiningBranchesParameter.Name;
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs	(revision 5026)
@@ -0,0 +1,108 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Drawing;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
+  /// <summary>
+  /// Represents a solution for a symbolic regression problem which can be visualized in the GUI.
+  /// </summary>
+  [Item("SymbolicRegressionSolution", "Represents a solution for a symbolic regression problem which can be visualized in the GUI.")]
+  [StorableClass]
+  public class SymbolicRegressionSolution : DataAnalysisSolution {
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; }
+    }
+
+    public new SymbolicRegressionModel Model {
+      get { return (SymbolicRegressionModel)base.Model; }
+      set { base.Model = value; }
+    }
+
+    protected List<double> estimatedValues;
+    public override IEnumerable<double> EstimatedValues {
+      get {
+        if (estimatedValues == null) RecalculateEstimatedValues();
+        return estimatedValues;
+      }
+    }
+
+    public override IEnumerable<double> EstimatedTrainingValues {
+      get { return GetEstimatedValues(ProblemData.TrainingIndizes); }
+    }
+
+    public override IEnumerable<double> EstimatedTestValues {
+      get { return GetEstimatedValues(ProblemData.TestIndizes); }
+    }
+
+    [StorableConstructor]
+    protected SymbolicRegressionSolution(bool deserializing) : base(deserializing) { }
+    protected SymbolicRegressionSolution(SymbolicRegressionSolution original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicRegressionSolution(DataAnalysisProblemData problemData, SymbolicRegressionModel model, double lowerEstimationLimit, double upperEstimationLimit)
+      : base(problemData, lowerEstimationLimit, upperEstimationLimit) {
+      this.Model = model;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionSolution(this, cloner);
+    }
+
+    protected override void RecalculateEstimatedValues() {
+      int minLag = GetMinimumLagFromTree(Model.SymbolicExpressionTree.Root);
+      IEnumerable<double> calculatedValues =
+          from x in Model.GetEstimatedValues(ProblemData, 0 - minLag, ProblemData.Dataset.Rows)
+          let boundedX = Math.Min(UpperEstimationLimit, Math.Max(LowerEstimationLimit, x))
+          select double.IsNaN(boundedX) ? UpperEstimationLimit : boundedX;
+      estimatedValues = Enumerable.Repeat(UpperEstimationLimit, Math.Abs(minLag)).Concat(calculatedValues).ToList();
+      OnEstimatedValuesChanged();
+    }
+
+    public virtual IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows) {
+      if (estimatedValues == null) RecalculateEstimatedValues();
+      foreach (int row in rows)
+        yield return estimatedValues[row];
+    }
+
+    protected int GetMinimumLagFromTree(SymbolicExpressionTreeNode node) {
+      if (node == null) return 0;
+      int lag = 0;
+
+      var laggedTreeNode = node as ILaggedTreeNode;
+      if (laggedTreeNode != null) lag += laggedTreeNode.Lag;
+
+      int subtreeLag = 0;
+      foreach (var subtree in node.SubTrees) {
+        subtreeLag = Math.Min(subtreeLag, GetMinimumLagFromTree(subtree));
+      }
+      return lag + subtreeLag;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.Designer.cs	(revision 5026)
@@ -0,0 +1,100 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class DataAnalysisProblemDataView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.importButton = new System.Windows.Forms.Button();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // parameterCollectionView
+      // 
+      this.parameterCollectionView.Size = new System.Drawing.Size(585, 366);
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Size = new System.Drawing.Size(513, 20);
+      // 
+      // descriptionTextBox
+      // 
+      this.descriptionTextBox.Size = new System.Drawing.Size(513, 20);
+      // 
+      // importButton
+      // 
+      this.importButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.importButton.Location = new System.Drawing.Point(6, 424);
+      this.importButton.Name = "importButton";
+      this.importButton.Size = new System.Drawing.Size(579, 23);
+      this.importButton.TabIndex = 4;
+      this.importButton.Text = "Import from CSV file";
+      this.importButton.UseVisualStyleBackColor = true;
+      this.importButton.Click += new System.EventHandler(this.importButton_Click);
+      // 
+      // DataAnalysisProblemDataView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.importButton);
+      this.Name = "DataAnalysisProblemDataView";
+      this.Size = new System.Drawing.Size(588, 450);
+      this.Controls.SetChildIndex(this.parameterCollectionView, 0);
+      this.Controls.SetChildIndex(this.importButton, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.descriptionLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Button importButton;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.cs	(revision 5026)
@@ -0,0 +1,62 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Data-Analysis Problem View")]
+  [Content(typeof(DataAnalysisProblemData), true)]
+  public partial class DataAnalysisProblemDataView : ParameterizedNamedItemView {
+    private OpenFileDialog openFileDialog;
+    public new DataAnalysisProblemData Content {
+      get { return (DataAnalysisProblemData)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public DataAnalysisProblemDataView() {
+      InitializeComponent();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      importButton.Enabled = Enabled && !ReadOnly && !Locked;
+    }
+
+    private void importButton_Click(object sender, EventArgs e) {
+      if (openFileDialog == null) openFileDialog = new OpenFileDialog();
+
+      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
+        try {
+          Content.ImportFromFile(openFileDialog.FileName);
+        }
+        catch (Exception ex) {
+          ErrorHandling.ShowErrorDialog(this, ex);
+        }
+      }
+    }
+
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.Designer.cs	(revision 5026)
@@ -0,0 +1,143 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class DataAnalysisSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.dataTabPage = new System.Windows.Forms.TabPage();
+      this.dataViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.modelTabPage = new System.Windows.Forms.TabPage();
+      this.modelViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.tabControl = new System.Windows.Forms.TabControl();
+      this.dataTabPage.SuspendLayout();
+      this.modelTabPage.SuspendLayout();
+      this.tabControl.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // dataTabPage
+      // 
+      this.dataTabPage.Controls.Add(this.dataViewHost);
+      this.dataTabPage.Location = new System.Drawing.Point(4, 22);
+      this.dataTabPage.Name = "dataTabPage";
+      this.dataTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.dataTabPage.Size = new System.Drawing.Size(372, 236);
+      this.dataTabPage.TabIndex = 1;
+      this.dataTabPage.Text = "Data";
+      this.dataTabPage.UseVisualStyleBackColor = true;
+      // 
+      // dataViewHost
+      // 
+      this.dataViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.dataViewHost.Caption = "DataAnalysisSolution Data View";
+      this.dataViewHost.Content = null;
+      this.dataViewHost.Enabled = false;
+      this.dataViewHost.Location = new System.Drawing.Point(6, 6);
+      this.dataViewHost.Name = "dataViewHost";
+      this.dataViewHost.ReadOnly = false;
+      this.dataViewHost.Size = new System.Drawing.Size(360, 224);
+      this.dataViewHost.TabIndex = 2;
+      this.dataViewHost.ViewType = null;
+      // 
+      // modelTabPage
+      // 
+      this.modelTabPage.Controls.Add(this.modelViewHost);
+      this.modelTabPage.Location = new System.Drawing.Point(4, 22);
+      this.modelTabPage.Name = "modelTabPage";
+      this.modelTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.modelTabPage.Size = new System.Drawing.Size(372, 236);
+      this.modelTabPage.TabIndex = 0;
+      this.modelTabPage.Text = "Model";
+      this.modelTabPage.UseVisualStyleBackColor = true;
+      // 
+      // modelViewHost
+      // 
+      this.modelViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.modelViewHost.Caption = "DataAnalysisSolution Model View";
+      this.modelViewHost.Content = null;
+      this.modelViewHost.Enabled = false;
+      this.modelViewHost.Location = new System.Drawing.Point(6, 6);
+      this.modelViewHost.Name = "modelViewHost";
+      this.modelViewHost.ReadOnly = false;
+      this.modelViewHost.Size = new System.Drawing.Size(360, 224);
+      this.modelViewHost.TabIndex = 1;
+      this.modelViewHost.ViewType = null;
+      // 
+      // tabControl
+      // 
+      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.tabControl.Controls.Add(this.modelTabPage);
+      this.tabControl.Controls.Add(this.dataTabPage);
+      this.tabControl.Location = new System.Drawing.Point(3, 3);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(380, 262);
+      this.tabControl.TabIndex = 1;
+      // 
+      // DataAnalysisSolutionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.tabControl);
+      this.Name = "DataAnalysisSolutionView";
+      this.Size = new System.Drawing.Size(386, 268);
+      this.dataTabPage.ResumeLayout(false);
+      this.modelTabPage.ResumeLayout(false);
+      this.tabControl.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.TabControl tabControl;
+    protected System.Windows.Forms.TabPage dataTabPage;
+    protected System.Windows.Forms.TabPage modelTabPage;
+    protected HeuristicLab.MainForm.WindowsForms.ViewHost dataViewHost;
+    protected HeuristicLab.MainForm.WindowsForms.ViewHost modelViewHost;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.cs	(revision 5026)
@@ -0,0 +1,69 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Data Analysis Solution View")]
+  [Content(typeof(DataAnalysisSolution))]
+  public partial class DataAnalysisSolutionView : AsynchronousContentView {
+    public DataAnalysisSolutionView() {
+      InitializeComponent();
+    }
+
+    public new DataAnalysisSolution Content {
+      get { return (DataAnalysisSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null) {
+        modelViewHost.Content = Content.Model;
+        dataViewHost.Content = Content.ProblemData;
+      } else {
+        modelViewHost.Content = null;
+        dataViewHost.Content = null;
+      }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ModelChanged += new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+
+    private void Content_ModelChanged(object sender, EventArgs e) {
+      modelViewHost.Content = Content.Model;
+    }
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      dataViewHost.Content = Content.ProblemData;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.Designer.cs	(revision 5026)
@@ -0,0 +1,62 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class EstimatedValuesView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.SuspendLayout();
+      // 
+      // EstimatedValuesView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Name = "EstimatedValuesView";
+      this.Size = new System.Drawing.Size(310, 285);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs	(revision 5026)
@@ -0,0 +1,105 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Data;
+using HeuristicLab.Data.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Estimated Values View")]
+  [Content(typeof(DataAnalysisSolution))]
+  public partial class EstimatedValuesView : AsynchronousContentView {
+    private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable";
+    private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues";
+
+    public new DataAnalysisSolution Content {
+      get { return (DataAnalysisSolution)base.Content; }
+      set {
+        base.Content = value;
+      }
+    }
+
+    private StringConvertibleMatrixView matrixView;
+
+    public EstimatedValuesView()
+      : base() {
+      InitializeComponent();
+      matrixView = new StringConvertibleMatrixView();
+      matrixView.ShowRowsAndColumnsTextBox = false;
+      matrixView.ShowStatisticalInformation = false;
+      matrixView.Dock = DockStyle.Fill;
+      this.Controls.Add(matrixView);
+    }
+
+    #region events
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+
+    void Content_ProblemDataChanged(object sender, EventArgs e) {
+      OnContentChanged();
+    }
+
+    void Content_EstimatedValuesChanged(object sender, EventArgs e) {
+      OnContentChanged();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateEstimatedValues();
+    }
+
+    private void UpdateEstimatedValues() {
+      if (InvokeRequired) Invoke((Action)UpdateEstimatedValues);
+      else {
+        DoubleMatrix matrix = null;
+        if (Content != null) {
+          double[,] values = new double[Content.ProblemData.Dataset.Rows, 4];
+
+          double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value);
+          double[] estimated = Content.EstimatedValues.ToArray();
+          for (int row = 0; row < target.Length; row++) {
+            values[row, 0] = target[row];
+            values[row, 1] = estimated[row];
+            values[row, 2] = estimated[row] - target[row];
+            values[row, 3] = estimated[row] / target[row] - 1;
+          }
+
+          matrix = new DoubleMatrix(values);
+          matrix.ColumnNames = new string[] { "Original", "Estimated", "Error", "Rel. Error" };
+        }
+        matrixView.Content = matrix;
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj	(revision 5026)
@@ -0,0 +1,314 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{799B0B38-E384-4A17-A73C-F211EB854592}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Views-3.3</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-3.1.0, Version=3.1.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\ALGLIB-3.1.0.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.ALGLIB-3.1.0, Version=2.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.ALGLIB-3.1.0.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimizer-3.3">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimizer-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Windows.Forms.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="HeuristicLabProblemsDataAnalysisViewsPlugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.frame" />
+    <Compile Include="DataAnalysisSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="DataAnalysisSolutionView.Designer.cs">
+      <DependentUpon>DataAnalysisSolutionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="ResultsView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="ResultsView.Designer.cs">
+      <DependentUpon>ResultsView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="RunCollectionVariableImpactView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectionVariableImpactView.Designer.cs">
+      <DependentUpon>RunCollectionVariableImpactView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SupportVectorRegressionSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SupportVectorRegressionSolutionView.Designer.cs">
+      <DependentUpon>SupportVectorRegressionSolutionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SupportVectorMachineModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SupportVectorMachineModelView.Designer.cs">
+      <DependentUpon>SupportVectorMachineModelView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="EstimatedValuesView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="EstimatedValuesView.Designer.cs">
+      <DependentUpon>EstimatedValuesView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="DataAnalysisProblemDataView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="DataAnalysisProblemDataView.Designer.cs">
+      <DependentUpon>DataAnalysisProblemDataView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="HeuristicLabProblemsDataAnalysisViewsPlugin.cs" />
+    <Compile Include="LineChartView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="LineChartView.Designer.cs">
+      <DependentUpon>LineChartView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ScatterPlotView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="ScatterPlotView.Designer.cs">
+      <DependentUpon>ScatterPlotView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbolic\InteractiveSymbolicRegressionSolutionSimplifierView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbolic\InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs">
+      <DependentUpon>InteractiveSymbolicRegressionSolutionSimplifierView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbolic\SimplifiedSymbolicExpressionModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbolic\SimplifiedSymbolicExpressionModelView.designer.cs">
+      <DependentUpon>SimplifiedSymbolicExpressionModelView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbolic\SymbolicExpressionModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbolic\SymbolicExpressionModelView.designer.cs">
+      <DependentUpon>SymbolicExpressionModelView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbolic\SymbolicRegressionSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbolic\SymbolicRegressionSolutionView.Designer.cs">
+      <DependentUpon>SymbolicRegressionSolutionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbolic\Symbols\ConstantView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbolic\Symbols\ConstantView.Designer.cs">
+      <DependentUpon>ConstantView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbolic\Symbols\LaggedVariableView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbolic\Symbols\LaggedVariableView.Designer.cs">
+      <DependentUpon>LaggedVariableView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbolic\Symbols\VariableView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbolic\Symbols\VariableView.Designer.cs">
+      <DependentUpon>VariableView.cs</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj">
+      <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Regression\3.3\HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj">
+      <Project>{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Regression-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.3\HeuristicLab.Problems.DataAnalysis-3.3.csproj">
+      <Project>{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisViewsPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisViewsPlugin.cs"</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLabProblemsDataAnalysisViewsPlugin.cs.frame
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLabProblemsDataAnalysisViewsPlugin.cs.frame	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLabProblemsDataAnalysisViewsPlugin.cs.frame	(revision 5026)
@@ -0,0 +1,47 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [Plugin("HeuristicLab.Problems.DataAnalysis.Views", "3.3.2.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis.Views-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.ALGLIB","3.1.0.0")]
+  [PluginDependency("HeuristicLab.Collections", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Common", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Core", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Core.Views", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Data", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Data.Views", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.MainForm", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Regression", "3.3.2.0")]
+  [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")]
+  public class HeuristicLabProblemsDataAnalysisViewsPlugin : PluginBase {
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.Designer.cs	(revision 5026)
@@ -0,0 +1,84 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class LineChartView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // chart
+      // 
+      chartArea1.Name = "ChartArea";
+      this.chart.ChartAreas.Add(chartArea1);
+      this.chart.Dock = System.Windows.Forms.DockStyle.Fill;
+      legend1.Alignment = System.Drawing.StringAlignment.Center;
+      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
+      legend1.Name = "Default";
+      this.chart.Legends.Add(legend1);
+      this.chart.Location = new System.Drawing.Point(0, 0);
+      this.chart.Name = "chart";
+      this.chart.Size = new System.Drawing.Size(358, 225);
+      this.chart.TabIndex = 0;
+      this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Chart_MouseDoubleClick);
+      // 
+      // LineChartView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.chart);
+      this.Name = "LineChartView";
+      this.Size = new System.Drawing.Size(358, 225);
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.cs	(revision 5026)
@@ -0,0 +1,155 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Line Chart View")]
+  [Content(typeof(DataAnalysisSolution))]
+  public partial class LineChartView : AsynchronousContentView {
+    private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable";
+    private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues";
+
+    public new DataAnalysisSolution Content {
+      get { return (DataAnalysisSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public LineChartView()
+      : base() {
+      InitializeComponent();
+      //configure axis
+      this.chart.CustomizeAllChartAreas();
+      this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
+      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
+      this.chart.ChartAreas[0].CursorX.Interval = 1;
+
+      this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
+      this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
+      this.chart.ChartAreas[0].CursorY.Interval = 0;
+    }
+
+    private void RedrawChart() {
+      this.chart.Series.Clear();
+      if (Content != null) {
+        this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME);
+        this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable.Value;
+        this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
+        this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value));
+        this.UpdateStripLines();
+
+        this.chart.Series.Add(ESTIMATEDVALUES_SERIES_NAME);
+        this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].LegendText = Content.ItemName;
+        this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].ChartType = SeriesChartType.FastLine;
+        this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Points.DataBindY(Content.EstimatedValues.ToArray());
+        this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Tag = Content;
+        UpdateCursorInterval();
+      }
+    }
+
+    private void UpdateCursorInterval() {
+      var estimatedValues = this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
+      var targetValues = this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
+      double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min();
+      double targetValuesRange = targetValues.Max() - targetValues.Min();
+      double interestingValuesRange = Math.Min(Math.Max(targetValuesRange, 1.0), Math.Max(estimatedValuesRange, 1.0));
+      double digits = (int)Math.Log10(interestingValuesRange) - 3;
+      double yZoomInterval = Math.Max(Math.Pow(10, digits), 10E-5);
+      this.chart.ChartAreas[0].CursorY.Interval = yZoomInterval;
+    }
+
+    #region events
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      RedrawChart();
+    }
+
+    private void Content_EstimatedValuesChanged(object sender, EventArgs e) {
+      UpdateEstimatedValuesLineChart();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      RedrawChart();
+    }
+
+    private void UpdateEstimatedValuesLineChart() {
+      if (InvokeRequired) Invoke((Action)UpdateEstimatedValuesLineChart);
+      else {
+        if (this.chart.Series.Count > 0) {
+          Series s = this.chart.Series.SingleOrDefault(x => x.Tag == Content);
+          if (s != null) {
+            s.Points.DataBindY(Content.EstimatedValues.ToArray());
+            s.LegendText = Content.ItemName;
+            this.UpdateStripLines();
+            UpdateCursorInterval();
+          }
+        }
+      }
+    }
+
+    private void Chart_MouseDoubleClick(object sender, MouseEventArgs e) {
+      HitTestResult result = chart.HitTest(e.X, e.Y);
+      if (result.ChartArea != null && (result.ChartElementType == ChartElementType.PlottingArea ||
+                                       result.ChartElementType == ChartElementType.Gridlines) ||
+                                       result.ChartElementType == ChartElementType.StripLines) {
+        foreach (var axis in result.ChartArea.Axes)
+          axis.ScaleView.ZoomReset(int.MaxValue);
+      }
+    }
+    #endregion
+
+    private void UpdateStripLines() {
+      this.chart.ChartAreas[0].AxisX.StripLines.Clear();
+      this.CreateAndAddStripLine("Training", Color.FromArgb(20, Color.Green),
+        Content.ProblemData.TrainingSamplesStart.Value,
+        Content.ProblemData.TrainingSamplesEnd.Value);
+      this.CreateAndAddStripLine("Test", Color.FromArgb(20, Color.Red),
+        Content.ProblemData.TestSamplesStart.Value,
+        Content.ProblemData.TestSamplesEnd.Value);
+    }
+
+    private void CreateAndAddStripLine(string title, Color c, int start, int end) {
+      StripLine stripLine = new StripLine();
+      stripLine.BackColor = c;
+      stripLine.Text = title;
+      stripLine.Font = new Font("Times New Roman", 12, FontStyle.Bold);
+      stripLine.StripWidth = end - start;
+      stripLine.IntervalOffset = start;
+      this.chart.ChartAreas[0].AxisX.StripLines.Add(stripLine);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Properties/AssemblyInfo.frame	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Properties/AssemblyInfo.frame	(revision 5026)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Views")]
+[assembly: AssemblyDescription("Views for HeuristicLab data analysis problem classes ")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2010 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("02BF0343-EAFB-445c-858C-E0038FAC0219")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.2.$WCREV$")]
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ResultsView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ResultsView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ResultsView.Designer.cs	(revision 5026)
@@ -0,0 +1,75 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class ResultsView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.matrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
+      this.SuspendLayout();
+      // 
+      // matrixView
+      // 
+      this.matrixView.Caption = "StringConvertibleMatrix View";
+      this.matrixView.Content = null;
+      this.matrixView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.matrixView.Location = new System.Drawing.Point(0, 0);
+      this.matrixView.Name = "matrixView";
+      this.matrixView.ReadOnly = true;
+      this.matrixView.Size = new System.Drawing.Size(494, 317);
+      this.matrixView.TabIndex = 0;
+      // 
+      // ResultsView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.matrixView);
+      this.Name = "ResultsView";
+      this.Size = new System.Drawing.Size(494, 317);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private HeuristicLab.Data.Views.StringConvertibleMatrixView matrixView;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ResultsView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ResultsView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ResultsView.cs	(revision 5026)
@@ -0,0 +1,93 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.Data;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [Content(typeof(DataAnalysisSolution), false)]
+  [View("Results View")]
+  public partial class ResultsView : AsynchronousContentView {
+    private List<string> rowNames = new List<string>() { "Mean squared error", "Pearson's R²", "Average relative error" };
+    private List<string> columnNames = new List<string>() { "Training", "Test" };
+
+    public ResultsView() {
+      InitializeComponent();
+    }
+
+    public new DataAnalysisSolution Content {
+      get { return (DataAnalysisSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ModelChanged += new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+      Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+      Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
+    }
+
+    private void Content_ModelChanged(object sender, EventArgs e) {
+      UpdateView();
+    }
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      UpdateView();
+    }
+    private void Content_EstimatedValuesChanged(object sender, EventArgs e) {
+      UpdateView();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateView();
+    }
+    private void UpdateView() {
+      if (Content != null) {
+        DoubleMatrix matrix = new DoubleMatrix(rowNames.Count, columnNames.Count);
+        matrix.RowNames = rowNames;
+        matrix.ColumnNames = columnNames;
+        matrix.SortableView = false;
+
+        IEnumerable<double> originalTrainingValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(Content.ProblemData.TargetVariable.Value, Content.ProblemData.TrainingIndizes);
+        IEnumerable<double> originalTestValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(Content.ProblemData.TargetVariable.Value, Content.ProblemData.TestIndizes);
+        matrix[0, 0] = SimpleMSEEvaluator.Calculate(originalTrainingValues, Content.EstimatedTrainingValues);
+        matrix[0, 1] = SimpleMSEEvaluator.Calculate(originalTestValues, Content.EstimatedTestValues);
+        matrix[1, 0] = SimpleRSquaredEvaluator.Calculate(originalTrainingValues, Content.EstimatedTrainingValues);
+        matrix[1, 1] = SimpleRSquaredEvaluator.Calculate(originalTestValues, Content.EstimatedTestValues);
+        matrix[2, 0] = SimpleMeanAbsolutePercentageErrorEvaluator.Calculate(originalTrainingValues, Content.EstimatedTrainingValues);
+        matrix[2, 1] = SimpleMeanAbsolutePercentageErrorEvaluator.Calculate(originalTestValues, Content.EstimatedTestValues);
+
+        matrixView.Content = matrix;
+      } else
+        matrixView.Content = null;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.Designer.cs	(revision 5026)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class RunCollectionVariableImpactView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.matrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
+      this.SuspendLayout();
+      // 
+      // matrixView
+      // 
+      this.matrixView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.matrixView.Caption = "StringConvertibleMatrix View";
+      this.matrixView.Content = null;
+      this.matrixView.Location = new System.Drawing.Point(3, 3);
+      this.matrixView.Name = "matrixView";
+      this.matrixView.ReadOnly = true;
+      this.matrixView.Size = new System.Drawing.Size(303, 229);
+      this.matrixView.TabIndex = 0;
+      // 
+      // RunCollectionVariableImpactView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.matrixView);
+      this.Name = "RunCollectionVariableImpactView";
+      this.Size = new System.Drawing.Size(309, 235);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private HeuristicLab.Data.Views.StringConvertibleMatrixView matrixView;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.cs	(revision 5026)
@@ -0,0 +1,217 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Data;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [Content(typeof(RunCollection), false)]
+  [View("RunCollection Variable Impact View")]
+  public sealed partial class RunCollectionVariableImpactView : AsynchronousContentView {
+    private const string variableImpactResultName = "Integrated variable frequencies";
+    public RunCollectionVariableImpactView() {
+      InitializeComponent();
+    }
+
+    public new RunCollection Content {
+      get { return (RunCollection)base.Content; }
+      set { base.Content = value; }
+    }
+
+    #region events
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged);
+      Content.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
+      Content.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
+      Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
+      RegisterRunEvents(Content);
+    }
+    protected override void DeregisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged);
+      Content.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded);
+      Content.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
+      Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
+      DeregisterRunEvents(Content);
+    }
+    private void RegisterRunEvents(IEnumerable<IRun> runs) {
+      foreach (IRun run in runs)
+        run.Changed += new EventHandler(Run_Changed);
+    }
+    private void DeregisterRunEvents(IEnumerable<IRun> runs) {
+      foreach (IRun run in runs)
+        run.Changed -= new EventHandler(Run_Changed);
+    }
+    private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
+      RegisterRunEvents(e.Items);
+      UpdateData();
+    }
+    private void Content_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
+      DeregisterRunEvents(e.Items);
+      UpdateData();
+    }
+    private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) {
+      DeregisterRunEvents(e.OldItems);
+      RegisterRunEvents(e.Items);
+      UpdateData();
+    }
+    private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) {
+      if (!Content.UpdateOfRunsInProgress) UpdateData();
+    }
+    private void Run_Changed(object sender, EventArgs e) {
+      if (!Content.UpdateOfRunsInProgress) UpdateData();
+    }
+    #endregion
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      this.UpdateData();
+    }
+
+    private void UpdateData() {
+      matrixView.Content = CalculateVariableImpactMatrix();
+    }
+
+    private DoubleMatrix CalculateVariableImpactMatrix() {
+      DoubleMatrix matrix = null;
+      if (Content != null) {
+        List<IRun> runsWithVariables = Content.Where(r => r.Visible && r.Results.ContainsKey(variableImpactResultName)).ToList();
+        IEnumerable<DoubleMatrix> allVariableImpacts = (from run in runsWithVariables
+                                                        select run.Results[variableImpactResultName]).Cast<DoubleMatrix>();
+        IEnumerable<string> variableNames = (from variableImpact in allVariableImpacts
+                                             from variableName in variableImpact.RowNames
+                                             select variableName)
+                                            .Distinct();
+        // filter variableNames: only include names that have at least one non-zero value in a run
+        List<string> variableNamesList = (from variableName in variableNames
+                                          where GetVariableImpacts(variableName, allVariableImpacts).Any(x => !x.IsAlmost(0.0))
+                                          select variableName)
+                                         .ToList();
+
+        List<string> statictics = new List<string> { "Median Rank", "Mean", "StdDev", "pValue" };
+        List<string> columnNames = runsWithVariables.Select(r => r.Name).ToList();
+        columnNames.AddRange(statictics);
+        int runs = runsWithVariables.Count();
+
+        matrix = new DoubleMatrix(variableNamesList.Count, runs + statictics.Count);
+        matrix.SortableView = true;
+        matrix.RowNames = variableNamesList;
+        matrix.ColumnNames = columnNames;
+
+        for (int i = 0; i < runsWithVariables.Count; i++) {
+          IRun run = runsWithVariables[i];
+          DoubleMatrix runVariableImpacts = (DoubleMatrix)run.Results[variableImpactResultName];
+          for (int j = 0; j < runVariableImpacts.Rows; j++) {
+            int rowIndex = variableNamesList.FindIndex(s => s == runVariableImpacts.RowNames.ElementAt(j));
+            if (rowIndex > -1) {
+              matrix[rowIndex, i] = runVariableImpacts[j, 0];
+            }
+          }
+        }
+
+        List<List<double>> variableImpactsOverRuns = (from variableName in variableNamesList
+                                                      select GetVariableImpacts(variableName, allVariableImpacts).ToList())
+                                                     .ToList();
+        List<List<double>> variableRanks = (from variableName in variableNamesList
+                                            select GetVariableImpactRanks(variableName, allVariableImpacts).ToList())
+                                        .ToList();
+        if (variableImpactsOverRuns.Count() > 0) {
+          // the variable with the worst median impact value is chosen as the reference variable
+          // this is problematic if all variables are relevant, however works often in practice
+          List<double> referenceImpacts = (from impacts in variableImpactsOverRuns
+                                           let avg = impacts.Median()
+                                           orderby avg
+                                           select impacts)
+                                           .First();
+          // for all variables
+          for (int row = 0; row < variableImpactsOverRuns.Count; row++) {
+            // median rank
+            matrix[row, runs] = variableRanks[row].Median();
+            // also show mean and std.dev. of relative variable impacts to indicate the relative difference in impacts of variables
+            matrix[row, runs + 1] = variableImpactsOverRuns[row].Average();
+            matrix[row, runs + 2] = variableImpactsOverRuns[row].StandardDeviation();
+
+            double leftTail = 0; double rightTail = 0; double bothTails = 0;
+            // calc differences of impacts for current variable and reference variable
+            double[] z = new double[referenceImpacts.Count];
+            for (int i = 0; i < z.Length; i++) {
+              z[i] = variableImpactsOverRuns[row][i] - referenceImpacts[i];
+            }
+            // wilcoxon signed rank test is used because the impact values of two variables in a single run are not independent
+            alglib.wsr.wilcoxonsignedranktest(z, z.Length, 0, ref bothTails, ref leftTail, ref rightTail);
+            matrix[row, runs + 3] = bothTails;
+          }
+        }
+      }
+      return matrix;
+    }
+
+    private IEnumerable<double> GetVariableImpactRanks(string variableName, IEnumerable<DoubleMatrix> allVariableImpacts) {
+      foreach (DoubleMatrix runVariableImpacts in allVariableImpacts) {
+        // certainly not yet very efficient because ranks are computed multiple times for the same run
+        string[] variableNames = runVariableImpacts.RowNames.ToArray();
+        double[] values = (from row in Enumerable.Range(0, runVariableImpacts.Rows)
+                           select runVariableImpacts[row, 0] * -1)
+                          .ToArray();
+        Array.Sort(values, variableNames);
+        // calculate ranks
+        double[] ranks = new double[values.Length];
+        // check for tied ranks
+        int i = 0;
+        while (i < values.Length) {
+          ranks[i] = i + 1;
+          int j = i + 1;
+          while (j < values.Length && values[i].IsAlmost(values[j])) {
+            ranks[j] = ranks[i];
+            j++;
+          }
+          i = j;
+        }
+        int rankIndex = 0;
+        foreach (string rowVariableName in variableNames) {
+          if (rowVariableName == variableName)
+            yield return ranks[rankIndex];
+          rankIndex++;
+        }
+      }
+    }
+
+    private IEnumerable<double> GetVariableImpacts(string variableName, IEnumerable<DoubleMatrix> allVariableImpacts) {
+      foreach (DoubleMatrix runVariableImpacts in allVariableImpacts) {
+        int row = 0;
+        foreach (string rowName in runVariableImpacts.RowNames) {
+          if (rowName == variableName)
+            yield return runVariableImpacts[row, 0];
+          row++;
+        }
+      }
+    }
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.Designer.cs	(revision 5026)
@@ -0,0 +1,86 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class ScatterPlotView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // chart
+      // 
+      chartArea1.Name = "ChartArea";
+      this.chart.ChartAreas.Add(chartArea1);
+      this.chart.Dock = System.Windows.Forms.DockStyle.Fill;
+      legend1.Alignment = System.Drawing.StringAlignment.Center;
+      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
+      legend1.Name = "Default";
+      this.chart.Legends.Add(legend1);
+      this.chart.Location = new System.Drawing.Point(0, 0);
+      this.chart.Name = "chart";
+      this.chart.Size = new System.Drawing.Size(527, 392);
+      this.chart.TabIndex = 1;
+      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
+      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
+      this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(chart_CustomizeLegend);
+      // 
+      // ScatterPlotView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.Controls.Add(this.chart);
+      this.Name = "ScatterPlotView";
+      this.AllowDrop = true;
+      this.Size = new System.Drawing.Size(527, 392);
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs	(revision 5026)
@@ -0,0 +1,222 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Scatter Plot View")]
+  [Content(typeof(DataAnalysisSolution), true)]
+  public partial class ScatterPlotView : AsynchronousContentView {
+    private const string ALL_SERIES = "All Samples";
+    private const string TRAINING_SERIES = "Training Samples";
+    private const string TEST_SERIES = "Test Samples";
+
+    public new DataAnalysisSolution Content {
+      get { return (DataAnalysisSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public ScatterPlotView()
+      : base() {
+      InitializeComponent();
+
+      this.chart.Series.Add(ALL_SERIES);
+      this.chart.Series[ALL_SERIES].LegendText = ALL_SERIES;
+      this.chart.Series[ALL_SERIES].ChartType = SeriesChartType.FastPoint;
+
+      this.chart.Series.Add(TRAINING_SERIES);
+      this.chart.Series[TRAINING_SERIES].LegendText = TRAINING_SERIES;
+      this.chart.Series[TRAINING_SERIES].ChartType = SeriesChartType.FastPoint;
+      this.chart.Series[TRAINING_SERIES].Points.Add(1.0);
+
+      this.chart.Series.Add(TEST_SERIES);
+      this.chart.Series[TEST_SERIES].LegendText = TEST_SERIES;
+      this.chart.Series[TEST_SERIES].ChartType = SeriesChartType.FastPoint;
+
+      this.chart.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
+      this.chart.AxisViewChanged += new EventHandler<System.Windows.Forms.DataVisualization.Charting.ViewEventArgs>(chart_AxisViewChanged);
+
+      //configure axis 
+      this.chart.CustomizeAllChartAreas();
+      this.chart.ChartAreas[0].AxisX.Title = "Estimated Values";
+      this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
+      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
+      this.chart.ChartAreas[0].CursorX.Interval = 1;
+      this.chart.ChartAreas[0].CursorY.Interval = 1;
+
+      this.chart.ChartAreas[0].AxisY.Title = "Target Values";
+      this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
+      this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
+      this.chart.ChartAreas[0].AxisY.IsStartedFromZero = true;
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+
+
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      UpdateChart();
+    }
+    private void Content_EstimatedValuesChanged(object sender, EventArgs e) {
+      UpdateSeries();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateChart();
+    }
+
+    private void UpdateChart() {
+      if (InvokeRequired) Invoke((Action)UpdateChart);
+      else {
+        if (Content != null) {
+          this.UpdateSeries();
+          if (!this.chart.Series.Any(s => s.Points.Count > 0))
+            this.ClearChart();
+        }
+      }
+    }
+
+    private void UpdateCursorInterval() {
+      var estimatedValues = this.chart.Series[ALL_SERIES].Points.Select(x => x.XValue).DefaultIfEmpty(1.0);
+      var targetValues = this.chart.Series[ALL_SERIES].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
+      double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min();
+      double targetValuesRange = targetValues.Max() - targetValues.Min();
+      double interestingValuesRange = Math.Min(Math.Max(targetValuesRange, 1.0), Math.Max(estimatedValuesRange, 1.0));
+      double digits = (int)Math.Log10(interestingValuesRange) - 3;
+      double zoomInterval = Math.Max(Math.Pow(10, digits), 10E-5);
+      this.chart.ChartAreas[0].CursorX.Interval = zoomInterval;
+      this.chart.ChartAreas[0].CursorY.Interval = zoomInterval;
+    }
+
+
+    private void UpdateSeries() {
+      if (InvokeRequired) Invoke((Action)UpdateSeries);
+      else {
+        string targetVariableName = Content.ProblemData.TargetVariable.Value;
+        Dataset dataset = Content.ProblemData.Dataset;
+        if (this.chart.Series[ALL_SERIES].Points.Count > 0)
+          this.chart.Series[ALL_SERIES].Points.DataBindXY(Content.EstimatedValues.ToArray(), "",
+            dataset.GetVariableValues(targetVariableName), "");
+        if (this.chart.Series[TRAINING_SERIES].Points.Count > 0)
+          this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.EstimatedTrainingValues.ToArray(), "",
+            dataset.GetEnumeratedVariableValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray(), "");
+        if (this.chart.Series[TEST_SERIES].Points.Count > 0)
+          this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.EstimatedTestValues.ToArray(), "",
+           dataset.GetEnumeratedVariableValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray(), "");
+
+        double max = Math.Max(Content.EstimatedValues.Max(), dataset.GetVariableValues(targetVariableName).Max());
+        double min = Math.Min(Content.EstimatedValues.Min(), dataset.GetVariableValues(targetVariableName).Min());
+
+        max = max + 0.2 * Math.Abs(max);
+        min = min - 0.2 * Math.Abs(min);
+
+        double interestingValuesRange = max - min;
+        int digits = Math.Max(0, 3 - (int)Math.Log10(interestingValuesRange));
+
+        max = Math.Round(max, digits);
+        min = Math.Round(min, digits);
+
+        this.chart.ChartAreas[0].AxisX.Maximum = max;
+        this.chart.ChartAreas[0].AxisX.Minimum = min;
+        this.chart.ChartAreas[0].AxisY.Maximum = max;
+        this.chart.ChartAreas[0].AxisY.Minimum = min;
+        UpdateCursorInterval();
+      }
+    }
+
+    private void ClearChart() {
+      this.chart.Series[ALL_SERIES].Points.Clear();
+      this.chart.Series[TRAINING_SERIES].Points.Clear();
+      this.chart.Series[TEST_SERIES].Points.Clear();
+    }
+
+    private void ToggleSeriesData(Series series) {
+      if (series.Points.Count > 0) {  //checks if series is shown
+        if (this.chart.Series.Any(s => s != series && s.Points.Count > 0)) {
+          series.Points.Clear();
+        }
+      } else if (Content != null) {
+        string targetVariableName = Content.ProblemData.TargetVariable.Value;
+
+        IEnumerable<double> predictedValues = null;
+        IEnumerable<double> targetValues = null;
+        switch (series.Name) {
+          case ALL_SERIES:
+            predictedValues = Content.EstimatedValues.ToArray();
+            targetValues = Content.ProblemData.Dataset.GetVariableValues(targetVariableName);
+            break;
+          case TRAINING_SERIES:
+            predictedValues = Content.EstimatedTrainingValues.ToArray();
+            targetValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray();
+            break;
+          case TEST_SERIES:
+            predictedValues = Content.EstimatedTestValues.ToArray();
+            targetValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray();
+            break;
+        }
+        series.Points.DataBindXY(predictedValues, "", targetValues, "");
+        this.chart.Legends[series.Legend].ForeColor = Color.Black;
+        UpdateCursorInterval();
+      }
+    }
+
+    private void chart_MouseDown(object sender, MouseEventArgs e) {
+      HitTestResult result = chart.HitTest(e.X, e.Y);
+      if (result.ChartElementType == ChartElementType.LegendItem) {
+        this.ToggleSeriesData(result.Series);
+      }
+    }
+
+    private void chart_MouseMove(object sender, MouseEventArgs e) {
+      HitTestResult result = chart.HitTest(e.X, e.Y);
+      if (result.ChartElementType == ChartElementType.LegendItem)
+        this.Cursor = Cursors.Hand;
+      else
+        this.Cursor = Cursors.Default;
+    }
+
+    private void chart_AxisViewChanged(object sender, System.Windows.Forms.DataVisualization.Charting.ViewEventArgs e) {
+      this.chart.ChartAreas[0].AxisX.ScaleView.Size = e.NewSize;
+      this.chart.ChartAreas[0].AxisY.ScaleView.Size = e.NewSize;
+    }
+
+    private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
+      e.LegendItems[0].Cells[1].ForeColor = this.chart.Series[ALL_SERIES].Points.Count == 0 ? Color.Gray : Color.Black;
+      e.LegendItems[1].Cells[1].ForeColor = this.chart.Series[TRAINING_SERIES].Points.Count == 0 ? Color.Gray : Color.Black;
+      e.LegendItems[2].Cells[1].ForeColor = this.chart.Series[TEST_SERIES].Points.Count == 0 ? Color.Gray : Color.Black;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorMachineModelView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorMachineModelView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorMachineModelView.Designer.cs	(revision 5026)
@@ -0,0 +1,81 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class SupportVectorMachineModelView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.textBox = new System.Windows.Forms.TextBox();
+      this.SuspendLayout();
+      // 
+      // textBox
+      // 
+      this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.textBox.Location = new System.Drawing.Point(3, 3);
+      this.textBox.Multiline = true;
+      this.textBox.Name = "textBox";
+      this.textBox.ReadOnly = true;
+      this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+      this.textBox.Size = new System.Drawing.Size(247, 245);
+      this.textBox.TabIndex = 0;
+      // 
+      // SupportVectorMachineModelView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.textBox);
+      this.Name = "SupportVectorMachineModelView";
+      this.Size = new System.Drawing.Size(253, 251);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.TextBox textBox;
+
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorMachineModelView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorMachineModelView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorMachineModelView.cs	(revision 5026)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.IO;
+using System.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Support Vector Machine Model View")]
+  [Content(typeof(SupportVectorMachineModel), true)]
+  public partial class SupportVectorMachineModelView : AsynchronousContentView {
+
+    public new SupportVectorMachineModel Content {
+      get { return (SupportVectorMachineModel)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public SupportVectorMachineModelView()
+      : base() {
+      InitializeComponent();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null)
+        textBox.Text = string.Empty;
+      else
+        UpdateTextBox();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.Changed -= new EventHandler(Content_Changed);
+    }
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateTextBox();
+    }
+
+    private void UpdateTextBox() {
+      using (MemoryStream s = new MemoryStream()) {
+        SupportVectorMachineModel.Export(Content, s);
+        s.Seek(0, System.IO.SeekOrigin.Begin);
+        StreamReader reader = new StreamReader(s);
+        textBox.Text = reader.ReadToEnd();
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.Designer.cs	(revision 5026)
@@ -0,0 +1,93 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class SupportVectorRegressionSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.supportVectorTabControl = new System.Windows.Forms.TabPage();
+      this.supportVectorViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.supportVectorTabControl.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // supportVectorTabControl
+      // 
+      this.supportVectorTabControl.Controls.Add(this.supportVectorViewHost);
+      this.supportVectorTabControl.Location = new System.Drawing.Point(4, 22);
+      this.supportVectorTabControl.Name = "supportVectorTabControl";
+      this.supportVectorTabControl.Padding = new System.Windows.Forms.Padding(3);
+      this.supportVectorTabControl.Size = new System.Drawing.Size(239, 219);
+      this.supportVectorTabControl.TabIndex = 2;
+      this.supportVectorTabControl.Text = "Support vectors";
+      this.supportVectorTabControl.UseVisualStyleBackColor = true;
+      // 
+      // supportVectorViewHost
+      // 
+      this.supportVectorViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.supportVectorViewHost.Caption = "SupportVectors";
+      this.supportVectorViewHost.Content = null;
+      this.supportVectorViewHost.Location = new System.Drawing.Point(6, 6);
+      this.supportVectorViewHost.Name = "supportVectorViewHost";
+      this.supportVectorViewHost.ReadOnly = false;
+      this.supportVectorViewHost.Size = new System.Drawing.Size(227, 207);
+      this.supportVectorViewHost.TabIndex = 1;
+      this.supportVectorViewHost.ViewType = null;
+      // 
+      // SupportVectorRegressionSolutionView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Name = "SupportVectorRegressionSolutionView";
+      this.tabControl.TabPages.Add(supportVectorTabControl);
+      this.supportVectorTabControl.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.TabPage supportVectorTabControl;
+    private HeuristicLab.MainForm.WindowsForms.ViewHost supportVectorViewHost;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.cs	(revision 5026)
@@ -0,0 +1,50 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.Regression.SupportVectorRegression;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Support Vector Regression Solution View")]
+  [Content(typeof(SupportVectorRegressionSolution))]
+  public partial class SupportVectorRegressionSolutionView : DataAnalysisSolutionView {
+
+    public new SupportVectorRegressionSolution Content {
+      get { return (SupportVectorRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public SupportVectorRegressionSolutionView()
+      : base() {
+      InitializeComponent();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null) {
+        supportVectorViewHost.Content = Content.SupportVectors;
+      } else {
+        supportVectorViewHost.Content = null;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs	(revision 5026)
@@ -0,0 +1,167 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
+  partial class InteractiveSymbolicRegressionSolutionSimplifierView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.treeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
+      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.grpSimplify = new System.Windows.Forms.GroupBox();
+      this.btnSimplify = new System.Windows.Forms.Button();
+      this.grpViewHost = new System.Windows.Forms.GroupBox();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.grpSimplify.SuspendLayout();
+      this.grpViewHost.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // treeChart
+      // 
+      this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.treeChart.BackgroundColor = System.Drawing.Color.White;
+      this.treeChart.LineColor = System.Drawing.Color.Black;
+      this.treeChart.Location = new System.Drawing.Point(6, 16);
+      this.treeChart.Name = "treeChart";
+      this.treeChart.Size = new System.Drawing.Size(201, 297);
+      this.treeChart.Spacing = 5;
+      this.treeChart.TabIndex = 0;
+      this.treeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
+      this.treeChart.Tree = null;
+      this.treeChart.SymbolicExpressionTreeNodeDoubleClicked += new System.Windows.Forms.MouseEventHandler(this.treeChart_SymbolicExpressionTreeNodeDoubleClicked);
+      // 
+      // viewHost
+      // 
+      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.viewHost.Caption = "View";
+      this.viewHost.Content = null;
+      this.viewHost.Location = new System.Drawing.Point(6, 16);
+      this.viewHost.Name = "viewHost";
+      this.viewHost.ReadOnly = false;
+      this.viewHost.Size = new System.Drawing.Size(335, 326);
+      this.viewHost.TabIndex = 0;
+      this.viewHost.ViewType = null;
+      // 
+      // splitContainer
+      // 
+      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer.Location = new System.Drawing.Point(0, 0);
+      this.splitContainer.Name = "splitContainer";
+      // 
+      // splitContainer.Panel1
+      // 
+      this.splitContainer.Panel1.Controls.Add(this.grpSimplify);
+      // 
+      // splitContainer.Panel2
+      // 
+      this.splitContainer.Panel2.Controls.Add(this.grpViewHost);
+      this.splitContainer.Size = new System.Drawing.Size(564, 348);
+      this.splitContainer.SplitterDistance = 213;
+      this.splitContainer.TabIndex = 1;
+      // 
+      // grpSimplify
+      // 
+      this.grpSimplify.Controls.Add(this.btnSimplify);
+      this.grpSimplify.Controls.Add(this.treeChart);
+      this.grpSimplify.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.grpSimplify.Location = new System.Drawing.Point(0, 0);
+      this.grpSimplify.Name = "grpSimplify";
+      this.grpSimplify.Size = new System.Drawing.Size(213, 348);
+      this.grpSimplify.TabIndex = 1;
+      this.grpSimplify.TabStop = false;
+      this.grpSimplify.Text = "Simplify";
+      // 
+      // btnSimplify
+      // 
+      this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.btnSimplify.Location = new System.Drawing.Point(6, 319);
+      this.btnSimplify.Name = "btnSimplify";
+      this.btnSimplify.Size = new System.Drawing.Size(201, 23);
+      this.btnSimplify.TabIndex = 1;
+      this.btnSimplify.Text = "Simplify";
+      this.btnSimplify.UseVisualStyleBackColor = true;
+      this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click);
+      // 
+      // grpViewHost
+      // 
+      this.grpViewHost.Controls.Add(this.viewHost);
+      this.grpViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.grpViewHost.Location = new System.Drawing.Point(0, 0);
+      this.grpViewHost.Name = "grpViewHost";
+      this.grpViewHost.Size = new System.Drawing.Size(347, 348);
+      this.grpViewHost.TabIndex = 1;
+      this.grpViewHost.TabStop = false;
+      this.grpViewHost.Text = "Details";
+      // 
+      // InteractiveSymbolicRegressionSolutionSimplifierView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.splitContainer);
+      this.Name = "InteractiveSymbolicRegressionSolutionSimplifierView";
+      this.Size = new System.Drawing.Size(564, 348);
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel2.ResumeLayout(false);
+      this.splitContainer.ResumeLayout(false);
+      this.grpSimplify.ResumeLayout(false);
+      this.grpViewHost.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart treeChart;
+    private System.Windows.Forms.SplitContainer splitContainer;
+    private HeuristicLab.MainForm.WindowsForms.ViewHost viewHost;
+    private System.Windows.Forms.GroupBox grpSimplify;
+    private System.Windows.Forms.GroupBox grpViewHost;
+    private System.Windows.Forms.Button btnSimplify;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 5026)
@@ -0,0 +1,222 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
+  public partial class InteractiveSymbolicRegressionSolutionSimplifierView : AsynchronousContentView {
+    private SymbolicExpressionTree simplifiedExpressionTree;
+    private Dictionary<SymbolicExpressionTreeNode, ConstantTreeNode> replacementNodes;
+    private Dictionary<SymbolicExpressionTreeNode, double> nodeImpacts;
+
+    public InteractiveSymbolicRegressionSolutionSimplifierView() {
+      InitializeComponent();
+      this.replacementNodes = new Dictionary<SymbolicExpressionTreeNode, ConstantTreeNode>();
+      this.nodeImpacts = new Dictionary<SymbolicExpressionTreeNode, double>();
+      this.simplifiedExpressionTree = null;
+      this.Caption = "Interactive Solution Simplifier";
+    }
+
+    public new SymbolicRegressionSolution Content {
+      get { return (SymbolicRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ModelChanged += new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+
+    private void Content_ModelChanged(object sender, EventArgs e) {
+      this.CalculateReplacementNodesAndNodeImpacts();
+    }
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      this.CalculateReplacementNodesAndNodeImpacts();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      this.CalculateReplacementNodesAndNodeImpacts();
+      this.viewHost.Content = this.Content;
+    }
+
+    private void CalculateReplacementNodesAndNodeImpacts() {
+      this.replacementNodes.Clear();
+      this.nodeImpacts.Clear();
+      if (Content != null && Content.Model != null && Content.ProblemData != null) {
+        SymbolicSimplifier simplifier = new SymbolicSimplifier();
+        simplifiedExpressionTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree);
+        int samplesStart = Content.ProblemData.TrainingSamplesStart.Value;
+        int samplesEnd = Content.ProblemData.TrainingSamplesEnd.Value;
+        double originalTrainingMeanSquaredError = SymbolicRegressionMeanSquaredErrorEvaluator.Calculate(
+            Content.Model.Interpreter, simplifiedExpressionTree, Content.LowerEstimationLimit, Content.UpperEstimationLimit,
+            Content.ProblemData.Dataset, Content.ProblemData.TargetVariable.Value,
+            Enumerable.Range(samplesStart, samplesEnd - samplesStart));
+
+        this.CalculateReplacementNodes();
+
+        this.CalculateNodeImpacts(simplifiedExpressionTree, simplifiedExpressionTree.Root.SubTrees[0], originalTrainingMeanSquaredError);
+        // show only interesting part of solution
+        this.treeChart.Tree = new SymbolicExpressionTree(simplifiedExpressionTree.Root.SubTrees[0].SubTrees[0]);
+        this.PaintNodeImpacts();
+      }
+    }
+
+    private void CalculateReplacementNodes() {
+      ISymbolicExpressionTreeInterpreter interpreter = Content.Model.Interpreter;
+      IEnumerable<int> trainingSamples = Enumerable.Range(Content.ProblemData.TrainingSamplesStart.Value, Content.ProblemData.TrainingSamplesEnd.Value - Content.ProblemData.TrainingSamplesStart.Value);
+      SymbolicExpressionTreeNode root = new ProgramRootSymbol().CreateTreeNode();
+      SymbolicExpressionTreeNode start = new StartSymbol().CreateTreeNode();
+      root.AddSubTree(start);
+      SymbolicExpressionTree tree = new SymbolicExpressionTree(root);
+      foreach (SymbolicExpressionTreeNode node in this.simplifiedExpressionTree.IterateNodesPrefix()) {
+        if (!(node.Symbol is ProgramRootSymbol || node.Symbol is StartSymbol)) {
+          while (start.SubTrees.Count > 0) start.RemoveSubTree(0);
+          start.AddSubTree(node);
+          double constantTreeNodeValue = interpreter.GetSymbolicExpressionTreeValues(tree, Content.ProblemData.Dataset, trainingSamples).Median();
+          ConstantTreeNode constantTreeNode = MakeConstantTreeNode(constantTreeNodeValue);
+          replacementNodes[node] = constantTreeNode;
+        }
+      }
+    }
+
+    private void CalculateNodeImpacts(SymbolicExpressionTree tree, SymbolicExpressionTreeNode currentTreeNode, double originalTrainingMeanSquaredError) {
+      foreach (SymbolicExpressionTreeNode childNode in currentTreeNode.SubTrees.ToList()) {
+        SwitchNode(currentTreeNode, childNode, replacementNodes[childNode]);
+        int samplesStart = Content.ProblemData.TrainingSamplesStart.Value;
+        int samplesEnd = Content.ProblemData.TrainingSamplesEnd.Value;
+        double newTrainingMeanSquaredError = SymbolicRegressionMeanSquaredErrorEvaluator.Calculate(
+          Content.Model.Interpreter, tree,
+          Content.LowerEstimationLimit, Content.UpperEstimationLimit,
+          Content.ProblemData.Dataset, Content.ProblemData.TargetVariable.Value,
+          Enumerable.Range(samplesStart, samplesEnd - samplesStart));
+        nodeImpacts[childNode] = newTrainingMeanSquaredError / originalTrainingMeanSquaredError;
+        SwitchNode(currentTreeNode, replacementNodes[childNode], childNode);
+        CalculateNodeImpacts(tree, childNode, originalTrainingMeanSquaredError);
+      }
+    }
+
+    private void SwitchNode(SymbolicExpressionTreeNode root, SymbolicExpressionTreeNode oldBranch, SymbolicExpressionTreeNode newBranch) {
+      for (int i = 0; i < root.SubTrees.Count; i++) {
+        if (root.SubTrees[i] == oldBranch) {
+          root.RemoveSubTree(i);
+          root.InsertSubTree(i, newBranch);
+          return;
+        }
+      }
+    }
+
+    private ConstantTreeNode MakeConstantTreeNode(double value) {
+      Constant constant = new Constant();
+      constant.MinValue = value - 1;
+      constant.MaxValue = value + 1;
+      ConstantTreeNode constantTreeNode = (ConstantTreeNode)constant.CreateTreeNode();
+      constantTreeNode.Value = value;
+      return constantTreeNode;
+    }
+
+    private void treeChart_SymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) {
+      VisualSymbolicExpressionTreeNode visualTreeNode = (VisualSymbolicExpressionTreeNode)sender;
+      foreach (SymbolicExpressionTreeNode treeNode in simplifiedExpressionTree.IterateNodesPostfix()) {
+        for (int i = 0; i < treeNode.SubTrees.Count; i++) {
+          SymbolicExpressionTreeNode subTree = treeNode.SubTrees[i];
+          if (subTree == visualTreeNode.SymbolicExpressionTreeNode) {
+            treeNode.RemoveSubTree(i);
+            if (replacementNodes.ContainsKey(subTree))
+              treeNode.InsertSubTree(i, replacementNodes[subTree]);
+            else if (subTree is ConstantTreeNode && replacementNodes.ContainsValue((ConstantTreeNode)subTree))
+              treeNode.InsertSubTree(i, replacementNodes.Where(v => v.Value == subTree).Single().Key);
+            else if (!(subTree is ConstantTreeNode))
+              throw new InvalidOperationException("Could not find replacement value.");
+          }
+        }
+      }
+
+      // show only interesting part of solution
+      this.treeChart.Tree = new SymbolicExpressionTree(simplifiedExpressionTree.Root.SubTrees[0].SubTrees[0]);
+
+      SymbolicExpressionTree tree = (SymbolicExpressionTree)simplifiedExpressionTree.Clone();
+
+      this.Content.ModelChanged -= new EventHandler(Content_ModelChanged);
+      this.Content.Model = new SymbolicRegressionModel(Content.Model.Interpreter, tree);
+      this.Content.ModelChanged += new EventHandler(Content_ModelChanged);
+
+      this.PaintNodeImpacts();
+    }
+
+    private void PaintNodeImpacts() {
+      var impacts = nodeImpacts.Values;
+      double max = impacts.Max();
+      double min = impacts.Min();
+      foreach (SymbolicExpressionTreeNode treeNode in simplifiedExpressionTree.IterateNodesPostfix()) {
+        if (!(treeNode is ConstantTreeNode) && nodeImpacts.ContainsKey(treeNode)) {
+          double impact = this.nodeImpacts[treeNode];
+          double replacementValue = this.replacementNodes[treeNode].Value;
+          VisualSymbolicExpressionTreeNode visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
+
+          if (impact < 1.0) {
+            visualTree.FillColor = Color.FromArgb((int)((1.0 - impact) * 255), Color.Red);
+          } else {
+            visualTree.FillColor = Color.FromArgb((int)((impact - 1.0) / max * 255), Color.Green);
+          }
+          visualTree.ToolTip += Environment.NewLine + "Node impact: " + impact;
+          visualTree.ToolTip += Environment.NewLine + "Replacement value: " + replacementValue;
+        }
+      }
+      this.PaintCollapsedNodes();
+      this.treeChart.Repaint();
+    }
+
+    private void PaintCollapsedNodes() {
+      foreach (SymbolicExpressionTreeNode treeNode in simplifiedExpressionTree.IterateNodesPostfix()) {
+        if (treeNode is ConstantTreeNode && replacementNodes.ContainsValue((ConstantTreeNode)treeNode))
+          this.treeChart.GetVisualSymbolicExpressionTreeNode(treeNode).LineColor = Color.DarkOrange;
+        else {
+          VisualSymbolicExpressionTreeNode visNode = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
+          if (visNode != null)
+            visNode.LineColor = Color.Black;
+        }
+      }
+    }
+
+    private void btnSimplify_Click(object sender, EventArgs e) {
+      this.CalculateReplacementNodesAndNodeImpacts();
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.cs	(revision 5026)
@@ -0,0 +1,56 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
+  [View("Simplified Symbolic Expression Model View")]
+  [Content(typeof(SymbolicRegressionModel))]
+  public partial class SimplifiedSymbolicExpressionModelView : AsynchronousContentView {
+    public SimplifiedSymbolicExpressionModelView()
+      : base() {
+      InitializeComponent();
+    }
+
+    public new SymbolicRegressionModel Content {
+      get { return (SymbolicRegressionModel)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null)
+        UpdateTreeChart();
+      else
+        viewHost.Content = null;
+    }
+
+    private void UpdateTreeChart() {
+      var simplifier = new SymbolicSimplifier();
+      var simplifiedTree = simplifier.Simplify(Content.SymbolicExpressionTree);
+      viewHost.Content = simplifiedTree;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.designer.cs	(revision 5026)
@@ -0,0 +1,95 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
+  partial class SimplifiedSymbolicExpressionModelView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.simplifiedModelGroupBox = new System.Windows.Forms.GroupBox();
+      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.simplifiedModelGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // simplifiedModelGroupBox
+      // 
+      this.simplifiedModelGroupBox.Controls.Add(this.viewHost);
+      this.simplifiedModelGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.simplifiedModelGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.simplifiedModelGroupBox.Name = "simplifiedModelGroupBox";
+      this.simplifiedModelGroupBox.Size = new System.Drawing.Size(352, 413);
+      this.simplifiedModelGroupBox.TabIndex = 0;
+      this.simplifiedModelGroupBox.TabStop = false;
+      this.simplifiedModelGroupBox.Text = "Simplified Symbolic Expression Model";
+      // 
+      // viewHost
+      // 
+      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.viewHost.Content = null;
+      this.viewHost.Location = new System.Drawing.Point(6, 19);
+      this.viewHost.Name = "viewHost";
+      this.viewHost.ReadOnly = false;
+      this.viewHost.Size = new System.Drawing.Size(340, 388);
+      this.viewHost.TabIndex = 0;
+      this.viewHost.ViewType = null;
+      // 
+      // SimplifiedSymbolicExpressionModelView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.simplifiedModelGroupBox);
+      this.Name = "SimplifiedSymbolicExpressionModelView";
+      this.Size = new System.Drawing.Size(352, 413);
+      this.simplifiedModelGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.GroupBox simplifiedModelGroupBox;
+    private HeuristicLab.MainForm.WindowsForms.ViewHost viewHost;
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.cs	(revision 5026)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
+  [View("Symbolic Expression Model View")]
+  [Content(typeof(SymbolicRegressionModel), true)]
+  public partial class SymbolicExpressionModelView : AsynchronousContentView {
+    public SymbolicExpressionModelView()
+      : base() {
+      InitializeComponent();
+    }
+
+    public new SymbolicRegressionModel Content {
+      get { return (SymbolicRegressionModel)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null)
+        UpdateTreeChart();
+      else
+        viewHost.Content = null;
+    }
+
+    private void UpdateTreeChart() {
+      viewHost.Content = Content.SymbolicExpressionTree;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.designer.cs	(revision 5026)
@@ -0,0 +1,95 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
+  partial class SymbolicExpressionModelView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.modelGroupBox = new System.Windows.Forms.GroupBox();
+      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.modelGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // modelGroupBox
+      // 
+      this.modelGroupBox.Controls.Add(this.viewHost);
+      this.modelGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.modelGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.modelGroupBox.Name = "modelGroupBox";
+      this.modelGroupBox.Size = new System.Drawing.Size(352, 413);
+      this.modelGroupBox.TabIndex = 0;
+      this.modelGroupBox.TabStop = false;
+      this.modelGroupBox.Text = "Symbolic Expression Model";
+      // 
+      // viewHost
+      // 
+      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.viewHost.Content = null;
+      this.viewHost.Location = new System.Drawing.Point(6, 19);
+      this.viewHost.Name = "viewHost";
+      this.viewHost.ReadOnly = false;
+      this.viewHost.Size = new System.Drawing.Size(340, 388);
+      this.viewHost.TabIndex = 0;
+      this.viewHost.ViewType = null;
+      // 
+      // SymbolicExpressionModelView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.modelGroupBox);
+      this.Name = "SymbolicExpressionModelView";
+      this.Size = new System.Drawing.Size(352, 413);
+      this.modelGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.GroupBox modelGroupBox;
+    private HeuristicLab.MainForm.WindowsForms.ViewHost viewHost;
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicRegressionSolutionView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicRegressionSolutionView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicRegressionSolutionView.Designer.cs	(revision 5026)
@@ -0,0 +1,104 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
+  partial class SymbolicRegressionSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.btn_SimplifyModel = new System.Windows.Forms.Button();
+      this.tabControl.SuspendLayout();
+      this.dataTabPage.SuspendLayout();
+      this.modelTabPage.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // tabControl
+      // 
+      this.tabControl.Size = new System.Drawing.Size(380, 233);
+      // 
+      // dataTabPage
+      // 
+      this.dataTabPage.Size = new System.Drawing.Size(372, 207);
+      // 
+      // modelTabPage
+      // 
+      this.modelTabPage.Size = new System.Drawing.Size(372, 207);
+      // 
+      // dataViewHost
+      // 
+      this.dataViewHost.Size = new System.Drawing.Size(360, 195);
+      // 
+      // modelViewHost
+      // 
+      this.modelViewHost.Size = new System.Drawing.Size(360, 195);
+      // 
+      // btn_SimplifyModel
+      // 
+      this.btn_SimplifyModel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.btn_SimplifyModel.Location = new System.Drawing.Point(3, 238);
+      this.btn_SimplifyModel.Name = "btn_SimplifyModel";
+      this.btn_SimplifyModel.Size = new System.Drawing.Size(376, 23);
+      this.btn_SimplifyModel.TabIndex = 2;
+      this.btn_SimplifyModel.Text = "Simplify Model";
+      this.btn_SimplifyModel.UseVisualStyleBackColor = true;
+      this.btn_SimplifyModel.Click += new System.EventHandler(this.btn_SimplifyModel_Click);
+      // 
+      // SymbolicRegressionSolutionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.btn_SimplifyModel);
+      this.Name = "SymbolicRegressionSolutionView";
+      this.Controls.SetChildIndex(this.btn_SimplifyModel, 0);
+      this.Controls.SetChildIndex(this.tabControl, 0);
+      this.tabControl.ResumeLayout(false);
+      this.dataTabPage.ResumeLayout(false);
+      this.modelTabPage.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Button btn_SimplifyModel;
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicRegressionSolutionView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicRegressionSolutionView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicRegressionSolutionView.cs	(revision 5026)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
+  [Content(typeof(SymbolicRegressionSolution))]
+  [View("Symbolic Regression Solution View")]
+  public partial class SymbolicRegressionSolutionView : DataAnalysisSolutionView {
+    public SymbolicRegressionSolutionView() {
+      InitializeComponent();
+    }
+
+    protected new SymbolicRegressionSolution Content {
+      get { return (SymbolicRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
+      InteractiveSymbolicRegressionSolutionSimplifierView view = new InteractiveSymbolicRegressionSolutionSimplifierView();
+      view.Content = (SymbolicRegressionSolution)this.Content.Clone();
+      view.Show();
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/ConstantView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/ConstantView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/ConstantView.Designer.cs	(revision 5026)
@@ -0,0 +1,242 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
+  partial class ConstantView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.weightNuLabel = new System.Windows.Forms.Label();
+      this.minValueTextBox = new System.Windows.Forms.TextBox();
+      this.initializationGroupBox = new System.Windows.Forms.GroupBox();
+      this.weightSigmaLabel = new System.Windows.Forms.Label();
+      this.maxValueTextBox = new System.Windows.Forms.TextBox();
+      this.mutationGroupBox = new System.Windows.Forms.GroupBox();
+      this.stdDevWeightChangeLabel = new System.Windows.Forms.Label();
+      this.valueChangeSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.meanWeightChangeLabel = new System.Windows.Forms.Label();
+      this.valueChangeMuTextBox = new System.Windows.Forms.TextBox();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.initializationGroupBox.SuspendLayout();
+      this.mutationGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // initialFrequencyLabel
+      // 
+      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // initialFrequencyTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.initialFrequencyTextBox.Size = new System.Drawing.Size(203, 20);
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Size = new System.Drawing.Size(203, 20);
+      // 
+      // descriptionTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.descriptionTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.descriptionTextBox.Size = new System.Drawing.Size(203, 20);
+      // 
+      // weightNuLabel
+      // 
+      this.weightNuLabel.AutoSize = true;
+      this.weightNuLabel.Location = new System.Drawing.Point(6, 22);
+      this.weightNuLabel.Name = "weightNuLabel";
+      this.weightNuLabel.Size = new System.Drawing.Size(56, 13);
+      this.weightNuLabel.TabIndex = 6;
+      this.weightNuLabel.Text = "Min value:";
+      this.toolTip.SetToolTip(this.weightNuLabel, "The minimal value to use for random initialization of constants.");
+      // 
+      // minValueTextBox
+      // 
+      this.minValueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.minValueTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minValueTextBox.Location = new System.Drawing.Point(92, 19);
+      this.minValueTextBox.Name = "minValueTextBox";
+      this.minValueTextBox.Size = new System.Drawing.Size(222, 20);
+      this.minValueTextBox.TabIndex = 7;
+      this.toolTip.SetToolTip(this.minValueTextBox, "The minimal value to use for random initialization of constants.");
+      this.minValueTextBox.TextChanged += new System.EventHandler(this.minValueTextBox_TextChanged);
+      // 
+      // initializationGroupBox
+      // 
+      this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.initializationGroupBox.Controls.Add(this.weightSigmaLabel);
+      this.initializationGroupBox.Controls.Add(this.maxValueTextBox);
+      this.initializationGroupBox.Controls.Add(this.weightNuLabel);
+      this.initializationGroupBox.Controls.Add(this.minValueTextBox);
+      this.initializationGroupBox.Location = new System.Drawing.Point(3, 79);
+      this.initializationGroupBox.Name = "initializationGroupBox";
+      this.initializationGroupBox.Size = new System.Drawing.Size(320, 73);
+      this.initializationGroupBox.TabIndex = 8;
+      this.initializationGroupBox.TabStop = false;
+      this.initializationGroupBox.Text = "Initialization";
+      // 
+      // weightSigmaLabel
+      // 
+      this.weightSigmaLabel.AutoSize = true;
+      this.weightSigmaLabel.Location = new System.Drawing.Point(6, 48);
+      this.weightSigmaLabel.Name = "weightSigmaLabel";
+      this.weightSigmaLabel.Size = new System.Drawing.Size(59, 13);
+      this.weightSigmaLabel.TabIndex = 8;
+      this.weightSigmaLabel.Text = "Max value:";
+      this.toolTip.SetToolTip(this.weightSigmaLabel, "The maximal value to use for random initialization of constants.");
+      // 
+      // maxValueTextBox
+      // 
+      this.maxValueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.maxValueTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maxValueTextBox.Location = new System.Drawing.Point(92, 45);
+      this.maxValueTextBox.Name = "maxValueTextBox";
+      this.maxValueTextBox.Size = new System.Drawing.Size(222, 20);
+      this.maxValueTextBox.TabIndex = 9;
+      this.toolTip.SetToolTip(this.maxValueTextBox, "The maximal value to use for random initialization of constants.");
+      this.maxValueTextBox.TextChanged += new System.EventHandler(this.maxValueTextBox_TextChanged);
+      // 
+      // mutationGroupBox
+      // 
+      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.mutationGroupBox.Controls.Add(this.stdDevWeightChangeLabel);
+      this.mutationGroupBox.Controls.Add(this.valueChangeSigmaTextBox);
+      this.mutationGroupBox.Controls.Add(this.meanWeightChangeLabel);
+      this.mutationGroupBox.Controls.Add(this.valueChangeMuTextBox);
+      this.mutationGroupBox.Location = new System.Drawing.Point(3, 158);
+      this.mutationGroupBox.Name = "mutationGroupBox";
+      this.mutationGroupBox.Size = new System.Drawing.Size(320, 73);
+      this.mutationGroupBox.TabIndex = 9;
+      this.mutationGroupBox.TabStop = false;
+      this.mutationGroupBox.Text = "Mutation";
+      // 
+      // stdDevWeightChangeLabel
+      // 
+      this.stdDevWeightChangeLabel.AutoSize = true;
+      this.stdDevWeightChangeLabel.Location = new System.Drawing.Point(6, 48);
+      this.stdDevWeightChangeLabel.Name = "stdDevWeightChangeLabel";
+      this.stdDevWeightChangeLabel.Size = new System.Drawing.Size(112, 13);
+      this.stdDevWeightChangeLabel.TabIndex = 8;
+      this.stdDevWeightChangeLabel.Text = "Value change (sigma):";
+      this.toolTip.SetToolTip(this.stdDevWeightChangeLabel, "The sigma (std. dev.) parameter for the normal distribution to use to sample the " +
+              "value change.");
+      // 
+      // valueChangeSigmaTextBox
+      // 
+      this.valueChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.valueChangeSigmaTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.valueChangeSigmaTextBox.Location = new System.Drawing.Point(136, 45);
+      this.valueChangeSigmaTextBox.Name = "valueChangeSigmaTextBox";
+      this.valueChangeSigmaTextBox.Size = new System.Drawing.Size(178, 20);
+      this.valueChangeSigmaTextBox.TabIndex = 9;
+      this.toolTip.SetToolTip(this.valueChangeSigmaTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample the " +
+              "value change.");
+      this.valueChangeSigmaTextBox.TextChanged += new System.EventHandler(this.valueChangeSigmaTextBox_TextChanged);
+      // 
+      // meanWeightChangeLabel
+      // 
+      this.meanWeightChangeLabel.AutoSize = true;
+      this.meanWeightChangeLabel.Location = new System.Drawing.Point(6, 22);
+      this.meanWeightChangeLabel.Name = "meanWeightChangeLabel";
+      this.meanWeightChangeLabel.Size = new System.Drawing.Size(99, 13);
+      this.meanWeightChangeLabel.TabIndex = 6;
+      this.meanWeightChangeLabel.Text = "Value change (mu):";
+      this.toolTip.SetToolTip(this.meanWeightChangeLabel, "The mu (mean) parameter for the normal distribution to sample the value change.");
+      // 
+      // valueChangeMuTextBox
+      // 
+      this.valueChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.valueChangeMuTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.valueChangeMuTextBox.Location = new System.Drawing.Point(136, 19);
+      this.valueChangeMuTextBox.Name = "valueChangeMuTextBox";
+      this.valueChangeMuTextBox.Size = new System.Drawing.Size(178, 20);
+      this.valueChangeMuTextBox.TabIndex = 7;
+      this.toolTip.SetToolTip(this.valueChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the value change.");
+      this.valueChangeMuTextBox.TextChanged += new System.EventHandler(this.valueChangeMuTextBox_TextChanged);
+      // 
+      // ConstantView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.mutationGroupBox);
+      this.Controls.Add(this.initializationGroupBox);
+      this.Name = "ConstantView";
+      this.Size = new System.Drawing.Size(326, 235);
+      this.Controls.SetChildIndex(this.initializationGroupBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.descriptionLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
+      this.Controls.SetChildIndex(this.mutationGroupBox, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.initializationGroupBox.ResumeLayout(false);
+      this.initializationGroupBox.PerformLayout();
+      this.mutationGroupBox.ResumeLayout(false);
+      this.mutationGroupBox.PerformLayout();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label weightNuLabel;
+    private System.Windows.Forms.TextBox minValueTextBox;
+    protected System.Windows.Forms.GroupBox initializationGroupBox;
+    private System.Windows.Forms.Label weightSigmaLabel;
+    private System.Windows.Forms.TextBox maxValueTextBox;
+    protected System.Windows.Forms.GroupBox mutationGroupBox;
+    private System.Windows.Forms.Label stdDevWeightChangeLabel;
+    private System.Windows.Forms.TextBox valueChangeSigmaTextBox;
+    private System.Windows.Forms.Label meanWeightChangeLabel;
+    private System.Windows.Forms.TextBox valueChangeMuTextBox;
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/ConstantView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/ConstantView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/ConstantView.cs	(revision 5026)
@@ -0,0 +1,133 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
+  [View("Constant View")]
+  [Content(typeof(Constant), true)]
+  public partial class ConstantView : SymbolView {
+    public new Constant Content {
+      get { return (Constant)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public ConstantView() {
+      InitializeComponent();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.Changed -= new EventHandler(Content_Changed);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateControl();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      minValueTextBox.Enabled = Content != null;
+      minValueTextBox.ReadOnly = ReadOnly;
+      maxValueTextBox.Enabled = Content != null;
+      maxValueTextBox.ReadOnly = ReadOnly;
+      valueChangeMuTextBox.Enabled = Content != null;
+      valueChangeMuTextBox.ReadOnly = ReadOnly;
+      valueChangeSigmaTextBox.Enabled = Content != null;
+      valueChangeSigmaTextBox.ReadOnly = ReadOnly;
+    }
+
+    #region content event handlers
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+    #endregion
+
+    #region control event handlers
+    private void minValueTextBox_TextChanged(object sender, EventArgs e) {
+      double min;
+      if (double.TryParse(minValueTextBox.Text, out min)) {
+        Content.MinValue = min;
+        errorProvider.SetError(minValueTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(minValueTextBox, "Invalid value");
+      }
+    }
+    private void maxValueTextBox_TextChanged(object sender, EventArgs e) {
+      double max;
+      if (double.TryParse(maxValueTextBox.Text, out max)) {
+        Content.MaxValue = max;
+        errorProvider.SetError(maxValueTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(maxValueTextBox, "Invalid value");
+      }
+    }
+
+    private void valueChangeMuTextBox_TextChanged(object sender, EventArgs e) {
+      double nu;
+      if (double.TryParse(valueChangeMuTextBox.Text, out nu)) {
+        Content.ManipulatorMu = nu;
+        errorProvider.SetError(valueChangeMuTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(valueChangeMuTextBox, "Invalid value");
+      }
+    }
+
+    private void valueChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double sigma;
+      if (double.TryParse(valueChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
+        Content.ManipulatorSigma = sigma;
+        errorProvider.SetError(valueChangeSigmaTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(valueChangeSigmaTextBox, "Invalid value");
+      }
+    }
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        minValueTextBox.Text = string.Empty;
+        maxValueTextBox.Text = string.Empty;
+        minValueTextBox.Text = string.Empty;
+        valueChangeSigmaTextBox.Text = string.Empty;
+      } else {
+        minValueTextBox.Text = Content.MinValue.ToString();
+        maxValueTextBox.Text = Content.MaxValue.ToString();
+        valueChangeMuTextBox.Text = Content.ManipulatorMu.ToString();
+        valueChangeSigmaTextBox.Text = Content.ManipulatorSigma.ToString();
+      }
+      SetEnabledStateOfControls();
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/LaggedVariableView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/LaggedVariableView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/LaggedVariableView.Designer.cs	(revision 5026)
@@ -0,0 +1,155 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
+  partial class LaggedVariableView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.minTimeOffsetLabel = new System.Windows.Forms.Label();
+      this.maxTimeOffsetLabel = new System.Windows.Forms.Label();
+      this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox();
+      this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // initializationGroupBox
+      // 
+      this.initializationGroupBox.Location = new System.Drawing.Point(3, 131);
+      this.initializationGroupBox.Size = new System.Drawing.Size(399, 73);
+      // 
+      // mutationGroupBox
+      // 
+      this.mutationGroupBox.Location = new System.Drawing.Point(6, 210);
+      this.mutationGroupBox.Size = new System.Drawing.Size(396, 73);
+      // 
+      // initialFrequencyLabel
+      // 
+      this.initialFrequencyLabel.Location = new System.Drawing.Point(3, 56);
+      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // initialFrequencyTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.initialFrequencyTextBox.Size = new System.Drawing.Size(285, 20);
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Size = new System.Drawing.Size(285, 20);
+      // 
+      // descriptionTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.descriptionTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.descriptionTextBox.Size = new System.Drawing.Size(285, 20);
+      // 
+      // minTimeOffsetLabel
+      // 
+      this.minTimeOffsetLabel.AutoSize = true;
+      this.minTimeOffsetLabel.Location = new System.Drawing.Point(3, 82);
+      this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
+      this.minTimeOffsetLabel.Size = new System.Drawing.Size(81, 13);
+      this.minTimeOffsetLabel.TabIndex = 10;
+      this.minTimeOffsetLabel.Text = "Min. time offset:";
+      // 
+      // maxTimeOffsetLabel
+      // 
+      this.maxTimeOffsetLabel.AutoSize = true;
+      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(3, 108);
+      this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
+      this.maxTimeOffsetLabel.Size = new System.Drawing.Size(84, 13);
+      this.maxTimeOffsetLabel.TabIndex = 11;
+      this.maxTimeOffsetLabel.Text = "Max. time offset:";
+      // 
+      // minTimeOffsetTextBox
+      // 
+      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(117, 79);
+      this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
+      this.minTimeOffsetTextBox.Size = new System.Drawing.Size(285, 20);
+      this.minTimeOffsetTextBox.TabIndex = 12;
+      this.minTimeOffsetTextBox.TextChanged += new System.EventHandler(this.minTimeOffsetTextBox_TextChanged);
+      // 
+      // maxTimeOffsetTextBox
+      // 
+      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(117, 105);
+      this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
+      this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(285, 20);
+      this.maxTimeOffsetTextBox.TabIndex = 13;
+      this.maxTimeOffsetTextBox.TextChanged += new System.EventHandler(this.maxTimeOffsetTextBox_TextChanged);
+      // 
+      // LaggedVariableView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.maxTimeOffsetTextBox);
+      this.Controls.Add(this.minTimeOffsetTextBox);
+      this.Controls.Add(this.maxTimeOffsetLabel);
+      this.Controls.Add(this.minTimeOffsetLabel);
+      this.Name = "LaggedVariableView";
+      this.Size = new System.Drawing.Size(408, 292);
+      this.Controls.SetChildIndex(this.initializationGroupBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.descriptionLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
+      this.Controls.SetChildIndex(this.mutationGroupBox, 0);
+      this.Controls.SetChildIndex(this.minTimeOffsetLabel, 0);
+      this.Controls.SetChildIndex(this.maxTimeOffsetLabel, 0);
+      this.Controls.SetChildIndex(this.minTimeOffsetTextBox, 0);
+      this.Controls.SetChildIndex(this.maxTimeOffsetTextBox, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label minTimeOffsetLabel;
+    private System.Windows.Forms.Label maxTimeOffsetLabel;
+    private System.Windows.Forms.TextBox minTimeOffsetTextBox;
+    private System.Windows.Forms.TextBox maxTimeOffsetTextBox;
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/LaggedVariableView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/LaggedVariableView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/LaggedVariableView.cs	(revision 5026)
@@ -0,0 +1,108 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
+  [View("LaggedVariable View")]
+  [Content(typeof(LaggedVariable), true)]
+  public partial class LaggedVariableView : VariableView {
+    public new LaggedVariable Content {
+      get { return (LaggedVariable)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public LaggedVariableView() {
+      InitializeComponent();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.Changed -= new EventHandler(Content_Changed);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateControl();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      minTimeOffsetTextBox.Enabled = Content != null;
+      minTimeOffsetTextBox.ReadOnly = ReadOnly;
+      maxTimeOffsetTextBox.Enabled = Content != null;
+      maxTimeOffsetTextBox.ReadOnly = ReadOnly;
+    }
+
+    #region content event handlers
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+    #endregion
+
+    #region control event handlers
+
+    private void minTimeOffsetTextBox_TextChanged(object sender, EventArgs e) {
+      int timeOffset;
+      if (int.TryParse(minTimeOffsetTextBox.Text, out timeOffset) && timeOffset < 0) {
+        Content.MinLag = timeOffset;
+        errorProvider.SetError(minTimeOffsetTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(minTimeOffsetTextBox, "Time offset must be a negative value.");
+      }
+    }
+
+    private void maxTimeOffsetTextBox_TextChanged(object sender, EventArgs e) {
+      int timeOffset;
+      if (int.TryParse(maxTimeOffsetTextBox.Text, out timeOffset) && timeOffset < 0) {
+        Content.MaxLag = timeOffset;
+        errorProvider.SetError(maxTimeOffsetTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(maxTimeOffsetTextBox, "Time offset must be a negative value.");
+      }
+    }
+
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        minTimeOffsetTextBox.Text = string.Empty;
+        maxTimeOffsetTextBox.Text = string.Empty;
+      } else {
+        minTimeOffsetTextBox.Text = Content.MinLag.ToString();
+        maxTimeOffsetTextBox.Text = Content.MaxLag.ToString();
+      }
+      SetEnabledStateOfControls();
+    }
+    #endregion
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/TimeLagView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/TimeLagView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/TimeLagView.Designer.cs	(revision 5026)
@@ -0,0 +1,143 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
+  partial class TimeLagView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.minTimeOffsetLabel = new System.Windows.Forms.Label();
+      this.maxTimeOffsetLabel = new System.Windows.Forms.Label();
+      this.minTimeOffsetTextBox = new System.Windows.Forms.TextBox();
+      this.maxTimeOffsetTextBox = new System.Windows.Forms.TextBox();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // initialFrequencyLabel
+      // 
+      this.initialFrequencyLabel.Location = new System.Drawing.Point(3, 56);
+      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // initialFrequencyTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.initialFrequencyTextBox.Size = new System.Drawing.Size(285, 20);
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Size = new System.Drawing.Size(285, 20);
+      // 
+      // descriptionTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.descriptionTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.descriptionTextBox.Size = new System.Drawing.Size(285, 20);
+      // 
+      // minTimeOffsetLabel
+      // 
+      this.minTimeOffsetLabel.AutoSize = true;
+      this.minTimeOffsetLabel.Location = new System.Drawing.Point(3, 82);
+      this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
+      this.minTimeOffsetLabel.Size = new System.Drawing.Size(81, 13);
+      this.minTimeOffsetLabel.TabIndex = 10;
+      this.minTimeOffsetLabel.Text = "Min. time offset:";
+      // 
+      // maxTimeOffsetLabel
+      // 
+      this.maxTimeOffsetLabel.AutoSize = true;
+      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(3, 108);
+      this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
+      this.maxTimeOffsetLabel.Size = new System.Drawing.Size(84, 13);
+      this.maxTimeOffsetLabel.TabIndex = 11;
+      this.maxTimeOffsetLabel.Text = "Max. time offset:";
+      // 
+      // minTimeOffsetTextBox
+      // 
+      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(117, 79);
+      this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
+      this.minTimeOffsetTextBox.Size = new System.Drawing.Size(285, 20);
+      this.minTimeOffsetTextBox.TabIndex = 12;
+      this.minTimeOffsetTextBox.TextChanged += new System.EventHandler(this.minTimeOffsetTextBox_TextChanged);
+      // 
+      // maxTimeOffsetTextBox
+      // 
+      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(117, 105);
+      this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
+      this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(285, 20);
+      this.maxTimeOffsetTextBox.TabIndex = 13;
+      this.maxTimeOffsetTextBox.TextChanged += new System.EventHandler(this.maxTimeOffsetTextBox_TextChanged);
+      // 
+      // TimeLagView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.maxTimeOffsetTextBox);
+      this.Controls.Add(this.minTimeOffsetTextBox);
+      this.Controls.Add(this.maxTimeOffsetLabel);
+      this.Controls.Add(this.minTimeOffsetLabel);
+      this.Name = "TimeLagView";
+      this.Size = new System.Drawing.Size(408, 141);
+      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.descriptionLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
+      this.Controls.SetChildIndex(this.minTimeOffsetLabel, 0);
+      this.Controls.SetChildIndex(this.maxTimeOffsetLabel, 0);
+      this.Controls.SetChildIndex(this.minTimeOffsetTextBox, 0);
+      this.Controls.SetChildIndex(this.maxTimeOffsetTextBox, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label minTimeOffsetLabel;
+    private System.Windows.Forms.Label maxTimeOffsetLabel;
+    private System.Windows.Forms.TextBox minTimeOffsetTextBox;
+    private System.Windows.Forms.TextBox maxTimeOffsetTextBox;
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/TimeLagView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/TimeLagView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/TimeLagView.cs	(revision 5026)
@@ -0,0 +1,109 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
+  [View("TimeLag View")]
+  [Content(typeof(TimeLag), true)]
+  public partial class TimeLagView : SymbolView {
+    public new TimeLag Content {
+      get { return (TimeLag)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public TimeLagView() {
+      InitializeComponent();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.Changed -= new EventHandler(Content_Changed);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateControl();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      minTimeOffsetTextBox.Enabled = Content != null;
+      minTimeOffsetTextBox.ReadOnly = ReadOnly;
+      maxTimeOffsetTextBox.Enabled = Content != null;
+      maxTimeOffsetTextBox.ReadOnly = ReadOnly;
+    }
+
+    #region content event handlers
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+    #endregion
+
+    #region control event handlers
+
+    private void minTimeOffsetTextBox_TextChanged(object sender, EventArgs e) {
+      int timeOffset;
+      if (int.TryParse(minTimeOffsetTextBox.Text, out timeOffset) && timeOffset < 0) {
+        Content.MinLag = timeOffset;
+        errorProvider.SetError(minTimeOffsetTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(minTimeOffsetTextBox, "Time offset must be a negative value.");
+      }
+    }
+
+    private void maxTimeOffsetTextBox_TextChanged(object sender, EventArgs e) {
+      int timeOffset;
+      if (int.TryParse(maxTimeOffsetTextBox.Text, out timeOffset) && timeOffset < 0) {
+        Content.MaxLag = timeOffset;
+        errorProvider.SetError(maxTimeOffsetTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(maxTimeOffsetTextBox, "Time offset must be a negative value.");
+      }
+    }
+
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        minTimeOffsetTextBox.Text = string.Empty;
+        maxTimeOffsetTextBox.Text = string.Empty;
+      } else {
+        minTimeOffsetTextBox.Text = Content.MinLag.ToString();
+        maxTimeOffsetTextBox.Text = Content.MaxLag.ToString();
+      }
+      SetEnabledStateOfControls();
+    }
+    #endregion
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/VariableView.Designer.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/VariableView.Designer.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/VariableView.Designer.cs	(revision 5026)
@@ -0,0 +1,242 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
+  partial class VariableView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.weightMuLabel = new System.Windows.Forms.Label();
+      this.weightMuTextBox = new System.Windows.Forms.TextBox();
+      this.initializationGroupBox = new System.Windows.Forms.GroupBox();
+      this.weightSigmaLabel = new System.Windows.Forms.Label();
+      this.weightSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.mutationGroupBox = new System.Windows.Forms.GroupBox();
+      this.stdDevWeightChangeLabel = new System.Windows.Forms.Label();
+      this.weightChangeSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.meanWeightChangeLabel = new System.Windows.Forms.Label();
+      this.weightChangeMuTextBox = new System.Windows.Forms.TextBox();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.initializationGroupBox.SuspendLayout();
+      this.mutationGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // initialFrequencyLabel
+      // 
+      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // initialFrequencyTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.initialFrequencyTextBox.Size = new System.Drawing.Size(203, 20);
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Size = new System.Drawing.Size(203, 20);
+      // 
+      // descriptionTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.descriptionTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.descriptionTextBox.Size = new System.Drawing.Size(203, 20);
+      // 
+      // weightMuLabel
+      // 
+      this.weightMuLabel.AutoSize = true;
+      this.weightMuLabel.Location = new System.Drawing.Point(6, 22);
+      this.weightMuLabel.Name = "weightMuLabel";
+      this.weightMuLabel.Size = new System.Drawing.Size(67, 13);
+      this.weightMuLabel.TabIndex = 6;
+      this.weightMuLabel.Text = "Weight (mu):";
+      this.toolTip.SetToolTip(this.weightMuLabel, "The mu (mean) parameter of the normal distribution to use for initial weights.");
+      // 
+      // weightMuTextBox
+      // 
+      this.weightMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.weightMuTextBox.Location = new System.Drawing.Point(92, 19);
+      this.weightMuTextBox.Name = "weightMuTextBox";
+      this.weightMuTextBox.Size = new System.Drawing.Size(201, 20);
+      this.weightMuTextBox.TabIndex = 7;
+      this.toolTip.SetToolTip(this.weightMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
+              "al weights.");
+      this.weightMuTextBox.TextChanged += new System.EventHandler(this.weightMuTextBox_TextChanged);
+      // 
+      // initializationGroupBox
+      // 
+      this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.initializationGroupBox.Controls.Add(this.weightSigmaLabel);
+      this.initializationGroupBox.Controls.Add(this.weightSigmaTextBox);
+      this.initializationGroupBox.Controls.Add(this.weightMuLabel);
+      this.initializationGroupBox.Controls.Add(this.weightMuTextBox);
+      this.initializationGroupBox.Location = new System.Drawing.Point(3, 79);
+      this.initializationGroupBox.Name = "initializationGroupBox";
+      this.initializationGroupBox.Size = new System.Drawing.Size(320, 73);
+      this.initializationGroupBox.TabIndex = 8;
+      this.initializationGroupBox.TabStop = false;
+      this.initializationGroupBox.Text = "Initialization";
+      // 
+      // weightSigmaLabel
+      // 
+      this.weightSigmaLabel.AutoSize = true;
+      this.weightSigmaLabel.Location = new System.Drawing.Point(6, 48);
+      this.weightSigmaLabel.Name = "weightSigmaLabel";
+      this.weightSigmaLabel.Size = new System.Drawing.Size(80, 13);
+      this.weightSigmaLabel.TabIndex = 8;
+      this.weightSigmaLabel.Text = "Weight (sigma):";
+      this.toolTip.SetToolTip(this.weightSigmaLabel, "The sigma parameter for the normal distribution to use for the initial weights.");
+      // 
+      // weightSigmaTextBox
+      // 
+      this.weightSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.weightSigmaTextBox.Location = new System.Drawing.Point(92, 45);
+      this.weightSigmaTextBox.Name = "weightSigmaTextBox";
+      this.weightSigmaTextBox.Size = new System.Drawing.Size(201, 20);
+      this.weightSigmaTextBox.TabIndex = 9;
+      this.toolTip.SetToolTip(this.weightSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
+              "weights.");
+      this.weightSigmaTextBox.TextChanged += new System.EventHandler(this.weightSigmaTextBox_TextChanged);
+      // 
+      // mutationGroupBox
+      // 
+      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.mutationGroupBox.Controls.Add(this.stdDevWeightChangeLabel);
+      this.mutationGroupBox.Controls.Add(this.weightChangeSigmaTextBox);
+      this.mutationGroupBox.Controls.Add(this.meanWeightChangeLabel);
+      this.mutationGroupBox.Controls.Add(this.weightChangeMuTextBox);
+      this.mutationGroupBox.Location = new System.Drawing.Point(3, 158);
+      this.mutationGroupBox.Name = "mutationGroupBox";
+      this.mutationGroupBox.Size = new System.Drawing.Size(320, 73);
+      this.mutationGroupBox.TabIndex = 9;
+      this.mutationGroupBox.TabStop = false;
+      this.mutationGroupBox.Text = "Mutation";
+      // 
+      // stdDevWeightChangeLabel
+      // 
+      this.stdDevWeightChangeLabel.AutoSize = true;
+      this.stdDevWeightChangeLabel.Location = new System.Drawing.Point(6, 48);
+      this.stdDevWeightChangeLabel.Name = "stdDevWeightChangeLabel";
+      this.stdDevWeightChangeLabel.Size = new System.Drawing.Size(119, 13);
+      this.stdDevWeightChangeLabel.TabIndex = 8;
+      this.stdDevWeightChangeLabel.Text = "Weight change (sigma):";
+      this.toolTip.SetToolTip(this.stdDevWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample the change in we" +
+              "ight.");
+      // 
+      // weightChangeSigmaTextBox
+      // 
+      this.weightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.weightChangeSigmaTextBox.Location = new System.Drawing.Point(131, 45);
+      this.weightChangeSigmaTextBox.Name = "weightChangeSigmaTextBox";
+      this.weightChangeSigmaTextBox.Size = new System.Drawing.Size(162, 20);
+      this.weightChangeSigmaTextBox.TabIndex = 9;
+      this.toolTip.SetToolTip(this.weightChangeSigmaTextBox, "The sigma parameter for the normal distribution to use to sample the change in we" +
+              "ight.");
+      this.weightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.weightChangeSigmaTextBox_TextChanged);
+      // 
+      // meanWeightChangeLabel
+      // 
+      this.meanWeightChangeLabel.AutoSize = true;
+      this.meanWeightChangeLabel.Location = new System.Drawing.Point(6, 22);
+      this.meanWeightChangeLabel.Name = "meanWeightChangeLabel";
+      this.meanWeightChangeLabel.Size = new System.Drawing.Size(106, 13);
+      this.meanWeightChangeLabel.TabIndex = 6;
+      this.meanWeightChangeLabel.Text = "Weight change (mu):";
+      this.toolTip.SetToolTip(this.meanWeightChangeLabel, "The nu (mean) parameter for the normal distribution to sample the change in weigh" +
+              "t.");
+      // 
+      // weightChangeMuTextBox
+      // 
+      this.weightChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.weightChangeMuTextBox.Location = new System.Drawing.Point(131, 19);
+      this.weightChangeMuTextBox.Name = "weightChangeMuTextBox";
+      this.weightChangeMuTextBox.Size = new System.Drawing.Size(162, 20);
+      this.weightChangeMuTextBox.TabIndex = 7;
+      this.toolTip.SetToolTip(this.weightChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the change in weigh" +
+              "t.");
+      this.weightChangeMuTextBox.TextChanged += new System.EventHandler(this.weightChangeMuTextBox_TextChanged);
+      // 
+      // VariableView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.mutationGroupBox);
+      this.Controls.Add(this.initializationGroupBox);
+      this.Name = "VariableView";
+      this.Size = new System.Drawing.Size(326, 235);
+      this.Controls.SetChildIndex(this.initializationGroupBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.descriptionLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
+      this.Controls.SetChildIndex(this.mutationGroupBox, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.initializationGroupBox.ResumeLayout(false);
+      this.initializationGroupBox.PerformLayout();
+      this.mutationGroupBox.ResumeLayout(false);
+      this.mutationGroupBox.PerformLayout();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label weightMuLabel;
+    private System.Windows.Forms.TextBox weightMuTextBox;
+    protected System.Windows.Forms.GroupBox initializationGroupBox;
+    private System.Windows.Forms.Label weightSigmaLabel;
+    private System.Windows.Forms.TextBox weightSigmaTextBox;
+    protected System.Windows.Forms.GroupBox mutationGroupBox;
+    private System.Windows.Forms.Label stdDevWeightChangeLabel;
+    private System.Windows.Forms.TextBox weightChangeSigmaTextBox;
+    private System.Windows.Forms.Label meanWeightChangeLabel;
+    private System.Windows.Forms.TextBox weightChangeMuTextBox;
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/VariableView.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/VariableView.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/VariableView.cs	(revision 5026)
@@ -0,0 +1,133 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Windows.Forms;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
+  [View("Variable View")]
+  [Content(typeof(Variable), true)]
+  public partial class VariableView : SymbolView {
+    public new Variable Content {
+      get { return (Variable)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public VariableView() {
+      InitializeComponent();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.Changed -= new EventHandler(Content_Changed);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateControl();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      weightMuTextBox.Enabled = Content != null;
+      weightMuTextBox.ReadOnly = ReadOnly;
+      weightSigmaTextBox.Enabled = Content != null;
+      weightSigmaTextBox.ReadOnly = ReadOnly;
+      weightChangeMuTextBox.Enabled = Content != null;
+      weightChangeMuTextBox.ReadOnly = ReadOnly;
+      weightChangeSigmaTextBox.Enabled = Content != null;
+      weightChangeSigmaTextBox.ReadOnly = ReadOnly;
+    }
+
+    #region content event handlers
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+    #endregion
+
+    #region control event handlers
+    private void weightMuTextBox_TextChanged(object sender, EventArgs e) {
+      double nu;
+      if (double.TryParse(weightMuTextBox.Text, out nu)) {
+        Content.WeightMu = nu;
+        errorProvider.SetError(weightMuTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(weightMuTextBox, "Invalid value");
+      }
+    }
+    private void weightSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double sigma;
+      if (double.TryParse(weightSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
+        Content.WeightSigma = sigma;
+        errorProvider.SetError(weightSigmaTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(weightSigmaTextBox, "Invalid value");
+      }
+    }
+
+    private void weightChangeMuTextBox_TextChanged(object sender, EventArgs e) {
+      double nu;
+      if (double.TryParse(weightChangeMuTextBox.Text, out nu)) {
+        Content.WeightManipulatorMu = nu;
+        errorProvider.SetError(weightChangeMuTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(weightChangeMuTextBox, "Invalid value");
+      }
+    }
+
+    private void weightChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double sigma;
+      if (double.TryParse(weightChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
+        Content.WeightManipulatorSigma = sigma;
+        errorProvider.SetError(weightChangeSigmaTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(weightChangeSigmaTextBox, "Invalid value");
+      }
+    }
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        weightMuTextBox.Text = string.Empty;
+        weightSigmaTextBox.Text = string.Empty;
+        weightMuTextBox.Text = string.Empty;
+        weightChangeSigmaTextBox.Text = string.Empty;
+      } else {
+        weightMuTextBox.Text = Content.WeightMu.ToString();
+        weightSigmaTextBox.Text = Content.WeightSigma.ToString();
+        weightChangeMuTextBox.Text = Content.WeightManipulatorMu.ToString();
+        weightChangeSigmaTextBox.Text = Content.WeightManipulatorSigma.ToString();
+      }
+      SetEnabledStateOfControls();
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs	(revision 5026)
@@ -0,0 +1,153 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Drawing;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Item("Data Analysis Problem", "Represents a data analysis problem.")]
+  [Creatable("Problems")]
+  [StorableClass]
+  public class DataAnalysisProblem : ParameterizedNamedItem, IDataAnalysisProblem, IStorableContent {
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+
+    public string Filename { get; set; }
+
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; }
+    }
+
+    #region Parameter Properties
+    public ValueParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (ValueParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected DataAnalysisProblem(bool deserializing) : base(deserializing) { }
+    protected DataAnalysisProblem(DataAnalysisProblem original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    public DataAnalysisProblem()
+      : base() {
+      Parameters.Add(new ValueParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data set, target variable and input variables of the data analysis problem.", new DataAnalysisProblemData()));
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterParameterEvents();
+      RegisterParameterValueEvents();
+    }
+
+    #region events
+    protected virtual void OnDataAnalysisProblemChanged(EventArgs e) {
+      RaiseReset(e);
+    }
+
+    private void RegisterParameterEvents() {
+      DataAnalysisProblemDataParameter.ValueChanged += new EventHandler(DataAnalysisProblemDataParameter_ValueChanged);
+    }
+
+    private void RegisterParameterValueEvents() {
+      DataAnalysisProblemData.ProblemDataChanged += new EventHandler(DataAnalysisProblemData_ProblemDataChanged);
+    }
+
+    private void DataAnalysisProblemDataParameter_ValueChanged(object sender, EventArgs e) {
+      OnDataAnalysisProblemChanged(e);
+    }
+
+    private void DataAnalysisProblemData_ProblemDataChanged(object sender, EventArgs e) {
+      OnDataAnalysisProblemChanged(e);
+    }
+    #endregion
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DataAnalysisProblem(this, cloner);
+    }
+
+    #region IProblem Members
+
+    public virtual IParameter SolutionCreatorParameter {
+      get { return null; }
+    }
+
+    public virtual ISolutionCreator SolutionCreator {
+      get { return null; }
+    }
+
+    public virtual IParameter EvaluatorParameter {
+      get { return null; }
+    }
+
+    public virtual IEvaluator Evaluator {
+      get { return null; }
+    }
+
+    public virtual IEnumerable<IOperator> Operators {
+      get { return new IOperator[0]; }
+    }
+
+    public event EventHandler SolutionCreatorChanged;
+    protected void RaiseSolutionCreatorChanged(EventArgs e) {
+      var changed = SolutionCreatorChanged;
+      if (changed != null)
+        changed(this, e);
+    }
+
+    public event EventHandler EvaluatorChanged;
+    protected void RaiseEvaluatorChanged(EventArgs e) {
+      var changed = EvaluatorChanged;
+      if (changed != null)
+        changed(this, e);
+    }
+
+    public event EventHandler OperatorsChanged;
+    protected void RaiseOperatorsChanged(EventArgs e) {
+      var changed = OperatorsChanged;
+      if (changed != null)
+        changed(this, e);
+    }
+
+    public event EventHandler Reset;
+    protected void RaiseReset(EventArgs e) {
+      var changed = Reset;
+      if (changed != null)
+        changed(this, e);
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs	(revision 5026)
@@ -0,0 +1,420 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.IO;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Item("DataAnalysisProblemData", "Represents an item containing all data defining a data analysis problem.")]
+  [StorableClass]
+  public class DataAnalysisProblemData : ParameterizedNamedItem, IStorableContent {
+    protected bool suppressEvents = false;
+    #region IStorableContent Members
+    public string Filename { get; set; }
+    #endregion
+    #region default data
+    // y = x^4 + x^3 + x^2 + x
+    private static double[,] kozaF1 = new double[,] {
+{2.017885919,	-1.449165046},
+{1.30060506,	-1.344523885},
+{1.147134798,	-1.317989331},
+{0.877182504,	-1.266142284},
+{0.852562452,	-1.261020794},
+{0.431095788,	-1.158793317},
+{0.112586002,	-1.050908405},
+{0.04594507,	-1.021989402},
+{0.042572879,	-1.020438113},
+{-0.074027291,	-0.959859562},
+{-0.109178553,	-0.938094706},
+{-0.259721109,	-0.803635355},
+{-0.272991057,	-0.387519561},
+{-0.161978191,	-0.193611001},
+{-0.102489983,	-0.114215349},
+{-0.01469968,	-0.014918985},
+{-0.008863365,	-0.008942626},
+{0.026751057,	0.026054094},
+{0.166922436,	0.14309643},
+{0.176953808,	0.1504144},
+{0.190233418,	0.159916534},
+{0.199800708,	0.166635331},
+{0.261502822,	0.207600348},
+{0.30182879,	0.232370249},
+{0.83763905,	0.468046718}
+    };
+    #endregion
+    #region parameter properties
+    public ValueParameter<Dataset> DatasetParameter {
+      get { return (ValueParameter<Dataset>)Parameters["Dataset"]; }
+    }
+    public IValueParameter<StringValue> TargetVariableParameter {
+      get { return (IValueParameter<StringValue>)Parameters["TargetVariable"]; }
+    }
+    public IValueParameter<ICheckedItemList<StringValue>> InputVariablesParameter {
+      get { return (IValueParameter<ICheckedItemList<StringValue>>)Parameters["InputVariables"]; }
+    }
+    public IValueParameter<IntValue> TrainingSamplesStartParameter {
+      get { return (IValueParameter<IntValue>)Parameters["TrainingSamplesStart"]; }
+    }
+    public IValueParameter<IntValue> TrainingSamplesEndParameter {
+      get { return (IValueParameter<IntValue>)Parameters["TrainingSamplesEnd"]; }
+    }
+    public IValueParameter<IntValue> TestSamplesStartParameter {
+      get { return (IValueParameter<IntValue>)Parameters["TestSamplesStart"]; }
+    }
+    public IValueParameter<IntValue> TestSamplesEndParameter {
+      get { return (IValueParameter<IntValue>)Parameters["TestSamplesEnd"]; }
+    }
+    public IValueParameter<PercentValue> ValidationPercentageParameter {
+      get { return (IValueParameter<PercentValue>)Parameters["ValidationPercentage"]; }
+    }
+    #endregion
+
+    #region properties
+    public Dataset Dataset {
+      get { return DatasetParameter.Value; }
+      set {
+        if (value != Dataset) {
+          if (value == null) throw new ArgumentNullException();
+          DatasetParameter.Value = value;
+        }
+      }
+    }
+    public StringValue TargetVariable {
+      get { return TargetVariableParameter.Value; }
+      set {
+        if (value != TargetVariableParameter.Value) {
+          if (value == null) throw new ArgumentNullException();
+          if (TargetVariable != null) DeregisterStringValueEventHandlers(TargetVariable);
+          TargetVariableParameter.Value = value;
+        }
+      }
+    }
+    public ICheckedItemList<StringValue> InputVariables {
+      get { return InputVariablesParameter.Value; }
+      set {
+        if (value != InputVariables) {
+          if (value == null) throw new ArgumentNullException();
+          if (InputVariables != null) DeregisterInputVariablesEventHandlers();
+          InputVariablesParameter.Value = value;
+        }
+      }
+    }
+    public IntValue TrainingSamplesStart {
+      get { return TrainingSamplesStartParameter.Value; }
+      set {
+        if (value != TrainingSamplesStart) {
+          if (value == null) throw new ArgumentNullException();
+          if (TrainingSamplesStart != null) DeregisterValueTypeEventHandlers(TrainingSamplesStart);
+          TrainingSamplesStartParameter.Value = value;
+        }
+      }
+    }
+    public IntValue TrainingSamplesEnd {
+      get { return TrainingSamplesEndParameter.Value; }
+      set {
+        if (value != TrainingSamplesEnd) {
+          if (value == null) throw new ArgumentNullException();
+          if (TrainingSamplesEnd != null) DeregisterValueTypeEventHandlers(TrainingSamplesEnd);
+          TrainingSamplesEndParameter.Value = value;
+        }
+      }
+    }
+    public IntValue TestSamplesStart {
+      get { return TestSamplesStartParameter.Value; }
+      set {
+        if (value != TestSamplesStart) {
+          if (value == null) throw new ArgumentNullException();
+          if (TestSamplesStart != null) DeregisterValueTypeEventHandlers(TestSamplesStart);
+          TestSamplesStartParameter.Value = value;
+        }
+      }
+    }
+    public IntValue TestSamplesEnd {
+      get { return TestSamplesEndParameter.Value; }
+      set {
+        if (value != TestSamplesEnd) {
+          if (value == null) throw new ArgumentNullException();
+          if (TestSamplesEnd != null) DeregisterValueTypeEventHandlers(TestSamplesEnd);
+          TestSamplesEndParameter.Value = value;
+        }
+      }
+    }
+    public PercentValue ValidationPercentage {
+      get { return ValidationPercentageParameter.Value; }
+      set {
+        if (value != ValidationPercentage) {
+          if (value == null) throw new ArgumentNullException();
+          if (value.Value < 0 || value.Value > 1) throw new ArgumentException("ValidationPercentage must be between 0 and 1.");
+          if (ValidationPercentage != null) DeregisterValueTypeEventHandlers(ValidationPercentage);
+          ValidationPercentageParameter.Value = value;
+        }
+      }
+    }
+
+    public IEnumerable<int> TrainingIndizes {
+      get {
+        return Enumerable.Range(TrainingSamplesStart.Value, TrainingSamplesEnd.Value - TrainingSamplesStart.Value)
+                         .Where(i => i >= 0 && i < Dataset.Rows && (i < TestSamplesStart.Value || TestSamplesEnd.Value <= i));
+      }
+    }
+    public IEnumerable<int> TestIndizes {
+      get {
+        return Enumerable.Range(TestSamplesStart.Value, TestSamplesEnd.Value - TestSamplesStart.Value)
+           .Where(i => i >= 0 && i < Dataset.Rows);
+      }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected DataAnalysisProblemData(bool deserializing) : base(deserializing) { }
+    protected DataAnalysisProblemData(DataAnalysisProblemData original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterParameterEventHandlers();
+      RegisterParameterValueEventHandlers();
+    }
+    public DataAnalysisProblemData()
+      : base() {
+      var inputVariables = new CheckedItemList<StringValue>();
+      StringValue inputVariable = new StringValue("x");
+      inputVariables.Add(inputVariable);
+      StringValue targetVariable = new StringValue("y");
+      var validTargetVariables = new ItemSet<StringValue>();
+      validTargetVariables.Add(targetVariable);
+      Parameters.Add(new ValueParameter<Dataset>("Dataset", new Dataset(new string[] { "y", "x" }, kozaF1)));
+      Parameters.Add(new ValueParameter<ICheckedItemList<StringValue>>("InputVariables", inputVariables.AsReadOnly()));
+      Parameters.Add(new ConstrainedValueParameter<StringValue>("TargetVariable", validTargetVariables, targetVariable));
+      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesStart", new IntValue(0)));
+      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesEnd", new IntValue(15)));
+      Parameters.Add(new ValueParameter<IntValue>("TestSamplesStart", new IntValue(15)));
+      Parameters.Add(new ValueParameter<IntValue>("TestSamplesEnd", new IntValue(25)));
+      Parameters.Add(new ValueParameter<PercentValue>("ValidationPercentage", "The relative amount of the training samples that should be used as validation set.", new PercentValue(0.5)));
+
+      DatasetParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false;
+      RegisterParameterEventHandlers();
+      RegisterParameterValueEventHandlers();
+    }
+
+    public DataAnalysisProblemData(Dataset dataset, IEnumerable<string> inputVariables, string targetVariable,
+      int trainingSamplesStart, int trainingSamplesEnd, int testSamplesStart, int testSamplesEnd) {
+      var inputVariablesList = new CheckedItemList<StringValue>(inputVariables.Select(x => new StringValue(x)).ToList());
+      StringValue targetVariableValue = new StringValue(targetVariable);
+      var validTargetVariables = new ItemSet<StringValue>();
+      foreach (var variable in dataset.VariableNames)
+        if (variable != targetVariable)
+          validTargetVariables.Add(new StringValue(variable));
+      validTargetVariables.Add(targetVariableValue);
+      Parameters.Add(new ValueParameter<Dataset>("Dataset", dataset));
+      Parameters.Add(new ValueParameter<ICheckedItemList<StringValue>>("InputVariables", inputVariablesList.AsReadOnly()));
+      Parameters.Add(new ConstrainedValueParameter<StringValue>("TargetVariable", validTargetVariables, targetVariableValue));
+      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesStart", new IntValue(trainingSamplesStart)));
+      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesEnd", new IntValue(trainingSamplesEnd)));
+      Parameters.Add(new ValueParameter<IntValue>("TestSamplesStart", new IntValue(testSamplesStart)));
+      Parameters.Add(new ValueParameter<IntValue>("TestSamplesEnd", new IntValue(testSamplesEnd)));
+      Parameters.Add(new ValueParameter<PercentValue>("ValidationPercentage", "The relative amount of the training samples that should be used as validation set.", new PercentValue(0.5)));
+
+      DatasetParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false;
+      RegisterParameterEventHandlers();
+      RegisterParameterValueEventHandlers();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DataAnalysisProblemData(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey("ValidationPercentage"))
+        Parameters.Add(new ValueParameter<PercentValue>("ValidationPercentage", "The relative amount of the training samples that should be used as validation set.", new PercentValue(0.5)));
+
+      DatasetParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false;
+      RegisterParameterEventHandlers();
+      RegisterParameterValueEventHandlers();
+    }
+
+    #region events
+    public event EventHandler ProblemDataChanged;
+    protected virtual void OnProblemDataChanged(EventArgs e) {
+      if (TrainingSamplesStart.Value < 0) TrainingSamplesStart.Value = 0;
+      else if (TestSamplesStart.Value < 0) TestSamplesStart.Value = 0;
+      else if (TrainingSamplesEnd.Value > Dataset.Rows - 1) TrainingSamplesEnd.Value = Dataset.Rows - 1;
+      else if (TestSamplesEnd.Value > Dataset.Rows - 1) TestSamplesEnd.Value = Dataset.Rows - 1;
+      else if (TrainingSamplesStart.Value > TrainingSamplesEnd.Value) TrainingSamplesStart.Value = TestSamplesEnd.Value;
+      else if (TestSamplesStart.Value > TestSamplesEnd.Value) TestSamplesStart.Value = TestSamplesEnd.Value;
+      else if (ValidationPercentage.Value < 0) ValidationPercentage.Value = 0;
+      else if (ValidationPercentage.Value > 1) ValidationPercentage.Value = 1;
+      else if (!TrainingIndizes.Any()) throw new ArgumentException("No training samples are available.");
+      else if (!suppressEvents) {
+        var listeners = ProblemDataChanged;
+        if (listeners != null) listeners(this, e);
+      }
+    }
+
+    private void RegisterParameterEventHandlers() {
+      DatasetParameter.ValueChanged += new EventHandler(DatasetParameter_ValueChanged);
+      InputVariablesParameter.ValueChanged += new EventHandler(InputVariablesParameter_ValueChanged);
+      TargetVariableParameter.ValueChanged += new EventHandler(TargetVariableParameter_ValueChanged);
+      TrainingSamplesStartParameter.ValueChanged += new EventHandler(TrainingSamplesStartParameter_ValueChanged);
+      TrainingSamplesEndParameter.ValueChanged += new EventHandler(TrainingSamplesEndParameter_ValueChanged);
+      TestSamplesStartParameter.ValueChanged += new EventHandler(TestSamplesStartParameter_ValueChanged);
+      TestSamplesEndParameter.ValueChanged += new EventHandler(TestSamplesEndParameter_ValueChanged);
+      ValidationPercentageParameter.ValueChanged += new EventHandler(ValidationPercentageParameter_ValueChanged);
+    }
+
+    private void RegisterParameterValueEventHandlers() {
+      RegisterInputVariablesEventHandlers();
+      if (TargetVariable != null) RegisterStringValueEventHandlers(TargetVariable);
+      RegisterValueTypeEventHandlers(TrainingSamplesStart);
+      RegisterValueTypeEventHandlers(TrainingSamplesEnd);
+      RegisterValueTypeEventHandlers(TestSamplesStart);
+      RegisterValueTypeEventHandlers(TestSamplesEnd);
+      RegisterValueTypeEventHandlers(ValidationPercentage);
+    }
+
+
+    #region parameter value changed event handlers
+    private void DatasetParameter_ValueChanged(object sender, EventArgs e) {
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void InputVariablesParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterInputVariablesEventHandlers();
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void TargetVariableParameter_ValueChanged(object sender, EventArgs e) {
+      if (TargetVariable != null) {
+        RegisterStringValueEventHandlers(TargetVariable);
+        OnProblemDataChanged(EventArgs.Empty);
+      }
+    }
+    private void TrainingSamplesStartParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(TrainingSamplesStart);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void TrainingSamplesEndParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(TrainingSamplesEnd);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void TestSamplesStartParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(TestSamplesStart);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void TestSamplesEndParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(TestSamplesEnd);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void ValidationPercentageParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(ValidationPercentage);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    #endregion
+
+    private void RegisterInputVariablesEventHandlers() {
+      InputVariables.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CollectionReset);
+      InputVariables.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsAdded);
+      InputVariables.ItemsRemoved += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsRemoved);
+      InputVariables.CheckedItemsChanged += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CheckedItemsChanged);
+      foreach (var item in InputVariables) {
+        item.ValueChanged += new EventHandler(InputVariable_ValueChanged);
+      }
+    }
+
+    private void DeregisterInputVariablesEventHandlers() {
+      InputVariables.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CollectionReset);
+      InputVariables.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsAdded);
+      InputVariables.ItemsRemoved -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_ItemsRemoved);
+      InputVariables.CheckedItemsChanged -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<HeuristicLab.Collections.IndexedItem<StringValue>>(InputVariables_CheckedItemsChanged);
+      foreach (var item in InputVariables) {
+        item.ValueChanged -= new EventHandler(InputVariable_ValueChanged);
+      }
+    }
+
+    private void InputVariables_CheckedItemsChanged(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) {
+      OnProblemDataChanged(e);
+    }
+    private void InputVariables_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) {
+      foreach (var indexedItem in e.Items)
+        indexedItem.Value.ValueChanged -= new EventHandler(InputVariable_ValueChanged);
+      OnProblemDataChanged(e);
+    }
+    private void InputVariables_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) {
+      foreach (var indexedItem in e.Items)
+        indexedItem.Value.ValueChanged += new EventHandler(InputVariable_ValueChanged);
+      OnProblemDataChanged(e);
+    }
+    private void InputVariables_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<HeuristicLab.Collections.IndexedItem<StringValue>> e) {
+      foreach (var indexedItem in e.OldItems)
+        indexedItem.Value.ValueChanged -= new EventHandler(InputVariable_ValueChanged);
+      OnProblemDataChanged(e);
+    }
+    private void InputVariable_ValueChanged(object sender, EventArgs e) {
+      OnProblemDataChanged(e);
+    }
+
+    #region helper
+    private void RegisterValueTypeEventHandlers<T>(ValueTypeValue<T> value) where T : struct {
+      value.ValueChanged += new EventHandler(value_ValueChanged);
+    }
+    private void DeregisterValueTypeEventHandlers<T>(ValueTypeValue<T> value) where T : struct {
+      value.ValueChanged -= new EventHandler(value_ValueChanged);
+    }
+    private void RegisterStringValueEventHandlers(StringValue value) {
+      value.ValueChanged += new EventHandler(value_ValueChanged);
+    }
+    private void DeregisterStringValueEventHandlers(StringValue value) {
+      value.ValueChanged -= new EventHandler(value_ValueChanged);
+    }
+
+    private void value_ValueChanged(object sender, EventArgs e) {
+      OnProblemDataChanged(e);
+    }
+    #endregion
+    #endregion
+
+    public virtual void ImportFromFile(string fileName) {
+      var csvFileParser = new TableFileParser();
+      csvFileParser.Parse(fileName);
+      suppressEvents = true;
+      Name = "Data imported from " + Path.GetFileName(fileName);
+      Dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
+      Dataset.Name = Path.GetFileName(fileName);
+      var variableNames = Dataset.VariableNames.Select(x => new StringValue(x).AsReadOnly()).ToList();
+      ((ConstrainedValueParameter<StringValue>)TargetVariableParameter).ValidValues.Clear();
+      foreach (var variableName in variableNames)
+        ((ConstrainedValueParameter<StringValue>)TargetVariableParameter).ValidValues.Add(variableName);
+      TargetVariable = variableNames.First();
+      InputVariables = new CheckedItemList<StringValue>(variableNames).AsReadOnly();
+      InputVariables.SetItemCheckedState(variableNames.First(), false);
+      int middle = (int)(csvFileParser.Rows * 0.5);
+      TrainingSamplesEnd = new IntValue(middle);
+      TrainingSamplesStart = new IntValue(0);
+      TestSamplesEnd = new IntValue(csvFileParser.Rows);
+      TestSamplesStart = new IntValue(middle);
+      suppressEvents = false;
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs	(revision 5026)
@@ -0,0 +1,164 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Represents a solution for a data analysis problem which can be visualized in the GUI.
+  /// </summary>
+  [Item("DataAnalysisSolution", "Represents a solution for a data analysis problem which can be visualized in the GUI.")]
+  [StorableClass]
+  public abstract class DataAnalysisSolution : NamedItem, IStorableContent {
+    #region IStorableContent Members
+    public string Filename { get; set; }
+    #endregion
+
+    [StorableConstructor]
+    protected DataAnalysisSolution(bool deserializing) : base(deserializing) { }
+    protected DataAnalysisSolution(DataAnalysisSolution original, Cloner cloner)
+      : base(original, cloner) {
+      problemData = (DataAnalysisProblemData)cloner.Clone(original.problemData);
+      model = (IDataAnalysisModel)cloner.Clone(original.model);
+      lowerEstimationLimit = original.lowerEstimationLimit;
+      upperEstimationLimit = original.upperEstimationLimit;
+      AfterDeserialization();
+    }
+    protected DataAnalysisSolution()
+      : base() { }
+    protected DataAnalysisSolution(DataAnalysisProblemData problemData) : this(problemData, double.NegativeInfinity, double.PositiveInfinity) { }
+    protected DataAnalysisSolution(DataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit)
+      : this() {
+      this.problemData = problemData;
+      this.lowerEstimationLimit = lowerEstimationLimit;
+      this.upperEstimationLimit = upperEstimationLimit;
+      AfterDeserialization();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (problemData != null)
+        RegisterProblemDataEvents();
+    }
+
+    [Storable]
+    private DataAnalysisProblemData problemData;
+    public DataAnalysisProblemData ProblemData {
+      get { return problemData; }
+      set {
+        if (problemData != value) {
+          if (value == null) throw new ArgumentNullException();
+          if (model != null && problemData != null && !problemData.InputVariables.Select(c => c.Value).SequenceEqual(
+            value.InputVariables.Select(c => c.Value)))
+            throw new ArgumentException("Could not set new problem data with different structure");
+
+          if (problemData != null) DeregisterProblemDataEvents();
+          problemData = value;
+          RegisterProblemDataEvents();
+          OnProblemDataChanged();
+          RecalculateEstimatedValues();
+        }
+      }
+    }
+
+    [Storable]
+    private IDataAnalysisModel model;
+    public IDataAnalysisModel Model {
+      get { return model; }
+      set {
+        if (model != value) {
+          if (value == null) throw new ArgumentNullException();
+          model = value;
+          OnModelChanged();
+          RecalculateEstimatedValues();
+        }
+      }
+    }
+
+    [Storable]
+    private double lowerEstimationLimit;
+    public double LowerEstimationLimit {
+      get { return lowerEstimationLimit; }
+      set {
+        if (lowerEstimationLimit != value) {
+          lowerEstimationLimit = value;
+          RecalculateEstimatedValues();
+        }
+      }
+    }
+
+    [Storable]
+    private double upperEstimationLimit;
+    public double UpperEstimationLimit {
+      get { return upperEstimationLimit; }
+      set {
+        if (upperEstimationLimit != value) {
+          upperEstimationLimit = value;
+          RecalculateEstimatedValues();
+        }
+      }
+    }
+
+    public abstract IEnumerable<double> EstimatedValues { get; }
+    public abstract IEnumerable<double> EstimatedTrainingValues { get; }
+    public abstract IEnumerable<double> EstimatedTestValues { get; }
+    protected abstract void RecalculateEstimatedValues();
+
+    #region Events
+    protected virtual void RegisterProblemDataEvents() {
+      ProblemData.ProblemDataChanged += new EventHandler(ProblemData_Changed);
+    }
+    protected virtual void DeregisterProblemDataEvents() {
+      ProblemData.ProblemDataChanged += new EventHandler(ProblemData_Changed);
+    }
+    private void ProblemData_Changed(object sender, EventArgs e) {
+      OnProblemDataChanged();
+    }
+
+    public event EventHandler ProblemDataChanged;
+    protected virtual void OnProblemDataChanged() {
+      var listeners = ProblemDataChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+
+    public event EventHandler ModelChanged;
+    protected virtual void OnModelChanged() {
+      EventHandler listeners = ModelChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+
+    public event EventHandler EstimatedValuesChanged;
+    protected virtual void OnEstimatedValuesChanged() {
+      var listeners = EstimatedValuesChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+    #endregion
+
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataFormatException.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataFormatException.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/DataFormatException.cs	(revision 5026)
@@ -0,0 +1,44 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Runtime.Serialization;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Serializable]
+  public class DataFormatException : Exception {
+    private int line;
+    public int Line {
+      get { return line; }
+    }
+    private string token;
+    public string Token {
+      get { return token; }
+    }
+    public DataFormatException(string message, string token, int line)
+      : base(message + "\nToken: " + token + " (line: " + line + ")") {
+      this.token = token;
+      this.line = line;
+    }
+
+    public DataFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Dataset.cs	(revision 5026)
@@ -0,0 +1,216 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Item("Dataset", "Represents a dataset containing data that should be analyzed.")]
+  [StorableClass]
+  public sealed class Dataset : NamedItem, IStringConvertibleMatrix {
+    [StorableConstructor]
+    private Dataset(bool deserializing) : base(deserializing) { }
+    private Dataset(Dataset original, Cloner cloner)
+      : base(original, cloner) {
+      variableNames = original.variableNames;
+      data = original.data;
+    }
+    public Dataset(IEnumerable<string> variableNames, double[,] data)
+      : base() {
+      Name = "-";
+      if (variableNames.Count() != data.GetLength(1)) {
+        throw new ArgumentException("Number of variable names doesn't match the number of columns of data");
+      }
+      this.data = (double[,])data.Clone();
+      this.variableNames = variableNames.ToArray();
+    }
+
+    [Storable]
+    private string[] variableNames;
+    public IEnumerable<string> VariableNames {
+      get { return variableNames; }
+    }
+
+    [Storable]
+    private double[,] data;
+    private double[,] Data {
+      get { return data; }
+    }
+
+    // elementwise access
+    public double this[int rowIndex, int columnIndex] {
+      get { return data[rowIndex, columnIndex]; }
+    }
+    public double this[string variableName, int rowIndex] {
+      get {
+        int columnIndex = GetVariableIndex(variableName);
+        return data[rowIndex, columnIndex];
+      }
+    }
+
+    public double[] GetVariableValues(int variableIndex) {
+      return GetVariableValues(variableIndex, 0, Rows);
+    }
+    public double[] GetVariableValues(int variableIndex, int start, int end) {
+      if (start < 0 || !(start <= end))
+        throw new ArgumentException("Start must be between 0 and end (" + end + ").");
+      if (end > Rows || end < start)
+        throw new ArgumentException("End must be between start (" + start + ") and dataset rows (" + Rows + ").");
+
+      double[] values = new double[end - start];
+      for (int i = 0; i < end - start; i++)
+        values[i] = data[i + start, variableIndex];
+      return values;
+    }
+    public double[] GetVariableValues(string variableName) {
+      return GetVariableValues(GetVariableIndex(variableName), 0, Rows);
+    }
+    public double[] GetVariableValues(string variableName, int start, int end) {
+      return GetVariableValues(GetVariableIndex(variableName), start, end);
+    }
+
+    public IEnumerable<double> GetEnumeratedVariableValues(int variableIndex) {
+      return GetEnumeratedVariableValues(variableIndex, 0, Rows);
+    }
+    public IEnumerable<double> GetEnumeratedVariableValues(int variableIndex, int start, int end) {
+      if (start < 0 || !(start <= end))
+        throw new ArgumentException("Start must be between 0 and end (" + end + ").");
+      if (end > Rows || end < start)
+        throw new ArgumentException("End must be between start (" + start + ") and dataset rows (" + Rows + ").");
+      for (int i = 0; i < end - start; i++)
+        yield return data[i + start, variableIndex];
+    }
+    public IEnumerable<double> GetEnumeratedVariableValues(int variableIndex, IEnumerable<int> rows) {
+      foreach (int row in rows)
+        yield return data[row, variableIndex];
+    }
+
+    public IEnumerable<double> GetEnumeratedVariableValues(string variableName) {
+      return GetEnumeratedVariableValues(GetVariableIndex(variableName), 0, Rows);
+    }
+    public IEnumerable<double> GetEnumeratedVariableValues(string variableName, int start, int end) {
+      return GetEnumeratedVariableValues(GetVariableIndex(variableName), start, end);
+    }
+    public IEnumerable<double> GetEnumeratedVariableValues(string variableName, IEnumerable<int> rows) {
+      return GetEnumeratedVariableValues(GetVariableIndex(variableName), rows);
+    }
+
+    public string GetVariableName(int variableIndex) {
+      return variableNames[variableIndex];
+    }
+
+    public int GetVariableIndex(string variableName) {
+      for (int i = 0; i < variableNames.Length; i++) {
+        if (variableNames[i].Equals(variableName)) return i;
+      }
+      throw new ArgumentException("The variable name " + variableName + " was not found.");
+    }
+
+    public double[,] GetClonedData() {
+      return (double[,])data.Clone();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Dataset(this, cloner);
+    }
+
+    public event EventHandler Reset;
+    private void OnReset(EventArgs e) {
+      var listeners = Reset;
+      if (listeners != null) listeners(this, e);
+    }
+
+    #region IStringConvertibleMatrix Members
+
+    public int Rows {
+      get { return data.GetLength(0); }
+      set { throw new NotSupportedException(); }
+    }
+
+    public int Columns {
+      get { return data.GetLength(1); }
+      set { throw new NotSupportedException(); }
+    }
+
+    public bool SortableView {
+      get { return false; }
+      set { throw new NotSupportedException(); }
+    }
+
+    public bool ReadOnly {
+      get { return true; }
+    }
+
+    IEnumerable<string> IStringConvertibleMatrix.ColumnNames {
+      get { return this.VariableNames; }
+      set { throw new NotSupportedException(); }
+    }
+
+    IEnumerable<string> IStringConvertibleMatrix.RowNames {
+      get { return new List<string>(); }
+      set { throw new NotSupportedException(); }
+    }
+
+    public bool Validate(string value, out string errorMessage) {
+      throw new NotSupportedException();
+    }
+
+    public string GetValue(int rowIndex, int columnIndex) {
+      return data[rowIndex, columnIndex].ToString();
+    }
+
+    public bool SetValue(string value, int rowIndex, int columnIndex) {
+      throw new NotSupportedException();
+    }
+
+    public event EventHandler ColumnNamesChanged;
+    private void OnColumnNamesChanged() {
+      EventHandler listeners = ColumnNamesChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+    public event EventHandler RowNamesChanged;
+    private void OnRowNamesChanged() {
+      EventHandler listeners = RowNamesChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+    public event EventHandler SortableViewChanged;
+    private void OnSortableViewChanged() {
+      EventHandler listeners = SortableViewChanged;
+      if (listeners != null)
+        listeners(this, EventArgs.Empty);
+    }
+    public event EventHandler<EventArgs<int, int>> ItemChanged;
+    private void OnItemChanged(int rowIndex, int columnIndex) {
+      var listeners = ItemChanged;
+      if (listeners != null)
+        listeners(this, new EventArgs<int, int>(rowIndex, columnIndex));
+      OnToStringChanged();
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineCovarianceEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineCovarianceEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineCovarianceEvaluator.cs	(revision 5026)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineCovarianceEvaluator : IOnlineEvaluator {
+
+    private double originalMean, estimatedMean, Cn;
+    private int n;
+    public double Covariance {
+      get {
+        if (n < 1)
+          throw new InvalidOperationException("No elements");
+        else
+          return Cn / n;
+      }
+    }
+
+    public OnlineCovarianceEvaluator() {
+      Reset();
+    }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return Covariance; }
+    }
+    public void Reset() {
+      n = 0;
+      Cn = 0.0;
+      originalMean = 0.0;
+      estimatedMean = 0.0;
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original)) {
+        throw new ArgumentException("Covariance is not defined for series containing NaN or infinity elements");
+      } else {
+        n++;
+        // online calculation of tMean
+        originalMean = originalMean + (original - originalMean) / n;
+        double delta = estimated - estimatedMean; // delta = (y - yMean(n-1))
+        estimatedMean = estimatedMean + delta / n;
+
+        // online calculation of covariance
+        Cn = Cn + delta * (original - originalMean); // C(n) = C(n-1) + (y - yMean(n-1)) (t - tMean(n))       
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs	(revision 5026)
@@ -0,0 +1,66 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineMeanAbsolutePercentageErrorEvaluator : IOnlineEvaluator {
+
+    private double sre;
+    private int n;
+    public double MeanAbsolutePercentageError {
+      get {
+        if (n < 1)
+          throw new InvalidOperationException("No elements");
+        else
+          return sre / n;
+      }
+    }
+
+    public OnlineMeanAbsolutePercentageErrorEvaluator() {
+      Reset();
+    }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return MeanAbsolutePercentageError; }
+    }
+    public void Reset() {
+      n = 0;
+      sre = 0.0;
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original)) {
+        throw new ArgumentException("Relative error is not defined for variables with NaN or infinity values.");
+      } else {
+        if (!original.IsAlmost(0.0)) {
+          sre += Math.Abs((estimated - original) / original);
+          n++;
+        }
+      }
+    }
+
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAndVarianceCalculator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAndVarianceCalculator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAndVarianceCalculator.cs	(revision 5026)
@@ -0,0 +1,80 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineMeanAndVarianceCalculator {
+
+    private double m_oldM, m_newM, m_oldS, m_newS;
+    private int n;
+
+    public double Variance {
+      get {
+        return (n > 1) ? m_newS / (n - 1) : 0.0;
+      }
+    }
+
+    public double PopulationVariance {
+      get {
+        return (n > 0) ? m_newS / n : 0.0;
+      }
+    }
+
+    public double Mean {
+      get {
+        return (n > 0) ? m_newM : 0.0;
+      }
+    }
+
+    public int Count {
+      get { return n; }
+    }
+
+    public OnlineMeanAndVarianceCalculator() {
+      Reset();
+    }
+
+    public void Reset() {
+      n = 0;
+    }
+
+    public void Add(double x) {
+      if (double.IsNaN(x) || double.IsInfinity(x)) {
+        throw new ArgumentException("Mean and variance are not defined for NaN or infinity elements");
+      } else {
+        n++;
+        // See Knuth TAOCP vol 2, 3rd edition, page 232
+        if (n == 1) {
+          m_oldM = m_newM = x;
+          m_oldS = 0.0;
+        } else {
+          m_newM = m_oldM + (x - m_oldM) / n;
+          m_newS = m_oldS + (x - m_oldM) * (x - m_newM);
+
+          // set up for next iteration
+          m_oldM = m_newM;
+          m_oldS = m_newS;
+        }
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanSquaredErrorEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanSquaredErrorEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanSquaredErrorEvaluator.cs	(revision 5026)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineMeanSquaredErrorEvaluator : IOnlineEvaluator {
+
+    private double sse;
+    private int n;
+    public double MeanSquaredError {
+      get {
+        if (n < 1)
+          throw new InvalidOperationException("No elements");
+        else
+          return sse / n;
+      }
+    }
+
+    public OnlineMeanSquaredErrorEvaluator() {
+      Reset();
+    }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return MeanSquaredError; }
+    }
+    public void Reset() {
+      n = 0;
+      sse = 0.0;
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original)) {
+        throw new ArgumentException("Mean squared error is not defined for NaN or infinity elements");
+      } else {
+        double error = estimated - original;
+        sse += error * error;
+        n++;
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs	(revision 5026)
@@ -0,0 +1,63 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlineNormalizedMeanSquaredErrorEvaluator : IOnlineEvaluator {
+    private OnlineMeanAndVarianceCalculator meanSquaredErrorCalculator;
+    private OnlineMeanAndVarianceCalculator originalVarianceCalculator;
+
+    public double NormalizedMeanSquaredError {
+      get {
+        return meanSquaredErrorCalculator.Mean / originalVarianceCalculator.Variance;
+      }
+    }
+
+    public OnlineNormalizedMeanSquaredErrorEvaluator() {
+      meanSquaredErrorCalculator = new OnlineMeanAndVarianceCalculator();
+      originalVarianceCalculator = new OnlineMeanAndVarianceCalculator();
+      Reset();
+    }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return NormalizedMeanSquaredError; }
+    }
+
+    public void Reset() {
+      meanSquaredErrorCalculator.Reset();
+      originalVarianceCalculator.Reset();
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original)) {
+        throw new ArgumentException("Mean squared error is not defined for NaN or infinity elements");
+      } else {
+        double error = estimated - original;
+        meanSquaredErrorCalculator.Add(error * error);
+        originalVarianceCalculator.Add(original);
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlinePearsonsRSquaredEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlinePearsonsRSquaredEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlinePearsonsRSquaredEvaluator.cs	(revision 5026)
@@ -0,0 +1,71 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class OnlinePearsonsRSquaredEvaluator : IOnlineEvaluator {
+    private OnlineCovarianceEvaluator covEvaluator = new OnlineCovarianceEvaluator();
+    private OnlineMeanAndVarianceCalculator sxEvaluator = new OnlineMeanAndVarianceCalculator();
+    private OnlineMeanAndVarianceCalculator syEvaluator = new OnlineMeanAndVarianceCalculator();
+
+    public double RSquared {
+      get {
+        double xVar = sxEvaluator.PopulationVariance;
+        double yVar = syEvaluator.PopulationVariance;
+        if (xVar.IsAlmost(0.0) || yVar.IsAlmost(0.0)) {
+          return 0.0;
+        } else {
+          double r = covEvaluator.Covariance / (Math.Sqrt(xVar) * Math.Sqrt(yVar));
+          return r * r;
+        }
+      }
+    }
+
+    public OnlinePearsonsRSquaredEvaluator() { }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return RSquared; }
+    }
+    public void Reset() {
+      covEvaluator.Reset();
+      sxEvaluator.Reset();
+      syEvaluator.Reset();
+    }
+
+    public void Add(double x, double y) {
+      if (IsInvalidValue(x) || IsInvalidValue(y)) {
+        throw new ArgumentException("R² is not defined for variables with NaN or infinity values.");
+      }
+      covEvaluator.Add(x, y);
+      sxEvaluator.Add(x);
+      syEvaluator.Add(y);
+    }
+
+    #endregion
+
+    private bool IsInvalidValue(double x) {
+      return double.IsNaN(x) || double.IsInfinity(x);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleEvaluator.cs	(revision 5026)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public abstract class SimpleEvaluator : SingleSuccessorOperator {
+    public const int ORIGINAL_INDEX = 0;
+    public const int ESTIMATION_INDEX = 1;
+
+    public ILookupParameter<DoubleMatrix> ValuesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters["Values"]; }
+    }
+    [StorableConstructor]
+    protected SimpleEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleEvaluator(SimpleEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SimpleEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Values", "Table of original and predicted values for which the quality value should be evaluated."));
+    }
+
+    public override IOperation Apply() {
+      DoubleMatrix values = ValuesParameter.ActualValue;
+      Apply(values);
+      return base.Apply();
+    }
+
+    protected abstract void Apply(DoubleMatrix values);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMSEEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMSEEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMSEEvaluator.cs	(revision 5026)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleMSEEvaluator : SimpleEvaluator {
+
+    public ILookupParameter<DoubleValue> MeanSquaredErrorParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MeanSquaredError"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleMSEEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleMSEEvaluator(SimpleMSEEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleMSEEvaluator(this, cloner);
+    }
+    public SimpleMSEEvaluator() {
+      Parameters.Add(new LookupParameter<DoubleValue>("MeanSquaredError", "The mean squared error of estimated values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      MeanSquaredErrorParameter.ActualValue = new DoubleValue(Calculate(values));
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      var onlineMseEvaluator = new OnlineMeanSquaredErrorEvaluator();
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+        onlineMseEvaluator.Add(o, e);
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        return onlineMseEvaluator.MeanSquaredError;
+      }
+    }
+
+    public static double Calculate(DoubleMatrix values) {
+      var original = from row in Enumerable.Range(0, values.Rows)
+                     select values[row, ORIGINAL_INDEX];
+      var estimated = from row in Enumerable.Range(0, values.Rows)
+                      select values[row, ESTIMATION_INDEX];
+      return Calculate(original, estimated);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageErrorEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageErrorEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageErrorEvaluator.cs	(revision 5026)
@@ -0,0 +1,74 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleMeanAbsolutePercentageErrorEvaluator : SimpleEvaluator {
+    public ILookupParameter<PercentValue> AverageRelativeErrorParameter {
+      get { return (ILookupParameter<PercentValue>)Parameters["AverageRelativeError"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleMeanAbsolutePercentageErrorEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleMeanAbsolutePercentageErrorEvaluator(SimpleMeanAbsolutePercentageErrorEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SimpleMeanAbsolutePercentageErrorEvaluator() {
+      Parameters.Add(new LookupParameter<PercentValue>("AverageRelativeError", "The average relative error of estimated values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+      AverageRelativeErrorParameter.ActualValue = new PercentValue(Calculate(original, estimated));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleMeanAbsolutePercentageErrorEvaluator(this, cloner);
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      OnlineMeanAbsolutePercentageErrorEvaluator onlineEvaluator = new OnlineMeanAbsolutePercentageErrorEvaluator();
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+        onlineEvaluator.Add(o, e);
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        return onlineEvaluator.MeanAbsolutePercentageError;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs	(revision 5026)
@@ -0,0 +1,92 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleMeanAbsolutePercentageOfRangeErrorEvaluator : SimpleEvaluator {
+
+    public ILookupParameter<PercentValue> AveragePercentageOfRangeErrorParameter {
+      get { return (ILookupParameter<PercentValue>)Parameters["AveragePercentageOfRangeError"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleMeanAbsolutePercentageOfRangeErrorEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleMeanAbsolutePercentageOfRangeErrorEvaluator(SimpleMeanAbsolutePercentageOfRangeErrorEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SimpleMeanAbsolutePercentageOfRangeErrorEvaluator() {
+      Parameters.Add(new LookupParameter<PercentValue>("AveragePercentageOfRangeError", "The average relative (percentage of range) error of estimated values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+      AveragePercentageOfRangeErrorParameter.ActualValue = new PercentValue(Calculate(original, estimated));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleMeanAbsolutePercentageOfRangeErrorEvaluator(this, cloner);
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      double errorsSum = 0.0;
+      int n = 0;
+      IList<double> originalList = original as IList<double>;
+      if (originalList == null) originalList = original.ToList();
+
+      double range = originalList.Max() - originalList.Min();
+      if (double.IsInfinity(range)) return double.MaxValue;
+      if (range.IsAlmost(0.0)) return double.MaxValue;
+
+
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+
+        if (!double.IsNaN(e) && !double.IsInfinity(e) &&
+          !double.IsNaN(o) && !double.IsInfinity(o) && !o.IsAlmost(0.0)) {
+          double percent_error = Math.Abs((e - o) / range);
+          errorsSum += percent_error;
+          n++;
+        }
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else if (n == 0) {
+        return double.MaxValue;
+      } else {
+        return errorsSum / n;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleNMSEEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleNMSEEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleNMSEEvaluator.cs	(revision 5026)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleNMSEEvaluator : SimpleEvaluator {
+
+    public ILookupParameter<DoubleValue> NormalizedMeanSquaredErrorParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["NormalizedMeanSquaredError"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleNMSEEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleNMSEEvaluator(SimpleNMSEEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleNMSEEvaluator(this, cloner);
+    }
+    public SimpleNMSEEvaluator() {
+      Parameters.Add(new LookupParameter<DoubleValue>("NormalizedMeanSquaredError", "The normalized mean squared error (divided by variance) of estimated values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+
+      NormalizedMeanSquaredErrorParameter.ActualValue = new DoubleValue(Calculate(original, estimated));
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      OnlineNormalizedMeanSquaredErrorEvaluator nmseEvaluator = new OnlineNormalizedMeanSquaredErrorEvaluator();
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        nmseEvaluator.Add(originalEnumerator.Current, estimatedEnumerator.Current);
+      }
+      if (originalEnumerator.MoveNext() || estimatedEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumerations doesn't match.");
+      }
+      return nmseEvaluator.NormalizedMeanSquaredError;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleRSquaredEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleRSquaredEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleRSquaredEvaluator.cs	(revision 5026)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  public class SimpleRSquaredEvaluator : SimpleEvaluator {
+    public ILookupParameter<DoubleValue> RSquaredParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["RSquared"]; }
+    }
+    [StorableConstructor]
+    protected SimpleRSquaredEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleRSquaredEvaluator(SimpleRSquaredEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleRSquaredEvaluator(this, cloner);
+    }
+    public SimpleRSquaredEvaluator() {
+      Parameters.Add(new LookupParameter<DoubleValue>("RSquared", "The squared Pearson's Product Moment Correlation (R²) of estimated values and original values."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+      RSquaredParameter.ActualValue = new DoubleValue(Calculate(original, estimated));
+    }
+
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      var onlinePearsonRSquaredEvaluator = new OnlinePearsonsRSquaredEvaluator();
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+        onlinePearsonRSquaredEvaluator.Add(o, e);
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      } else {
+        return onlinePearsonRSquaredEvaluator.RSquared;
+      }
+    }
+
+    private static bool IsInvalidValue(double d) {
+      return double.IsNaN(d) || double.IsInfinity(d);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleVarianceAccountedForEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleVarianceAccountedForEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleVarianceAccountedForEvaluator.cs	(revision 5026)
@@ -0,0 +1,91 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Evaluators {
+  /// <summary>
+  /// The Variance Accounted For (VAF) function calculates is computed as
+  /// VAF(y,y') =  1 - var(y-y')/var(y)
+  /// where y' denotes the predicted / modelled values for y and var(x) the variance of a signal x.
+  /// </summary>
+  public class SimpleVarianceAccountedForEvaluator : SimpleEvaluator {
+
+    public ILookupParameter<DoubleValue> VarianceAccountedForParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["VarianceAccountedFor"]; }
+    }
+
+    [StorableConstructor]
+    protected SimpleVarianceAccountedForEvaluator(bool deserializing) : base(deserializing) { }
+    protected SimpleVarianceAccountedForEvaluator(SimpleVarianceAccountedForEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleVarianceAccountedForEvaluator(this, cloner);
+    }
+    public SimpleVarianceAccountedForEvaluator() {
+      Parameters.Add(new LookupParameter<DoubleValue>("VarianceAccountedFor", "The variance of the original values accounted for by the estimated values (VAF(y,y') = 1 - var(y-y') / var(y) )."));
+    }
+
+    protected override void Apply(DoubleMatrix values) {
+      var original = from i in Enumerable.Range(0, values.Rows)
+                     select values[i, ORIGINAL_INDEX];
+      var estimated = from i in Enumerable.Range(0, values.Rows)
+                      select values[i, ESTIMATION_INDEX];
+      VarianceAccountedForParameter.ActualValue = new DoubleValue(Calculate(original, estimated));
+    }
+
+    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
+      var originalEnumerator = original.GetEnumerator();
+      var estimatedEnumerator = estimated.GetEnumerator();
+      var errors = new List<double>();
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double e = estimatedEnumerator.Current;
+        double o = originalEnumerator.Current;
+        if (!double.IsNaN(e) && !double.IsInfinity(e) &&
+          !double.IsNaN(o) && !double.IsInfinity(o)) {
+          errors.Add(o - e);
+        }
+      }
+      if (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in original and estimated enumeration doesn't match.");
+      }
+
+      double errorsVariance = errors.Variance();
+      double originalsVariance = original.Variance();
+      if (originalsVariance.IsAlmost(0.0))
+        if (errorsVariance.IsAlmost(0.0)) {
+          return 1.0;
+        } else {
+          return double.MaxValue;
+        } else {
+        return 1.0 - errorsVariance / originalsVariance;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj	(revision 5026)
@@ -0,0 +1,267 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis-3.3</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </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>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-3.1.0, Version=3.1.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\ALGLIB-3.1.0.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.ALGLIB-3.1.0, Version=2.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.ALGLIB-3.1.0.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.LibSVM-1.6.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>c:\Program Files\HeuristicLab 3.3\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="LibSVM-1.6.3, Version=1.6.3.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\LibSVM-1.6.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="TableFileParser.cs" />
+    <None Include="HeuristicLab.snk" />
+    <None Include="HeuristicLabProblemsDataAnalysisPlugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.frame" />
+    <Compile Include="Evaluators\OnlineCovarianceEvaluator.cs" />
+    <Compile Include="Evaluators\OnlineMeanAndVarianceCalculator.cs" />
+    <Compile Include="Evaluators\OnlineNormalizedMeanSquaredErrorEvaluator.cs" />
+    <Compile Include="DataAnalysisSolution.cs" />
+    <Compile Include="DataAnalysisProblem.cs" />
+    <Compile Include="DataAnalysisProblemData.cs" />
+    <Compile Include="DataFormatException.cs" />
+    <Compile Include="Dataset.cs" />
+    <Compile Include="Evaluators\OnlineMeanAbsolutePercentageErrorEvaluator.cs" />
+    <Compile Include="Evaluators\OnlineMeanSquaredErrorEvaluator.cs" />
+    <Compile Include="Evaluators\OnlinePearsonsRSquaredEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleMeanAbsolutePercentageErrorEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleMSEEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleNMSEEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleRSquaredEvaluator.cs" />
+    <Compile Include="Evaluators\SimpleVarianceAccountedForEvaluator.cs" />
+    <Compile Include="HeuristicLabProblemsDataAnalysisPlugin.cs" />
+    <Compile Include="Interfaces\ILaggedTreeNode.cs" />
+    <Compile Include="Interfaces\ISingleObjectiveDataAnalysisProblem.cs" />
+    <Compile Include="Interfaces\IDataAnalysisModel.cs" />
+    <Compile Include="Interfaces\IDataAnalysisProblem.cs" />
+    <Compile Include="Interfaces\IOnlineEvaluator.cs" />
+    <Compile Include="MatrixExtensions.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="RandomEnumerable.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineCrossValidationEvaluator.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineModel.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineModelCreator.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineModelEvaluator.cs" />
+    <Compile Include="SupportVectorMachine\SupportVectorMachineUtil.cs" />
+    <Compile Include="Symbolic\ArithmeticExpressionGrammar.cs" />
+    <Compile Include="Symbolic\FullFunctionalExpressionGrammar.cs" />
+    <Compile Include="Symbolic\ISymbolicExpressionTreeInterpreter.cs" />
+    <Compile Include="Symbolic\SimpleArithmeticExpressionInterpreter.cs" />
+    <Compile Include="Symbolic\SymbolicSimplifier.cs" />
+    <Compile Include="Symbolic\Symbols\Addition.cs" />
+    <Compile Include="Symbolic\Symbols\LaggedSymbol.cs" />
+    <Compile Include="Symbolic\Symbols\Constant.cs" />
+    <Compile Include="Symbolic\Symbols\ConstantTreeNode.cs" />
+    <Compile Include="Symbolic\Symbols\LaggedTreeNode.cs" />
+    <Compile Include="Symbolic\Symbols\LaggedVariable.cs" />
+    <Compile Include="Symbolic\Symbols\LaggedVariableTreeNode.cs" />
+    <Compile Include="Symbolic\Symbols\GreaterThan.cs" />
+    <Compile Include="Symbolic\Symbols\LessThan.cs" />
+    <Compile Include="Symbolic\Symbols\And.cs" />
+    <Compile Include="Symbolic\Symbols\Or.cs" />
+    <Compile Include="Symbolic\Symbols\Not.cs" />
+    <Compile Include="Symbolic\Symbols\Logarithm.cs" />
+    <Compile Include="Symbolic\Symbols\Exponential.cs" />
+    <Compile Include="Symbolic\Symbols\Sine.cs" />
+    <Compile Include="Symbolic\Symbols\Cosine.cs" />
+    <Compile Include="Symbolic\Symbols\Tangent.cs" />
+    <Compile Include="Symbolic\Symbols\Average.cs" />
+    <Compile Include="Symbolic\Symbols\IfThenElse.cs" />
+    <Compile Include="Symbolic\Symbols\Division.cs" />
+    <Compile Include="Symbolic\Symbols\Multiplication.cs" />
+    <Compile Include="Symbolic\Symbols\Subtraction.cs" />
+    <Compile Include="Symbolic\Symbols\TimeLag.cs" />
+    <Compile Include="Symbolic\Symbols\Variable.cs" />
+    <Compile Include="Symbolic\Symbols\VariableTreeNode.cs" />
+    <Compile Include="Symbolic\VariableFrequencyAnalyser.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj">
+      <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Operators\" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisPlugin.cs"</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLabProblemsDataAnalysisPlugin.cs.frame
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLabProblemsDataAnalysisPlugin.cs.frame	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLabProblemsDataAnalysisPlugin.cs.frame	(revision 5026)
@@ -0,0 +1,45 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [Plugin("HeuristicLab.Problems.DataAnalysis", "3.3.2.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.ALGLIB", "3.1")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.3")]
+  [PluginDependency("HeuristicLab.LibSVM", "1.6.3.0")]
+  [PluginDependency("HeuristicLab.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization","3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  public class HeuristicLabProblemsDataAnalysisPlugin : PluginBase {
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisModel.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisModel.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisModel.cs	(revision 5026)
@@ -0,0 +1,29 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IDataAnalysisModel : INamedItem {
+    IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisProblem.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisProblem.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisProblem.cs	(revision 5026)
@@ -0,0 +1,28 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Optimization;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IDataAnalysisProblem : IProblem {
+    DataAnalysisProblemData DataAnalysisProblemData { get; }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/ILaggedTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/ILaggedTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/ILaggedTreeNode.cs	(revision 5026)
@@ -0,0 +1,28 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface ILaggedTreeNode : ISymbolicExpressionTreeNode {
+    int Lag { get; set; }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IOnlineEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IOnlineEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IOnlineEvaluator.cs	(revision 5026)
@@ -0,0 +1,29 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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
+
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IOnlineEvaluator {
+    double Value { get; }
+    void Reset();
+    void Add(double original, double estimated);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/ISingleObjectiveDataAnalysisProblem.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/ISingleObjectiveDataAnalysisProblem.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/ISingleObjectiveDataAnalysisProblem.cs	(revision 5026)
@@ -0,0 +1,26 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Optimization;
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface ISingleObjectiveDataAnalysisProblem : ISingleObjectiveProblem, IDataAnalysisProblem {
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/MatrixExtensions.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/MatrixExtensions.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/MatrixExtensions.cs	(revision 5026)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public static class MatrixExtensions<T> {
+    public static T[,] Create(T[] first, T[] second) {
+      if (first.Length != second.Length)
+        throw new ArgumentException("Both arrays must be of same length.");
+      T[,] array = new T[first.Length, 2];
+      for (int i = 0; i < first.Length; i++) {
+        array[i, 0] = first[i];
+        array[i, 1] = second[i];
+      }
+      return array;
+    }
+
+    public static T[] GetColumn(T[,] matrix, int column) {
+      if (column >= matrix.GetLength(1)) throw new ArgumentException("Invalid column index: " + column + ". Matrix has only " + matrix.GetLength(1) + " columns.");
+      T[] result = new T[matrix.GetLength(0)];
+      for (int i = 0; i < result.Length; i++) {
+        result[i] = matrix[i, column];
+      }
+      return result;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Properties/AssemblyInfo.frame	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Properties/AssemblyInfo.frame	(revision 5026)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis")]
+[assembly: AssemblyDescription("HeuristicLab generic data analysis problem classes")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2010 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("73d531fb-a823-4000-b980-3087eb5975f1")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.2.$WCREV$")]
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/RandomEnumerable.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/RandomEnumerable.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/RandomEnumerable.cs	(revision 5026)
@@ -0,0 +1,52 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public class RandomEnumerable {
+    public static IEnumerable<int> SampleRandomNumbers(int maxElement, int count) {
+      return SampleRandomNumbers(Environment.TickCount, 0, maxElement, count);
+    }
+
+    public static IEnumerable<int> SampleRandomNumbers(int start, int end, int count) {
+      return SampleRandomNumbers(Environment.TickCount, start, end, count);
+    }
+
+    //algorithm taken from progamming pearls page 127
+    //IMPORTANT because IEnumerables with yield are used the seed must best be specified to return always 
+    //the same sequence of numbers without caching the values.
+    public static IEnumerable<int> SampleRandomNumbers(int seed, int start, int end, int count) {
+      int remaining = end - start;
+      var mt = new FastRandom(seed);
+      for (int i = start; i < end && count > 0; i++) {
+        double probability = mt.NextDouble();
+        if (probability < ((double)count) / remaining) {
+          count--;
+          yield return i;
+        }
+        remaining--;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs	(revision 5026)
@@ -0,0 +1,254 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using SVM;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  /// <summary>
+  /// Represents an operator that performs SVM cross validation with the given parameters.
+  /// </summary>
+  [StorableClass]
+  [Item("SupportVectorMachineCrossValidationEvaluator", "Represents an operator that performs SVM cross validation with the given parameters.")]
+  public class SupportVectorMachineCrossValidationEvaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {
+    private const string RandomParameterName = "Random";
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string SvmTypeParameterName = "SvmType";
+    private const string KernelTypeParameterName = "KernelType";
+    private const string CostParameterName = "Cost";
+    private const string NuParameterName = "Nu";
+    private const string GammaParameterName = "Gamma";
+    private const string EpsilonParameterName = "Epsilon";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string ActualSamplesParameterName = "ActualSamples";
+    private const string NumberOfFoldsParameterName = "NumberOfFolds";
+    private const string QualityParameterName = "Quality";
+
+    #region parameter properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> SvmTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[SvmTypeParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> KernelTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[KernelTypeParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> NuParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[NuParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> CostParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[CostParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> GammaParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[GammaParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> EpsilonParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[EpsilonParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<PercentValue> ActualSamplesParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[ActualSamplesParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> NumberOfFoldsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[NumberOfFoldsParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public StringValue SvmType {
+      get { return SvmTypeParameter.ActualValue; }
+    }
+    public StringValue KernelType {
+      get { return KernelTypeParameter.ActualValue; }
+    }
+    public DoubleValue Nu {
+      get { return NuParameter.ActualValue; }
+    }
+    public DoubleValue Cost {
+      get { return CostParameter.ActualValue; }
+    }
+    public DoubleValue Gamma {
+      get { return GammaParameter.ActualValue; }
+    }
+    public DoubleValue Epsilon {
+      get { return EpsilonParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    public IntValue NumberOfFolds {
+      get { return NumberOfFoldsParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SupportVectorMachineCrossValidationEvaluator(bool deserializing) : base(deserializing) { }
+
+    protected SupportVectorMachineCrossValidationEvaluator(SupportVectorMachineCrossValidationEvaluator original,
+      Cloner cloner)
+      : base(original, cloner) { }
+    public SupportVectorMachineCrossValidationEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
+      Parameters.Add(new ValueLookupParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use."));
+      Parameters.Add(new ValueLookupParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(NuParameterName, "The value of the nu parameter nu-SVC, one-class SVM and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(CostParameterName, "The value of the C (cost) parameter of C-SVC, epsilon-SVR and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(GammaParameterName, "The value of the gamma parameter in the kernel function."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(EpsilonParameterName, "The value of the epsilon parameter for epsilon-SVR."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The last index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>(ActualSamplesParameterName, "The percentage of the training set that should be acutally used for cross-validation (samples are picked randomly from the training set)."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(NumberOfFoldsParameterName, "The number of folds to use for cross-validation."));
+      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The cross validation quality reached with the given parameters."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorMachineCrossValidationEvaluator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      double reductionRatio = 1.0; // TODO: make parameter
+      if (ActualSamplesParameter.ActualValue != null)
+        reductionRatio = ActualSamplesParameter.ActualValue.Value;
+      IEnumerable<int> rows =
+        Enumerable.Range(SamplesStart.Value, SamplesEnd.Value - SamplesStart.Value)
+        .Where(i => i < DataAnalysisProblemData.TestSamplesStart.Value || DataAnalysisProblemData.TestSamplesEnd.Value <= i);
+
+      // create a new DataAnalysisProblemData instance
+      DataAnalysisProblemData reducedProblemData = (DataAnalysisProblemData)DataAnalysisProblemData.Clone();
+      reducedProblemData.Dataset =
+        CreateReducedDataset(RandomParameter.ActualValue, reducedProblemData.Dataset, rows, reductionRatio);
+      reducedProblemData.TrainingSamplesStart.Value = 0;
+      reducedProblemData.TrainingSamplesEnd.Value = reducedProblemData.Dataset.Rows;
+      reducedProblemData.TestSamplesStart.Value = reducedProblemData.Dataset.Rows;
+      reducedProblemData.TestSamplesEnd.Value = reducedProblemData.Dataset.Rows;
+      reducedProblemData.ValidationPercentage.Value = 0;
+
+      double quality = PerformCrossValidation(reducedProblemData,
+                             SvmType.Value, KernelType.Value,
+                             Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value, NumberOfFolds.Value);
+
+      QualityParameter.ActualValue = new DoubleValue(quality);
+      return base.Apply();
+    }
+
+    private Dataset CreateReducedDataset(IRandom random, Dataset dataset, IEnumerable<int> rowIndices, double reductionRatio) {
+
+      // must not make a fink:
+      // => select n rows randomly from start..end
+      // => sort the selected rows by index
+      // => move rows to beginning of partition (start)
+
+      // all possible rowIndexes from start..end
+      int[] rowIndexArr = rowIndices.ToArray();
+      int n = (int)Math.Max(1.0, rowIndexArr.Length * reductionRatio);
+
+      // knuth shuffle
+      for (int i = rowIndexArr.Length - 1; i > 0; i--) {
+        int j = random.Next(0, i);
+        // swap
+        int tmp = rowIndexArr[i];
+        rowIndexArr[i] = rowIndexArr[j];
+        rowIndexArr[j] = tmp;
+      }
+
+      // take the first n indexes (selected n rowIndexes from start..end)
+      // now order by index
+      int[] orderedRandomIndexes =
+        rowIndexArr.Take(n)
+        .OrderBy(x => x)
+        .ToArray();
+
+      // now build a dataset containing only rows from orderedRandomIndexes 
+      double[,] reducedData = new double[n, dataset.Columns];
+      for (int i = 0; i < n; i++) {
+        for (int column = 0; column < dataset.Columns; column++) {
+          reducedData[i, column] = dataset[orderedRandomIndexes[i], column];
+        }
+      }
+      return new Dataset(dataset.VariableNames, reducedData);
+    }
+
+    private static double PerformCrossValidation(
+      DataAnalysisProblemData problemData,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon,
+      int nFolds) {
+      return PerformCrossValidation(problemData, problemData.TrainingIndizes, svmType, kernelType, cost, nu, gamma, epsilon, nFolds);
+    }
+
+    public static double PerformCrossValidation(
+      DataAnalysisProblemData problemData,
+      IEnumerable<int> rowIndices,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon,
+      int nFolds) {
+      int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
+
+      //extract SVM parameters from scope and set them
+      SVM.Parameter parameter = new SVM.Parameter();
+      parameter.SvmType = (SVM.SvmType)Enum.Parse(typeof(SVM.SvmType), svmType, true);
+      parameter.KernelType = (SVM.KernelType)Enum.Parse(typeof(SVM.KernelType), kernelType, true);
+      parameter.C = cost;
+      parameter.Nu = nu;
+      parameter.Gamma = gamma;
+      parameter.P = epsilon;
+      parameter.CacheSize = 500;
+      parameter.Probability = false;
+
+
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, rowIndices);
+      SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
+      SVM.Problem scaledProblem = Scaling.Scale(rangeTransform, problem);
+
+      return SVM.Training.PerformCrossValidation(scaledProblem, parameter, nFolds, false);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs	(revision 5026)
@@ -0,0 +1,181 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.IO;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using SVM;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  /// <summary>
+  /// Represents a support vector machine model.
+  /// </summary>
+  [StorableClass]
+  [Item("SupportVectorMachineModel", "Represents a support vector machine model.")]
+  public sealed class SupportVectorMachineModel : NamedItem, IDataAnalysisModel {
+    [StorableConstructor]
+    private SupportVectorMachineModel(bool deserializing) : base(deserializing) { }
+    private SupportVectorMachineModel(SupportVectorMachineModel original, Cloner cloner)
+      : base(original, cloner) {
+      // only using a shallow copy here! (gkronber)
+      this.model = original.model;
+      this.rangeTransform = original.rangeTransform;
+    }
+    public SupportVectorMachineModel() : base() { }
+
+    private SVM.Model model;
+    /// <summary>
+    /// Gets or sets the SVM model.
+    /// </summary>
+    public SVM.Model Model {
+      get { return model; }
+      set {
+        if (value != model) {
+          if (value == null) throw new ArgumentNullException();
+          model = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    /// <summary>
+    /// Gets or sets the range transformation for the model.
+    /// </summary>
+    private SVM.RangeTransform rangeTransform;
+    public SVM.RangeTransform RangeTransform {
+      get { return rangeTransform; }
+      set {
+        if (value != rangeTransform) {
+          if (value == null) throw new ArgumentNullException();
+          rangeTransform = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    public IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end) {
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, Enumerable.Range(start, end - start));
+      SVM.Problem scaledProblem = Scaling.Scale(RangeTransform, problem);
+
+      return (from row in Enumerable.Range(0, scaledProblem.Count)
+              select SVM.Prediction.Predict(Model, scaledProblem.X[row]))
+              .ToList();
+    }
+
+    #region events
+    public event EventHandler Changed;
+    private void OnChanged(EventArgs e) {
+      var handlers = Changed;
+      if (handlers != null)
+        handlers(this, e);
+    }
+    #endregion
+
+    #region persistence
+    [Storable]
+    private int[] SupportVectorIndizes {
+      get { return this.Model.SupportVectorIndizes; }
+      set { this.Model.SupportVectorIndizes = value; }
+    }
+
+    [Storable]
+    private string ModelAsString {
+      get {
+        using (MemoryStream stream = new MemoryStream()) {
+          SVM.Model.Write(stream, Model);
+          stream.Seek(0, System.IO.SeekOrigin.Begin);
+          StreamReader reader = new StreamReader(stream);
+          return reader.ReadToEnd();
+        }
+      }
+      set {
+        using (MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes(value))) {
+          model = SVM.Model.Read(stream);
+        }
+      }
+    }
+    [Storable]
+    private string RangeTransformAsString {
+      get {
+        using (MemoryStream stream = new MemoryStream()) {
+          SVM.RangeTransform.Write(stream, RangeTransform);
+          stream.Seek(0, System.IO.SeekOrigin.Begin);
+          StreamReader reader = new StreamReader(stream);
+          return reader.ReadToEnd();
+        }
+      }
+      set {
+        using (MemoryStream stream = new MemoryStream(Encoding.ASCII.GetBytes(value))) {
+          RangeTransform = SVM.RangeTransform.Read(stream);
+        }
+      }
+    }
+    #endregion
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorMachineModel(this, cloner);
+    }
+
+    /// <summary>
+    ///  Exports the <paramref name="model"/> in string representation to stream <paramref name="s"/>
+    /// </summary>
+    /// <param name="model">The support vector regression model to export</param>
+    /// <param name="s">The stream to export the model to</param>
+    public static void Export(SupportVectorMachineModel model, Stream s) {
+      StreamWriter writer = new StreamWriter(s);
+      writer.WriteLine("RangeTransform:");
+      writer.Flush();
+      using (MemoryStream memStream = new MemoryStream()) {
+        SVM.RangeTransform.Write(memStream, model.RangeTransform);
+        memStream.Seek(0, SeekOrigin.Begin);
+        memStream.WriteTo(s);
+      }
+      writer.WriteLine("Model:");
+      writer.Flush();
+      using (MemoryStream memStream = new MemoryStream()) {
+        SVM.Model.Write(memStream, model.Model);
+        memStream.Seek(0, SeekOrigin.Begin);
+        memStream.WriteTo(s);
+      }
+      s.Flush();
+    }
+
+    /// <summary>
+    /// Imports a support vector machine model given as string representation.
+    /// </summary>
+    /// <param name="reader">The reader to retrieve the string representation from</param>
+    /// <returns>The imported support vector machine model.</returns>
+    public static SupportVectorMachineModel Import(TextReader reader) {
+      SupportVectorMachineModel model = new SupportVectorMachineModel();
+      while (reader.ReadLine().Trim() != "RangeTransform:") ; // read until line "RangeTransform";
+      model.RangeTransform = SVM.RangeTransform.Read(reader);
+      // read until "Model:"
+      while (reader.ReadLine().Trim() != "Model:") ;
+      model.Model = SVM.Model.Read(reader);
+      return model;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelCreator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelCreator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelCreator.cs	(revision 5026)
@@ -0,0 +1,187 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using SVM;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  /// <summary>
+  /// Represents an operator that creates a support vector machine model.
+  /// </summary>
+  [StorableClass]
+  [Item("SupportVectorMachineModelCreator", "Represents an operator that creates a support vector machine model.")]
+  public sealed class SupportVectorMachineModelCreator : SingleSuccessorOperator {
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string SvmTypeParameterName = "SvmType";
+    private const string KernelTypeParameterName = "KernelType";
+    private const string CostParameterName = "Cost";
+    private const string NuParameterName = "Nu";
+    private const string GammaParameterName = "Gamma";
+    private const string EpsilonParameterName = "Epsilon";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string ModelParameterName = "SupportVectorMachineModel";
+
+    #region parameter properties
+    public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> SvmTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[SvmTypeParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> KernelTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[KernelTypeParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> NuParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[NuParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> CostParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[CostParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> GammaParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[GammaParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> EpsilonParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[EpsilonParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public ILookupParameter<SupportVectorMachineModel> SupportVectorMachineModelParameter {
+      get { return (ILookupParameter<SupportVectorMachineModel>)Parameters[ModelParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public StringValue SvmType {
+      get { return SvmTypeParameter.Value; }
+    }
+    public StringValue KernelType {
+      get { return KernelTypeParameter.Value; }
+    }
+    public DoubleValue Nu {
+      get { return NuParameter.ActualValue; }
+    }
+    public DoubleValue Cost {
+      get { return CostParameter.ActualValue; }
+    }
+    public DoubleValue Gamma {
+      get { return GammaParameter.ActualValue; }
+    }
+    public DoubleValue Epsilon {
+      get { return EpsilonParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SupportVectorMachineModelCreator(bool deserializing) : base(deserializing) { }
+    private SupportVectorMachineModelCreator(SupportVectorMachineModelCreator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorMachineModelCreator(this, cloner);
+    }
+    public SupportVectorMachineModelCreator()
+      : base() {
+      StringValue nuSvrType = new StringValue("NU_SVR").AsReadOnly();
+      StringValue rbfKernelType = new StringValue("RBF").AsReadOnly();
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
+      Parameters.Add(new ValueLookupParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use.", nuSvrType));
+      Parameters.Add(new ValueLookupParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM.", rbfKernelType));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(NuParameterName, "The value of the nu parameter nu-SVC, one-class SVM and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(CostParameterName, "The value of the C (cost) parameter of C-SVC, epsilon-SVR and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(GammaParameterName, "The value of the gamma parameter in the kernel function."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(EpsilonParameterName, "The value of the epsilon parameter for epsilon-SVR."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The last index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new LookupParameter<SupportVectorMachineModel>(ModelParameterName, "The result model generated by the SVM."));
+    }
+
+    public override IOperation Apply() {
+      int start = SamplesStart.Value;
+      int end = SamplesEnd.Value;
+      IEnumerable<int> rows =
+        Enumerable.Range(start, end - start)
+        .Where(i => i < DataAnalysisProblemData.TestSamplesStart.Value || DataAnalysisProblemData.TestSamplesEnd.Value <= i);
+
+      SupportVectorMachineModel model = TrainModel(DataAnalysisProblemData,
+                             rows,
+                             SvmType.Value, KernelType.Value,
+                             Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value);
+      SupportVectorMachineModelParameter.ActualValue = model;
+
+      return base.Apply();
+    }
+
+    private static SupportVectorMachineModel TrainModel(
+      DataAnalysisProblemData problemData,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon) {
+      return TrainModel(problemData, problemData.TrainingIndizes, svmType, kernelType, cost, nu, gamma, epsilon);
+    }
+
+    public static SupportVectorMachineModel TrainModel(
+      DataAnalysisProblemData problemData,
+      IEnumerable<int> trainingIndizes,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon) {
+      int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
+
+      //extract SVM parameters from scope and set them
+      SVM.Parameter parameter = new SVM.Parameter();
+      parameter.SvmType = (SVM.SvmType)Enum.Parse(typeof(SVM.SvmType), svmType, true);
+      parameter.KernelType = (SVM.KernelType)Enum.Parse(typeof(SVM.KernelType), kernelType, true);
+      parameter.C = cost;
+      parameter.Nu = nu;
+      parameter.Gamma = gamma;
+      parameter.P = epsilon;
+      parameter.CacheSize = 500;
+      parameter.Probability = false;
+
+
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, trainingIndizes);
+      SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
+      SVM.Problem scaledProblem = Scaling.Scale(rangeTransform, problem);
+      var model = new SupportVectorMachineModel();
+      model.Model = SVM.Training.Train(scaledProblem, parameter);
+      model.RangeTransform = rangeTransform;
+
+      return model;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelEvaluator.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelEvaluator.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelEvaluator.cs	(revision 5026)
@@ -0,0 +1,117 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2009 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 System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using SVM;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  [StorableClass]
+  [Item("SupportVectorMachineModelEvaluator", "Represents a operator that evaluates a support vector machine model on a data set.")]
+  public class SupportVectorMachineModelEvaluator : SingleSuccessorOperator {
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string ModelParameterName = "SupportVectorMachineModel";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string ValuesParameterName = "Values";
+
+    #region parameter properties
+    public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public ILookupParameter<SupportVectorMachineModel> SupportVectorMachineModelParameter {
+      get { return (ILookupParameter<SupportVectorMachineModel>)Parameters[ModelParameterName]; }
+    }
+    public ILookupParameter<DoubleMatrix> ValuesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters[ValuesParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public SupportVectorMachineModel SupportVectorMachineModel {
+      get { return SupportVectorMachineModelParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SupportVectorMachineModelEvaluator(bool deserializing) : base(deserializing) { }
+    protected SupportVectorMachineModelEvaluator(SupportVectorMachineModelEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorMachineModelEvaluator(this, cloner);
+    }
+    public SupportVectorMachineModelEvaluator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
+      Parameters.Add(new LookupParameter<SupportVectorMachineModel>(ModelParameterName, "The result model generated by the SVM."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition on which the SVM model should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The last index of the data set partition on which the SVM model should be evaluated."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>(ValuesParameterName, "A matrix of original values of the target variable and output values of the SVM model."));
+    }
+
+    public override IOperation Apply() {
+      int start = SamplesStart.Value;
+      int end = SamplesEnd.Value;
+      IEnumerable<int> rows =
+        Enumerable.Range(start, end - start)
+        .Where(i => i < DataAnalysisProblemData.TestSamplesStart.Value || DataAnalysisProblemData.TestSamplesEnd.Value <= i);
+
+      ValuesParameter.ActualValue = new DoubleMatrix(Evaluate(SupportVectorMachineModel, DataAnalysisProblemData, rows));
+      return base.Apply();
+    }
+
+    public static double[,] Evaluate(SupportVectorMachineModel model, DataAnalysisProblemData problemData, IEnumerable<int> rowIndices) {
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, rowIndices);
+      SVM.Problem scaledProblem = model.RangeTransform.Scale(problem);
+
+      int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
+
+      double[,] values = new double[scaledProblem.Count, 2];
+      var rowEnumerator = rowIndices.GetEnumerator();
+      for (int i = 0; i < scaledProblem.Count; i++) {
+        rowEnumerator.MoveNext();
+        values[i, 0] = problemData.Dataset[rowEnumerator.Current, targetVariableIndex];
+        values[i, 1] = SVM.Prediction.Predict(model.Model, scaledProblem.X[i]);
+      }
+
+      return values;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineUtil.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineUtil.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineUtil.cs	(revision 5026)
@@ -0,0 +1,59 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  public class SupportVectorMachineUtil {
+    /// <summary>
+    /// Transforms <paramref name="problemData"/> into a data structure as needed by libSVM.
+    /// </summary>
+    /// <param name="problemData">The problem data to transform</param>
+    /// <param name="rowIndices">The rows of the dataset that should be contained in the resulting SVM-problem</param>
+    /// <returns>A problem data type that can be used to train a support vector machine.</returns>
+    public static SVM.Problem CreateSvmProblem(DataAnalysisProblemData problemData, IEnumerable<int> rowIndices) {
+      double[] targetVector =
+        problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable.Value, rowIndices)
+        .ToArray();
+
+      SVM.Node[][] nodes = new SVM.Node[targetVector.Length][];
+      List<SVM.Node> tempRow;
+      int maxNodeIndex = 0;
+      int svmProblemRowIndex = 0;
+      foreach (int row in rowIndices) {
+        tempRow = new List<SVM.Node>();
+        foreach (var inputVariable in problemData.InputVariables.CheckedItems) {
+          int col = problemData.Dataset.GetVariableIndex(inputVariable.Value.Value);
+          double value = problemData.Dataset[row, col];
+          if (!double.IsNaN(value)) {
+            int nodeIndex = col + 1; // make sure the smallest nodeIndex is 1 (libSVM convention)
+            tempRow.Add(new SVM.Node(nodeIndex, value));
+            if (nodeIndex > maxNodeIndex) maxNodeIndex = nodeIndex;
+          }
+        }
+        nodes[svmProblemRowIndex++] = tempRow.OrderBy(x => x.Index).ToArray(); // make sure the values are sorted by node index
+      }
+
+      return new SVM.Problem(targetVector.Length, targetVector, nodes, maxNodeIndex);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ArithmeticExpressionGrammar.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ArithmeticExpressionGrammar.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ArithmeticExpressionGrammar.cs	(revision 5026)
@@ -0,0 +1,84 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("ArithmeticExpressionGrammar", "Represents a grammar for functional expressions using only arithmetic operations.")]
+  public class ArithmeticExpressionGrammar : DefaultSymbolicExpressionGrammar {
+
+    [StorableConstructor]
+    protected ArithmeticExpressionGrammar(bool deserializing) : base(deserializing) { }
+    protected ArithmeticExpressionGrammar(ArithmeticExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public ArithmeticExpressionGrammar()
+      : base() {
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ArithmeticExpressionGrammar(this, cloner);
+    }
+
+    private void Initialize() {
+      var add = new Addition();
+      var sub = new Subtraction();
+      var mul = new Multiplication();
+      var div = new Division();
+      var constant = new Constant();
+      constant.MinValue = -20;
+      constant.MaxValue = 20;
+      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
+
+      var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol };
+      var functionSymbols = new List<Symbol>() { add, sub, mul, div };
+
+      foreach (var symb in allSymbols)
+        AddSymbol(symb);
+
+      foreach (var funSymb in functionSymbols) {
+        SetMinSubtreeCount(funSymb, 1);
+        SetMaxSubtreeCount(funSymb, 3);
+      }
+      SetMinSubtreeCount(constant, 0);
+      SetMaxSubtreeCount(constant, 0);
+      SetMinSubtreeCount(variableSymbol, 0);
+      SetMaxSubtreeCount(variableSymbol, 0);
+
+      // allow each symbol as child of the start symbol
+      foreach (var symb in allSymbols) {
+        SetAllowedChild(StartSymbol, symb, 0);
+      }
+
+      // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
+      foreach (var parent in allSymbols) {
+        for (int i = 0; i < GetMaxSubtreeCount(parent); i++)
+          foreach (var child in allSymbols) {
+            SetAllowedChild(parent, child, i);
+          }
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs	(revision 5026)
@@ -0,0 +1,116 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("FullFunctionalExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
+  public class FullFunctionalExpressionGrammar : DefaultSymbolicExpressionGrammar {
+    [StorableConstructor]
+    protected FullFunctionalExpressionGrammar(bool deserializing) : base(deserializing) { }
+    protected FullFunctionalExpressionGrammar(FullFunctionalExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public FullFunctionalExpressionGrammar()
+      : base() {
+      Initialize();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FullFunctionalExpressionGrammar(this, cloner);
+    }
+
+    private void Initialize() {
+      var add = new Addition();
+      var sub = new Subtraction();
+      var mul = new Multiplication();
+      var div = new Division();
+      var mean = new Average();
+      var sin = new Sine();
+      var cos = new Cosine();
+      var tan = new Tangent();
+      var log = new Logarithm();
+      var exp = new Exponential();
+      var @if = new IfThenElse();
+      var gt = new GreaterThan();
+      var lt = new LessThan();
+      var and = new And();
+      var or = new Or();
+      var not = new Not();
+      var timeLag = new TimeLag();
+      timeLag.InitialFrequency = 0.0;
+      var constant = new Constant();
+      constant.MinValue = -20;
+      constant.MaxValue = 20;
+      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable();
+      var laggedVariable = new LaggedVariable();
+      laggedVariable.InitialFrequency = 0.0;
+
+      var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, timeLag, constant, variableSymbol, laggedVariable };
+      var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not, timeLag };
+      var binaryFunctionSymbols = new List<Symbol>() { gt, lt };
+      var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or };
+      var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable };
+
+      foreach (var symb in allSymbols)
+        AddSymbol(symb);
+
+      foreach (var funSymb in functionSymbols) {
+        SetMinSubtreeCount(funSymb, 1);
+        SetMaxSubtreeCount(funSymb, 3);
+      }
+      foreach (var funSymb in unaryFunctionSymbols) {
+        SetMinSubtreeCount(funSymb, 1);
+        SetMaxSubtreeCount(funSymb, 1);
+      }
+      foreach (var funSymb in binaryFunctionSymbols) {
+        SetMinSubtreeCount(funSymb, 2);
+        SetMaxSubtreeCount(funSymb, 2);
+      }
+
+      foreach (var terminalSymbol in terminalSymbols) {
+        SetMinSubtreeCount(terminalSymbol, 0);
+        SetMaxSubtreeCount(terminalSymbol, 0);
+      }
+
+      SetMinSubtreeCount(@if, 3);
+      SetMaxSubtreeCount(@if, 3);
+
+
+      // allow each symbol as child of the start symbol
+      foreach (var symb in allSymbols) {
+        SetAllowedChild(StartSymbol, symb, 0);
+      }
+
+      // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
+      foreach (var parent in allSymbols) {
+        for (int i = 0; i < GetMaxSubtreeCount(parent); i++)
+          foreach (var child in allSymbols) {
+            SetAllowedChild(parent, child, i);
+          }
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ISymbolicExpressionTreeInterpreter.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ISymbolicExpressionTreeInterpreter.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ISymbolicExpressionTreeInterpreter.cs	(revision 5026)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicExpressionTreeInterpreter : IItem {
+    IEnumerable<double> GetSymbolicExpressionTreeValues(SymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows);
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs	(revision 5026)
@@ -0,0 +1,319 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Compiler;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SimpleArithmeticExpressionInterpreter", "Interpreter for arithmetic symbolic expression trees including function calls.")]
+  // not thread safe!
+  public sealed class SimpleArithmeticExpressionInterpreter : NamedItem, ISymbolicExpressionTreeInterpreter {
+    private class OpCodes {
+      public const byte Add = 1;
+      public const byte Sub = 2;
+      public const byte Mul = 3;
+      public const byte Div = 4;
+
+      public const byte Sin = 5;
+      public const byte Cos = 6;
+      public const byte Tan = 7;
+
+      public const byte Log = 8;
+      public const byte Exp = 9;
+
+      public const byte IfThenElse = 10;
+
+      public const byte GT = 11;
+      public const byte LT = 12;
+
+      public const byte AND = 13;
+      public const byte OR = 14;
+      public const byte NOT = 15;
+
+
+      public const byte Average = 16;
+
+      public const byte Call = 17;
+
+      public const byte Variable = 18;
+      public const byte LagVariable = 19;
+      public const byte Constant = 20;
+      public const byte Arg = 21;
+
+      public const byte TimeLag = 22;
+    }
+
+    private Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
+      { typeof(Addition), OpCodes.Add },
+      { typeof(Subtraction), OpCodes.Sub },
+      { typeof(Multiplication), OpCodes.Mul },
+      { typeof(Division), OpCodes.Div },
+      { typeof(Sine), OpCodes.Sin },
+      { typeof(Cosine), OpCodes.Cos },
+      { typeof(Tangent), OpCodes.Tan },
+      { typeof(Logarithm), OpCodes.Log },
+      { typeof(Exponential), OpCodes.Exp },
+      { typeof(IfThenElse), OpCodes.IfThenElse },
+      { typeof(GreaterThan), OpCodes.GT },
+      { typeof(LessThan), OpCodes.LT },
+      { typeof(And), OpCodes.AND },
+      { typeof(Or), OpCodes.OR },
+      { typeof(Not), OpCodes.NOT},
+      { typeof(Average), OpCodes.Average},
+      { typeof(InvokeFunction), OpCodes.Call },
+      { typeof(HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable), OpCodes.Variable },
+      { typeof(LaggedVariable), OpCodes.LagVariable },
+      { typeof(Constant), OpCodes.Constant },
+      { typeof(Argument), OpCodes.Arg },
+      { typeof(TimeLag), OpCodes.TimeLag},
+    };
+    private const int ARGUMENT_STACK_SIZE = 1024;
+
+    private Dataset dataset;
+    private int row;
+    private Instruction[] code;
+    private int pc;
+    private double[] argumentStack = new double[ARGUMENT_STACK_SIZE];
+    private int argStackPointer;
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    [StorableConstructor]
+    private SimpleArithmeticExpressionInterpreter(bool deserializing) : base(deserializing) { }
+    private SimpleArithmeticExpressionInterpreter(SimpleArithmeticExpressionInterpreter original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleArithmeticExpressionInterpreter(this, cloner);
+    }
+
+    public SimpleArithmeticExpressionInterpreter()
+      : base() {
+    }
+
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(SymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
+      this.dataset = dataset;
+      var compiler = new SymbolicExpressionTreeCompiler();
+      compiler.AddInstructionPostProcessingHook(PostProcessInstruction);
+      code = compiler.Compile(tree, MapSymbolToOpCode);
+      foreach (var row in rows) {
+        this.row = row;
+        pc = 0;
+        argStackPointer = 0;
+        yield return Evaluate();
+      }
+    }
+
+    private Instruction PostProcessInstruction(Instruction instr) {
+      if (instr.opCode == OpCodes.Variable) {
+        var variableTreeNode = instr.dynamicNode as VariableTreeNode;
+        instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName);
+      } else if (instr.opCode == OpCodes.LagVariable) {
+        var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode;
+        instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName);
+      }
+      return instr;
+    }
+
+    private byte MapSymbolToOpCode(SymbolicExpressionTreeNode treeNode) {
+      if (symbolToOpcode.ContainsKey(treeNode.Symbol.GetType()))
+        return symbolToOpcode[treeNode.Symbol.GetType()];
+      else
+        throw new NotSupportedException("Symbol: " + treeNode.Symbol);
+    }
+
+    private double Evaluate() {
+      Instruction currentInstr = code[pc++];
+      switch (currentInstr.opCode) {
+        case OpCodes.Add: {
+            double s = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              s += Evaluate();
+            }
+            return s;
+          }
+        case OpCodes.Sub: {
+            double s = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              s -= Evaluate();
+            }
+            if (currentInstr.nArguments == 1) s = -s;
+            return s;
+          }
+        case OpCodes.Mul: {
+            double p = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              p *= Evaluate();
+            }
+            return p;
+          }
+        case OpCodes.Div: {
+            double p = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              p /= Evaluate();
+            }
+            if (currentInstr.nArguments == 1) p = 1.0 / p;
+            return p;
+          }
+        case OpCodes.Average: {
+            double sum = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              sum += Evaluate();
+            }
+            return sum / currentInstr.nArguments;
+          }
+        case OpCodes.Cos: {
+            return Math.Cos(Evaluate());
+          }
+        case OpCodes.Sin: {
+            return Math.Sin(Evaluate());
+          }
+        case OpCodes.Tan: {
+            return Math.Tan(Evaluate());
+          }
+        case OpCodes.Exp: {
+            return Math.Exp(Evaluate());
+          }
+        case OpCodes.Log: {
+            return Math.Log(Evaluate());
+          }
+        case OpCodes.IfThenElse: {
+            double condition = Evaluate();
+            double result;
+            if (condition > 0.0) {
+              result = Evaluate(); SkipBakedCode();
+            } else {
+              SkipBakedCode(); result = Evaluate();
+            }
+            return result;
+          }
+        case OpCodes.AND: {
+            double result = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              if (result <= 0.0) SkipBakedCode();
+              else {
+                result = Evaluate();
+              }
+            }
+            return result <= 0.0 ? -1.0 : 1.0;
+          }
+        case OpCodes.OR: {
+            double result = Evaluate();
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              if (result > 0.0) SkipBakedCode();
+              else {
+                result = Evaluate();
+              }
+            }
+            return result > 0.0 ? 1.0 : -1.0;
+          }
+        case OpCodes.NOT: {
+            return -Evaluate();
+          }
+        case OpCodes.GT: {
+            double x = Evaluate();
+            double y = Evaluate();
+            if (x > y) return 1.0;
+            else return -1.0;
+          }
+        case OpCodes.LT: {
+            double x = Evaluate();
+            double y = Evaluate();
+            if (x < y) return 1.0;
+            else return -1.0;
+          }
+        case OpCodes.Call: {
+            // evaluate sub-trees
+            // push on argStack in reverse order 
+            for (int i = 0; i < currentInstr.nArguments; i++) {
+              argumentStack[argStackPointer + currentInstr.nArguments - i] = Evaluate();
+            }
+            argStackPointer += currentInstr.nArguments;
+
+            // save the pc
+            int nextPc = pc;
+            // set pc to start of function  
+            pc = currentInstr.iArg0;
+            // evaluate the function
+            double v = Evaluate();
+
+            // decrease the argument stack pointer by the number of arguments pushed
+            // to set the argStackPointer back to the original location
+            argStackPointer -= currentInstr.nArguments;
+
+            // restore the pc => evaluation will continue at point after my subtrees  
+            pc = nextPc;
+            return v;
+          }
+        case OpCodes.Arg: {
+            return argumentStack[argStackPointer - currentInstr.iArg0];
+          }
+        case OpCodes.Variable: {
+            var variableTreeNode = currentInstr.dynamicNode as VariableTreeNode;
+            return dataset[row, currentInstr.iArg0] * variableTreeNode.Weight;
+          }
+        case OpCodes.LagVariable: {
+            var lagVariableTreeNode = currentInstr.dynamicNode as LaggedVariableTreeNode;
+            int actualRow = row + lagVariableTreeNode.Lag;
+            if (actualRow < 0 || actualRow >= dataset.Rows) throw new ArgumentException("Out of range access to dataset row: " + row);
+            return dataset[actualRow, currentInstr.iArg0] * lagVariableTreeNode.Weight;
+          }
+        case OpCodes.Constant: {
+            var constTreeNode = currentInstr.dynamicNode as ConstantTreeNode;
+            return constTreeNode.Value;
+          }
+        case OpCodes.TimeLag: {
+            var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
+            row += timeLagTreeNode.Lag;
+            if (row < 0 || row >= dataset.Rows) {
+              row -= timeLagTreeNode.Lag;
+              return double.NaN;
+            }
+            double result = Evaluate();
+            row -= timeLagTreeNode.Lag;
+            return result;
+          }
+        default: throw new NotSupportedException();
+      }
+    }
+
+    // skips a whole branch
+    private void SkipBakedCode() {
+      int i = 1;
+      while (i > 0) {
+        i += code[pc++].nArguments;
+        i--;
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SymbolicSimplifier.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SymbolicSimplifier.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SymbolicSimplifier.cs	(revision 5026)
@@ -0,0 +1,529 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Diagnostics;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Simplistic simplifier for arithmetic expressions
+  /// </summary>
+  public class SymbolicSimplifier {
+    private Addition addSymbol = new Addition();
+    private Multiplication mulSymbol = new Multiplication();
+    private Division divSymbol = new Division();
+    private Constant constSymbol = new Constant();
+    private Variable varSymbol = new Variable();
+
+    public SymbolicExpressionTree Simplify(SymbolicExpressionTree originalTree) {
+      var clone = (SymbolicExpressionTreeNode)originalTree.Root.Clone();
+      // macro expand (initially no argument trees)
+      var macroExpandedTree = MacroExpand(clone, clone.SubTrees[0], new List<SymbolicExpressionTreeNode>());
+      SymbolicExpressionTreeNode rootNode = (new ProgramRootSymbol()).CreateTreeNode();
+      rootNode.AddSubTree(GetSimplifiedTree(macroExpandedTree));
+      return new SymbolicExpressionTree(rootNode);
+    }
+
+    // the argumentTrees list contains already expanded trees used as arguments for invocations
+    private SymbolicExpressionTreeNode MacroExpand(SymbolicExpressionTreeNode root, SymbolicExpressionTreeNode node, IList<SymbolicExpressionTreeNode> argumentTrees) {
+      List<SymbolicExpressionTreeNode> subtrees = new List<SymbolicExpressionTreeNode>(node.SubTrees);
+      while (node.SubTrees.Count > 0) node.RemoveSubTree(0);
+      if (node.Symbol is InvokeFunction) {
+        var invokeSym = node.Symbol as InvokeFunction;
+        var defunNode = FindFunctionDefinition(root, invokeSym.FunctionName);
+        var macroExpandedArguments = new List<SymbolicExpressionTreeNode>();
+        foreach (var subtree in subtrees) {
+          macroExpandedArguments.Add(MacroExpand(root, subtree, argumentTrees));
+        }
+        return MacroExpand(root, defunNode, macroExpandedArguments);
+      } else if (node.Symbol is Argument) {
+        var argSym = node.Symbol as Argument;
+        // return the correct argument sub-tree (already macro-expanded)
+        return (SymbolicExpressionTreeNode)argumentTrees[argSym.ArgumentIndex].Clone();
+      } else {
+        // recursive application
+        foreach (var subtree in subtrees) {
+          node.AddSubTree(MacroExpand(root, subtree, argumentTrees));
+        }
+        return node;
+      }
+    }
+
+    private SymbolicExpressionTreeNode FindFunctionDefinition(SymbolicExpressionTreeNode root, string functionName) {
+      foreach (var subtree in root.SubTrees.OfType<DefunTreeNode>()) {
+        if (subtree.FunctionName == functionName) return subtree.SubTrees[0];
+      }
+
+      throw new ArgumentException("Definition of function " + functionName + " not found.");
+    }
+
+
+    #region symbol predicates
+    private bool IsDivision(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Division;
+    }
+
+    private bool IsMultiplication(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Multiplication;
+    }
+
+    private bool IsSubtraction(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Subtraction;
+    }
+
+    private bool IsAddition(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Addition;
+    }
+
+    private bool IsVariable(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Variable;
+    }
+
+    private bool IsConstant(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Constant;
+    }
+
+    private bool IsAverage(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Average;
+    }
+    private bool IsLog(SymbolicExpressionTreeNode original) {
+      return original.Symbol is Logarithm;
+    }
+    private bool IsIfThenElse(SymbolicExpressionTreeNode original) {
+      return original.Symbol is IfThenElse;
+    }
+    #endregion
+
+    /// <summary>
+    /// Creates a new simplified tree
+    /// </summary>
+    /// <param name="original"></param>
+    /// <returns></returns>
+    public SymbolicExpressionTreeNode GetSimplifiedTree(SymbolicExpressionTreeNode original) {
+      if (IsConstant(original) || IsVariable(original)) {
+        return (SymbolicExpressionTreeNode)original.Clone();
+      } else if (IsAddition(original)) {
+        return SimplifyAddition(original);
+      } else if (IsSubtraction(original)) {
+        return SimplifySubtraction(original);
+      } else if (IsMultiplication(original)) {
+        return SimplifyMultiplication(original);
+      } else if (IsDivision(original)) {
+        return SimplifyDivision(original);
+      } else if (IsAverage(original)) {
+        return SimplifyAverage(original);
+      } else if (IsLog(original)) {
+        // TODO simplify logarithm
+        return SimplifyAny(original);
+      } else if (IsIfThenElse(original)) {
+        // TODO simplify conditionals
+        return SimplifyAny(original);
+      } else if (IsAverage(original)) {
+        return SimplifyAverage(original);
+      } else {
+        return SimplifyAny(original);
+      }
+    }
+
+    #region specific simplification routines
+    private SymbolicExpressionTreeNode SimplifyAny(SymbolicExpressionTreeNode original) {
+      // can't simplify this function but simplify all subtrees 
+      List<SymbolicExpressionTreeNode> subTrees = new List<SymbolicExpressionTreeNode>(original.SubTrees);
+      while (original.SubTrees.Count > 0) original.RemoveSubTree(0);
+      var clone = (SymbolicExpressionTreeNode)original.Clone();
+      List<SymbolicExpressionTreeNode> simplifiedSubTrees = new List<SymbolicExpressionTreeNode>();
+      foreach (var subTree in subTrees) {
+        simplifiedSubTrees.Add(GetSimplifiedTree(subTree));
+        original.AddSubTree(subTree);
+      }
+      foreach (var simplifiedSubtree in simplifiedSubTrees) {
+        clone.AddSubTree(simplifiedSubtree);
+      }
+      if (simplifiedSubTrees.TrueForAll(t => IsConstant(t))) {
+        SimplifyConstantExpression(clone);
+      }
+      return clone;
+    }
+
+    private SymbolicExpressionTreeNode SimplifyConstantExpression(SymbolicExpressionTreeNode original) {
+      // not yet implemented
+      return original;
+    }
+
+    private SymbolicExpressionTreeNode SimplifyAverage(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return GetSimplifiedTree(original.SubTrees[0]);
+      } else {
+        // simplify expressions x0..xn
+        // make sum(x0..xn) / n
+        Trace.Assert(original.SubTrees.Count > 1);
+        var sum = original.SubTrees
+          .Select(x => GetSimplifiedTree(x))
+          .Aggregate((a, b) => MakeSum(a, b));
+        return MakeFraction(sum, MakeConstant(original.SubTrees.Count));
+      }
+    }
+
+    private SymbolicExpressionTreeNode SimplifyDivision(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return Invert(GetSimplifiedTree(original.SubTrees[0]));
+      } else {
+        // simplify expressions x0..xn
+        // make multiplication (x0 * 1/(x1 * x1 * .. * xn))
+        Trace.Assert(original.SubTrees.Count > 1);
+        var simplifiedTrees = original.SubTrees.Select(x => GetSimplifiedTree(x));
+        return
+          MakeProduct(simplifiedTrees.First(), Invert(simplifiedTrees.Skip(1).Aggregate((a, b) => MakeProduct(a, b))));
+      }
+    }
+
+    private SymbolicExpressionTreeNode SimplifyMultiplication(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return GetSimplifiedTree(original.SubTrees[0]);
+      } else {
+        Trace.Assert(original.SubTrees.Count > 1);
+        return original.SubTrees
+          .Select(x => GetSimplifiedTree(x))
+          .Aggregate((a, b) => MakeProduct(a, b));
+      }
+    }
+
+    private SymbolicExpressionTreeNode SimplifySubtraction(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return Negate(GetSimplifiedTree(original.SubTrees[0]));
+      } else {
+        // simplify expressions x0..xn
+        // make addition (x0,-x1..-xn)
+        Trace.Assert(original.SubTrees.Count > 1);
+        var simplifiedTrees = original.SubTrees.Select(x => GetSimplifiedTree(x));
+        return simplifiedTrees.Take(1)
+          .Concat(simplifiedTrees.Skip(1).Select(x => Negate(x)))
+          .Aggregate((a, b) => MakeSum(a, b));
+      }
+    }
+
+    private SymbolicExpressionTreeNode SimplifyAddition(SymbolicExpressionTreeNode original) {
+      if (original.SubTrees.Count == 1) {
+        return GetSimplifiedTree(original.SubTrees[0]);
+      } else {
+        // simplify expression x0..xn
+        // make addition (x0..xn)
+        Trace.Assert(original.SubTrees.Count > 1);
+        return original.SubTrees
+          .Select(x => GetSimplifiedTree(x))
+          .Aggregate((a, b) => MakeSum(a, b));
+      }
+    }
+    #endregion
+
+
+
+    #region low level tree restructuring
+    // MakeFraction, MakeProduct and MakeSum take two already simplified trees and create a new simplified tree
+
+    private SymbolicExpressionTreeNode MakeFraction(SymbolicExpressionTreeNode a, SymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        // fold constants
+        return MakeConstant(((ConstantTreeNode)a).Value / ((ConstantTreeNode)b).Value);
+      } if (IsConstant(a) && !((ConstantTreeNode)a).Value.IsAlmost(1.0)) {
+        return MakeFraction(MakeConstant(1.0), MakeProduct(b, Invert(a)));
+      } else if (IsVariable(a) && IsConstant(b)) {
+        // merge constant values into variable weights
+        var constB = ((ConstantTreeNode)b).Value;
+        ((VariableTreeNode)a).Weight /= constB;
+        return a;
+      } else if (IsAddition(a) && IsConstant(b)) {
+        return a.SubTrees
+          .Select(x => GetSimplifiedTree(x))
+         .Select(x => MakeFraction(x, b))
+         .Aggregate((c, d) => MakeSum(c, d));
+      } else if (IsMultiplication(a) && IsConstant(b)) {
+        return MakeProduct(a, Invert(b));
+      } else if (IsDivision(a) && IsConstant(b)) {
+        // (a1 / a2) / c => (a1 / (a2 * c))
+        Trace.Assert(a.SubTrees.Count == 2);
+        return MakeFraction(a.SubTrees[0], MakeProduct(a.SubTrees[1], b));
+      } else if (IsDivision(a) && IsDivision(b)) {
+        // (a1 / a2) / (b1 / b2) => 
+        Trace.Assert(a.SubTrees.Count == 2);
+        Trace.Assert(b.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(a.SubTrees[0], b.SubTrees[1]), MakeProduct(a.SubTrees[1], b.SubTrees[0]));
+      } else if (IsDivision(a)) {
+        // (a1 / a2) / b => (a1 / (a2 * b))
+        Trace.Assert(a.SubTrees.Count == 2);
+        return MakeFraction(a.SubTrees[0], MakeProduct(a.SubTrees[1], b));
+      } else if (IsDivision(b)) {
+        // a / (b1 / b2) => (a * b2) / b1
+        Trace.Assert(b.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(a, b.SubTrees[1]), b.SubTrees[0]);
+      } else {
+        var div = divSymbol.CreateTreeNode();
+        div.AddSubTree(a);
+        div.AddSubTree(b);
+        return div;
+      }
+    }
+
+    private SymbolicExpressionTreeNode MakeSum(SymbolicExpressionTreeNode a, SymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        // fold constants
+        ((ConstantTreeNode)a).Value += ((ConstantTreeNode)b).Value;
+        return a;
+      } else if (IsConstant(a)) {
+        // c + x => x + c
+        // b is not constant => make sure constant is on the right
+        return MakeSum(b, a);
+      } else if (IsConstant(b) && ((ConstantTreeNode)b).Value.IsAlmost(0.0)) {
+        // x + 0 => x
+        return a;
+      } else if (IsAddition(a) && IsAddition(b)) {
+        // merge additions
+        var add = addSymbol.CreateTreeNode();
+        for (int i = 0; i < a.SubTrees.Count - 1; i++) add.AddSubTree(a.SubTrees[i]);
+        for (int i = 0; i < b.SubTrees.Count - 1; i++) add.AddSubTree(b.SubTrees[i]);
+        if (IsConstant(a.SubTrees.Last()) && IsConstant(b.SubTrees.Last())) {
+          add.AddSubTree(MakeSum(a.SubTrees.Last(), b.SubTrees.Last()));
+        } else if (IsConstant(a.SubTrees.Last())) {
+          add.AddSubTree(b.SubTrees.Last());
+          add.AddSubTree(a.SubTrees.Last());
+        } else {
+          add.AddSubTree(a.SubTrees.Last());
+          add.AddSubTree(b.SubTrees.Last());
+        }
+        MergeVariablesInSum(add);
+        return add;
+      } else if (IsAddition(b)) {
+        return MakeSum(b, a);
+      } else if (IsAddition(a) && IsConstant(b)) {
+        // a is an addition and b is a constant => append b to a and make sure the constants are merged
+        var add = addSymbol.CreateTreeNode();
+        for (int i = 0; i < a.SubTrees.Count - 1; i++) add.AddSubTree(a.SubTrees[i]);
+        if (IsConstant(a.SubTrees.Last()))
+          add.AddSubTree(MakeSum(a.SubTrees.Last(), b));
+        else {
+          add.AddSubTree(a.SubTrees.Last());
+          add.AddSubTree(b);
+        }
+        return add;
+      } else if (IsAddition(a)) {
+        // a is already an addition => append b
+        var add = addSymbol.CreateTreeNode();
+        add.AddSubTree(b);
+        foreach (var subTree in a.SubTrees) {
+          add.AddSubTree(subTree);
+        }
+        MergeVariablesInSum(add);
+        return add;
+      } else {
+        var add = addSymbol.CreateTreeNode();
+        add.AddSubTree(a);
+        add.AddSubTree(b);
+        MergeVariablesInSum(add);
+        return add;
+      }
+    }
+
+    // makes sure variable symbols in sums are combined
+    // possible improvment: combine sums of products where the products only reference the same variable
+    private void MergeVariablesInSum(SymbolicExpressionTreeNode sum) {
+      var subtrees = new List<SymbolicExpressionTreeNode>(sum.SubTrees);
+      while (sum.SubTrees.Count > 0) sum.RemoveSubTree(0);
+      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNode>()
+                            group node by node.VariableName into g
+                            select g;
+      var unchangedSubTrees = subtrees.Where(t => !(t is VariableTreeNode));
+
+      foreach (var variableNodeGroup in groupedVarNodes) {
+        var weightSum = variableNodeGroup.Select(t => t.Weight).Sum();
+        var representative = variableNodeGroup.First();
+        representative.Weight = weightSum;
+        sum.AddSubTree(representative);
+      }
+      foreach (var unchangedSubtree in unchangedSubTrees)
+        sum.AddSubTree(unchangedSubtree);
+    }
+
+
+    private SymbolicExpressionTreeNode MakeProduct(SymbolicExpressionTreeNode a, SymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        // fold constants
+        ((ConstantTreeNode)a).Value *= ((ConstantTreeNode)b).Value;
+        return a;
+      } else if (IsConstant(a)) {
+        // a * $ => $ * a
+        return MakeProduct(b, a);
+      } else if (IsConstant(b) && ((ConstantTreeNode)b).Value.IsAlmost(1.0)) {
+        // $ * 1.0 => $
+        return a;
+      } else if (IsConstant(b) && IsVariable(a)) {
+        // multiply constants into variables weights
+        ((VariableTreeNode)a).Weight *= ((ConstantTreeNode)b).Value;
+        return a;
+      } else if (IsConstant(b) && IsAddition(a)) {
+        // multiply constants into additions
+        return a.SubTrees.Select(x => MakeProduct(x, b)).Aggregate((c, d) => MakeSum(c, d));
+      } else if (IsDivision(a) && IsDivision(b)) {
+        // (a1 / a2) * (b1 / b2) => (a1 * b1) / (a2 * b2)
+        Trace.Assert(a.SubTrees.Count == 2);
+        Trace.Assert(b.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(a.SubTrees[0], b.SubTrees[0]), MakeProduct(a.SubTrees[1], b.SubTrees[1]));
+      } else if (IsDivision(a)) {
+        // (a1 / a2) * b => (a1 * b) / a2
+        Trace.Assert(a.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(a.SubTrees[0], b), a.SubTrees[1]);
+      } else if (IsDivision(b)) {
+        // a * (b1 / b2) => (b1 * a) / b2
+        Trace.Assert(b.SubTrees.Count == 2);
+        return MakeFraction(MakeProduct(b.SubTrees[0], a), b.SubTrees[1]);
+      } else if (IsMultiplication(a) && IsMultiplication(b)) {
+        // merge multiplications (make sure constants are merged)
+        var mul = mulSymbol.CreateTreeNode();
+        for (int i = 0; i < a.SubTrees.Count; i++) mul.AddSubTree(a.SubTrees[i]);
+        for (int i = 0; i < b.SubTrees.Count; i++) mul.AddSubTree(b.SubTrees[i]);
+        MergeVariablesAndConstantsInProduct(mul);
+        return mul;
+      } else if (IsMultiplication(b)) {
+        return MakeProduct(b, a);
+      } else if (IsMultiplication(a)) {
+        // a is already an multiplication => append b
+        a.AddSubTree(b);
+        MergeVariablesAndConstantsInProduct(a);
+        return a;
+      } else {
+        var mul = mulSymbol.CreateTreeNode();
+        mul.SubTrees.Add(a);
+        mul.SubTrees.Add(b);
+        MergeVariablesAndConstantsInProduct(mul);
+        return mul;
+      }
+    }
+    #endregion
+
+    // helper to combine the constant factors in products and to combine variables (powers of 2, 3...)
+    private void MergeVariablesAndConstantsInProduct(SymbolicExpressionTreeNode prod) {
+      var subtrees = new List<SymbolicExpressionTreeNode>(prod.SubTrees);
+      while (prod.SubTrees.Count > 0) prod.RemoveSubTree(0);
+      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNode>()
+                            group node by node.VariableName into g
+                            orderby g.Count()
+                            select g;
+      var constantProduct = (from node in subtrees.OfType<VariableTreeNode>()
+                             select node.Weight)
+                            .Concat(from node in subtrees.OfType<ConstantTreeNode>()
+                                    select node.Value)
+                            .DefaultIfEmpty(1.0)
+                            .Aggregate((c1, c2) => c1 * c2);
+
+      var unchangedSubTrees = from tree in subtrees
+                              where !(tree is VariableTreeNode)
+                              where !(tree is ConstantTreeNode)
+                              select tree;
+
+      foreach (var variableNodeGroup in groupedVarNodes) {
+        var representative = variableNodeGroup.First();
+        representative.Weight = 1.0;
+        if (variableNodeGroup.Count() > 1) {
+          var poly = mulSymbol.CreateTreeNode();
+          for (int p = 0; p < variableNodeGroup.Count(); p++) {
+            poly.AddSubTree((SymbolicExpressionTreeNode)representative.Clone());
+          }
+          prod.AddSubTree(poly);
+        } else {
+          prod.AddSubTree(representative);
+        }
+      }
+
+      foreach (var unchangedSubtree in unchangedSubTrees)
+        prod.AddSubTree(unchangedSubtree);
+
+      if (!constantProduct.IsAlmost(1.0)) {
+        prod.AddSubTree(MakeConstant(constantProduct));
+      }
+    }
+
+
+    #region helper functions
+    /// <summary>
+    /// x => x * -1
+    /// Doesn't create new trees and manipulates x
+    /// </summary>
+    /// <param name="x"></param>
+    /// <returns>-x</returns>
+    private SymbolicExpressionTreeNode Negate(SymbolicExpressionTreeNode x) {
+      if (IsConstant(x)) {
+        ((ConstantTreeNode)x).Value *= -1;
+      } else if (IsVariable(x)) {
+        var variableTree = (VariableTreeNode)x;
+        variableTree.Weight *= -1.0;
+      } else if (IsAddition(x)) {
+        // (x0 + x1 + .. + xn) * -1 => (-x0 + -x1 + .. + -xn)        
+        foreach (var subTree in x.SubTrees) {
+          Negate(subTree);
+        }
+      } else if (IsMultiplication(x) || IsDivision(x)) {
+        // x0 * x1 * .. * xn * -1 => x0 * x1 * .. * -xn
+        Negate(x.SubTrees.Last()); // last is maybe a constant, prefer to negate the constant
+      } else {
+        // any other function
+        return MakeProduct(x, MakeConstant(-1));
+      }
+      return x;
+    }
+
+    /// <summary>
+    /// x => 1/x
+    /// Doesn't create new trees and manipulates x
+    /// </summary>
+    /// <param name="x"></param>
+    /// <returns></returns>
+    private SymbolicExpressionTreeNode Invert(SymbolicExpressionTreeNode x) {
+      if (IsConstant(x)) {
+        return MakeConstant(1.0 / ((ConstantTreeNode)x).Value);
+      } else if (IsDivision(x)) {
+        Trace.Assert(x.SubTrees.Count == 2);
+        return MakeFraction(x.SubTrees[1], x.SubTrees[0]);
+      } else {
+        // any other function
+        return MakeFraction(MakeConstant(1), x);
+      }
+    }
+
+    private SymbolicExpressionTreeNode MakeConstant(double value) {
+      ConstantTreeNode constantTreeNode = (ConstantTreeNode)(constSymbol.CreateTreeNode());
+      constantTreeNode.Value = value;
+      return (SymbolicExpressionTreeNode)constantTreeNode;
+    }
+
+    private SymbolicExpressionTreeNode MakeVariable(double weight, string name) {
+      var tree = (VariableTreeNode)varSymbol.CreateTreeNode();
+      tree.Weight = weight;
+      tree.VariableName = name;
+      return tree;
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Addition.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Addition.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Addition.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Addition", "Symbol that represents the + operator.")]
+  public sealed class Addition : Symbol {
+    [StorableConstructor]
+    private Addition(bool deserializing) : base(deserializing) { }
+    private Addition(Addition original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Addition(this, cloner);
+    }
+    public Addition() : base("Addition", "Symbol that represents the + operator.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/And.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/And.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/And.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("And", "Symbol that represents the boolean AND operator.")]
+  public sealed class And : Symbol {
+    [StorableConstructor]
+    private And(bool deserializing) : base(deserializing) { }
+    private And(And original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new And(this, cloner);
+    }
+    public And() : base("And", "Symbol that represents the boolean AND operator.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Average.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Average.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Average.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Average", "Symbol that represents the average (arithmetic mean) function.")]
+  public sealed class Average : Symbol {
+    [StorableConstructor]
+    private Average(bool deserializing) : base(deserializing) { }
+    private Average(Average original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Average(this, cloner);
+    }
+    public Average() : base("Average", "Symbol that represents the average (arithmetic mean) function.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Constant.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Constant.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Constant.cs	(revision 5026)
@@ -0,0 +1,104 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Constant", "Represents a constant value.")]
+  public sealed class Constant : Symbol {
+    #region Propeties
+    [Storable]
+    private double minValue;
+    public double MinValue {
+      get { return minValue; }
+      set {
+        if (value != minValue) {
+          minValue = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double maxValue;
+    public double MaxValue {
+      get { return maxValue; }
+      set {
+        if (value != maxValue) {
+          maxValue = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double manipulatorMu;
+    public double ManipulatorMu {
+      get { return manipulatorMu; }
+      set {
+        if (value != manipulatorMu) {
+          manipulatorMu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double manipulatorSigma;
+    public double ManipulatorSigma {
+      get { return manipulatorSigma; }
+      set {
+        if (value < 0) throw new ArgumentException();
+        if (value != manipulatorSigma) {
+          manipulatorSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    #endregion
+    [StorableConstructor]
+    private Constant(bool deserializing) : base(deserializing) { }
+    private Constant(Constant original, Cloner cloner)
+      : base(original, cloner) {
+      minValue = original.minValue;
+      maxValue = original.maxValue;
+      manipulatorMu = original.manipulatorMu;
+      manipulatorSigma = original.manipulatorSigma;
+    }
+    public Constant()
+      : base("Constant", "Represents a constant value.") {
+      manipulatorMu = 0.0;
+      manipulatorSigma = 1.0;
+      minValue = -20.0;
+      maxValue = 20.0;
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new ConstantTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Constant(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/ConstantTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/ConstantTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/ConstantTreeNode.cs	(revision 5026)
@@ -0,0 +1,77 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  public sealed class ConstantTreeNode : SymbolicExpressionTreeTerminalNode {
+    public new Constant Symbol {
+      get { return (Constant)base.Symbol; }
+    }
+
+    private double constantValue;
+    [Storable]
+    public double Value {
+      get { return constantValue; }
+      set { constantValue = value; }
+    }
+
+    [StorableConstructor]
+    private ConstantTreeNode(bool deserializing) : base(deserializing) { }
+
+    private ConstantTreeNode(ConstantTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      constantValue = original.constantValue;
+    }
+
+    private ConstantTreeNode() : base() { }
+    public ConstantTreeNode(Constant constantSymbol) : base(constantSymbol) { }
+
+    public override bool HasLocalParameters {
+      get {
+        return true;
+      }
+    }
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      var range = Symbol.MaxValue - Symbol.MinValue;
+      Value = random.NextDouble() * range - Symbol.MinValue;
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+      double x = NormalDistributedRandom.NextDouble(random, Symbol.ManipulatorMu, Symbol.ManipulatorSigma);
+      Value = Value + x * shakingFactor;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ConstantTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      return constantValue.ToString("E4");
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Cosine.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Cosine.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Cosine.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Cosine", "Symbol that represents the cosine function.")]
+  public sealed class Cosine : Symbol {
+    [StorableConstructor]
+    private Cosine(bool deserializing) : base(deserializing) { }
+    private Cosine(Cosine original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Cosine(this, cloner);
+    }
+    public Cosine() : base("Cosine", "Symbol that represents the cosine function.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Division.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Division.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Division.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Division", "Symbol that represents the / operator.")]
+  public sealed class Division : Symbol {
+    [StorableConstructor]
+    private Division(bool deserializing) : base(deserializing) { }
+    private Division(Division original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Division(this, cloner);
+    }
+    public Division() : base("Division", "Symbol that represents the / operator.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Exponential.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Exponential.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Exponential.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Exponential", "Symbol that represents the exponential function.")]
+  public sealed class Exponential : Symbol {
+    [StorableConstructor]
+    private Exponential(bool deserializing) : base(deserializing) { }
+    private Exponential(Exponential original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Exponential(this, cloner);
+    }
+    public Exponential() : base("Exponential", "Symbol that represents the exponential function.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/GreaterThan.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/GreaterThan.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/GreaterThan.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("GreaterThan", "Symbol that represents a greater than relation.")]
+  public sealed class GreaterThan : Symbol {
+    [StorableConstructor]
+    private GreaterThan(bool deserializing) : base(deserializing) { }
+    private GreaterThan(GreaterThan original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GreaterThan(this, cloner);
+    }
+    public GreaterThan() : base("GreaterThan", "Symbol that represents a greater than relation.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/IfThenElse.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/IfThenElse.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/IfThenElse.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("IfThenElse", "Symbol that represents a conditional operator.")]
+  public sealed class IfThenElse : Symbol {
+    [StorableConstructor]
+    private IfThenElse(bool deserializing) : base(deserializing) { }
+    private IfThenElse(IfThenElse original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new IfThenElse(this, cloner);
+    }
+    public IfThenElse() : base("IfThenElse", "Symbol that represents a conditional operator.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedSymbol.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedSymbol.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedSymbol.cs	(revision 5026)
@@ -0,0 +1,44 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("LaggedSymbol", "Represents a symblol whose evaluation is shifted.")]
+  public abstract class LaggedSymbol : Symbol {
+    [Storable]
+    private int minLag;
+    public virtual int MinLag {
+      get { return minLag; }
+      set { minLag = value; }
+    }
+    [Storable]
+    private int maxLag;
+    public virtual int MaxLag {
+      get { return maxLag; }
+      set { maxLag = value; }
+    }
+
+    [StorableConstructor]
+    protected LaggedSymbol(bool deserializing) : base(deserializing) { }
+    protected LaggedSymbol(LaggedSymbol original, Cloner cloner)
+      : base(original, cloner) {
+      minLag = original.minLag;
+      maxLag = original.maxLag;
+    }
+    protected LaggedSymbol()
+      : base("LaggedSymbol", "Represents a symbol whose evaluation is shifted.") {
+      minLag = -1; maxLag = -1;
+    }
+    protected LaggedSymbol(string name, string description)
+      : base(name, description) {
+      minLag = -1; maxLag = -1;
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new LaggedTreeNode(this);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedTreeNode.cs	(revision 5026)
@@ -0,0 +1,70 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  public class LaggedTreeNode : SymbolicExpressionTreeNode, ILaggedTreeNode {
+    public new LaggedSymbol Symbol {
+      get { return (LaggedSymbol)base.Symbol; }
+    }
+    [Storable]
+    private int lag;
+    public int Lag {
+      get { return lag; }
+      set { lag = value; }
+    }
+
+    [StorableConstructor]
+    protected LaggedTreeNode(bool deserializing) : base(deserializing) { }
+    protected LaggedTreeNode(LaggedTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      lag = original.lag;
+    }
+    public LaggedTreeNode(LaggedSymbol timeLagSymbol) : base(timeLagSymbol) { }
+
+    public override bool HasLocalParameters {
+      get { return true; }
+    }
+
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      lag = random.Next(Symbol.MinLag, Symbol.MaxLag + 1);
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+      lag = Math.Min(Symbol.MaxLag, Math.Max(Symbol.MinLag, lag + random.Next(-1, 2)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LaggedTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      return base.ToString() + " " + lag.ToString();
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariable.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariable.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariable.cs	(revision 5026)
@@ -0,0 +1,62 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("LaggedVariable", "Represents a variable value with a time offset.")]
+  public sealed class LaggedVariable : Variable {
+    [Storable]
+    private int minLag;
+    public int MinLag {
+      get { return minLag; }
+      set { minLag = value; }
+    }
+    [Storable]
+    private int maxLag;
+    public int MaxLag {
+      get { return maxLag; }
+      set { maxLag = value; }
+    }
+    [StorableConstructor]
+    private LaggedVariable(bool deserializing) : base(deserializing) { }
+    private LaggedVariable(LaggedVariable original, Cloner cloner)
+      : base(original, cloner) {
+      minLag = original.minLag;
+      maxLag = original.maxLag;
+    }
+    public LaggedVariable()
+      : base("LaggedVariable", "Represents a variable value with a time offset.") {
+      minLag = -1; maxLag = -1;
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new LaggedVariableTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LaggedVariable(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariableTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariableTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LaggedVariableTreeNode.cs	(revision 5026)
@@ -0,0 +1,74 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  public sealed class LaggedVariableTreeNode : VariableTreeNode, ILaggedTreeNode {
+    public new LaggedVariable Symbol {
+      get { return (LaggedVariable)base.Symbol; }
+    }
+    [Storable]
+    private int lag;
+    public int Lag {
+      get { return lag; }
+      set { lag = value; }
+    }
+
+    [StorableConstructor]
+    private LaggedVariableTreeNode(bool deserializing) : base(deserializing) { }
+    private LaggedVariableTreeNode(LaggedVariableTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      lag = original.lag;
+    }
+    private LaggedVariableTreeNode() { }
+
+    public LaggedVariableTreeNode(LaggedVariable variableSymbol) : base(variableSymbol) { }
+
+    public override bool HasLocalParameters {
+      get {
+        return true;
+      }
+    }
+
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      lag = random.Next(Symbol.MinLag, Symbol.MaxLag + 1);
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+      lag = Math.Min(Symbol.MaxLag, Math.Max(Symbol.MinLag, lag + random.Next(-1, 2)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LaggedVariableTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      return base.ToString() +
+        " (t" + (lag > 0 ? "+" : "") + lag + ")";
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LessThan.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LessThan.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/LessThan.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("LessThan", "Symbol that represents a less than relation.")]
+  public sealed class LessThan : Symbol {
+    [StorableConstructor]
+    private LessThan(bool deserializing) : base(deserializing) { }
+    private LessThan(LessThan original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LessThan(this, cloner);
+    }
+    public LessThan() : base("LessThan", "Symbol that represents a less than relation.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Logarithm.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Logarithm.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Logarithm.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Logarithm", "Symbol that represents the logarithm function.")]
+  public sealed class Logarithm : Symbol {
+    [StorableConstructor]
+    private Logarithm(bool deserializing) : base(deserializing) { }
+    private Logarithm(Logarithm original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Logarithm(this, cloner);
+    }
+    public Logarithm() : base("Logarithm", "Symbol that represents the logarithm function.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Multiplication.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Multiplication.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Multiplication.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Multiplication", "Symbol that represents the * operator.")]
+  public sealed class Multiplication : Symbol {
+    [StorableConstructor]
+    private Multiplication(bool deserializing) : base(deserializing) { }
+    private Multiplication(Multiplication original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Multiplication(this, cloner);
+    }
+    public Multiplication() : base("Multiplication", "Symbol that represents the * operator.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Not.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Not.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Not.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Not", "Symbol that represents the boolean NOT operator.")]
+  public sealed class Not : Symbol {
+    [StorableConstructor]
+    private Not(bool deserializing) : base(deserializing) { }
+    private Not(Not original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Not(this, cloner);
+    }
+    public Not() : base("Not", "Symbol that represents the boolean NOT operator.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Or.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Or.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Or.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Or", "Symbol that represents the boolean OR operator.")]
+  public sealed class Or : Symbol {
+    [StorableConstructor]
+    private Or(bool deserializing) : base(deserializing) { }
+    private Or(Or original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Or(this, cloner);
+    }
+    public Or() : base("Or", "Symbol that represents the boolean OR operator.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Sine.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Sine.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Sine.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Sine", "Symbol that represents the sine function.")]
+  public sealed class Sine : Symbol {
+    [StorableConstructor]
+    private Sine(bool deserializing) : base(deserializing) { }
+    private Sine(Sine original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Sine(this, cloner);
+    }
+    public Sine() : base("Sine", "Symbol that represents the sine function.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Subtraction.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Subtraction.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Subtraction.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Subtraction", "Symbol that represents the - operator.")]
+  public sealed class Subtraction : Symbol {
+    [StorableConstructor]
+    private Subtraction(bool deserializing) : base(deserializing) { }
+    private Subtraction(Subtraction original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Subtraction(this, cloner);
+    }
+    public Subtraction() : base("Subtraction", "Symbol that represents the - operator.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Tangent.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Tangent.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Tangent.cs	(revision 5026)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Tangent", "Symbol that represents the tangent trigonometric function.")]
+  public sealed class Tangent : Symbol {
+    [StorableConstructor]
+    private Tangent(bool deserializing) : base(deserializing) { }
+    private Tangent(Tangent original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Tangent(this, cloner);
+    }
+    public Tangent() : base("Tangent", "Symbol that represents the tangent trigonometric function.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/TimeLag.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/TimeLag.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/TimeLag.cs	(revision 5026)
@@ -0,0 +1,38 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("TimeLag", "Represents a symblol whose evaluation is shifted.")]
+  public sealed class TimeLag : LaggedSymbol {
+    [StorableConstructor]
+    private TimeLag(bool deserializing) : base(deserializing) { }
+    private TimeLag(TimeLag original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TimeLag(this, cloner);
+    }
+    public TimeLag() : base("TimeLag", "Represents a symblol whose evaluation is shifted.") { }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs	(revision 5026)
@@ -0,0 +1,122 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  [Item("Variable", "Represents a variable value.")]
+  public class Variable : Symbol {
+    #region Properties
+    [Storable]
+    private double weightMu;
+    public double WeightMu {
+      get { return weightMu; }
+      set {
+        if (value != weightMu) {
+          weightMu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double weightSigma;
+    public double WeightSigma {
+      get { return weightSigma; }
+      set {
+        if (weightSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
+        if (value != weightSigma) {
+          weightSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double weightManipulatorMu;
+    public double WeightManipulatorMu {
+      get { return weightManipulatorMu; }
+      set {
+        if (value != weightManipulatorMu) {
+          weightManipulatorMu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double weightManipulatorSigma;
+    public double WeightManipulatorSigma {
+      get { return weightManipulatorSigma; }
+      set {
+        if (weightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
+        if (value != weightManipulatorSigma) {
+          weightManipulatorSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    private List<string> variableNames;
+    [Storable]
+    public IEnumerable<string> VariableNames {
+      get { return variableNames; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        variableNames.Clear();
+        variableNames.AddRange(value);
+        OnChanged(EventArgs.Empty);
+      }
+    }
+    #endregion
+    [StorableConstructor]
+    protected Variable(bool deserializing) : base(deserializing) {
+      variableNames = new List<string>();
+    }
+    protected Variable(Variable original, Cloner cloner)
+      : base(original, cloner) {
+      weightMu = original.weightMu;
+      weightSigma = original.weightSigma;
+      variableNames = new List<string>(original.variableNames);
+      weightManipulatorMu = original.weightManipulatorMu;
+      weightManipulatorSigma = original.weightManipulatorSigma;
+    }
+    public Variable() : this("Variable", "Represents a variable value.") { }
+    public Variable(string name, string description)
+      : base(name, description) {
+      weightMu = 1.0;
+      weightSigma = 1.0;
+      weightManipulatorMu = 0.0;
+      weightManipulatorSigma = 1.0;
+      variableNames = new List<string>();
+    }
+
+    public override SymbolicExpressionTreeNode CreateTreeNode() {
+      return new VariableTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Variable(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs	(revision 5026)
@@ -0,0 +1,84 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols {
+  [StorableClass]
+  public class VariableTreeNode : SymbolicExpressionTreeTerminalNode {
+    public new Variable Symbol {
+      get { return (Variable)base.Symbol; }
+    }
+    [Storable]
+    private double weight;
+    public double Weight {
+      get { return weight; }
+      set { weight = value; }
+    }
+    [Storable]
+    private string variableName;
+    public string VariableName {
+      get { return variableName; }
+      set { variableName = value; }
+    }
+
+    [StorableConstructor]
+    protected VariableTreeNode(bool deserializing) : base(deserializing) { }
+    protected VariableTreeNode(VariableTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      weight = original.weight;
+      variableName = original.variableName;
+    }
+    protected VariableTreeNode() { }
+    public VariableTreeNode(Variable variableSymbol) : base(variableSymbol) { }
+
+    public override bool HasLocalParameters {
+      get {
+        return true;
+      }
+    }
+
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma);
+      variableName = Symbol.VariableNames.SelectRandom(random);
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+      double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma);
+      weight = weight + x * shakingFactor;
+      variableName = Symbol.VariableNames.SelectRandom(random);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new VariableTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      if (weight.IsAlmost(1.0)) return variableName;
+      else return weight.ToString("E4") + " " + variableName;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/VariableFrequencyAnalyser.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/VariableFrequencyAnalyser.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/VariableFrequencyAnalyser.cs	(revision 5026)
@@ -0,0 +1,125 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("VariableFrequencyAnalyser", "Calculates the accumulated frequencies of variable-symbols over the whole population.")]
+  [StorableClass]
+  public abstract class VariableFrequencyAnalyser : SingleSuccessorOperator {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string VariableFrequenciesParameterName = "VariableFrequencies";
+
+    #region parameter properties
+    public ILookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (ILookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public ILookupParameter<ItemArray<SymbolicExpressionTree>> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ItemArray<SymbolicExpressionTree>>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<DoubleMatrix> VariableFrequenciesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters[VariableFrequenciesParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public ItemArray<SymbolicExpressionTree> SymbolicExpressionTrees {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public DoubleMatrix VariableFrequencies {
+      get { return VariableFrequenciesParameter.ActualValue; }
+      set { VariableFrequenciesParameter.ActualValue = value; }
+    }
+    #endregion
+    [StorableConstructor]
+    protected VariableFrequencyAnalyser(bool deserializing) : base(deserializing) { }
+    protected VariableFrequencyAnalyser(VariableFrequencyAnalyser original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public VariableFrequencyAnalyser()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees that should be analyzed."));
+      Parameters.Add(new LookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The problem data on which the for which the symbolic expression tree is a solution."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>(VariableFrequenciesParameterName, "The relative variable reference frequencies aggregated over the whole population."));
+    }
+
+    public override IOperation Apply() {
+      var inputVariables = DataAnalysisProblemData.InputVariables.CheckedItems.Select(x => x.Value.Value);
+      if (VariableFrequencies == null) {
+        VariableFrequencies = new DoubleMatrix(0, 1, inputVariables);
+      }
+      ((IStringConvertibleMatrix)VariableFrequencies).Rows = VariableFrequencies.Rows + 1;
+      int lastRowIndex = VariableFrequencies.Rows - 1;
+      var columnNames = VariableFrequencies.ColumnNames.ToList();
+      foreach (var pair in CalculateVariableFrequencies(SymbolicExpressionTrees, inputVariables)) {
+        int columnIndex = columnNames.IndexOf(pair.Key);
+        VariableFrequencies[lastRowIndex, columnIndex] = pair.Value;
+      }
+      return base.Apply();
+    }
+
+    public static IEnumerable<KeyValuePair<string, double>> CalculateVariableFrequencies(IEnumerable<SymbolicExpressionTree> trees, IEnumerable<string> inputVariables) {
+      Dictionary<string, double> variableReferencesSum = new Dictionary<string, double>();
+      Dictionary<string, double> variableFrequencies = new Dictionary<string, double>();
+      foreach (var inputVariable in inputVariables)
+        variableReferencesSum[inputVariable] = 0.0;
+      foreach (var tree in trees) {
+        var variableReferences = GetVariableReferenceCount(tree, inputVariables);
+        foreach (var pair in variableReferences) {
+          variableReferencesSum[pair.Key] += pair.Value;
+        }
+      }
+      double totalVariableReferences = variableReferencesSum.Values.Sum();
+      foreach (string inputVariable in inputVariables) {
+        double relFreq = variableReferencesSum[inputVariable] / totalVariableReferences;
+        variableFrequencies.Add(inputVariable, relFreq);
+      }
+      return variableFrequencies;
+    }
+
+    private static IEnumerable<KeyValuePair<string, int>> GetVariableReferenceCount(SymbolicExpressionTree tree, IEnumerable<string> inputVariables) {
+      Dictionary<string, int> references = new Dictionary<string, int>();
+      var variableNames = from node in tree.IterateNodesPrefix().OfType<VariableTreeNode>()
+                          select node.VariableName;
+
+      foreach (var variableName in variableNames) {
+        if (!references.ContainsKey(variableName)) {
+          references[variableName] = 1;
+        } else {
+          references[variableName] += 1;
+        }
+      }
+      return references;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/TableFileParser.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/TableFileParser.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/TableFileParser.cs	(revision 5026)
@@ -0,0 +1,375 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Globalization;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public class TableFileParser {
+    private const int BUFFER_SIZE = 1024;
+    private readonly char[] POSSIBLE_SEPARATORS = new char[] { ',', ';', '\t' };
+    private const string VARIABLENAMES = "VARIABLENAMES";
+    private Tokenizer tokenizer;
+    private List<string> variableNames;
+    private List<List<double>> rowValues;
+
+    private int rows;
+    public int Rows {
+      get { return rows; }
+      set { rows = value; }
+    }
+
+    private int columns;
+    public int Columns {
+      get { return columns; }
+      set { columns = value; }
+    }
+
+    private double[,] values;
+    public double[,] Values {
+      get {
+        return values;
+      }
+    }
+
+    public IEnumerable<string> VariableNames {
+      get {
+        if (variableNames.Count > 0) return variableNames;
+        else {
+          string[] names = new string[columns];
+          for (int i = 0; i < names.Length; i++) {
+            names[i] = "X" + i.ToString("000");
+          }
+          return names;
+        }
+      }
+    }
+
+    public TableFileParser() {
+      rowValues = new List<List<double>>();
+      variableNames = new List<string>();
+    }
+
+    private void Reset() {
+      variableNames.Clear();
+      rowValues.Clear();
+    }
+
+    public void Parse(string fileName) {
+      NumberFormatInfo numberFormat;
+      char separator;
+      DetermineFileFormat(fileName, out numberFormat, out separator);
+      using (StreamReader reader = new StreamReader(fileName)) {
+        tokenizer = new Tokenizer(reader, numberFormat, separator);
+        // parse the file
+        Parse();
+      }
+
+      // translate the list of samples into a DoubleMatrixData item
+      rows = rowValues.Count;
+      columns = rowValues[0].Count;
+      values = new double[rows, columns];
+
+      int rowIndex = 0;
+      int columnIndex = 0;
+      foreach (List<double> row in rowValues) {
+        columnIndex = 0;
+        foreach (double element in row) {
+          values[rowIndex, columnIndex++] = element;
+        }
+        rowIndex++;
+      }
+    }
+
+    private void DetermineFileFormat(string fileName, out NumberFormatInfo numberFormat, out char separator) {
+      using (StreamReader reader = new StreamReader(fileName)) {
+        // skip first line
+        reader.ReadLine();
+        // read a block
+        char[] buffer = new char[BUFFER_SIZE];
+        int charsRead = reader.ReadBlock(buffer, 0, BUFFER_SIZE);
+        // count frequency of special characters
+        Dictionary<char, int> charCounts = buffer.Take(charsRead)
+          .GroupBy(c => c)
+          .ToDictionary(g => g.Key, g => g.Count());
+
+        // depending on the characters occuring in the block 
+        // we distinghish a number of different cases based on the the following rules:
+        // many points => it must be English number format, the other frequently occuring char is the separator
+        // no points but many commas => this is the problematic case. Either German format (real numbers) or English format (only integer numbers) with ',' as separator
+        //   => check the line in more detail:
+        //            English: 0, 0, 0, 0
+        //            German:  0,0 0,0 0,0 ...
+        //            => if commas are followed by space => English format
+        // no points no commas => English format (only integer numbers) use the other frequently occuring char as separator
+        // in all cases only treat ' ' as separator if no other separator is possible (spaces can also occur additionally to separators)
+        if (OccurrencesOf(charCounts, '.') > 10) {
+          numberFormat = NumberFormatInfo.InvariantInfo;
+          separator = POSSIBLE_SEPARATORS
+            .Where(c => OccurrencesOf(charCounts, c) > 10)
+            .OrderBy(c => -OccurrencesOf(charCounts, c))
+            .DefaultIfEmpty(' ')
+            .First();
+        } else if (OccurrencesOf(charCounts, ',') > 10) {
+          // no points and many commas
+          int countCommaNonDigitPairs = 0;
+          for (int i = 0; i < charsRead - 1; i++) {
+            if (buffer[i] == ',' && !Char.IsDigit(buffer[i + 1])) {
+              countCommaNonDigitPairs++;
+            }
+          }
+          if (countCommaNonDigitPairs > 10) {
+            // English format (only integer values) with ',' as separator
+            numberFormat = NumberFormatInfo.InvariantInfo;
+            separator = ',';
+          } else {
+            char[] disallowedSeparators = new char[] { ',' };
+            // German format (real values)
+            numberFormat = NumberFormatInfo.GetInstance(new CultureInfo("de"));
+            separator = POSSIBLE_SEPARATORS
+              .Except(disallowedSeparators)
+              .Where(c => OccurrencesOf(charCounts, c) > 10)
+              .OrderBy(c => -OccurrencesOf(charCounts, c))
+              .DefaultIfEmpty(' ')
+              .First();
+          }
+        } else {
+          // no points and no commas => English format
+          numberFormat = NumberFormatInfo.InvariantInfo;
+          separator = POSSIBLE_SEPARATORS
+            .Where(c => OccurrencesOf(charCounts, c) > 10)
+            .OrderBy(c => -OccurrencesOf(charCounts, c))
+            .DefaultIfEmpty(' ')
+            .First();
+        }
+      }
+    }
+
+    private int OccurrencesOf(Dictionary<char, int> charCounts, char c) {
+      return charCounts.ContainsKey(c) ? charCounts[c] : 0;
+    }
+
+    #region tokenizer
+    internal enum TokenTypeEnum {
+      NewLine, Separator, String, Double
+    }
+
+    internal class Token {
+      public TokenTypeEnum type;
+      public string stringValue;
+      public double doubleValue;
+
+      public Token(TokenTypeEnum type, string value) {
+        this.type = type;
+        stringValue = value;
+        doubleValue = 0.0;
+      }
+
+      public override string ToString() {
+        return stringValue;
+      }
+    }
+
+
+    internal class Tokenizer {
+      private StreamReader reader;
+      private List<Token> tokens;
+      private NumberFormatInfo numberFormatInfo;
+      private char separator;
+      private const string INTERNAL_SEPARATOR = "#";
+
+      private int currentLineNumber = 0;
+      public int CurrentLineNumber {
+        get { return currentLineNumber; }
+        private set { currentLineNumber = value; }
+      }
+      private string currentLine;
+      public string CurrentLine {
+        get { return currentLine; }
+        private set { currentLine = value; }
+      }
+
+      private Token newlineToken;
+      public Token NewlineToken {
+        get { return newlineToken; }
+        private set { newlineToken = value; }
+      }
+      private Token separatorToken;
+      public Token SeparatorToken {
+        get { return separatorToken; }
+        private set { separatorToken = value; }
+      }
+
+      public Tokenizer(StreamReader reader, NumberFormatInfo numberFormatInfo, char separator) {
+        this.reader = reader;
+        this.numberFormatInfo = numberFormatInfo;
+        this.separator = separator;
+        separatorToken = new Token(TokenTypeEnum.Separator, INTERNAL_SEPARATOR);
+        newlineToken = new Token(TokenTypeEnum.NewLine, Environment.NewLine);
+        tokens = new List<Token>();
+        ReadNextTokens();
+      }
+
+      private void ReadNextTokens() {
+        if (!reader.EndOfStream) {
+          CurrentLine = reader.ReadLine();
+          var newTokens = from str in Split(CurrentLine)
+                          let trimmedStr = str.Trim()
+                          where !string.IsNullOrEmpty(trimmedStr)
+                          select MakeToken(trimmedStr);
+
+          tokens.AddRange(newTokens);
+          tokens.Add(NewlineToken);
+          CurrentLineNumber++;
+        }
+      }
+
+      private IEnumerable<string> Split(string line) {
+        StringBuilder subStr = new StringBuilder();
+        foreach (char c in line) {
+          if (c == separator) {
+            yield return subStr.ToString();
+            subStr = new StringBuilder();
+            // all separator characters are transformed to the internally used separator character
+            yield return INTERNAL_SEPARATOR;
+          } else {
+            subStr.Append(c);
+          }
+        }
+        yield return subStr.ToString();
+      }
+
+      private Token MakeToken(string strToken) {
+        Token token = new Token(TokenTypeEnum.String, strToken);
+        if (strToken.Equals(INTERNAL_SEPARATOR)) {
+          return SeparatorToken;
+        } else if (double.TryParse(strToken, NumberStyles.Float, numberFormatInfo, out token.doubleValue)) {
+          token.type = TokenTypeEnum.Double;
+          return token;
+        }
+
+        // couldn't parse the token as an int or float number so return a string token
+        return token;
+      }
+
+      public Token Peek() {
+        return tokens[0];
+      }
+
+      public Token Next() {
+        Token next = tokens[0];
+        tokens.RemoveAt(0);
+        if (tokens.Count == 0) {
+          ReadNextTokens();
+        }
+        return next;
+      }
+
+      public bool HasNext() {
+        return tokens.Count > 0 || !reader.EndOfStream;
+      }
+    }
+    #endregion
+
+    #region parsing
+    private void Parse() {
+      ParseVariableNames();
+      if (!tokenizer.HasNext()) Error("Couldn't parse data values. Probably because of incorrect number format (the parser expects english number format with a '.' as decimal separator).", "", tokenizer.CurrentLineNumber);
+      ParseValues();
+      if (rowValues.Count == 0) Error("Couldn't parse data values. Probably because of incorrect number format (the parser expects english number format with a '.' as decimal separator).", "", tokenizer.CurrentLineNumber);
+    }
+
+    private void ParseValues() {
+      while (tokenizer.HasNext()) {
+        List<double> row = new List<double>();
+        row.Add(NextValue(tokenizer));
+        while (tokenizer.HasNext() && tokenizer.Peek() == tokenizer.SeparatorToken) {
+          Expect(tokenizer.SeparatorToken);
+          row.Add(NextValue(tokenizer));
+        }
+        Expect(tokenizer.NewlineToken);
+        // all rows have to have the same number of values            
+        // the first row defines how many samples are needed
+        if (rowValues.Count > 0 && rowValues[0].Count != row.Count) {
+          Error("The first row of the dataset has " + rowValues[0].Count + " columns." +
+            "\nLine " + tokenizer.CurrentLineNumber + " has " + row.Count + " columns.", "", tokenizer.CurrentLineNumber);
+        }
+        // add the current row to the collection of rows and start a new row
+        rowValues.Add(row);
+        row = new List<double>();
+      }
+    }
+
+    private double NextValue(Tokenizer tokenizer) {
+      if (tokenizer.Peek() == tokenizer.SeparatorToken || tokenizer.Peek() == tokenizer.NewlineToken) return double.NaN;
+      Token current = tokenizer.Next();
+      if (current.type == TokenTypeEnum.Separator || current.type == TokenTypeEnum.String) {
+        return double.NaN;
+      } else if (current.type == TokenTypeEnum.Double) {
+        // just take the value
+        return current.doubleValue;
+      }
+      // found an unexpected token => throw error 
+      Error("Unexpected token.", current.stringValue, tokenizer.CurrentLineNumber);
+      // this line is never executed because Error() throws an exception
+      throw new InvalidOperationException();
+    }
+
+    private void ParseVariableNames() {
+      // if the first line doesn't start with a double value then we assume that the
+      // first line contains variable names
+      if (tokenizer.HasNext() && tokenizer.Peek().type != TokenTypeEnum.Double) {
+
+        List<Token> tokens = new List<Token>();
+        Token valueToken;
+        valueToken = tokenizer.Next();
+        tokens.Add(valueToken);
+        while (tokenizer.HasNext() && tokenizer.Peek() == tokenizer.SeparatorToken) {
+          Expect(tokenizer.SeparatorToken);
+          valueToken = tokenizer.Next();
+          if (valueToken != tokenizer.NewlineToken) {
+            tokens.Add(valueToken);
+          }
+        }
+        if (valueToken != tokenizer.NewlineToken) {
+          Expect(tokenizer.NewlineToken);
+        }
+        variableNames = tokens.Select(x => x.stringValue.Trim()).ToList();
+      }
+    }
+
+    private void Expect(Token expectedToken) {
+      Token actualToken = tokenizer.Next();
+      if (actualToken != expectedToken) {
+        Error("Expected: " + expectedToken, actualToken.stringValue, tokenizer.CurrentLineNumber);
+      }
+    }
+
+    private void Error(string message, string token, int lineNumber) {
+      throw new DataFormatException("Error while parsing.\n" + message, token, lineNumber);
+    }
+    #endregion
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/HeuristicLab.Problems.DataAnalysis.Tests-3.3.csproj
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/HeuristicLab.Problems.DataAnalysis.Tests-3.3.csproj	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/HeuristicLab.Problems.DataAnalysis.Tests-3.3.csproj	(revision 5026)
@@ -0,0 +1,224 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{5A4679EF-A8F3-4647-B722-441A36B3BA6B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Tests_3._3</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Tests-3.3</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </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>
+    <CodeAnalysisLogFile>bin\Debug\HeuristicLab.Problems.DataAnalysis.Tests-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Release\HeuristicLab.Problems.DataAnalysis.Tests-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="TableFileParserTest.cs" />
+    <Compile Include="SymbolicSimplifierTest.cs" />
+    <Compile Include="StatisticCalculatorsTest.cs" />
+    <Compile Include="LinearScalingTest.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SimpleArithmeticExpressionInterpreterTest.cs" />
+    <Compile Include="SymbolicExpressionImporter.cs" />
+    <Compile Include="Token.cs" />
+    <Compile Include="Util.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
+      <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
+      <Name>HeuristicLab.Common.Resources-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
+      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
+      <Name>HeuristicLab.Common-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
+      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
+      <Name>HeuristicLab.Core-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
+      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
+      <Name>HeuristicLab.Data-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.3\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj">
+      <Project>{125D3006-67F5-48CB-913E-73C0548F17FA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\3.1.0\ALGLIB-3.1.0\ALGLIB-3.1.0.csproj">
+      <Project>{FC841674-62A7-4055-BE91-E41944B6C606}</Project>
+      <Name>ALGLIB-3.1.0</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
+      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
+      <Name>HeuristicLab.Operators-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
+      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
+      <Name>HeuristicLab.Optimization-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
+      <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
+      <Name>HeuristicLab.Parameters-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Problems.DataAnalysis.Regression\3.3\HeuristicLab.Problems.DataAnalysis.Regression-3.3.csproj">
+      <Project>{BDF86B1D-630E-4CE2-8A49-8C90B1BDE4C9}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Regression-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
+      <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
+      <Name>HeuristicLab.Random-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Problems.DataAnalysis-3.3.csproj">
+      <Project>{70DFD984-B1D9-46FE-8EB7-4DE92D71A9FC}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="bin\" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="RegressionSolution01.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution02.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution03.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution04.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution05.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="RegressionSolution06.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/LinearScalingTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/LinearScalingTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/LinearScalingTest.cs	(revision 5026)
@@ -0,0 +1,83 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Linq;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+
+  [TestClass()]
+  public class LinearScalingTest {
+    [TestMethod]
+    public void CalculateScalingParametersTest() {
+      var testData = new double[,] {
+     {5,1,1,1,2,1,3,1,1,2},
+     {5,4,4,5,7,10,3,2,1,2},
+     {3,1,1,1,2,2,3,1,1,2},
+     {6,8,8,1,3,4,3,7,1,2},
+     {4,1,1,3,2,1,3,1,1,2},
+     {8,10,10,8,7,10,9,7,1,4},            
+     {1,1,1,1,2,10,3,1,1,2},              
+     {2,1,2,1,2,1,3,1,1,2},                 
+     {2,1,1,1,2,1,1,1,5,2},                 
+     {4,2,1,1,2,1,2,1,1,2},                   
+     {1,1,1,1,1,1,3,1,1,2},    
+     {2,1,1,1,2,1,2,1,1,2},                   
+     {5,3,3,3,2,3,4,4,1,4},                          
+     {8,7,5,10,7,9,5,5,4,4},          
+     {7,4,6,4,6,1,4,3,1,4},                          
+     {4,1,1,1,2,1,2,1,1,2},     
+     {4,1,1,1,2,1,3,1,1,2},      
+     {10,7,7,6,4,10,4,1,2,4},  
+     {6,1,1,1,2,1,3,1,1,2},     
+     {7,3,2,10,5,10,5,4,4,4},   
+     {10,5,5,3,6,7,7,10,1,4} 
+      };
+
+      double alpha, beta;
+      int n = testData.GetLength(0);
+      {
+        IEnumerable<double> x = from rows in Enumerable.Range(0, n)
+                                select testData[rows, 0];
+        IEnumerable<double> y = from rows in Enumerable.Range(0, n)
+                                select testData[rows, 1];
+        SymbolicRegressionScaledMeanSquaredErrorEvaluator.CalculateScalingParameters(x, y, out beta, out alpha);
+
+        Assert.AreEqual(alpha, 2.757281, 1.0E-6);
+        Assert.AreEqual(beta, 0.720267, 1.0E-6);
+
+        IEnumerable<double> scaledY = from value in y select value * beta + alpha;
+        Assert.AreEqual(x.Average(), scaledY.Average(), 1.0E-6);
+      }
+      {
+        IEnumerable<double> x = from rows in Enumerable.Range(0, n)
+                                select testData[rows, 2] * 1.0E3;
+        IEnumerable<double> y = from rows in Enumerable.Range(0, n)
+                                select testData[rows, 8] * 1.0E-3;
+        SymbolicRegressionScaledMeanSquaredErrorEvaluator.CalculateScalingParameters(x, y, out beta, out alpha);
+
+        IEnumerable<double> scaledY = from value in y select value * beta + alpha;
+        Assert.AreEqual(x.Average(), scaledY.Average(), 1.0E-6);
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Properties/AssemblyInfo.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Properties/AssemblyInfo.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Properties/AssemblyInfo.cs	(revision 5026)
@@ -0,0 +1,54 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Tests-3.3")]
+[assembly: AssemblyDescription("Test cases for HeuristicLab generic data analysis problem classes")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2010 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM componenets.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7dddd116-d8ae-459a-ae2a-d55294e0fd8a")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.2.0")]
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SimpleArithmeticExpressionInterpreterTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SimpleArithmeticExpressionInterpreterTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SimpleArithmeticExpressionInterpreterTest.cs	(revision 5026)
@@ -0,0 +1,242 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Globalization;
+using System.Linq;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+
+
+  /// <summary>
+  ///This is a test class for SimpleArithmeticExpressionInterpreter and is intended
+  ///to contain all SimpleArithmeticExpressionInterpreter Unit Tests
+  ///</summary>
+  [TestClass()]
+  public class SimpleArithmeticExpressionInterpreterTest {
+    private const int N = 1000;
+    private const int Rows = 1000;
+    private const int Columns = 50;
+    private static SymbolicExpressionTree[] randomTrees;
+    private static Dataset dataset;
+    private static MersenneTwister twister;
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    [ClassInitialize()]
+    public static void CreateRandomTrees(TestContext testContext) {
+      twister = new MersenneTwister();
+      dataset = Util.CreateRandomDataset(twister, Rows, Columns);
+      var grammar = new GlobalSymbolicExpressionGrammar(new FullFunctionalExpressionGrammar());
+      grammar.MaxFunctionArguments = 0;
+      grammar.MaxFunctionDefinitions = 0;
+      grammar.MinFunctionArguments = 0;
+      grammar.MinFunctionDefinitions = 0;
+      randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1, 100, 0, 0);
+    }
+
+    [TestMethod]
+    public void SimpleArithmeticExpressionInterpreterPerformanceTest() {
+      double[] estimation = new double[Rows];
+      foreach (SymbolicExpressionTree tree in randomTrees) {
+        Util.InitTree(tree, twister, new List<string>(dataset.VariableNames));
+      }
+      SimpleArithmeticExpressionInterpreter interpreter = new SimpleArithmeticExpressionInterpreter();
+      Util.EvaluateTrees(randomTrees, interpreter, dataset, 10);
+    }
+
+
+    /// <summary>
+    ///A test for Evaluate
+    ///</summary>
+    [TestMethod]
+    public void SimpleArithmeticExpressionInterpreterEvaluateTest() {
+
+      Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] {
+        { 1.0, 1.0, 1.0 },
+        { 2.0, 2.0, 2.0 },
+        { 3.0, 1.0, 2.0 }
+      });
+
+      SimpleArithmeticExpressionInterpreter interpreter = new SimpleArithmeticExpressionInterpreter();
+
+      // constants
+      Evaluate(interpreter, ds, "(+ 1.5 3.5)", 0, 5.0);
+
+      // variables
+      Evaluate(interpreter, ds, "(variable 2.0 a)", 0, 2.0);
+      Evaluate(interpreter, ds, "(variable 2.0 a)", 1, 4.0);
+
+
+      // addition
+      Evaluate(interpreter, ds, "(+ (variable 2.0 a ))", 1, 4.0);
+      Evaluate(interpreter, ds, "(+ (variable 2.0 a ) (variable 3.0 b ))", 0, 5.0);
+      Evaluate(interpreter, ds, "(+ (variable 2.0 a ) (variable 3.0 b ))", 1, 10.0);
+      Evaluate(interpreter, ds, "(+ (variable 2.0 a) (variable 3.0 b ))", 2, 8.0);
+      Evaluate(interpreter, ds, "(+ 8.0 2.0 2.0)", 0, 12.0);
+
+      // subtraction
+      Evaluate(interpreter, ds, "(- (variable 2.0 a ))", 1, -4.0);
+      Evaluate(interpreter, ds, "(- (variable 2.0 a ) (variable 3.0 b))", 0, -1.0);
+      Evaluate(interpreter, ds, "(- (variable 2.0 a ) (variable 3.0 b ))", 1, -2.0);
+      Evaluate(interpreter, ds, "(- (variable 2.0 a ) (variable 3.0 b ))", 2, -4.0);
+      Evaluate(interpreter, ds, "(- 8.0 2.0 2.0)", 0, 4.0);
+
+      // multiplication
+      Evaluate(interpreter, ds, "(* (variable 2.0 a ))", 0, 2.0);
+      Evaluate(interpreter, ds, "(* (variable 2.0 a ) (variable 3.0 b ))", 0, 6.0);
+      Evaluate(interpreter, ds, "(* (variable 2.0 a ) (variable 3.0 b ))", 1, 24.0);
+      Evaluate(interpreter, ds, "(* (variable 2.0 a ) (variable 3.0 b ))", 2, 12.0);
+      Evaluate(interpreter, ds, "(* 8.0 2.0 2.0)", 0, 32.0);
+
+      // division
+      Evaluate(interpreter, ds, "(/ (variable 2.0 a ))", 1, 1.0 / 4.0);
+      Evaluate(interpreter, ds, "(/ (variable 2.0 a ) 2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(/ (variable 2.0 a ) 2.0)", 1, 2.0);
+      Evaluate(interpreter, ds, "(/ (variable 3.0 b ) 2.0)", 2, 3.0);
+      Evaluate(interpreter, ds, "(/ 8.0 2.0 2.0)", 0, 2.0);
+
+      // gt
+      Evaluate(interpreter, ds, "(> (variable 2.0 a) 2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(> 2.0 (variable 2.0 a))", 0, -1.0);
+      Evaluate(interpreter, ds, "(> (variable 2.0 a) 1.9)", 0, 1.0);
+      Evaluate(interpreter, ds, "(> 1.9 (variable 2.0 a))", 0, -1.0);
+      //Evaluate(interpreter, ds, "(> (sqrt -1.0) (log -1.0))", 0, -1.0); // (> nan nan) should be false
+
+      // lt
+      Evaluate(interpreter, ds, "(< (variable 2.0 a) 2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(< 2.0 (variable 2.0 a))", 0, -1.0);
+      Evaluate(interpreter, ds, "(< (variable 2.0 a) 1.9)", 0, -1.0);
+      Evaluate(interpreter, ds, "(< 1.9 (variable 2.0 a))", 0, 1.0);
+      //Evaluate(interpreter, ds, "(< (sqrt -1,0) (log -1,0))", 0, -1.0); // (< nan nan) should be false
+
+      // If
+      Evaluate(interpreter, ds, "(if -10.0 2.0 3.0)", 0, 3.0);
+      Evaluate(interpreter, ds, "(if -1.0 2.0 3.0)", 0, 3.0);
+      Evaluate(interpreter, ds, "(if 0.0 2.0 3.0)", 0, 3.0);
+      Evaluate(interpreter, ds, "(if 1.0 2.0 3.0)", 0, 2.0);
+      Evaluate(interpreter, ds, "(if 10.0 2.0 3.0)", 0, 2.0);
+      // Evaluate(interpreter, ds, "(if (sqrt -1.0) 2.0 3.0)", 0, 3.0); // if(nan) should return the else branch
+
+      // NOT
+      Evaluate(interpreter, ds, "(not -1.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(not -2.0)", 0, 2.0);
+      Evaluate(interpreter, ds, "(not 1.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(not 2.0)", 0, -2.0);
+      Evaluate(interpreter, ds, "(not 0.0)", 0, 0.0);
+
+      // AND
+      Evaluate(interpreter, ds, "(and -1.0 -2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and -1.0 2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and 1.0 -2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and 1.0 0.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and 0.0 0.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(and 1.0 2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(and 1.0 2.0 3.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(and 1.0 -2.0 3.0)", 0, -1.0);
+
+      // OR
+      Evaluate(interpreter, ds, "(or -1.0 -2.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(or -1.0 2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(or 1.0 -2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(or 1.0 2.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(or 0.0 0.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(or -1.0 -2.0 -3.0)", 0, -1.0);
+      Evaluate(interpreter, ds, "(or -1.0 -2.0 3.0)", 0, 1.0);
+
+      // sin, cos, tan
+      Evaluate(interpreter, ds, "(sin " + Math.PI.ToString(NumberFormatInfo.InvariantInfo) + ")", 0, 0.0);
+      Evaluate(interpreter, ds, "(sin 0.0)", 0, 0.0);
+      Evaluate(interpreter, ds, "(cos " + Math.PI.ToString(NumberFormatInfo.InvariantInfo) + ")", 0, -1.0);
+      Evaluate(interpreter, ds, "(cos 0.0)", 0, 1.0);
+      Evaluate(interpreter, ds, "(tan " + Math.PI.ToString(NumberFormatInfo.InvariantInfo) + ")", 0, Math.Tan(Math.PI));
+      Evaluate(interpreter, ds, "(tan 0.0)", 0, Math.Tan(Math.PI));
+
+      // exp, log
+      Evaluate(interpreter, ds, "(log (exp 7.0))", 0, Math.Log(Math.Exp(7)));
+      Evaluate(interpreter, ds, "(exp (log 7.0))", 0, Math.Exp(Math.Log(7)));
+      Evaluate(interpreter, ds, "(log -3.0)", 0, Math.Log(-3));
+
+      // mean
+      Evaluate(interpreter, ds, "(mean -1.0 1.0 -1.0)", 0, -1.0 / 3.0);
+
+      // ADF      
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN 
+                                      (CALL ADF0)) 
+                                    (defun ADF0 1.0))", 1, 1.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN 
+                                      (* (CALL ADF0) (CALL ADF0)))
+                                    (defun ADF0 2.0))", 1, 4.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN 
+                                      (CALL ADF0 2.0 3.0))
+                                    (defun ADF0 
+                                      (+ (ARG 0) (ARG 1))))", 1, 5.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN (CALL ADF1 2.0 3.0))
+                                    (defun ADF0 
+                                      (- (ARG 1) (ARG 0)))
+                                    (defun ADF1
+                                      (+ (CALL ADF0 (ARG 1) (ARG 0))
+                                         (CALL ADF0 (ARG 0) (ARG 1)))))", 1, 0.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN (CALL ADF1 (variable 2.0 a) 3.0))
+                                    (defun ADF0 
+                                      (- (ARG 1) (ARG 0)))
+                                    (defun ADF1                                                                              
+                                      (CALL ADF0 (ARG 1) (ARG 0))))", 1, 1.0);
+      Evaluate(interpreter, ds, @"(PROG 
+                                    (MAIN (CALL ADF1 (variable 2.0 a) 3.0))
+                                    (defun ADF0 
+                                      (- (ARG 1) (ARG 0)))
+                                    (defun ADF1                                                                              
+                                      (+ (CALL ADF0 (ARG 1) (ARG 0))
+                                         (CALL ADF0 (ARG 0) (ARG 1)))))", 1, 0.0);
+    }
+
+    private void Evaluate(SimpleArithmeticExpressionInterpreter interpreter, Dataset ds, string expr, int index, double expected) {
+      var importer = new SymbolicExpressionImporter();
+      SymbolicExpressionTree tree = importer.Import(expr);
+
+      double actual = interpreter.GetSymbolicExpressionTreeValues(tree, ds, Enumerable.Range(index, 1)).First();
+
+      Assert.AreEqual(expected, actual, 1.0E-12, expr);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/StatisticCalculatorsTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/StatisticCalculatorsTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/StatisticCalculatorsTest.cs	(revision 5026)
@@ -0,0 +1,117 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+
+  [TestClass()]
+  public class StatisticCalculatorsTest {
+    private double[,] testData = new double[,] {
+     {5,1,1,1,2,1,3,1,1,2},
+     {5,4,4,5,7,10,3,2,1,2},
+     {3,1,1,1,2,2,3,1,1,2},
+     {6,8,8,1,3,4,3,7,1,2},
+     {4,1,1,3,2,1,3,1,1,2},
+     {8,10,10,8,7,10,9,7,1,4},            
+     {1,1,1,1,2,10,3,1,1,2},              
+     {2,1,2,1,2,1,3,1,1,2},                 
+     {2,1,1,1,2,1,1,1,5,2},                 
+     {4,2,1,1,2,1,2,1,1,2},                   
+     {1,1,1,1,1,1,3,1,1,2},    
+     {2,1,1,1,2,1,2,1,1,2},                   
+     {5,3,3,3,2,3,4,4,1,4},                          
+     {8,7,5,10,7,9,5,5,4,4},          
+     {7,4,6,4,6,1,4,3,1,4},                          
+     {4,1,1,1,2,1,2,1,1,2},     
+     {4,1,1,1,2,1,3,1,1,2},      
+     {10,7,7,6,4,10,4,1,2,4},  
+     {6,1,1,1,2,1,3,1,1,2},     
+     {7,3,2,10,5,10,5,4,4,4},   
+     {10,5,5,3,6,7,7,10,1,4} 
+      };
+
+    [TestMethod]
+    public void CalculateMeanAndVarianceTest() {
+      System.Random random = new System.Random(31415);
+
+      int n = testData.GetLength(0);
+      int cols = testData.GetLength(1);
+      {
+        for (int col = 0; col < cols; col++) {
+          double scale = random.NextDouble() * 1E7;
+          IEnumerable<double> x = from rows in Enumerable.Range(0, n)
+                                  select testData[rows, col] * scale;
+          double[] xs = x.ToArray();
+          double mean_alglib, variance_alglib;
+          mean_alglib = variance_alglib = 0.0;
+          double tmp = 0;
+
+          alglib.samplemoments(xs, n, out  mean_alglib, out variance_alglib, out tmp, out tmp);
+
+          var calculator = new OnlineMeanAndVarianceCalculator();
+          for (int i = 0; i < n; i++) {
+            calculator.Add(xs[i]);
+          }
+          double mean = calculator.Mean;
+          double variance = calculator.Variance;
+
+          Assert.AreEqual(mean_alglib, mean, 1E-6 * scale);
+          Assert.AreEqual(variance_alglib, variance, 1E-6 * scale);
+        }
+      }
+    }
+
+    [TestMethod]
+    public void CalculatePearsonsRSquaredTest() {
+      System.Random random = new System.Random(31415);
+      int n = testData.GetLength(0);
+      int cols = testData.GetLength(1);
+      for (int c1 = 0; c1 < cols; c1++) {
+        for (int c2 = c1 + 1; c2 < cols; c2++) {
+          {
+            double c1Scale = random.NextDouble() * 1E7;
+            double c2Scale = random.NextDouble() * 1E7;
+            IEnumerable<double> x = from rows in Enumerable.Range(0, n)
+                                    select testData[rows, c1] * c1Scale;
+            IEnumerable<double> y = from rows in Enumerable.Range(0, n)
+                                    select testData[rows, c2] * c2Scale;
+            double[] xs = x.ToArray();
+            double[] ys = y.ToArray();
+            double r2_alglib = alglib.pearsoncorrelation(xs, ys, n);
+            r2_alglib *= r2_alglib;
+
+            var r2Calculator = new OnlinePearsonsRSquaredEvaluator();
+            for (int i = 0; i < n; i++) {
+              r2Calculator.Add(xs[i], ys[i]);
+            }
+            double r2 = r2Calculator.RSquared;
+
+            Assert.AreEqual(r2_alglib, r2, 1E-6 * Math.Max(c1Scale, c2Scale));
+          }
+        }
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicExpressionImporter.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicExpressionImporter.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicExpressionImporter.cs	(revision 5026)
@@ -0,0 +1,169 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Diagnostics;
+using System.Linq;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+  internal class SymbolicExpressionImporter {
+    private const string VARSTART = "VAR";
+    private const string DEFUNSTART = "DEFUN";
+    private const string ARGSTART = "ARG";
+    private const string INVOKESTART = "CALL";
+    private Dictionary<string, Symbol> knownSymbols = new Dictionary<string, Symbol>() 
+      {
+        {"+", new Addition()},
+        {"/", new Division()},
+        {"*", new Multiplication()},
+        {"-", new Subtraction()},
+        {"EXP", new Exponential()},
+        {"LOG", new Logarithm()},
+        {"SIN",new Sine()},
+        {"COS", new Cosine()},
+        {"TAN", new Tangent()},
+        {"MEAN", new Average()},
+        {"IF", new IfThenElse()},
+        {">", new GreaterThan()},
+        {"<", new LessThan()},
+        {"AND", new And()},
+        {"OR", new Or()},
+        {"NOT", new Not()},
+        {"PROG", new ProgramRootSymbol()},
+        {"MAIN", new StartSymbol()},
+      };
+
+    Constant constant = new Constant();
+    Variable variable = new Variable();
+    Defun defun = new Defun();
+
+    ProgramRootSymbol programRootSymbol = new ProgramRootSymbol();
+    StartSymbol startSymbol = new StartSymbol();
+
+    public SymbolicExpressionImporter() {
+    }
+
+    internal SymbolicExpressionTree Import(string str) {
+      str = str.Replace("(", " ( ").Replace(")", " ) ");
+      SymbolicExpressionTreeNode root = programRootSymbol.CreateTreeNode();
+      SymbolicExpressionTreeNode start = startSymbol.CreateTreeNode();
+      SymbolicExpressionTreeNode mainBranch = ParseSexp(new Queue<Token>(GetTokenStream(str)));
+      if (mainBranch.Symbol is ProgramRootSymbol) {
+        // when a root symbol was parsed => use main branch as root
+        root = mainBranch;
+      } else {
+        // only a main branch was given => insert the main branch into the default tree template
+        root.AddSubTree(start);
+        start.AddSubTree(mainBranch);
+      }
+      return new SymbolicExpressionTree(root);
+    }
+
+    private IEnumerable<Token> GetTokenStream(string str) {
+      return
+             from strToken in str.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries).AsEnumerable()
+             let t = Token.Parse(strToken)
+             where t != null
+             select t;
+    }
+
+    private SymbolicExpressionTreeNode ParseSexp(Queue<Token> tokens) {
+      if (tokens.Peek().Symbol == TokenSymbol.LPAR) {
+        SymbolicExpressionTreeNode tree;
+        Expect(Token.LPAR, tokens);
+        if (tokens.Peek().StringValue.StartsWith(VARSTART)) {
+          tree = ParseVariable(tokens);
+        } else if (tokens.Peek().StringValue.StartsWith(DEFUNSTART)) {
+          tree = ParseDefun(tokens);
+          while (!tokens.Peek().Equals(Token.RPAR)) {
+            tree.AddSubTree(ParseSexp(tokens));
+          }
+        } else if (tokens.Peek().StringValue.StartsWith(ARGSTART)) {
+          tree = ParseArgument(tokens);
+        } else if (tokens.Peek().StringValue.StartsWith(INVOKESTART)) {
+          tree = ParseInvoke(tokens);
+          while (!tokens.Peek().Equals(Token.RPAR)) {
+            tree.AddSubTree(ParseSexp(tokens));
+          }
+        } else {
+          Token curToken = tokens.Dequeue();
+          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) {
+        ConstantTreeNode t = (ConstantTreeNode)constant.CreateTreeNode();
+        t.Value = tokens.Dequeue().DoubleValue;
+        return t;
+      } else throw new FormatException("Expected function or constant symbol");
+    }
+
+    private SymbolicExpressionTreeNode ParseInvoke(Queue<Token> tokens) {
+      Token invokeTok = tokens.Dequeue();
+      Debug.Assert(invokeTok.StringValue == "CALL");
+      InvokeFunction invokeSym = new InvokeFunction(tokens.Dequeue().StringValue);
+      SymbolicExpressionTreeNode invokeNode = invokeSym.CreateTreeNode();
+      return invokeNode;
+    }
+
+    private SymbolicExpressionTreeNode ParseArgument(Queue<Token> tokens) {
+      Token argTok = tokens.Dequeue();
+      Debug.Assert(argTok.StringValue == "ARG");
+      Argument argument = new Argument((int)tokens.Dequeue().DoubleValue);
+      SymbolicExpressionTreeNode argNode = argument.CreateTreeNode();
+      return argNode;
+    }
+
+    private SymbolicExpressionTreeNode ParseDefun(Queue<Token> tokens) {
+      Token defTok = tokens.Dequeue();
+      Debug.Assert(defTok.StringValue == "DEFUN");
+      DefunTreeNode t = (DefunTreeNode)defun.CreateTreeNode();
+      t.FunctionName = tokens.Dequeue().StringValue;
+      return t;
+    }
+
+    private SymbolicExpressionTreeNode ParseVariable(Queue<Token> tokens) {
+      Token varTok = tokens.Dequeue();
+      Debug.Assert(varTok.StringValue == "VARIABLE");
+      VariableTreeNode t = (VariableTreeNode)variable.CreateTreeNode();
+      t.Weight = tokens.Dequeue().DoubleValue;
+      t.VariableName = tokens.Dequeue().StringValue;
+      return t;
+    }
+
+    private SymbolicExpressionTreeNode CreateTree(Token token) {
+      if (token.Symbol != TokenSymbol.SYMB) throw new FormatException("Expected function symbol, but got: " + token.StringValue);
+      return knownSymbols[token.StringValue].CreateTreeNode();
+    }
+
+    private void Expect(Token token, Queue<Token> tokens) {
+      Token cur = tokens.Dequeue();
+      if (!token.Equals(cur)) throw new FormatException("Expected: " + token.StringValue + ", but got: " + cur.StringValue);
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicSimplifierTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicSimplifierTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/SymbolicSimplifierTest.cs	(revision 5026)
@@ -0,0 +1,108 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+
+  [TestClass()]
+  public class SymbolicSimplifierTest {
+    [DeploymentItem(@"RegressionSolution01.hl")]
+    [DeploymentItem(@"RegressionSolution02.hl")]
+    [DeploymentItem(@"RegressionSolution03.hl")]
+    [DeploymentItem(@"RegressionSolution04.hl")]
+    [DeploymentItem(@"RegressionSolution05.hl")]
+    [DeploymentItem(@"RegressionSolution06.hl")]
+    [TestMethod]
+    public void SimplifyRegressionSolutionsTest() {
+      ContentManager.Initialize(new PersistenceContentManager());
+
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution01.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution02.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution03.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution04.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution05.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+      {
+        SymbolicRegressionSolution solution = LoadSolution("RegressionSolution06.hl");
+        SymbolicRegressionSolution simplifiedSolution = SimplifySolution(solution);
+        AssertEqualEnumerations(solution.EstimatedValues, simplifiedSolution.EstimatedValues);
+      }
+    }
+
+    private SymbolicRegressionSolution LoadSolution(string fileName) {
+      var doc = ContentManager.Load(fileName);
+      Result result = doc as Result;
+      if (result != null) {
+        return (SymbolicRegressionSolution)result.Value;
+      }
+      SymbolicRegressionSolution solution = doc as SymbolicRegressionSolution;
+      if (solution != null) {
+        return solution;
+      }
+      Assert.Fail("Cannot load file " + fileName);
+      throw new AssertFailedException();
+    }
+
+    private SymbolicRegressionSolution SimplifySolution(SymbolicRegressionSolution original) {
+      SymbolicSimplifier simplifier = new SymbolicSimplifier();
+      SymbolicExpressionTree simplifiedTree = simplifier.Simplify(original.Model.SymbolicExpressionTree);
+      SymbolicRegressionModel simplifiedModel = new SymbolicRegressionModel(original.Model.Interpreter, simplifiedTree);
+      return new SymbolicRegressionSolution(original.ProblemData, simplifiedModel, original.LowerEstimationLimit, original.UpperEstimationLimit);
+    }
+
+    private void AssertEqualEnumerations(IEnumerable<double> expected, IEnumerable<double> actual) {
+      var expectedEnumerator = expected.GetEnumerator();
+      var actualEnumerator = actual.GetEnumerator();
+      while (expectedEnumerator.MoveNext() & actualEnumerator.MoveNext()) {
+        Assert.AreEqual(expectedEnumerator.Current, actualEnumerator.Current, Math.Abs(1E-6 * expectedEnumerator.Current));
+      }
+      if (expectedEnumerator.MoveNext() | actualEnumerator.MoveNext())
+        Assert.Fail("Number of elements in enumerations do not match");
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/TableFileParserTest.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/TableFileParserTest.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/TableFileParserTest.cs	(revision 5026)
@@ -0,0 +1,483 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System.IO;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+
+  [TestClass()]
+  public class TableFileParserTest {
+
+    [TestMethod]
+    public void ParseCSV() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"0.00, 0.00, 0.00, 3.14
+0.00, 0.00, 0.00, 0.00
+0.00, 0.00, 0.00, 0.00
+0.00, 0.00, 0.00, 0.00
+0.00, 0.00, 0.00, 0.00
+0.00, 0.00, 0.00, 0.00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+    [TestMethod]
+    public void ParseCSVWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"x01, x02, x03, x04
+0.00, 0.00, 0.00, 3.14
+0.00, 0.00, 0.00, 0.00
+0.00, 0.00, 0.00, 0.00
+0.00, 0.00, 0.00, 0.00
+0.00, 0.00, 0.00, 0.00
+0.00, 0.00, 0.00, 0.00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseGermanCSV() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"0,00; 0,00; 0,00; 3,14
+0,00; 0,00; 0,00; 0,00
+0,00; 0,00; 0,00; 0,00
+0,00; 0,00; 0,00; 0,00
+0,00; 0,00; 0,00; 0,00
+0,00; 0,00; 0,00; 0,00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseGermanCSVWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"x01; x02; x03; x04
+0,00; 0,00; 0,00; 3,14
+0,00; 0,00; 0,00; 0,00
+0,00; 0,00; 0,00; 0,00
+0,00; 0,00; 0,00; 0,00
+0,00; 0,00; 0,00; 0,00
+0,00; 0,00; 0,00; 0,00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseGermanCSVWithoutCommas() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"0; 0; 0; 3
+0; 0; 0; 0
+0; 0; 0; 0
+0; 0; 0; 0
+0; 0; 0; 0
+0; 0; 0; 0");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+    [TestMethod]
+    public void ParseGermanCSVWithoutCommasWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"x01; x02; x03; x04
+0; 0; 0; 3
+0; 0; 0; 0
+0; 0; 0; 0
+0; 0; 0; 0
+0; 0; 0; 0
+0; 0; 0; 0");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseEnglishCSVWithoutCommas() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"0, 0, 0, 3
+0, 0, 0, 0
+0, 0, 0, 0
+0, 0, 0, 0
+0, 0, 0, 0
+0, 0, 0, 0");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseEnglishCSVWithoutCommasWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"x01, x02, x03, x04
+0, 0, 0, 3
+0, 0, 0, 0
+0, 0, 0, 0
+0, 0, 0, 0
+0, 0, 0, 0
+0, 0, 0, 0");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+
+    [TestMethod]
+    public void ParseGermanTabSeparated() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+"0,00\t 0,00\t 0,00\t 3,14" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseGermanTabSeparatedWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+"x01\t x02\t x03\t x04" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 3,14" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00" + Environment.NewLine +
+"0,00\t 0,00\t 0,00\t 0,00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseEnglishTabSeparated() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+"0.00\t 0.00\t 0.00\t 3.14" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+    [TestMethod]
+    public void ParseEnglishTabSeparatedWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+"x01\t x02\t x03\t x04" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 3.14" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00" + Environment.NewLine +
+"0.00\t 0.00\t 0.00\t 0.00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseTabSeparatedWithoutCommas() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+"0\t 0\t 0\t 3" + Environment.NewLine +
+"0\t 0\t 0\t 0" + Environment.NewLine +
+"0\t 0\t 0\t 0" + Environment.NewLine +
+"0\t 0\t 0\t 0" + Environment.NewLine +
+"0\t 0\t 0\t 0" + Environment.NewLine +
+"0\t 0\t 0\t 0");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+    [TestMethod]
+    public void ParseTabSeparatedWithoutCommasWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+"x01\t x02\t x03\t x04" + Environment.NewLine +
+"0\t 0\t 0\t 3" + Environment.NewLine +
+"0\t 0\t 0\t 0" + Environment.NewLine +
+"0\t 0\t 0\t 0" + Environment.NewLine +
+"0\t 0\t 0\t 0" + Environment.NewLine +
+"0\t 0\t 0\t 0" + Environment.NewLine +
+"0\t 0\t 0\t 0");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseGermanSpaceSeparated() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"0,00 0,00 0,00 3,14
+0,00 0,00 0,00 0,00
+0,00 0,00 0,00 0,00
+0,00 0,00 0,00 0,00
+0,00 0,00 0,00 0,00
+0,00 0,00 0,00 0,00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+    [TestMethod]
+    public void ParseGermanSpaceSeparatedWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"x01 x02 x03 x04
+0,00 0,00 0,00 3,14
+0,00 0,00 0,00 0,00
+0,00 0,00 0,00 0,00
+0,00 0,00 0,00 0,00
+0,00 0,00 0,00 0,00
+0,00 0,00 0,00 0,00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseEnglishSpaceSeparated() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"0.00 0.00 0.00 3.14
+0.00 0.00 0.00 0.00
+0.00 0.00 0.00 0.00
+0.00 0.00 0.00 0.00
+0.00 0.00 0.00 0.00
+0.00 0.00 0.00 0.00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+    [TestMethod]
+    public void ParseEnglishSpaceSeparatedWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"x01 x02 x03 x04
+0.00 0.00 0.00 3.14
+0.00 0.00 0.00 0.00
+0.00 0.00 0.00 0.00
+0.00 0.00 0.00 0.00
+0.00 0.00 0.00 0.00
+0.00 0.00 0.00 0.00");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3.14);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    [TestMethod]
+    public void ParseSpaceSeparatedWithoutCommas() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"0 0 0 3
+0 0 0 0
+0 0 0 0
+0 0 0 0
+0 0 0 0
+0 0 0 0");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+    [TestMethod]
+    public void ParseSpaceSeparatedWithoutCommasWithNames() {
+      string tempFileName = Path.GetTempFileName();
+      WriteToFile(tempFileName,
+@"x01 x02 x03 x04
+0 0 0 3
+0 0 0 0
+0 0 0 0
+0 0 0 0
+0 0 0 0
+0 0 0 0");
+      TableFileParser parser = new TableFileParser();
+      try {
+        parser.Parse(tempFileName);
+        Assert.AreEqual(6, parser.Rows);
+        Assert.AreEqual(4, parser.Columns);
+        Assert.AreEqual(parser.Values[0, 3], 3);
+      }
+      finally {
+        File.Delete(tempFileName);
+      }
+    }
+
+    private void WriteToFile(string fileName, string content) {
+      using (StreamWriter writer = new StreamWriter(fileName)) {
+        writer.Write(content);
+      }
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Token.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Token.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Token.cs	(revision 5026)
@@ -0,0 +1,67 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Globalization;
+
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+  internal enum TokenSymbol { LPAR, RPAR, SYMB, NUMBER };
+  internal 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 override int GetHashCode() {
+      return Symbol.GetHashCode() & StringValue.GetHashCode();
+    }
+
+    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, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out temp)) {
+        t.Symbol = TokenSymbol.NUMBER;
+        t.DoubleValue = double.Parse(strToken, CultureInfo.InvariantCulture.NumberFormat);
+      } else {
+        t.Symbol = TokenSymbol.SYMB;
+        t.StringValue = t.StringValue.ToUpper();
+      }
+      return t;
+    }
+  }
+}
Index: /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Util.cs
===================================================================
--- /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Util.cs	(revision 5026)
+++ /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Tests/Util.cs	(revision 5026)
@@ -0,0 +1,104 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Diagnostics;
+using System.Linq;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+namespace HeuristicLab.Problems.DataAnalysis.Tests {
+  internal class Util {
+
+    public static void InitTree(SymbolicExpressionTree tree, MersenneTwister twister, List<string> varNames) {
+      foreach (var node in tree.IterateNodesPostfix()) {
+        if (node is VariableTreeNode) {
+          var varNode = node as VariableTreeNode;
+          varNode.Weight = twister.NextDouble() * 20.0 - 10.0;
+          varNode.VariableName = varNames[twister.Next(varNames.Count)];
+        } else if (node is ConstantTreeNode) {
+          var constantNode = node as ConstantTreeNode;
+          constantNode.Value = twister.NextDouble() * 20.0 - 10.0;
+        }
+      }
+    }
+
+
+    public static SymbolicExpressionTree[] CreateRandomTrees(MersenneTwister twister, Dataset dataset, ISymbolicExpressionGrammar grammar, int popSize) {
+      return CreateRandomTrees(twister, dataset, grammar, popSize, 1, 200, 3, 3);
+    }
+
+    public static SymbolicExpressionTree[] CreateRandomTrees(MersenneTwister twister, Dataset dataset, ISymbolicExpressionGrammar grammar,
+      int popSize, int minSize, int maxSize,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
+      foreach (Variable variableSymbol in grammar.Symbols.OfType<Variable>()) {
+        variableSymbol.VariableNames = dataset.VariableNames.Skip(1);
+      }
+      SymbolicExpressionTree[] randomTrees = new SymbolicExpressionTree[popSize];
+      for (int i = 0; i < randomTrees.Length; i++) {
+        randomTrees[i] = ProbabilisticTreeCreator.Create(twister, grammar, maxSize, 10, maxFunctionDefinitions, maxFunctionArguments);
+      }
+      return randomTrees;
+    }
+
+
+    public static Dataset CreateRandomDataset(MersenneTwister twister, int rows, int columns) {
+      double[,] data = new double[rows, columns];
+      for (int i = 0; i < rows; i++) {
+        for (int j = 0; j < columns; j++) {
+          data[i, j] = twister.NextDouble() * 2.0 - 1.0;
+        }
+      }
+      IEnumerable<string> variableNames = new string[] { "y" }.Concat(Enumerable.Range(0, columns - 1).Select(x => "x" + x.ToString()));
+      Dataset ds = new Dataset(variableNames, data);
+      return ds;
+    }
+
+    public static double NodesPerSecond(long nNodes, Stopwatch watch) {
+      return nNodes / (watch.ElapsedMilliseconds / 1000.0);
+    }
+
+    public static void EvaluateTrees(SymbolicExpressionTree[] trees, ISymbolicExpressionTreeInterpreter interpreter, Dataset dataset, int repetitions) {
+      double[] estimation = new double[dataset.Rows];
+      // warm up
+      for (int i = 0; i < trees.Length; i++) {
+        estimation = interpreter.GetSymbolicExpressionTreeValues(trees[i], dataset, Enumerable.Range(0, dataset.Rows)).ToArray();
+      }
+
+      Stopwatch watch = new Stopwatch();
+      long nNodes = 0;
+      for (int rep = 0; rep < repetitions; rep++) {
+        watch.Start();
+        for (int i = 0; i < trees.Length; i++) {
+          nNodes += trees[i].Size * (dataset.Rows - 1);
+          estimation = interpreter.GetSymbolicExpressionTreeValues(trees[i], dataset, Enumerable.Range(0, dataset.Rows)).ToArray();
+        }
+        watch.Stop();
+      }
+      Assert.Inconclusive("Random tree evaluation performance of " + interpreter.GetType() + ":" +
+        watch.ElapsedMilliseconds + "ms " +
+        Util.NodesPerSecond(nNodes, watch) + " nodes/sec");
+    }
+  }
+}
