Index: /branches/1772_HeuristicLab.EvolutionTracking/Build.cmd
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/Build.cmd	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/Build.cmd	(revision 16132)
@@ -0,0 +1,94 @@
+@ECHO OFF
+
+SET CLEANBEFOREBUILD=0
+
+SET SELECTED=
+SET CONFIGURATION=
+SET PLATFORM=
+
+IF "%~1"=="" GOTO :prompt_solution
+
+SET SELECTED=%1
+IF NOT EXIST %SELECTED% (
+  ECHO Solution file %SELECTED% could not be found.
+  GOTO :end
+)
+ECHO Building solution %SELECTED% ...
+GOTO :config_selection
+
+:prompt_solution
+SET /A COUNT=0
+FOR /F "tokens=*" %%A IN ('dir /B *.sln') DO (
+  CALL :forloopbody "%%A"
+)
+
+IF "%COUNT%"=="1" (
+  SET SELECTED=%SOLUTIONS.1%
+  ECHO Building %SOLUTIONS.1% as it is the only solution that was found ...
+  GOTO :config_selection
+)
+
+ECHO Found the following solutions:
+FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO ECHO %%A = %%B
+ECHO.
+SET /P SOLUTIONINDEX=Which solution to build? Type the number: 
+
+SET SELECTED=""
+FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO (
+  IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B
+)
+
+IF %SELECTED%=="" GOTO :eof
+
+:config_selection
+IF "%~2"==""  GOTO :prompt_config
+
+SET CONFIGURATION=%~2
+ECHO Building configuration %CONFIGURATION% ...
+GOTO :platform_selection
+
+:prompt_config
+SET /P CONFIGURATION=Which configuration to build [Release]: 
+IF "%CONFIGURATION%"=="" SET CONFIGURATION=Release
+
+:platform_selection
+IF "%~3"=="" GOTO :prompt_platform
+  
+SET PLATFORM=%~3
+ECHO Building platform %PLATFORM% ...
+GOTO :main
+
+:prompt_platform
+SET /P PLATFORM=Which platform to build [Any CPU]: 
+IF "%PLATFORM%"=="" SET PLATFORM=Any CPU
+
+:main
+REM First find the path to the msbuild.exe by performing a registry query
+FOR /F "tokens=1,3 delims=	 " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"') DO (
+  IF "%%A"=="MSBuildToolsPath" SET MSBUILDPATH=%%B)
+
+REM Then execute msbuild to clean and build the solution
+REM Disable that msbuild creates a cache file of the solution
+SET MSBuildUseNoSolutionCache=1
+REM Run msbuild to clean and then build
+IF "%CLEANBEFOREBUILD%"=="1" (
+  ECHO Cleaning ...
+  %MSBUILDPATH%msbuild.exe %SELECTED% /target:Clean /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /m:2 /nologo /verbosity:q /clp:ErrorsOnly
+)
+ECHO Building ...
+%MSBUILDPATH%msbuild.exe %SELECTED% /target:Rebuild /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /m:2 /nologo /verbosity:q /clp:ErrorsOnly
+
+ECHO.
+ECHO DONE.
+
+:end
+
+PAUSE
+
+GOTO :eof
+
+REM This workaround is necessary so that COUNT gets reevaluated
+:forloopbody
+SET /A COUNT+=1
+SET SOLUTIONS.%COUNT%=%1
+GOTO :eof
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Formatters/SymbolicExpressionTreeLatexFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Formatters/SymbolicExpressionTreeLatexFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Formatters/SymbolicExpressionTreeLatexFormatter.cs	(revision 16132)
@@ -0,0 +1,117 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Globalization;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [Item("LaTeX/PDF Formatter", "Formatter for symbolic expression trees for use with latex package tikz.")]
+  public class SymbolicExpressionTreeLatexFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+    private readonly static Dictionary<string, string> symbolNameMap = new Dictionary<string, string>
+    {
+      {"ProgramRootSymbol", "Prog"},
+      {"StartSymbol","RPB"},
+      {"Multiplication", "$\\times$"},
+      {"Division", "$\\div$"},
+      {"Addition", "$+$"},
+      {"Subtraction", "$-$"},
+      {"Exponential", "$\\exp$"},
+      {"Logarithm", "$\\log$"}
+    };
+
+    private readonly ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> layoutEngine;
+
+    public SymbolicExpressionTreeLatexFormatter()
+      : base("LaTeX/PDF Formatter", "Formatter for symbolic expression trees for use with latex package tikz.") {
+      layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(n => n.Subtrees) {
+        HorizontalSpacing = 2,
+        VerticalSpacing = 2,
+        NodeWidth = 8,
+        NodeHeight = 4
+      };
+    }
+
+    protected SymbolicExpressionTreeLatexFormatter(SymbolicExpressionTreeLatexFormatter original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeLatexFormatter(this, cloner);
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      string s;
+      Format(symbolicExpressionTree, out s);
+      return s;
+    }
+
+    public Dictionary<ISymbolicExpressionTreeNode, string> Format(ISymbolicExpressionTree symbolicExpressionTree, out string str, int offset = 0) {
+      var nodeIds = new Dictionary<ISymbolicExpressionTreeNode, string>();
+      var root = symbolicExpressionTree.Root;
+      var actualRoot = root.SubtreeCount == 0 ? root.GetSubtree(0) : root;
+      var nodeCoordinates = layoutEngine.CalculateLayout(actualRoot).ToDictionary(n => n.Content, n => new PointF(n.X, n.Y));
+      var sb = new StringBuilder();
+      var nl = Environment.NewLine;
+      double ws = 1;
+      double hs = 0.7;
+
+      sb.Append("\\documentclass[class=minimal,border=0pt]{standalone}" + nl +
+                "\\usepackage{tikz}" + nl +
+                "\\begin{document}" + nl +
+                "\\begin{tikzpicture}" + nl +
+                "\\def\\ws{1}" + nl +
+                "\\def\\hs{0.7}" + nl +
+                "\\def\\offs{" + offset + "}" + nl);
+
+      var nodes = symbolicExpressionTree.IterateNodesBreadth().ToList();
+      for (int i = 0; i < nodes.Count; ++i) {
+        var node = nodes[i];
+        var id = Guid.NewGuid().ToString();
+        nodeIds[node] = id;
+        var coord = nodeCoordinates[node];
+        var nodeName = symbolNameMap.ContainsKey(node.Symbol.Name) ? symbolNameMap[node.Symbol.Name] : node.ToString();
+        sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "\\node ({0}) at (\\ws*{1} + \\offs,\\hs*{2}) {{{3}}};", nodeIds[node], ws * coord.X, -hs * coord.Y, EscapeLatexString(nodeName)));
+      }
+
+      for (int i = 0; i < nodes.Count; ++i) {
+        var n = nodes[i];
+        foreach (var s in nodes[i].Subtrees) {
+          sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "\\draw ({0}) -- ({1});", nodeIds[n], nodeIds[s]));
+        }
+      }
+
+      sb.Append("\\end{tikzpicture}" + nl +
+                "\\end{document}" + nl);
+      str = sb.ToString();
+      return nodeIds;
+    }
+
+    private static string EscapeLatexString(string s) {
+      return s.Replace("\\", "\\\\").Replace("{", "\\{").Replace("}", "\\}").Replace("_", "\\_");
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.Designer.cs	(revision 16132)
@@ -0,0 +1,80 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Drawing;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class GraphicalSymbolicExpressionTreeView {
+    /// <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.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
+      this.SuspendLayout();
+      // 
+      // functionTreeChart
+      // 
+      this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White;
+      this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolicExpressionTreeChart.Tree = null;
+      this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black;
+      this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0);
+      this.symbolicExpressionTreeChart.Name = "functionTreeChart";
+      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(407, 367);
+      this.symbolicExpressionTreeChart.TabIndex = 0;
+      this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font(FontFamily.GenericSerif, 8F);
+      // 
+      // FunctionTreeView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.symbolicExpressionTreeChart);
+      this.Name = "FunctionTreeView";
+      this.Size = new System.Drawing.Size(407, 367);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private SymbolicExpressionTreeChart symbolicExpressionTreeChart;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.cs	(revision 16132)
@@ -0,0 +1,61 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Graphical SymbolicExpressionTree View")]
+  [Content(typeof(ISymbolicExpressionTree), true)]
+  public partial class GraphicalSymbolicExpressionTreeView : ItemView {
+    public new ISymbolicExpressionTree Content {
+      get { return (ISymbolicExpressionTree)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public GraphicalSymbolicExpressionTreeView()
+      : base() {
+      InitializeComponent();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        symbolicExpressionTreeChart.Tree = null;
+      } else {
+        symbolicExpressionTreeChart.Tree = Content;
+      }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      symbolicExpressionTreeChart.Enabled = Content != null;
+    }
+
+    public SymbolicExpressionTreeChart SymbolicExpressionTreeChart {
+      get {
+        return symbolicExpressionTreeChart;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 16132)
@@ -0,0 +1,296 @@
+﻿<?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>{423BD94F-963A-438E-BA45-3BB3D61CD03B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <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>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data.Views-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Views-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization-3.3, Version=3.3.0.9491, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
+      <Private>False</Private>
+    </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" />
+    <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="Formatters\SymbolicExpressionTreeLatexFormatter.cs" />
+    <Compile Include="LayoutEngines\BoxesLayoutEngine.cs" />
+    <Compile Include="LayoutEngines\ILayoutEngine.cs" />
+    <Compile Include="LayoutEngines\LayoutNode.cs" />
+    <Compile Include="LayoutEngines\ReingoldTilfordLayoutEngine.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="SymbolicExpressionGrammarAllowedChildSymbolsControl.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarAllowedChildSymbolsControl.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarEditorView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarEditorView.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarEditorView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarSampleExpressionTreeView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarSampleExpressionTreeView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarView.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolView.Designer.cs">
+      <DependentUpon>SymbolView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="GraphicalSymbolicExpressionTreeView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="GraphicalSymbolicExpressionTreeView.Designer.cs">
+      <DependentUpon>GraphicalSymbolicExpressionTreeView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SymbolicExpressionTreeChart.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionTreeChart.Designer.cs">
+      <DependentUpon>SymbolicExpressionTreeChart.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionView.Designer.cs">
+      <DependentUpon>SymbolicExpressionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="VisualTreeNode.cs" />
+    <Compile Include="VisualTreeNodeConnection.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.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>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
+      <Project>{06d4a186-9319-48a0-bade-a2058d462eea}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.EvolutionTracking\3.4\HeuristicLab.EvolutionTracking-3.4.csproj">
+      <Project>{1f75cea3-464f-4a6f-b2f0-04b9841ebc16}</Project>
+      <Name>HeuristicLab.EvolutionTracking-3.4</Name>
+    </ProjectReference>
+  </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 Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/BoxesLayoutEngine.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/BoxesLayoutEngine.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/BoxesLayoutEngine.cs	(revision 16132)
@@ -0,0 +1,117 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public class BoxesLayoutEngine<T> : ILayoutEngine<T> where T : class {
+    public int NodeWidth { get; set; }
+    public int NodeHeight { get; set; }
+    public int HorizontalSpacing { get; set; }
+    public int VerticalSpacing { get; set; }
+
+    private readonly Func<T, IEnumerable<T>> GetChildren;
+    private readonly Func<T, int> GetLength;
+    private readonly Func<T, int> GetDepth;
+
+    public BoxesLayoutEngine(Func<T, IEnumerable<T>> GetChildren, Func<T, int> GetLength, Func<T, int> GetDepth) {
+      if (GetChildren == null) throw new ArgumentNullException("GetChildren");
+      if (GetLength == null) throw new ArgumentNullException("GetLength");
+      if (GetDepth == null) throw new ArgumentNullException("GetDepth");
+
+      this.GetChildren = GetChildren;
+      this.GetLength = GetLength;
+      this.GetDepth = GetDepth;
+    }
+
+
+    public IEnumerable<VisualTreeNode<T>> CalculateLayout(T root, float width, float height) {
+      var nodeMap = new Dictionary<T, VisualTreeNode<T>>();
+      CreateVisualNodes(root, nodeMap);
+      RecursiveLayout(nodeMap, nodeMap[root], 0, 0, (int)Math.Round(width), (int)Math.Round(height) / GetDepth(root));
+      return nodeMap.Values;
+    }
+
+    private void CreateVisualNodes(T root, Dictionary<T, VisualTreeNode<T>> map) {
+      var node = new VisualTreeNode<T>(root) {
+        PreferredWidth = NodeWidth,
+        PreferredHeight = NodeHeight
+      };
+
+      map.Add(root, node);
+      var children = GetChildren(root).ToList();
+      if (children.Any()) {
+        foreach (var child in children) {
+          CreateVisualNodes(child, map);
+        }
+      }
+    }
+
+    private void RecursiveLayout(Dictionary<T, VisualTreeNode<T>> nodeMap, VisualTreeNode<T> visualTreeNode, int x, int y, int width, int height) {
+      float center_x = x + width / 2;
+      float center_y = y + height / 2;
+      int actualWidth = width - HorizontalSpacing;
+      int actualHeight = height - VerticalSpacing;
+
+      //calculate size of node
+      if (actualWidth >= visualTreeNode.PreferredWidth && actualHeight >= visualTreeNode.PreferredHeight) {
+        visualTreeNode.Width = visualTreeNode.PreferredWidth;
+        visualTreeNode.Height = visualTreeNode.PreferredHeight;
+        visualTreeNode.X = (int)center_x - visualTreeNode.Width / 2;
+        visualTreeNode.Y = (int)center_y - visualTreeNode.Height / 2;
+      }
+        //width too small to draw in desired sized
+      else if (actualWidth < visualTreeNode.PreferredWidth && actualHeight >= visualTreeNode.PreferredHeight) {
+        visualTreeNode.Width = actualWidth;
+        visualTreeNode.Height = visualTreeNode.PreferredHeight;
+        visualTreeNode.X = x;
+        visualTreeNode.Y = (int)center_y - visualTreeNode.Height / 2;
+      }
+        //height too small to draw in desired sized
+      else if (actualWidth >= visualTreeNode.PreferredWidth && actualHeight < visualTreeNode.PreferredHeight) {
+        visualTreeNode.Width = visualTreeNode.PreferredWidth;
+        visualTreeNode.Height = actualHeight;
+        visualTreeNode.X = (int)center_x - visualTreeNode.Width / 2;
+        visualTreeNode.Y = y;
+      }
+        //width and height too small to draw in desired size
+      else {
+        visualTreeNode.Width = actualWidth;
+        visualTreeNode.Height = actualHeight;
+        visualTreeNode.X = x;
+        visualTreeNode.Y = y;
+      }
+      //calculate areas for the subtrees according to their tree size 
+      var node = visualTreeNode.Content;
+      var children = GetChildren(node).ToList();
+      int[] xBoundaries = new int[children.Count + 1];
+      xBoundaries[0] = x;
+      for (int i = 0; i < children.Count; i++) {
+        xBoundaries[i + 1] = (int)(xBoundaries[i] + (width * (double)GetLength(children[i])) / (GetLength(node) - 1));
+        RecursiveLayout(nodeMap, nodeMap[children[i]], xBoundaries[i], y + height, xBoundaries[i + 1] - xBoundaries[i], height);
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/ILayoutEngine.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/ILayoutEngine.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/ILayoutEngine.cs	(revision 16132)
@@ -0,0 +1,34 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  interface ILayoutEngine<T> where T : class {
+    int NodeWidth { get; set; }
+    int NodeHeight { get; set; }
+    int HorizontalSpacing { get; set; }
+    int VerticalSpacing { get; set; }
+
+    IEnumerable<VisualTreeNode<T>> CalculateLayout(T root, float width, float height);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/LayoutNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/LayoutNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/LayoutNode.cs	(revision 16132)
@@ -0,0 +1,108 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  internal class LayoutNode<T> : object where T : class {
+    public float Width { get; set; }
+    public float Height { get; set; }
+
+    public LayoutNode<T> NextLeft {
+      get {
+        return Children == null ? Thread : Children.First();
+      }
+    }
+    public LayoutNode<T> NextRight {
+      get {
+        return Children == null ? Thread : Children.Last();
+      }
+    }
+    public LayoutNode<T> LeftSibling {
+      get {
+        if (Parent == null) return null;
+        return Number == 0 ? null : Parent.Children[Number - 1];
+      }
+    }
+    public LayoutNode<T> LeftmostSibling {
+      get {
+        if (Parent == null) return null;
+        return Number == 0 ? null : Parent.Children[0];
+      }
+    }
+
+    public LayoutNode<T> Thread { get; set; }
+    public LayoutNode<T> Ancestor { get; set; }
+    public LayoutNode<T> Parent { get; set; }
+    public List<LayoutNode<T>> Children { get; set; }
+    public float Mod { get; set; }
+    public float Prelim { get; set; }
+    public float Change { get; set; }
+    public float Shift { get; set; }
+    public int Number { get; set; }
+    public int Level { get; set; }
+    public float X { get; set; }
+    public float Y { get; set; }
+
+    public bool IsLeaf {
+      get { return Children == null || Children.Count == 0; }
+    }
+
+    private T content;
+    public T Content {
+      get { return content; }
+      set {
+        if (value == null)
+          throw new ArgumentNullException("LayoutNode: Content cannot be null.");
+        content = value;
+      }
+    }
+    /// <summary>
+    /// Translate the position of the layout node according to the given offsets
+    /// </summary>
+    /// <param name="dx"></param>
+    /// <param name="dy"></param>
+    public void Translate(float dx, float dy) {
+      X += dx;
+      Y += dy;
+    }
+
+    public void ResetCoordinates() {
+      X = 0;
+      Y = 0;
+    }
+
+    /// <summary>
+    /// Reset layout-related parameters
+    /// </summary>
+    public void Reset() {
+      Ancestor = this;
+      Thread = null;
+      Change = 0;
+      Shift = 0;
+      Prelim = 0;
+      Mod = 0;
+      ResetCoordinates();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/ReingoldTilfordLayoutEngine.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/ReingoldTilfordLayoutEngine.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/ReingoldTilfordLayoutEngine.cs	(revision 16132)
@@ -0,0 +1,293 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public class ReingoldTilfordLayoutEngine<T> : ILayoutEngine<T> where T : class {
+    public int NodeWidth { get; set; }
+    public int NodeHeight { get; set; }
+    private int minHorizontalSpacing = 5;
+    public int HorizontalSpacing {
+      get { return minHorizontalSpacing; }
+      set { minHorizontalSpacing = value; }
+    }
+
+    private int minVerticalSpacing = 5;
+    public int VerticalSpacing {
+      get { return minVerticalSpacing; }
+      set { minVerticalSpacing = value; }
+    }
+
+    private readonly Func<T, IEnumerable<T>> GetChildren;
+
+    public ReingoldTilfordLayoutEngine(Func<T, IEnumerable<T>> GetChildren) {
+      this.GetChildren = GetChildren;
+    }
+
+    public IEnumerable<VisualTreeNode<T>> CalculateLayout(T root) {
+      return CalculateLayout(root, 0, 0);
+    }
+
+    public IEnumerable<VisualTreeNode<T>> CalculateLayout(T root, float width, float height) {
+      Dictionary<T, LayoutNode<T>> layoutNodeMap = new Dictionary<T, LayoutNode<T>>();
+      var layoutRoot = new LayoutNode<T> { Content = root, Width = NodeWidth, Height = NodeHeight, };
+      layoutRoot.Ancestor = layoutRoot;
+      Expand(layoutRoot, layoutNodeMap);
+
+      FirstWalk(layoutRoot);
+      SecondWalk(layoutRoot, -layoutRoot.Prelim);
+      NormalizeCoordinates(layoutNodeMap.Values);
+      if (width > 0 && height > 0) {
+        FitToBounds(width, height, layoutNodeMap.Values);
+        Center(width, height, layoutNodeMap.Values);
+      }
+
+      return layoutNodeMap.Values.Select(x => new VisualTreeNode<T>(x.Content) {
+        Width = (int)Math.Round(x.Width),
+        Height = (int)Math.Round(x.Height),
+        X = (int)Math.Round(x.X),
+        Y = (int)Math.Round(x.Y)
+      });
+    }
+
+    private void Expand(LayoutNode<T> lRoot, Dictionary<T, LayoutNode<T>> map) {
+      map.Add(lRoot.Content, lRoot);
+      var children = GetChildren(lRoot.Content).ToList();
+      if (!children.Any()) return;
+      lRoot.Children = new List<LayoutNode<T>>(children.Count);
+      for (int i = 0; i < children.Count; ++i) {
+        var node = new LayoutNode<T> {
+          Content = children[i],
+          Number = i,
+          Parent = lRoot,
+          Level = lRoot.Level + 1,
+          Width = NodeWidth,
+          Height = NodeHeight
+        };
+        node.Ancestor = node;
+        lRoot.Children.Add(node);
+        Expand(node, map);
+      }
+    }
+
+
+    /// <summary>
+    /// Transform LayoutNode coordinates so that all coordinates are positive and start from (0,0)
+    /// </summary>
+    private static void NormalizeCoordinates(IEnumerable<LayoutNode<T>> nodes) {
+      float xmin = 0, ymin = 0;
+      foreach (var node in nodes) {
+        if (xmin > node.X) xmin = node.X;
+        if (ymin > node.Y) ymin = node.Y;
+      }
+      foreach (var node in nodes) {
+        node.X -= xmin;
+        node.Y -= ymin;
+      }
+    }
+
+    private void Center(float width, float height, IEnumerable<LayoutNode<T>> nodes) {
+      // center layout on screen
+      var bounds = Bounds(nodes);
+      float dx = 0, dy = 0;
+      if (width > bounds.Width) { dx = (width - bounds.Width) / 2f; }
+      if (height > bounds.Height) { dy = (height - bounds.Height) / 2f; }
+      foreach (var node in nodes) { node.Translate(dx, dy); }
+    }
+
+    private void FitToBounds(float width, float height, IEnumerable<LayoutNode<T>> nodes) {
+      var bounds = Bounds(nodes);
+      var myWidth = bounds.Width;
+      var myHeight = bounds.Height;
+
+      if (myWidth <= width && myHeight <= height) return; // no need to fit since we are within bounds
+
+      var layers = nodes.GroupBy(node => node.Level, node => node).ToList();
+
+      if (myWidth > width) {
+        // need to scale horizontally
+        float x = width / myWidth;
+        foreach (var node in layers.SelectMany(g => g)) {
+          node.X *= x;
+          node.Width *= x;
+        }
+        float spacing = minHorizontalSpacing * x;
+        foreach (var layer in layers) {
+          var nodesLayer = layer.ToList();
+          float minWidth = float.MaxValue;
+          for (int i = 0; i < nodesLayer.Count - 1; ++i) { minWidth = Math.Min(minWidth, nodesLayer[i + 1].X - nodesLayer[i].X); }
+          float w = Math.Min(NodeWidth, minWidth - spacing);
+          foreach (var node in nodesLayer) {
+            node.X += (node.Width - w) / 2f;
+            node.Width = w;
+            //this is a simple solution to ensure that the leftmost and rightmost nodes are not drawn partially offscreen due to scaling and offset
+            //this should work well enough 99.9% of the time with no noticeable visual difference
+            if (node.X < 0) {
+              node.Width += node.X;
+              node.X = 0;
+            } else if (node.X + node.Width > width) {
+              node.Width = width - node.X;
+            }
+          }
+        }
+      }
+      if (myHeight > height) {
+        // need to scale vertically
+        float x = height / myHeight;
+        foreach (var node in layers.SelectMany(g => g)) {
+          node.Y *= x;
+          node.Height *= x;
+        }
+      }
+    }
+
+
+    /// <summary>
+    /// Returns the bounding box for this layout. When the layout is normalized, the rectangle should be [0,0,xmin,xmax].
+    /// </summary>
+    /// <returns></returns>
+    private RectangleF Bounds(IEnumerable<LayoutNode<T>> nodes) {
+      float xmin = 0, xmax = 0, ymin = 0, ymax = 0;
+      foreach (LayoutNode<T> node in nodes) {
+        float x = node.X, y = node.Y;
+        if (xmin > x) xmin = x;
+        if (xmax < x) xmax = x;
+        if (ymin > y) ymin = y;
+        if (ymax < y) ymax = y;
+      }
+      return new RectangleF(xmin, ymin, xmax + NodeWidth, ymax + NodeHeight);
+    }
+
+    #region methods specific to the reingold-tilford layout algorithm
+    private void FirstWalk(LayoutNode<T> v) {
+      LayoutNode<T> w;
+      if (v.IsLeaf) {
+        w = v.LeftSibling;
+        if (w != null) {
+          v.Prelim = w.Prelim + minHorizontalSpacing + NodeWidth;
+        }
+      } else {
+        var defaultAncestor = v.Children[0]; // leftmost child
+
+        foreach (var child in v.Children) {
+          FirstWalk(child);
+          Apportion(child, ref defaultAncestor);
+        }
+        ExecuteShifts(v);
+        var leftmost = v.Children.First();
+        var rightmost = v.Children.Last();
+        float midPoint = (leftmost.Prelim + rightmost.Prelim) / 2;
+        w = v.LeftSibling;
+        if (w != null) {
+          v.Prelim = w.Prelim + minHorizontalSpacing + NodeWidth;
+          v.Mod = v.Prelim - midPoint;
+        } else {
+          v.Prelim = midPoint;
+        }
+      }
+    }
+
+    private void SecondWalk(LayoutNode<T> v, float m) {
+      v.X = v.Prelim + m;
+      v.Y = v.Level * (minVerticalSpacing + NodeHeight);
+      if (v.IsLeaf) return;
+      foreach (var child in v.Children) {
+        SecondWalk(child, m + v.Mod);
+      }
+    }
+
+    private void Apportion(LayoutNode<T> v, ref LayoutNode<T> defaultAncestor) {
+      var w = v.LeftSibling;
+      if (w == null) return;
+      LayoutNode<T> vip = v;
+      LayoutNode<T> vop = v;
+      LayoutNode<T> vim = w;
+      LayoutNode<T> vom = vip.LeftmostSibling;
+
+      float sip = vip.Mod;
+      float sop = vop.Mod;
+      float sim = vim.Mod;
+      float som = vom.Mod;
+
+      while (vim.NextRight != null && vip.NextLeft != null) {
+        vim = vim.NextRight;
+        vip = vip.NextLeft;
+        vom = vom.NextLeft;
+        vop = vop.NextRight;
+        vop.Ancestor = v;
+        float shift = (vim.Prelim + sim) - (vip.Prelim + sip) + minHorizontalSpacing + NodeWidth;
+        if (shift > 0) {
+          var ancestor = Ancestor(vim, v) ?? defaultAncestor;
+          MoveSubtree(ancestor, v, shift);
+          sip += shift;
+          sop += shift;
+        }
+        sim += vim.Mod;
+        sip += vip.Mod;
+        som += vom.Mod;
+        sop += vop.Mod;
+      }
+      if (vim.NextRight != null && vop.NextRight == null) {
+        vop.Thread = vim.NextRight;
+        vop.Mod += (sim - sop);
+      }
+      if (vip.NextLeft != null && vom.NextLeft == null) {
+        vom.Thread = vip.NextLeft;
+        vom.Mod += (sip - som);
+        defaultAncestor = v;
+      }
+    }
+
+    private void MoveSubtree(LayoutNode<T> wm, LayoutNode<T> wp, float shift) {
+      int subtrees = wp.Number - wm.Number; // TODO: Investigate possible bug (if the value ever happens to be zero) - happens when the tree is actually a graph (but that's outside the use case of this algorithm which only works with trees)
+      if (subtrees == 0) throw new Exception("MoveSubtree failed: check if object is really a tree (no cycles)");
+      wp.Change -= shift / subtrees;
+      wp.Shift += shift;
+      wm.Change += shift / subtrees;
+      wp.Prelim += shift;
+      wp.Mod += shift;
+    }
+
+    private void ExecuteShifts(LayoutNode<T> v) {
+      if (v.IsLeaf) return;
+      float shift = 0;
+      float change = 0;
+      for (int i = v.Children.Count - 1; i >= 0; --i) {
+        var w = v.Children[i];
+        w.Prelim += shift;
+        w.Mod += shift;
+        change += w.Change;
+        shift += (w.Shift + change);
+      }
+    }
+
+    private LayoutNode<T> Ancestor(LayoutNode<T> u, LayoutNode<T> v) {
+      var ancestor = u.Ancestor;
+      if (ancestor == null) return null;
+      return ancestor.Parent == v.Parent ? ancestor : null;
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Plugin.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Plugin.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Plugin.cs.frame	(revision 16132)
@@ -0,0 +1,41 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Views {
+  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views","Provides views for the symbolic expression tree encoding.", "3.4.11.$WCREV$")]
+  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
+  [PluginDependency("HeuristicLab.MainForm", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.Random","3.3")]
+  public class HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin : PluginBase {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
@@ -0,0 +1,47 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Views")]
+[assembly: AssemblyDescription("Provides views for the symbolic expression tree encoding.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 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("673A0460-B43A-4853-84D2-4125532B7F51")]
+
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.11.$WCREV$")]
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs	(revision 16132)
@@ -0,0 +1,184 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Views {
+  partial class SymbolView {
+    /// <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.initialFrequencyLabel = new System.Windows.Forms.Label();
+      this.initialFrequencyTextBox = new System.Windows.Forms.TextBox();
+      this.enabledCheckBox = new System.Windows.Forms.CheckBox();
+      this.minimumArityLabel = new System.Windows.Forms.Label();
+      this.maximumArityLabel = new System.Windows.Forms.Label();
+      this.minimumArityTextBox = new System.Windows.Forms.TextBox();
+      this.maximumArityTextBox = new System.Windows.Forms.TextBox();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Location = new System.Drawing.Point(93, 0);
+      this.nameTextBox.Size = new System.Drawing.Size(202, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(301, 3);
+      // 
+      // initialFrequencyLabel
+      // 
+      this.initialFrequencyLabel.AutoSize = true;
+      this.initialFrequencyLabel.Location = new System.Drawing.Point(3, 29);
+      this.initialFrequencyLabel.Name = "initialFrequencyLabel";
+      this.initialFrequencyLabel.Size = new System.Drawing.Size(84, 13);
+      this.initialFrequencyLabel.TabIndex = 3;
+      this.initialFrequencyLabel.Text = "Initial frequency:";
+      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // initialFrequencyTextBox
+      // 
+      this.initialFrequencyTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.initialFrequencyTextBox.Location = new System.Drawing.Point(93, 26);
+      this.initialFrequencyTextBox.Name = "initialFrequencyTextBox";
+      this.initialFrequencyTextBox.Size = new System.Drawing.Size(227, 20);
+      this.initialFrequencyTextBox.TabIndex = 4;
+      this.initialFrequencyTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.initialFrequencyTextBox_KeyDown);
+      this.initialFrequencyTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.initialFrequencyTextBox_Validating);
+      this.initialFrequencyTextBox.Validated += new System.EventHandler(this.initialFrequencyTextBox_Validated);
+      // 
+      // enabledCheckBox
+      // 
+      this.enabledCheckBox.AutoSize = true;
+      this.enabledCheckBox.Location = new System.Drawing.Point(93, 104);
+      this.enabledCheckBox.Name = "enabledCheckBox";
+      this.enabledCheckBox.Size = new System.Drawing.Size(65, 17);
+      this.enabledCheckBox.TabIndex = 5;
+      this.enabledCheckBox.Text = "Enabled";
+      this.enabledCheckBox.UseVisualStyleBackColor = true;
+      this.enabledCheckBox.CheckedChanged += new System.EventHandler(this.checkBoxEnabled_CheckedChanged);
+      // 
+      // minimumArityLabel
+      // 
+      this.minimumArityLabel.AutoSize = true;
+      this.minimumArityLabel.Location = new System.Drawing.Point(3, 55);
+      this.minimumArityLabel.Name = "minimumArityLabel";
+      this.minimumArityLabel.Size = new System.Drawing.Size(74, 13);
+      this.minimumArityLabel.TabIndex = 8;
+      this.minimumArityLabel.Text = "Minimum Arity:";
+      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
+      // 
+      // maximumArityLabel
+      // 
+      this.maximumArityLabel.AutoSize = true;
+      this.maximumArityLabel.Location = new System.Drawing.Point(3, 81);
+      this.maximumArityLabel.Name = "maximumArityLabel";
+      this.maximumArityLabel.Size = new System.Drawing.Size(74, 13);
+      this.maximumArityLabel.TabIndex = 6;
+      this.maximumArityLabel.Text = "Maximum Arity";
+      this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol");
+      // 
+      // minimumArityTextBox
+      // 
+      this.minimumArityTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Location = new System.Drawing.Point(93, 52);
+      this.minimumArityTextBox.Name = "minimumArityTextBox";
+      this.minimumArityTextBox.ReadOnly = true;
+      this.minimumArityTextBox.Size = new System.Drawing.Size(227, 20);
+      this.minimumArityTextBox.TabIndex = 9;
+      // 
+      // maximumArityTextBox
+      // 
+      this.maximumArityTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Location = new System.Drawing.Point(93, 78);
+      this.maximumArityTextBox.Name = "maximumArityTextBox";
+      this.maximumArityTextBox.ReadOnly = true;
+      this.maximumArityTextBox.Size = new System.Drawing.Size(227, 20);
+      this.maximumArityTextBox.TabIndex = 7;
+      // 
+      // SymbolView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.minimumArityTextBox);
+      this.Controls.Add(this.minimumArityLabel);
+      this.Controls.Add(this.maximumArityTextBox);
+      this.Controls.Add(this.maximumArityLabel);
+      this.Controls.Add(this.initialFrequencyTextBox);
+      this.Controls.Add(this.initialFrequencyLabel);
+      this.Controls.Add(this.enabledCheckBox);
+      this.Name = "SymbolView";
+      this.Size = new System.Drawing.Size(320, 123);
+      this.Controls.SetChildIndex(this.enabledCheckBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.Label initialFrequencyLabel;
+    protected System.Windows.Forms.TextBox initialFrequencyTextBox;
+    protected System.Windows.Forms.CheckBox enabledCheckBox;
+    protected System.Windows.Forms.Label minimumArityLabel;
+    protected System.Windows.Forms.Label maximumArityLabel;
+    protected System.Windows.Forms.TextBox minimumArityTextBox;
+    protected System.Windows.Forms.TextBox maximumArityTextBox;
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 16132)
@@ -0,0 +1,121 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.ComponentModel;
+using System.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbol View")]
+  [Content(typeof(ISymbol), true)]
+  public partial class SymbolView : NamedItemView {
+    public new ISymbol Content {
+      get { return (ISymbol)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public SymbolView() {
+      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();
+      initialFrequencyTextBox.Enabled = Content != null && !Locked;
+      initialFrequencyTextBox.ReadOnly = ReadOnly;
+      enabledCheckBox.Enabled = Content != null && !Locked && !ReadOnly;
+    }
+
+    #region content event handlers
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+    #endregion
+
+    #region control event handlers
+    private void initialFrequencyTextBox_KeyDown(object sender, KeyEventArgs e) {
+      if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return))
+        initialFrequencyLabel.Select();  // select label to validate data
+
+      if (e.KeyCode == Keys.Escape) {
+        initialFrequencyTextBox.Text = Content.InitialFrequency.ToString();
+        initialFrequencyLabel.Select();  // select label to validate data
+      }
+    }
+    private void initialFrequencyTextBox_Validating(object sender, CancelEventArgs e) {
+      double freq;
+      if (double.TryParse(initialFrequencyTextBox.Text, out freq) && freq >= 0.0) {
+        errorProvider.SetError(initialFrequencyTextBox, string.Empty);
+        e.Cancel = false;
+      } else {
+        errorProvider.SetError(initialFrequencyTextBox, "Invalid value");
+        e.Cancel = true;
+      }
+    }
+    private void initialFrequencyTextBox_Validated(object sender, EventArgs e) {
+      double freq;
+      if (double.TryParse(initialFrequencyTextBox.Text, out freq) && freq >= 0.0) {
+        Content.InitialFrequency = freq;
+      }
+    }
+
+    private void checkBoxEnabled_CheckedChanged(object sender, EventArgs e) {
+      if (Content != null)
+        Content.Enabled = enabledCheckBox.Checked;
+    }
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        initialFrequencyTextBox.Text = string.Empty;
+        minimumArityTextBox.Text = string.Empty;
+        maximumArityTextBox.Text = string.Empty;
+        enabledCheckBox.Checked = false;
+      } else {
+        initialFrequencyTextBox.Text = Content.InitialFrequency.ToString();
+        minimumArityTextBox.Text = Content.MinimumArity.ToString();
+        maximumArityTextBox.Text = Content.MaximumArity.ToString();
+        enabledCheckBox.Checked = Content.Enabled;
+      }
+      SetEnabledStateOfControls();
+    }
+    #endregion
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs	(revision 16132)
@@ -0,0 +1,101 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Views {
+  partial class SymbolicExpressionGrammarAllowedChildSymbolsControl {
+    /// <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.allowedChildSymbolsGroupBox = new System.Windows.Forms.GroupBox();
+      this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
+      this.allowedChildSymbolsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // allowedChildSymbolsGroupBox
+      // 
+      this.allowedChildSymbolsGroupBox.Controls.Add(this.symbolicExpressionTreeChart);
+      this.allowedChildSymbolsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.allowedChildSymbolsGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.allowedChildSymbolsGroupBox.Name = "allowedChildSymbolsGroupBox";
+      this.allowedChildSymbolsGroupBox.Size = new System.Drawing.Size(651, 405);
+      this.allowedChildSymbolsGroupBox.TabIndex = 2;
+      this.allowedChildSymbolsGroupBox.TabStop = false;
+      this.allowedChildSymbolsGroupBox.Text = "Allowed Child Symbols";
+      // 
+      // allowedChildSymbolsControl
+      // 
+      this.symbolicExpressionTreeChart.AllowDrop = true;
+      this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White;
+      this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black;
+      this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(3, 16);
+      this.symbolicExpressionTreeChart.Name = "allowedChildSymbolsControl";
+      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(645, 386);
+      this.symbolicExpressionTreeChart.SuspendRepaint = false;
+      this.symbolicExpressionTreeChart.TabIndex = 0;
+      this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
+      this.symbolicExpressionTreeChart.Tree = null;
+      this.symbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked += new System.Windows.Forms.MouseEventHandler(this.symbolicExpressionTreeChart_SymbolicExpressionTreeNodeClicked);
+      this.symbolicExpressionTreeChart.DragDrop += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragDrop);
+      this.symbolicExpressionTreeChart.DragEnter += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragEnter);
+      this.symbolicExpressionTreeChart.DragOver += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragOver);
+      this.symbolicExpressionTreeChart.Paint += new System.Windows.Forms.PaintEventHandler(this.allowedChildSymbolsControl_Paint);
+      this.symbolicExpressionTreeChart.KeyDown += new System.Windows.Forms.KeyEventHandler(this.symbolicExpressionTreeChart_KeyDown);
+      this.symbolicExpressionTreeChart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.allowedChildSymbolsControl_MouseDown);
+      // 
+      // SymbolicExpressionGrammarAllowedChildSymbolsControl
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.allowedChildSymbolsGroupBox);
+      this.Name = "SymbolicExpressionGrammarAllowedChildSymbolsControl";
+      this.Size = new System.Drawing.Size(651, 405);
+      this.allowedChildSymbolsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.GroupBox allowedChildSymbolsGroupBox;
+    private SymbolicExpressionTreeChart symbolicExpressionTreeChart;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs	(revision 16132)
@@ -0,0 +1,341 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.PluginInfrastructure;
+
+using VisualSymbolicExpressionTreeNode = HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.VisualTreeNode<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTreeNode>;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public sealed partial class SymbolicExpressionGrammarAllowedChildSymbolsControl : UserControl {
+    private ObservableList<ISymbolicExpressionTreeNode> selectedSymbolicExpressionTreeNodes;
+
+    public SymbolicExpressionGrammarAllowedChildSymbolsControl() {
+      InitializeComponent();
+      selectedSymbolicExpressionTreeNodes = new ObservableList<ISymbolicExpressionTreeNode>();
+    }
+
+    private ISymbolicExpressionGrammar grammar;
+    public ISymbolicExpressionGrammar Grammar {
+      get { return grammar; }
+      set {
+        if (grammar != value) {
+          if (grammar != null) DeregisterGrammarEvents();
+          grammar = value;
+          if (grammar != null) RegisterGrammarEvents();
+          OnGrammarChanged();
+        }
+      }
+    }
+
+    private ISymbol symbol;
+    public ISymbol Symbol {
+      get { return symbol; }
+      set {
+        if (symbol != value) {
+          if (value != null && grammar == null) throw new InvalidOperationException("grammar is null");
+          if (value != null && !grammar.ContainsSymbol(value)) throw new ArgumentException("grammar does not contain symbol.");
+          symbol = value;
+          OnSymbolChanged();
+        }
+      }
+    }
+
+    private void RegisterGrammarEvents() {
+      grammar.Changed += new EventHandler(Grammar_Changed);
+      grammar.ReadOnlyChanged += new EventHandler(Grammar_ReadOnlyChanged);
+    }
+    private void DeregisterGrammarEvents() {
+      grammar.Changed -= new EventHandler(Grammar_Changed);
+      grammar.ReadOnlyChanged -= new EventHandler(Grammar_ReadOnlyChanged);
+    }
+
+    private void Grammar_Changed(object sender, EventArgs e) {
+      if (Grammar == null) return;
+      if (Symbol == null) return;
+      if (Symbol != null && !Grammar.ContainsSymbol(Symbol)) Symbol = null;
+      else BuildAllowedChildSymbolsTree();
+    }
+
+    private void Grammar_ReadOnlyChanged(object sender, EventArgs e) {
+      if (InvokeRequired) Invoke((MethodInvoker)BuildAllowedChildSymbolsTree);
+      else BuildAllowedChildSymbolsTree();
+    }
+
+    private void OnGrammarChanged() {
+      if (Grammar == null) {
+        symbolicExpressionTreeChart.Tree = null;
+        Symbol = null;
+      }
+    }
+    private void OnSymbolChanged() {
+      if (Symbol == null) symbolicExpressionTreeChart.Tree = null;
+      else BuildAllowedChildSymbolsTree();
+    }
+
+    private void BuildAllowedChildSymbolsTree() {
+      if (Symbol == null) {
+        symbolicExpressionTreeChart.Tree = null;
+        return;
+      }
+
+      var tree = new SymbolicExpressionTree(new SymbolicExpressionTreeNode(Symbol));
+      if (Grammar.GetMaximumSubtreeCount(Symbol) > 0) {
+        for (int i = 0; i < Grammar.GetMaximumSubtreeCount(Symbol); i++) {
+          var node = new DummySymbol("Subtree " + i).CreateTreeNode();
+          var groupSymbols = grammar.GetAllowedChildSymbols(Symbol, i).OfType<GroupSymbol>().ToList();
+          foreach (var childSymbol in Grammar.GetAllowedChildSymbols(Symbol, i)) {
+            if (!groupSymbols.Any(g => g != childSymbol && g.Flatten().Contains(childSymbol)))
+              node.AddSubtree(new SymbolicExpressionTreeNode(childSymbol));
+          }
+          tree.Root.AddSubtree(node);
+        }
+      }
+      symbolicExpressionTreeChart.Tree = tree;
+      symbolicExpressionTreeChart.SuspendRepaint = true;
+      foreach (var subtreeNode in tree.Root.Subtrees) {
+        foreach (var allowedChildNode in subtreeNode.Subtrees) {
+          var visualLine = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(subtreeNode, allowedChildNode);
+          visualLine.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
+        }
+      }
+
+      for (int i = Grammar.GetMinimumSubtreeCount(symbol); i < Grammar.GetMaximumSubtreeCount(symbol); i++) {
+        var subtreeNode = tree.Root.GetSubtree(i);
+        var visualTreeNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(subtreeNode);
+        visualTreeNode.TextColor = Color.Gray;
+        visualTreeNode.LineColor = Color.LightGray;
+
+        var visualLine = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(tree.Root, subtreeNode);
+        visualLine.LineColor = Color.LightGray;
+
+        foreach (var allowedChildNode in subtreeNode.Subtrees) {
+          visualTreeNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(allowedChildNode);
+          visualTreeNode.TextColor = Color.Gray;
+          visualTreeNode.LineColor = Color.LightGray;
+
+          visualLine = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(subtreeNode, allowedChildNode);
+          visualLine.LineColor = Color.LightGray;
+        }
+      }
+      symbolicExpressionTreeChart.SuspendRepaint = false;
+      UpdateSelectedSymbolicExpressionTreeNodes();
+    }
+
+    private void UpdateSelectedSymbolicExpressionTreeNodes() {
+      foreach (var node in symbolicExpressionTreeChart.Tree.IterateNodesPrefix()) {
+        var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node);
+        if (!selectedSymbolicExpressionTreeNodes.Contains(node)) visualNode.FillColor = Color.White;
+        else visualNode.FillColor = Color.LightSteelBlue;
+      }
+      symbolicExpressionTreeChart.RepaintNodes();
+    }
+
+    private void symbolicExpressionTreeChart_SymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
+      if (Grammar.ReadOnly) return;
+      if ((Control.ModifierKeys & Keys.Control) == 0)
+        selectedSymbolicExpressionTreeNodes.Clear();
+
+      VisualSymbolicExpressionTreeNode clickedNode = (VisualSymbolicExpressionTreeNode)sender;
+      var selectedNode = clickedNode.Content;
+      if (selectedNode.SubtreeCount == 0) {
+        if (!selectedSymbolicExpressionTreeNodes.Contains(selectedNode))
+          selectedSymbolicExpressionTreeNodes.Add(selectedNode);
+        else
+          selectedSymbolicExpressionTreeNodes.Remove(selectedNode);
+      }
+
+      UpdateSelectedSymbolicExpressionTreeNodes();
+    }
+
+    private void symbolicExpressionTreeChart_KeyDown(object sender, KeyEventArgs e) {
+      if (Grammar.ReadOnly) return;
+      if (e.KeyCode == Keys.Delete) {
+        var root = symbolicExpressionTreeChart.Tree.Root;
+        Grammar.StartGrammarManipulation();
+        foreach (var node in selectedSymbolicExpressionTreeNodes) {
+          int argIndex = root.IndexOfSubtree(node.Parent);
+          Grammar.RemoveAllowedChildSymbol(root.Symbol, node.Symbol, argIndex);
+        }
+
+        selectedSymbolicExpressionTreeNodes.Clear();
+        Grammar.FinishedGrammarManipulation();
+      }
+    }
+
+    #region drag & drop operations
+    private bool validDragOperation;
+    private void symbolicExpressionTreeChart_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      if (Grammar.ReadOnly) return;
+
+      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      var symbol = data as ISymbol;
+      var symbols = data as IEnumerable<ISymbol>;
+      if (symbol != null && !(symbol is IReadOnlySymbol) && Grammar.ContainsSymbol(symbol)) validDragOperation = true;
+      else if (symbols != null && symbols.All(s => !(symbol is IReadOnlySymbol) && Grammar.ContainsSymbol(s))) validDragOperation = true;
+    }
+
+    private void symbolicExpressionTreeChart_DragOver(object sender, DragEventArgs e) {
+      e.Effect = DragDropEffects.None;
+      if (validDragOperation) {
+        Point coordinates = symbolicExpressionTreeChart.PointToClient(new Point(e.X, e.Y));
+        var visualNode = symbolicExpressionTreeChart.FindVisualSymbolicExpressionTreeNodeAt(coordinates.X, coordinates.Y);
+        if (visualNode != null) {
+          var node = visualNode.Content;
+          var root = symbolicExpressionTreeChart.Tree.Root;
+          if (node == root || node.Parent == root) e.Effect = DragDropEffects.Copy;
+        }
+      }
+    }
+
+    private void symbolicExpressionTreeChart_DragDrop(object sender, DragEventArgs e) {
+      Point coordinates = symbolicExpressionTreeChart.PointToClient(new Point(e.X, e.Y));
+      var node = symbolicExpressionTreeChart.FindVisualSymbolicExpressionTreeNodeAt(coordinates.X, coordinates.Y);
+      var root = symbolicExpressionTreeChart.Tree.Root;
+
+      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      var symbol = data as ISymbol;
+      var symbols = data as IEnumerable<ISymbol>;
+
+      if (node.Content == root) {
+        if (symbol != null)
+          Grammar.AddAllowedChildSymbol(root.Symbol, symbol);
+        else if (symbols != null)
+          foreach (var s in symbols) Grammar.AddAllowedChildSymbol(root.Symbol, s);
+      } else {
+        int argumentIndex = root.IndexOfSubtree(node.Content);
+        if (symbol != null)
+          Grammar.AddAllowedChildSymbol(root.Symbol, symbol, argumentIndex);
+        else if (symbols != null)
+          foreach (var s in symbols) Grammar.AddAllowedChildSymbol(root.Symbol, s, argumentIndex);
+      }
+      BuildAllowedChildSymbolsTree();
+    }
+    #endregion
+
+    #region draw and handle root node with buttons to manipulate the subtree count
+    private RectangleF increaseMinimumSubtreeCountRectangle;
+    private RectangleF decreaseMinimumSubtreeCountRectangle;
+    private RectangleF increaseMaximumSubtreeCountRectangle;
+    private RectangleF decreaseMaximumSubtreeCountRectangle;
+    private void allowedChildSymbolsControl_Paint(object sender, PaintEventArgs e) {
+      increaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+      decreaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+      increaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+      decreaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+
+      if (Grammar == null) return;
+      if (symbolicExpressionTreeChart.Tree == null) return;
+
+      var rootNode = symbolicExpressionTreeChart.Tree.Root;
+      var visualRootNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(rootNode);
+      var graphics = e.Graphics;
+
+      if (rootNode.Symbol is IReadOnlySymbol) return;
+      if (rootNode.Symbol.MinimumArity == rootNode.Symbol.MaximumArity) return;
+
+      using (Pen pen = new Pen(Color.Black)) {
+        using (Font font = new Font("Times New Roman", 8)) {
+          var stringFormat = new StringFormat();
+          stringFormat.Alignment = StringAlignment.Center;
+          stringFormat.LineAlignment = StringAlignment.Center;
+          int spacing = 5;
+          int size = (visualRootNode.Height - spacing * 3) / 2;
+
+          increaseMinimumSubtreeCountRectangle = new RectangleF(visualRootNode.X - spacing - size, visualRootNode.Y + spacing, size, size);
+          decreaseMinimumSubtreeCountRectangle = new RectangleF(visualRootNode.X - spacing - size, visualRootNode.Y + size + 2 * spacing, size, size);
+          increaseMaximumSubtreeCountRectangle = new RectangleF(visualRootNode.X + visualRootNode.Width + spacing, visualRootNode.Y + spacing, size, size);
+          decreaseMaximumSubtreeCountRectangle = new RectangleF(visualRootNode.X + visualRootNode.Width + spacing, visualRootNode.Y + size + 2 * spacing, size, size);
+
+          pen.Color = Grammar.ReadOnly || Grammar.GetMaximumSubtreeCount(rootNode.Symbol) == Grammar.GetMinimumSubtreeCount(rootNode.Symbol) ? Color.LightGray : Color.Black;
+          graphics.DrawString("+", font, pen.Brush, increaseMinimumSubtreeCountRectangle, stringFormat);
+          graphics.DrawRectangle(pen, Rectangle.Round(increaseMinimumSubtreeCountRectangle));
+          if (pen.Color == Color.LightGray) increaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+
+          pen.Color = Grammar.ReadOnly || Grammar.GetMinimumSubtreeCount(rootNode.Symbol) == rootNode.Symbol.MinimumArity ? Color.LightGray : Color.Black;
+          graphics.DrawString("-", font, pen.Brush, decreaseMinimumSubtreeCountRectangle, stringFormat);
+          graphics.DrawRectangle(pen, Rectangle.Round(decreaseMinimumSubtreeCountRectangle));
+          if (pen.Color == Color.LightGray) decreaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+
+          pen.Color = Grammar.ReadOnly || Grammar.GetMaximumSubtreeCount(rootNode.Symbol) == rootNode.Symbol.MaximumArity ? Color.LightGray : Color.Black;
+          graphics.DrawRectangle(pen, Rectangle.Round(increaseMaximumSubtreeCountRectangle));
+          graphics.DrawString("+", font, pen.Brush, increaseMaximumSubtreeCountRectangle, stringFormat);
+          if (pen.Color == Color.LightGray) increaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+
+          pen.Color = Grammar.ReadOnly || Grammar.GetMaximumSubtreeCount(rootNode.Symbol) == Grammar.GetMinimumSubtreeCount(rootNode.Symbol) ? Color.LightGray : Color.Black;
+          graphics.DrawRectangle(pen, Rectangle.Round(decreaseMaximumSubtreeCountRectangle));
+          graphics.DrawString("-", font, pen.Brush, decreaseMaximumSubtreeCountRectangle, stringFormat);
+          if (pen.Color == Color.LightGray) decreaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+        }
+      }
+    }
+
+    private void allowedChildSymbolsControl_MouseDown(object sender, MouseEventArgs e) {
+      if (Grammar == null || Grammar.ReadOnly) return;
+      if (symbolicExpressionTreeChart.Tree == null) return;
+
+      var pointF = new PointF(e.X, e.Y);
+      var rootSymbol = symbolicExpressionTreeChart.Tree.Root.Symbol;
+      int minimumSubtreeCount = Grammar.GetMinimumSubtreeCount(rootSymbol);
+      int maximumSubtreecount = Grammar.GetMaximumSubtreeCount(rootSymbol);
+
+      bool changed = true;
+      if (increaseMinimumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount + 1, maximumSubtreecount);
+      else if (decreaseMinimumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount - 1, maximumSubtreecount);
+      else if (increaseMaximumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount, maximumSubtreecount + 1);
+      else if (decreaseMaximumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount, maximumSubtreecount - 1);
+      else
+        changed = false;
+
+      if (changed) BuildAllowedChildSymbolsTree();
+    }
+    #endregion
+
+  }
+
+  [NonDiscoverableType]
+  internal class DummySymbol : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    public DummySymbol(DummySymbol original, Cloner cloner) : base(original, cloner) { }
+    public DummySymbol(string name) : base(name, "DummySymbol for views") { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new DummySymbol(this, cloner); }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs	(revision 16132)
@@ -0,0 +1,309 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Views {
+  partial class SymbolicExpressionGrammarEditorView {
+    /// <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.components = new System.ComponentModel.Container();
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SymbolicExpressionGrammarEditorView));
+      this.grpSymbols = new System.Windows.Forms.GroupBox();
+      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+      this.copyButton = new System.Windows.Forms.Button();
+      this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
+      this.removeButton = new System.Windows.Forms.Button();
+      this.addButton = new System.Windows.Forms.Button();
+      this.symbolsTreeView = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.CheckBoxTreeView();
+      this.imageList = new System.Windows.Forms.ImageList(this.components);
+      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+      this.allowedChildSymbolsControl = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionGrammarAllowedChildSymbolsControl();
+      this.symbolDetailsGroupBox = new System.Windows.Forms.GroupBox();
+      this.symbolDetailsViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.showSampleTreeButton = new System.Windows.Forms.Button();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.grpSymbols.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+      this.splitContainer1.Panel1.SuspendLayout();
+      this.splitContainer1.Panel2.SuspendLayout();
+      this.splitContainer1.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
+      this.splitContainer2.Panel1.SuspendLayout();
+      this.splitContainer2.Panel2.SuspendLayout();
+      this.splitContainer2.SuspendLayout();
+      this.symbolDetailsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Size = new System.Drawing.Size(686, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(750, 3);
+      // 
+      // grpSymbols
+      // 
+      this.grpSymbols.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.grpSymbols.Controls.Add(this.splitContainer1);
+      this.grpSymbols.Location = new System.Drawing.Point(0, 26);
+      this.grpSymbols.Name = "grpSymbols";
+      this.grpSymbols.Size = new System.Drawing.Size(769, 378);
+      this.grpSymbols.TabIndex = 3;
+      this.grpSymbols.TabStop = false;
+      this.grpSymbols.Text = "Symbols";
+      // 
+      // splitContainer1
+      // 
+      this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer1.Location = new System.Drawing.Point(3, 16);
+      this.splitContainer1.Name = "splitContainer1";
+      // 
+      // splitContainer1.Panel1
+      // 
+      this.splitContainer1.Panel1.Controls.Add(this.showSampleTreeButton);
+      this.splitContainer1.Panel1.Controls.Add(this.copyButton);
+      this.splitContainer1.Panel1.Controls.Add(this.showDetailsCheckBox);
+      this.splitContainer1.Panel1.Controls.Add(this.removeButton);
+      this.splitContainer1.Panel1.Controls.Add(this.addButton);
+      this.splitContainer1.Panel1.Controls.Add(this.symbolsTreeView);
+      // 
+      // splitContainer1.Panel2
+      // 
+      this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
+      this.splitContainer1.Size = new System.Drawing.Size(763, 359);
+      this.splitContainer1.SplitterDistance = 191;
+      this.splitContainer1.TabIndex = 0;
+      // 
+      // copyButton
+      // 
+      this.copyButton.Enabled = false;
+      this.copyButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Copy;
+      this.copyButton.Location = new System.Drawing.Point(33, 3);
+      this.copyButton.Name = "copyButton";
+      this.copyButton.Size = new System.Drawing.Size(24, 24);
+      this.copyButton.TabIndex = 8;
+      this.toolTip.SetToolTip(this.copyButton, "Copy Symbol");
+      this.copyButton.UseVisualStyleBackColor = true;
+      this.copyButton.Click += new System.EventHandler(this.copyButton_Click);
+      // 
+      // showDetailsCheckBox
+      // 
+      this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
+      this.showDetailsCheckBox.Checked = true;
+      this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
+      this.showDetailsCheckBox.Image = HeuristicLab.Common.Resources.VSImageLibrary.Properties;
+      this.showDetailsCheckBox.Location = new System.Drawing.Point(93, 3);
+      this.showDetailsCheckBox.Name = "showDetailsCheckBox";
+      this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
+      this.showDetailsCheckBox.TabIndex = 7;
+      this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
+      this.showDetailsCheckBox.UseVisualStyleBackColor = true;
+      this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged);
+      // 
+      // removeButton
+      // 
+      this.removeButton.Enabled = false;
+      this.removeButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Remove;
+      this.removeButton.Location = new System.Drawing.Point(63, 3);
+      this.removeButton.Name = "removeButton";
+      this.removeButton.Size = new System.Drawing.Size(24, 24);
+      this.removeButton.TabIndex = 6;
+      this.toolTip.SetToolTip(this.removeButton, "Remove Symbol");
+      this.removeButton.UseVisualStyleBackColor = true;
+      this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
+      // 
+      // addButton
+      // 
+      this.addButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Add;
+      this.addButton.Location = new System.Drawing.Point(3, 3);
+      this.addButton.Name = "addButton";
+      this.addButton.Size = new System.Drawing.Size(24, 24);
+      this.addButton.TabIndex = 5;
+      this.toolTip.SetToolTip(this.addButton, "Add Symbol");
+      this.addButton.UseVisualStyleBackColor = true;
+      this.addButton.Click += new System.EventHandler(this.addButton_Click);
+      // 
+      // symbolsTreeView
+      // 
+      this.symbolsTreeView.AllowDrop = true;
+      this.symbolsTreeView.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.symbolsTreeView.CheckBoxes = true;
+      this.symbolsTreeView.HideSelection = false;
+      this.symbolsTreeView.ImageIndex = 0;
+      this.symbolsTreeView.ImageList = this.imageList;
+      this.symbolsTreeView.Location = new System.Drawing.Point(3, 28);
+      this.symbolsTreeView.Name = "symbolsTreeView";
+      this.symbolsTreeView.SelectedImageIndex = 0;
+      this.symbolsTreeView.Size = new System.Drawing.Size(185, 299);
+      this.symbolsTreeView.TabIndex = 0;
+      this.symbolsTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.symbolsTreeView_AfterCheck);
+      this.symbolsTreeView.BeforeCheck += new System.Windows.Forms.TreeViewCancelEventHandler(symbolsTreeView_BeforeCheck);
+      this.symbolsTreeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.symbolsTreeView_ItemDrag);
+      this.symbolsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.symbolsTreeView_AfterSelect);
+      this.symbolsTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragDrop);
+      this.symbolsTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragEnter);
+      this.symbolsTreeView.DragOver += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragOver);
+      this.symbolsTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.symbolsTreeView_KeyDown);
+      this.symbolsTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.symbolsTreeView_MouseDown);
+      this.symbolsTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(symbolsTreeView_NodeMouseDoubleClick);
+      // 
+      // imageList
+      // 
+      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
+      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
+      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
+      // 
+      // splitContainer2
+      // 
+      this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer2.Location = new System.Drawing.Point(0, 0);
+      this.splitContainer2.Name = "splitContainer2";
+      this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
+      // 
+      // splitContainer2.Panel1
+      // 
+      this.splitContainer2.Panel1.Controls.Add(this.allowedChildSymbolsControl);
+      // 
+      // splitContainer2.Panel2
+      // 
+      this.splitContainer2.Panel2.Controls.Add(this.symbolDetailsGroupBox);
+      this.splitContainer2.Size = new System.Drawing.Size(568, 359);
+      this.splitContainer2.SplitterDistance = 165;
+      this.splitContainer2.TabIndex = 0;
+      // 
+      // allowedChildSymbolsControl
+      // 
+      this.allowedChildSymbolsControl.AllowDrop = true;
+      this.allowedChildSymbolsControl.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.allowedChildSymbolsControl.Grammar = null;
+      this.allowedChildSymbolsControl.Location = new System.Drawing.Point(0, 0);
+      this.allowedChildSymbolsControl.Name = "allowedChildSymbolsControl";
+      this.allowedChildSymbolsControl.Size = new System.Drawing.Size(568, 165);
+      this.allowedChildSymbolsControl.Symbol = null;
+      this.allowedChildSymbolsControl.TabIndex = 0;
+      // 
+      // symbolDetailsGroupBox
+      // 
+      this.symbolDetailsGroupBox.Controls.Add(this.symbolDetailsViewHost);
+      this.symbolDetailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolDetailsGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.symbolDetailsGroupBox.Name = "symbolDetailsGroupBox";
+      this.symbolDetailsGroupBox.Size = new System.Drawing.Size(568, 190);
+      this.symbolDetailsGroupBox.TabIndex = 1;
+      this.symbolDetailsGroupBox.TabStop = false;
+      this.symbolDetailsGroupBox.Text = "Symbol Details";
+      // 
+      // symbolDetailsViewHost
+      // 
+      this.symbolDetailsViewHost.Caption = "View";
+      this.symbolDetailsViewHost.Content = null;
+      this.symbolDetailsViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolDetailsViewHost.Enabled = false;
+      this.symbolDetailsViewHost.Location = new System.Drawing.Point(3, 16);
+      this.symbolDetailsViewHost.Name = "symbolDetailsViewHost";
+      this.symbolDetailsViewHost.ReadOnly = false;
+      this.symbolDetailsViewHost.Size = new System.Drawing.Size(562, 171);
+      this.symbolDetailsViewHost.TabIndex = 1;
+      this.symbolDetailsViewHost.ViewsLabelVisible = true;
+      this.symbolDetailsViewHost.ViewType = null;
+      // 
+      // showSampleTreeButton
+      // 
+      this.showSampleTreeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.showSampleTreeButton.Location = new System.Drawing.Point(3, 333);
+      this.showSampleTreeButton.Name = "showSampleTreeButton";
+      this.showSampleTreeButton.Size = new System.Drawing.Size(185, 23);
+      this.showSampleTreeButton.TabIndex = 9;
+      this.showSampleTreeButton.Text = "Show Sample Tree";
+      this.showSampleTreeButton.UseVisualStyleBackColor = true;
+      this.showSampleTreeButton.Click += new System.EventHandler(this.showSampleTreeButton_Click);
+      // 
+      // SymbolicExpressionGrammarEditorView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.grpSymbols);
+      this.Name = "SymbolicExpressionGrammarEditorView";
+      this.Size = new System.Drawing.Size(769, 404);
+      this.Controls.SetChildIndex(this.grpSymbols, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.grpSymbols.ResumeLayout(false);
+      this.splitContainer1.Panel1.ResumeLayout(false);
+      this.splitContainer1.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+      this.splitContainer1.ResumeLayout(false);
+      this.splitContainer2.Panel1.ResumeLayout(false);
+      this.splitContainer2.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
+      this.splitContainer2.ResumeLayout(false);
+      this.symbolDetailsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+    #endregion
+
+    private System.Windows.Forms.GroupBox grpSymbols;
+    private System.Windows.Forms.SplitContainer splitContainer1;
+    private CheckBoxTreeView symbolsTreeView;
+    private System.Windows.Forms.SplitContainer splitContainer2;
+    private System.Windows.Forms.ImageList imageList;
+    protected System.Windows.Forms.CheckBox showDetailsCheckBox;
+    protected System.Windows.Forms.Button removeButton;
+    protected System.Windows.Forms.Button addButton;
+    private System.Windows.Forms.GroupBox symbolDetailsGroupBox;
+    private MainForm.WindowsForms.ViewHost symbolDetailsViewHost;
+    protected System.Windows.Forms.Button copyButton;
+    private SymbolicExpressionGrammarAllowedChildSymbolsControl allowedChildSymbolsControl;
+    private System.Windows.Forms.Button showSampleTreeButton;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs	(revision 16132)
@@ -0,0 +1,452 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbolic Expression Grammar Editor")]
+  [Content(typeof(ISymbolicExpressionGrammar), true)]
+  public partial class SymbolicExpressionGrammarEditorView : NamedItemView {
+    public SymbolicExpressionGrammarEditorView() {
+      InitializeComponent();
+    }
+
+    public override bool ReadOnly {
+      get {
+        if ((Content != null) && Content.ReadOnly) return true;
+        return base.ReadOnly;
+      }
+      set {
+        if ((Content != null) && Content.ReadOnly) base.ReadOnly = true;
+        else base.ReadOnly = value;
+      }
+    }
+
+    public new ISymbolicExpressionGrammar Content {
+      get { return (ISymbolicExpressionGrammar)base.Content; }
+      set { base.Content = value; }
+    }
+
+    private Color treeViewBackColor = Color.Empty;
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      if (Content == null || Content.ReadOnly || ReadOnly || Locked) {
+        addButton.Enabled = false;
+        removeButton.Enabled = false;
+        copyButton.Enabled = false;
+        treeViewBackColor = symbolsTreeView.BackColor;
+        symbolsTreeView.BackColor = Color.FromArgb(255, 240, 240, 240);
+      } else {
+        addButton.Enabled = true;
+        if (symbolsTreeView.SelectedNode != null && !(symbolsTreeView.SelectedNode.Tag is IReadOnlySymbol)) {
+          removeButton.Enabled = true;
+          copyButton.Enabled = true;
+        }
+        treeViewBackColor = Color.Empty;
+        symbolsTreeView.BackColor = treeViewBackColor;
+      }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null) {
+        symbolsTreeView.Nodes.Clear();
+        UpdateSymbolsTreeView();
+
+        symbolsTreeView.CollapseAll();
+        foreach (var node in IterateTreeNodes())
+          if (node.Checked) node.Expand();
+
+        //mkommend: scrolls to the top node
+        symbolsTreeView.Nodes[0].EnsureVisible();
+
+        allowedChildSymbolsControl.Grammar = Content;
+        allowedChildSymbolsControl.Symbol = null;
+        symbolDetailsViewHost.Content = null;
+      } else {
+        symbolsTreeView.Nodes.Clear();
+        allowedChildSymbolsControl.Grammar = null;
+        symbolDetailsViewHost.Content = null;
+      }
+    }
+
+    #region events
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ReadOnlyChanged += new System.EventHandler(Content_ReadOnlyChanged);
+      Content.Changed += new System.EventHandler(Content_Changed);
+    }
+    protected override void DeregisterContentEvents() {
+      Content.ReadOnlyChanged -= new System.EventHandler(Content_ReadOnlyChanged);
+      Content.Changed -= new System.EventHandler(Content_Changed);
+      base.DeregisterContentEvents();
+    }
+
+    private void Content_ReadOnlyChanged(object sender, EventArgs e) {
+      ReadOnly = Content.ReadOnly;
+    }
+
+    private void Content_Changed(object sender, EventArgs e) {
+      ISymbol symbol = null;
+      if (symbolsTreeView.SelectedNode != null)
+        symbol = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+
+      allowedChildSymbolsControl.Grammar = Content;
+
+      UpdateSymbolsTreeView();
+      if (symbol != null && Content.ContainsSymbol(symbol)) {
+        symbolsTreeView.SelectedNode = IterateTreeNodes().Where(n => n.Tag == symbol).ToList().FirstOrDefault();
+        UpdateSymbolDetailsViews();
+      }
+    }
+    #endregion
+
+    private void UpdateSymbolsTreeView() {
+      var symbols = Content.Symbols.ToList();
+      foreach (var treeNode in IterateTreeNodes().ToList()) {
+        var symbol = treeNode.Tag as ISymbol;
+        if (!symbols.Contains(symbol))
+          treeNode.Remove();
+      }
+
+      var groupSymbols = symbols.OfType<GroupSymbol>().ToList();
+      var topLevelSymbols = Content.Symbols.Where(s => !groupSymbols.Any(g => g.Symbols.Contains(s)));
+      UpdateChildTreeNodes(symbolsTreeView.Nodes, topLevelSymbols);
+      RebuildImageList();
+    }
+
+    private void UpdateChildTreeNodes(TreeNodeCollection collection, IEnumerable<ISymbol> symbols) {
+      foreach (ISymbol symbol in symbols) {
+        if (symbol is ProgramRootSymbol) continue;
+        if (symbol is Defun) continue;
+
+        TreeNode node = collection.Cast<TreeNode>().Where(n => n.Tag == symbol).FirstOrDefault();
+        if (node == null) {
+          node = new TreeNode();
+          node.Tag = symbol;
+          collection.Add(node);
+        }
+        node.Checked = symbol.Enabled;
+        node.Text = symbol.Name;
+
+        var groupSymbol = symbol as GroupSymbol;
+        if (groupSymbol != null) UpdateChildTreeNodes(node.Nodes, groupSymbol.Symbols);
+      }
+    }
+
+    private void symbolsTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
+      if (e.Action != TreeViewAction.Unknown) UpdateSymbolDetailsViews();
+      SetEnabledStateOfControls();
+    }
+
+    private void symbolsTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e) {
+      if (e.Action == TreeViewAction.Unknown) return;
+      e.Cancel = Content == null || Content.ReadOnly || ReadOnly || Locked;
+    }
+
+    private void symbolsTreeView_AfterCheck(object sender, TreeViewEventArgs e) {
+      if (e.Action == TreeViewAction.Unknown) return;
+      Content.StartGrammarManipulation();
+      allowedChildSymbolsControl.Symbol = null;
+      var symbol = (ISymbol)e.Node.Tag;
+      symbol.Enabled = e.Node.Checked;
+      foreach (var node in IterateTreeNodes())
+        node.Checked = ((ISymbol)node.Tag).Enabled;
+
+      Content.FinishedGrammarManipulation();
+    }
+
+    #region drag & drop operations
+    private void symbolsTreeView_ItemDrag(object sender, ItemDragEventArgs e) {
+      if (!Locked) {
+        var treeNode = e.Item as TreeNode;
+        var data = new DataObject();
+        data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, treeNode.Tag);
+        validDragOperation = true;
+        DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Move);
+      }
+    }
+
+
+    private bool validDragOperation;
+    private void symbolsTreeView_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      if (Content == null || Content.ReadOnly || ReadOnly || Locked) return;
+
+      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      var symbol = data as ISymbol;
+      if (symbol != null && !(symbol is IReadOnlySymbol)) validDragOperation = true;
+    }
+    private void symbolsTreeView_DragOver(object sender, DragEventArgs e) {
+      e.Effect = DragDropEffects.None;
+      if (validDragOperation) {
+        GroupSymbol groupSymbol = null;
+        Point mouse = symbolsTreeView.PointToClient(new Point(e.X, e.Y));
+        TreeNode node = symbolsTreeView.GetNodeAt(mouse);
+        if (node == null) return;
+        groupSymbol = node.Tag as GroupSymbol;
+        if (groupSymbol == null) return;
+        var symbol = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+        if (symbol == groupSymbol) return;
+
+        if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
+      }
+    }
+    private void symbolsTreeView_DragDrop(object sender, DragEventArgs e) {
+      var symbol = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ISymbol;
+
+      GroupSymbol groupSymbol = null;
+      Point mouse = symbolsTreeView.PointToClient(new Point(e.X, e.Y));
+      TreeNode node = symbolsTreeView.GetNodeAt(mouse);
+      if (node != null) groupSymbol = node.Tag as GroupSymbol;
+      if (node != null && groupSymbol == null) groupSymbol = node.Parent.Tag as GroupSymbol;
+
+      Content.StartGrammarManipulation();
+      Cloner cloner = new Cloner();
+      var clonedSymbol = cloner.Clone(symbol);
+      ChangeDuplicateSymbolNames(clonedSymbol);
+
+      if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(clonedSymbol);
+      else Content.AddSymbol(clonedSymbol);
+
+      UpdateGrammerConstraintsForClonedSymbol(symbol, cloner);
+      Content.FinishedGrammarManipulation();
+    }
+    #endregion
+
+    private void symbolsTreeView_MouseDown(object sender, MouseEventArgs e) {
+      // enables deselection of treeNodes
+      Point coordinates = new Point(e.X, e.Y);
+      TreeNode node = symbolsTreeView.GetNodeAt(coordinates);
+      if (e.Button == MouseButtons.Left && node == null) {
+        symbolsTreeView.SelectedNode = null;
+        symbolDetailsViewHost.Content = null;
+        SetEnabledStateOfControls();
+      }
+    }
+
+    private void symbolsTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) {
+      var symbol = e.Node.Tag as ISymbol;
+      if (symbol == null) return;
+      if (e.Button != MouseButtons.Left) return;
+      if (e.X < e.Node.Bounds.Left - symbolsTreeView.ImageList.Images[e.Node.ImageIndex].Width || e.X > e.Node.Bounds.Right) return;
+      MainFormManager.MainForm.ShowContent(symbol);
+      e.Node.Toggle();
+    }
+
+    private void symbolsTreeView_KeyDown(object sender, KeyEventArgs e) {
+      if (Content == null || Content.ReadOnly || ReadOnly || Locked) return;
+      if (symbolsTreeView.SelectedNode == null) return;
+      if (e.KeyCode != Keys.Delete) return;
+
+      var symbol = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+      if (!(symbol is IReadOnlySymbol))
+        Content.RemoveSymbol(symbol);
+
+      SetEnabledStateOfControls();
+      UpdateSymbolDetailsViews();
+      RebuildImageList();
+    }
+
+    #region button events
+    private TypeSelectorDialog typeSelectorDialog;
+    private void addButton_Click(object sender, EventArgs e) {
+      if (typeSelectorDialog == null) {
+        typeSelectorDialog = new TypeSelectorDialog();
+        typeSelectorDialog.Caption = "Select Symbol";
+        typeSelectorDialog.TypeSelector.Caption = "Available Symbols";
+        typeSelectorDialog.TypeSelector.Configure(typeof(ISymbol), false, false, (t) => { return !typeof(IReadOnlySymbol).IsAssignableFrom(t); });
+      }
+      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
+        try {
+          ISymbol symbol = (ISymbol)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
+          ChangeDuplicateSymbolNames(symbol);
+          GroupSymbol groupSymbol = null;
+
+          TreeNode selectedNode = symbolsTreeView.SelectedNode;
+          if (selectedNode != null) {
+            groupSymbol = selectedNode.Tag as GroupSymbol;
+            if (groupSymbol == null && selectedNode.Parent != null) groupSymbol = selectedNode.Parent.Tag as GroupSymbol;
+          }
+          if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(symbol);
+          else Content.AddSymbol(symbol);
+        }
+        catch (Exception ex) {
+          ErrorHandling.ShowErrorDialog(this, ex);
+        }
+      }
+    }
+
+    private void copyButton_Click(object sender, EventArgs e) {
+      var symbol = symbolsTreeView.SelectedNode.Tag as ISymbol;
+      if (symbol != null && !(symbol is IReadOnlySymbol)) {
+
+        Content.StartGrammarManipulation();
+        Cloner cloner = new Cloner();
+        var clonedSymbol = cloner.Clone(symbol);
+        ChangeDuplicateSymbolNames(clonedSymbol);
+
+        GroupSymbol groupSymbol = null;
+        if (symbolsTreeView.SelectedNode.Parent != null) groupSymbol = symbolsTreeView.SelectedNode.Parent.Tag as GroupSymbol;
+
+        if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(clonedSymbol);
+        else Content.AddSymbol(clonedSymbol);
+
+        UpdateGrammerConstraintsForClonedSymbol(symbol, cloner);
+        Content.FinishedGrammarManipulation();
+      }
+    }
+
+    private void removeButton_Click(object sender, EventArgs e) {
+      var symbol = symbolsTreeView.SelectedNode.Tag as ISymbol;
+      if (symbol != null && !(symbol is IReadOnlySymbol)) {
+        Content.RemoveSymbol(symbol);
+      }
+    }
+
+    private void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
+      splitContainer1.Panel2Collapsed = !showDetailsCheckBox.Checked;
+    }
+
+    private void showSampleTreeButton_Click(object sender, EventArgs e) {
+      SymbolicExpressionGrammarSampleExpressionTreeView view = new SymbolicExpressionGrammarSampleExpressionTreeView();
+      view.Content = Content;
+      view.Show();
+    }
+
+    #endregion
+
+    #region helpers
+    private void UpdateGrammerConstraintsForClonedSymbol(ISymbol symbol, Cloner cloner) {
+      foreach (var s in symbol.Flatten().Where(x => !(x is GroupSymbol))) {
+        if (!cloner.ClonedObjectRegistered(s)) throw new InvalidOperationException();
+        var clone = cloner.Clone(s);
+        Content.SetSubtreeCount(clone, Content.GetMinimumSubtreeCount(s), Content.GetMaximumSubtreeCount(s));
+        foreach (var childSymbol in Content.GetAllowedChildSymbols(s)) {
+          var newChildSymbol = childSymbol;
+          if (cloner.ClonedObjectRegistered(childSymbol)) newChildSymbol = cloner.Clone(childSymbol);
+          Content.AddAllowedChildSymbol(clone, newChildSymbol);
+        }
+        for (int i = 0; i < Content.GetMaximumSubtreeCount(s); i++) {
+          foreach (var childSymbol in Content.GetAllowedChildSymbols(s, i)) {
+            var newChildSymbol = childSymbol;
+            if (cloner.ClonedObjectRegistered(childSymbol)) newChildSymbol = cloner.Clone(childSymbol);
+            Content.AddAllowedChildSymbol(clone, newChildSymbol, i);
+          }
+        }
+      }
+    }
+
+    private void ChangeDuplicateSymbolNames(ISymbol symbol) {
+      foreach (var s in symbol.Flatten()) {
+        var originalSymbolName = s.Name;
+        int i = 1;
+        while (Content.ContainsSymbol(s)) {
+          s.Name = originalSymbolName + i;
+          i++;
+        }
+      }
+    }
+
+    private void UpdateSymbolDetailsViews() {
+      if (symbolsTreeView.SelectedNode != null) {
+        symbolDetailsViewHost.Content = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+        allowedChildSymbolsControl.Symbol = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+      } else {
+        symbolDetailsViewHost.Content = null;
+        allowedChildSymbolsControl.Symbol = null;
+      }
+    }
+
+    private IEnumerable<TreeNode> IterateTreeNodes(TreeNode node = null) {
+      TreeNodeCollection nodes;
+      if (node == null)
+        nodes = symbolsTreeView.Nodes;
+      else {
+        nodes = node.Nodes;
+        yield return node;
+      }
+
+      foreach (var childNode in nodes.OfType<TreeNode>())
+        foreach (var n in IterateTreeNodes(childNode))
+          yield return n;
+    }
+
+    protected virtual void RebuildImageList() {
+      symbolsTreeView.ImageList.Images.Clear();
+      foreach (TreeNode treeNode in IterateTreeNodes()) {
+        var symbol = (ISymbol)treeNode.Tag;
+        symbolsTreeView.ImageList.Images.Add(symbol == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : symbol.ItemImage);
+        treeNode.ImageIndex = symbolsTreeView.ImageList.Images.Count - 1;
+      }
+    }
+
+    //necessary code to handle dock correctly regarding the expanded nodes
+    bool[] expandendedState;
+    protected override void OnHandleCreated(EventArgs e) {
+      base.OnHandleCreated(e);
+      if (expandendedState == null) return;
+      var nodes = IterateTreeNodes().ToList();
+      for (int i = 0; i < nodes.Count; i++)
+        if (expandendedState[i]) nodes[i].Expand();
+    }
+    protected override void OnHandleDestroyed(EventArgs e) {
+      base.OnHandleDestroyed(e);
+      var nodes = IterateTreeNodes().ToList();
+      expandendedState = new bool[nodes.Count];
+      for (int i = 0; i < nodes.Count; i++)
+        expandendedState[i] = nodes[i].IsExpanded;
+    }
+    #endregion
+  }
+
+  //this class is necessary to prevent double clicks which do not fire the checkbox checked event
+  //workaround taken from http://connect.microsoft.com/VisualStudio/feedback/details/374516/treeview-control-does-not-fire-events-reliably-when-double-clicking-on-checkbox
+  internal class CheckBoxTreeView : TreeView {
+    protected override void WndProc(ref Message m) {
+      // Suppress WM_LBUTTONDBLCLK
+      if (m.Msg == 0x203 && IsOnCheckBox(m)) { m.Result = IntPtr.Zero; } else base.WndProc(ref m);
+    }
+
+    private int GetXLParam(IntPtr lParam) {
+      return lParam.ToInt32() & 0xffff;
+    }
+
+    private int GetYLParam(IntPtr lParam) {
+      return lParam.ToInt32() >> 16;
+    }
+
+    private bool IsOnCheckBox(Message m) {
+      int x = GetXLParam(m.LParam);
+      int y = GetYLParam(m.LParam);
+      TreeNode node = this.GetNodeAt(x, y);
+      return ((x <= node.Bounds.Left - 20) && (x >= node.Bounds.Left - 32));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs	(revision 16132)
@@ -0,0 +1,215 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Views {
+  partial class SymbolicExpressionGrammarSampleExpressionTreeView {
+    /// <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.sampleTreeGroupBox = new System.Windows.Forms.GroupBox();
+      this.sampleTreeView = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.GraphicalSymbolicExpressionTreeView();
+      this.maxTreeLengthLabel = new System.Windows.Forms.Label();
+      this.maxTreeDepthLabel = new System.Windows.Forms.Label();
+      this.maxTreeLengthTextBox = new System.Windows.Forms.TextBox();
+      this.maxTreeDepthTextBox = new System.Windows.Forms.TextBox();
+      this.generateSampleTreeButton = new System.Windows.Forms.Button();
+      this.treeCreatorComboBox = new System.Windows.Forms.ComboBox();
+      this.treeCreatorLabel = new System.Windows.Forms.Label();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.sampleTreeGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Location = new System.Drawing.Point(93, 0);
+      this.nameTextBox.Size = new System.Drawing.Size(319, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(418, 3);
+      // 
+      // sampleTreeGroupBox
+      // 
+      this.sampleTreeGroupBox.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.sampleTreeGroupBox.Controls.Add(this.sampleTreeView);
+      this.sampleTreeGroupBox.Location = new System.Drawing.Point(3, 134);
+      this.sampleTreeGroupBox.Name = "sampleTreeGroupBox";
+      this.sampleTreeGroupBox.Size = new System.Drawing.Size(431, 265);
+      this.sampleTreeGroupBox.TabIndex = 3;
+      this.sampleTreeGroupBox.TabStop = false;
+      this.sampleTreeGroupBox.Text = "Sample SymbolicExpressionTree";
+      // 
+      // sampleTreeView
+      // 
+      this.sampleTreeView.AllowDrop = true;
+      this.sampleTreeView.Caption = "Graphical SymbolicExpressionTree View";
+      this.sampleTreeView.Content = null;
+      this.sampleTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.sampleTreeView.Location = new System.Drawing.Point(3, 16);
+      this.sampleTreeView.Name = "sampleTreeView";
+      this.sampleTreeView.ReadOnly = false;
+      this.sampleTreeView.Size = new System.Drawing.Size(425, 246);
+      this.sampleTreeView.TabIndex = 0;
+      // 
+      // maxTreeLengthLabel
+      // 
+      this.maxTreeLengthLabel.AutoSize = true;
+      this.maxTreeLengthLabel.Location = new System.Drawing.Point(3, 29);
+      this.maxTreeLengthLabel.Name = "maxTreeLengthLabel";
+      this.maxTreeLengthLabel.Size = new System.Drawing.Size(88, 13);
+      this.maxTreeLengthLabel.TabIndex = 4;
+      this.maxTreeLengthLabel.Text = "Max TreeLength:";
+      // 
+      // maxTreeDepthLabel
+      // 
+      this.maxTreeDepthLabel.AutoSize = true;
+      this.maxTreeDepthLabel.Location = new System.Drawing.Point(3, 55);
+      this.maxTreeDepthLabel.Name = "maxTreeDepthLabel";
+      this.maxTreeDepthLabel.Size = new System.Drawing.Size(84, 13);
+      this.maxTreeDepthLabel.TabIndex = 5;
+      this.maxTreeDepthLabel.Text = "Max TreeDepth:";
+      // 
+      // maxTreeLengthTextBox
+      // 
+      this.maxTreeLengthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.maxTreeLengthTextBox.Location = new System.Drawing.Point(93, 26);
+      this.maxTreeLengthTextBox.Name = "maxTreeLengthTextBox";
+      this.maxTreeLengthTextBox.Size = new System.Drawing.Size(341, 20);
+      this.maxTreeLengthTextBox.TabIndex = 6;
+      this.maxTreeLengthTextBox.Text = "50";
+      this.maxTreeLengthTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxTreeLengthTextBox_Validating);
+      this.maxTreeLengthTextBox.Validated += new System.EventHandler(this.maxTreeLengthTextBox_Validated);
+      // 
+      // maxTreeDepthTextBox
+      // 
+      this.maxTreeDepthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.maxTreeDepthTextBox.Location = new System.Drawing.Point(93, 52);
+      this.maxTreeDepthTextBox.Name = "maxTreeDepthTextBox";
+      this.maxTreeDepthTextBox.Size = new System.Drawing.Size(341, 20);
+      this.maxTreeDepthTextBox.TabIndex = 7;
+      this.maxTreeDepthTextBox.Text = "10";
+      this.maxTreeDepthTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxTreeDepthTextBox_Validating);
+      this.maxTreeDepthTextBox.Validated += new System.EventHandler(this.maxTreeDepthTextBox_Validated);
+      // 
+      // generateSampleTreeButton
+      // 
+      this.generateSampleTreeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.generateSampleTreeButton.Location = new System.Drawing.Point(6, 105);
+      this.generateSampleTreeButton.Name = "generateSampleTreeButton";
+      this.generateSampleTreeButton.Size = new System.Drawing.Size(431, 23);
+      this.generateSampleTreeButton.TabIndex = 8;
+      this.generateSampleTreeButton.Text = "Generate SymbolicExpressionTree";
+      this.generateSampleTreeButton.UseVisualStyleBackColor = true;
+      this.generateSampleTreeButton.Click += new System.EventHandler(this.generateSampleTreeButton_Click);
+      // 
+      // treeCreatorComboBox
+      // 
+      this.treeCreatorComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.treeCreatorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.treeCreatorComboBox.FormattingEnabled = true;
+      this.treeCreatorComboBox.Location = new System.Drawing.Point(93, 78);
+      this.treeCreatorComboBox.Name = "treeCreatorComboBox";
+      this.treeCreatorComboBox.Size = new System.Drawing.Size(341, 21);
+      this.treeCreatorComboBox.TabIndex = 9;
+      this.treeCreatorComboBox.SelectedIndexChanged += new System.EventHandler(this.treeCreatorComboBox_SelectedIndexChanged);
+      // 
+      // treeCreatorLabel
+      // 
+      this.treeCreatorLabel.AutoSize = true;
+      this.treeCreatorLabel.Location = new System.Drawing.Point(3, 81);
+      this.treeCreatorLabel.Name = "treeCreatorLabel";
+      this.treeCreatorLabel.Size = new System.Drawing.Size(69, 13);
+      this.treeCreatorLabel.TabIndex = 10;
+      this.treeCreatorLabel.Text = "Tree Creator:";
+      // 
+      // SymbolicExpressionGrammarSampleExpressionTreeView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.treeCreatorLabel);
+      this.Controls.Add(this.sampleTreeGroupBox);
+      this.Controls.Add(this.maxTreeDepthLabel);
+      this.Controls.Add(this.maxTreeLengthTextBox);
+      this.Controls.Add(this.treeCreatorComboBox);
+      this.Controls.Add(this.maxTreeLengthLabel);
+      this.Controls.Add(this.maxTreeDepthTextBox);
+      this.Controls.Add(this.generateSampleTreeButton);
+      this.Name = "SymbolicExpressionGrammarSampleExpressionTreeView";
+      this.Size = new System.Drawing.Size(437, 402);
+      this.Controls.SetChildIndex(this.generateSampleTreeButton, 0);
+      this.Controls.SetChildIndex(this.maxTreeDepthTextBox, 0);
+      this.Controls.SetChildIndex(this.maxTreeLengthLabel, 0);
+      this.Controls.SetChildIndex(this.treeCreatorComboBox, 0);
+      this.Controls.SetChildIndex(this.maxTreeLengthTextBox, 0);
+      this.Controls.SetChildIndex(this.maxTreeDepthLabel, 0);
+      this.Controls.SetChildIndex(this.sampleTreeGroupBox, 0);
+      this.Controls.SetChildIndex(this.treeCreatorLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.sampleTreeGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.GroupBox sampleTreeGroupBox;
+    private System.Windows.Forms.Label maxTreeLengthLabel;
+    private System.Windows.Forms.Label maxTreeDepthLabel;
+    private System.Windows.Forms.TextBox maxTreeLengthTextBox;
+    private System.Windows.Forms.TextBox maxTreeDepthTextBox;
+    private System.Windows.Forms.Button generateSampleTreeButton;
+    private GraphicalSymbolicExpressionTreeView sampleTreeView;
+    private System.Windows.Forms.ComboBox treeCreatorComboBox;
+    private System.Windows.Forms.Label treeCreatorLabel;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs	(revision 16132)
@@ -0,0 +1,158 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.ComponentModel;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbolic Expression Grammar Sample Tree")]
+  public partial class SymbolicExpressionGrammarSampleExpressionTreeView : NamedItemView {
+    private IRandom random;
+    public SymbolicExpressionGrammarSampleExpressionTreeView() {
+      InitializeComponent();
+      random = new MersenneTwister();
+      maxSampleTreeLength = int.Parse(maxTreeLengthTextBox.Text);
+      maxSampleTreeDepth = int.Parse(maxTreeDepthTextBox.Text);
+      foreach (var treeCreator in ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeCreator>()) {
+        treeCreatorComboBox.Items.Add(treeCreator);
+      }
+      treeCreatorComboBox.SelectedItem = treeCreatorComboBox.Items.OfType<ProbabilisticTreeCreator>().First();
+    }
+
+    private int maxSampleTreeLength;
+    public int MaxSampleTreeLength {
+      get { return maxSampleTreeLength; }
+      set {
+        if (maxSampleTreeLength != value) {
+          maxSampleTreeLength = value;
+          UpdateSampleTreeView();
+        }
+      }
+    }
+
+    private int maxSampleTreeDepth;
+    public int MaxSampleTreeDepth {
+      get { return maxSampleTreeDepth; }
+      set {
+        if (maxSampleTreeDepth != value) {
+          maxSampleTreeDepth = value;
+          UpdateSampleTreeView();
+        }
+      }
+    }
+
+    public new ISymbolicExpressionGrammar Content {
+      get { return (ISymbolicExpressionGrammar)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      maxTreeLengthTextBox.Enabled = Content != null;
+      maxTreeDepthTextBox.Enabled = Content != null;
+      generateSampleTreeButton.Enabled = Content != null;
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+
+    protected override void DeregisterContentEvents() {
+      Content.Changed -= new EventHandler(Content_Changed);
+      base.DeregisterContentEvents();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) sampleTreeView.Content = null;
+      else UpdateSampleTreeView();
+    }
+
+    private void Content_Changed(object sender, System.EventArgs e) {
+      UpdateSampleTreeView();
+    }
+
+    private void UpdateSampleTreeView() {
+      try {
+        ISymbolicExpressionTreeCreator creator = (ISymbolicExpressionTreeCreator)treeCreatorComboBox.SelectedItem;
+        ISymbolicExpressionTree tree = creator.CreateTree(random, Content, MaxSampleTreeLength, MaxSampleTreeDepth);
+        foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>())
+          node.SetGrammar(null);
+        sampleTreeView.Content = tree;
+      }
+      catch (Exception ex) {
+        sampleTreeView.Content = null;
+        ErrorHandling.ShowErrorDialog(ex);
+      }
+    }
+
+    #region control events
+    private void generateSampleTreeButton_Click(object sender, EventArgs e) {
+      UpdateSampleTreeView();
+    }
+
+    private void maxTreeLengthTextBox_Validating(object sender, CancelEventArgs e) {
+      int maxTreeLength;
+      if (int.TryParse(maxTreeLengthTextBox.Text, out maxTreeLength) && maxTreeLength > 3) {
+        errorProvider.SetError(maxTreeLengthTextBox, string.Empty);
+        e.Cancel = false;
+      } else {
+        errorProvider.SetError(maxTreeLengthTextBox, "Invalid value: maximum tree length must be larger than 3.");
+        e.Cancel = true;
+      }
+    }
+    private void maxTreeLengthTextBox_Validated(object sender, EventArgs e) {
+      int maxTreeLength;
+      if (int.TryParse(maxTreeLengthTextBox.Text, out maxTreeLength) && maxTreeLength > 3) {
+        MaxSampleTreeLength = maxTreeLength;
+      }
+    }
+
+    private void maxTreeDepthTextBox_Validating(object sender, CancelEventArgs e) {
+      int maxTreeDepth;
+      if (int.TryParse(maxTreeDepthTextBox.Text, out maxTreeDepth) && maxTreeDepth > 3) {
+        errorProvider.SetError(maxTreeDepthTextBox, string.Empty);
+        e.Cancel = false;
+      } else {
+        errorProvider.SetError(maxTreeDepthTextBox, "Invalid value: maximum tree depth must be larger than 3.");
+        e.Cancel = true;
+      }
+    }
+    private void maxTreeDepthTextBox_Validated(object sender, EventArgs e) {
+      int maxTreeDepth;
+      if (int.TryParse(maxTreeDepthTextBox.Text, out maxTreeDepth) && maxTreeDepth > 3) {
+        MaxSampleTreeDepth = maxTreeDepth;
+      }
+    }
+    #endregion
+
+    private void treeCreatorComboBox_SelectedIndexChanged(object sender, EventArgs e) {
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.Designer.cs	(revision 16132)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Views {
+  partial class SymbolicExpressionGrammarView {
+    /// <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.checkedItemListView = new HeuristicLab.Core.Views.CheckedItemListView<ISymbol>();
+      this.SuspendLayout();
+      this.checkedItemListView.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.checkedItemListView.Location = new System.Drawing.Point(0, 52);
+      this.checkedItemListView.Name = "itemListView";
+      this.checkedItemListView.Size = new System.Drawing.Size(351, 190);
+      this.checkedItemListView.TabIndex = 0;
+      //                                        
+      // DefaultSymbolicExpressionGrammarView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.checkedItemListView);
+      this.Name = "DefaultSymbolicExpressionGrammarView";
+      this.Size = new System.Drawing.Size(351, 245);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    protected HeuristicLab.Core.Views.CheckedItemListView<ISymbol> checkedItemListView;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs	(revision 16132)
@@ -0,0 +1,118 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbolic Expression Grammar View")]
+  [Content(typeof(ISymbolicExpressionGrammar), false)]
+  public partial class SymbolicExpressionGrammarView : NamedItemView {
+    private CheckedItemList<ISymbol> symbols;
+
+    public new ISymbolicExpressionGrammar Content {
+      get { return (ISymbolicExpressionGrammar)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public override bool ReadOnly {
+      get {
+        if ((Content != null) && Content.ReadOnly) return true;
+        return base.ReadOnly;
+      }
+      set {
+        if ((Content != null) && Content.ReadOnly) base.ReadOnly = true;
+        else base.ReadOnly = value;
+      }
+    }
+
+    public SymbolicExpressionGrammarView() {
+      InitializeComponent();
+      symbols = new CheckedItemList<ISymbol>();
+      symbols.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<ISymbol>>(symbols_CheckedItemsChanged);
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateControl();
+    }
+
+    private void Content_ReadOnlyChanged(object sender, EventArgs e) {
+      ReadOnly = Content.ReadOnly;
+    }
+
+    #region content event handlers
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        ClearSymbols();
+        checkedItemListView.Content = symbols.AsReadOnly();
+      } else {
+        ClearSymbols();
+        foreach (ISymbol symbol in Content.Symbols) {
+          if (!(symbol is IReadOnlySymbol)) {
+            symbol.Changed += new EventHandler(symbol_Changed);
+            symbols.Add(symbol, symbol.Enabled);
+          }
+        }
+        checkedItemListView.Content = symbols.AsReadOnly();
+      }
+      SetEnabledStateOfControls();
+    }
+
+
+    private void symbol_Changed(object sender, EventArgs e) {
+      ISymbol symbol = (ISymbol)sender;
+      symbols.SetItemCheckedState(symbol, symbol.Enabled);
+    }
+
+    private void symbols_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbol>> e) {
+      ICheckedItemList<ISymbol> checkedItemList = (ICheckedItemList<ISymbol>)sender;
+      foreach (var indexedItem in e.Items)
+        indexedItem.Value.Enabled = checkedItemList.ItemChecked(indexedItem.Value);
+    }
+    private void ClearSymbols() {
+      foreach (Symbol s in symbols)
+        s.Changed -= new EventHandler(symbol_Changed);
+      symbols.Clear();
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs	(revision 16132)
@@ -0,0 +1,136 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Views {
+  public partial class SymbolicExpressionTreeChart {
+    /// <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.components = new System.ComponentModel.Container();
+      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+      this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
+      this.saveImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.exportPgfLaTeXToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.layoutEngineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.reingoldTilfordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.boxesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
+      this.contextMenuStrip.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // contextMenuStrip
+      // 
+      this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.saveImageToolStripMenuItem,
+            this.exportPgfLaTeXToolStripMenuItem,
+            this.layoutEngineToolStripMenuItem});
+      this.contextMenuStrip.Name = "contextMenuStrip";
+      this.contextMenuStrip.Size = new System.Drawing.Size(166, 70);
+      // 
+      // saveImageToolStripMenuItem
+      // 
+      this.saveImageToolStripMenuItem.Name = "saveImageToolStripMenuItem";
+      this.saveImageToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+      this.saveImageToolStripMenuItem.Text = "Save Image";
+      this.saveImageToolStripMenuItem.Click += new System.EventHandler(this.saveImageToolStripMenuItem_Click);
+      // 
+      // exportPgfLaTeXToolStripMenuItem
+      // 
+      this.exportPgfLaTeXToolStripMenuItem.Name = "exportPgfLaTeXToolStripMenuItem";
+      this.exportPgfLaTeXToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+      this.exportPgfLaTeXToolStripMenuItem.Text = "Export Pgf/LaTeX";
+      this.exportPgfLaTeXToolStripMenuItem.Click += new System.EventHandler(this.exportLatexToolStripMenuItem_Click);
+      // 
+      // layoutEngineToolStripMenuItem
+      // 
+      this.layoutEngineToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.reingoldTilfordToolStripMenuItem,
+            this.boxesToolStripMenuItem});
+      this.layoutEngineToolStripMenuItem.Name = "layoutEngineToolStripMenuItem";
+      this.layoutEngineToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+      this.layoutEngineToolStripMenuItem.Text = "Layout Engine:";
+      // 
+      // reingoldTilfordToolStripMenuItem
+      // 
+      this.reingoldTilfordToolStripMenuItem.Name = "reingoldTilfordToolStripMenuItem";
+      this.reingoldTilfordToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
+      this.reingoldTilfordToolStripMenuItem.Text = "Reingold-Tilford";
+      this.reingoldTilfordToolStripMenuItem.Click += new System.EventHandler(this.reingoldTilfordToolStripMenuItem_Click);
+      // 
+      // boxesToolStripMenuItem
+      // 
+      this.boxesToolStripMenuItem.Name = "boxesToolStripMenuItem";
+      this.boxesToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
+      this.boxesToolStripMenuItem.Text = "Boxes";
+      this.boxesToolStripMenuItem.Click += new System.EventHandler(this.boxesToolStripMenuItem_Click);
+      // 
+      // saveFileDialog
+      // 
+      this.saveFileDialog.Filter = "Bitmap (*.bmp)|*.bmp|EMF (*.emf)|*.emf";
+      // 
+      // SymbolicExpressionTreeChart
+      // 
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.ContextMenuStrip = this.contextMenuStrip;
+      this.DoubleBuffered = true;
+      this.Name = "SymbolicExpressionTreeChart";
+      this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseClick);
+      this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseDoubleClick);
+      this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseDown);
+      this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseMove);
+      this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseUp);
+      this.contextMenuStrip.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.ToolTip toolTip;
+    protected System.Windows.Forms.ContextMenuStrip contextMenuStrip;
+    protected System.Windows.Forms.ToolStripMenuItem saveImageToolStripMenuItem;
+    protected System.Windows.Forms.SaveFileDialog saveFileDialog;
+    private System.Windows.Forms.ToolStripMenuItem exportPgfLaTeXToolStripMenuItem;
+    private System.Windows.Forms.ToolStripMenuItem layoutEngineToolStripMenuItem;
+    private System.Windows.Forms.ToolStripMenuItem reingoldTilfordToolStripMenuItem;
+    private System.Windows.Forms.ToolStripMenuItem boxesToolStripMenuItem;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 16132)
@@ -0,0 +1,496 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Drawing.Imaging;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public partial class SymbolicExpressionTreeChart : UserControl {
+    private Image image;
+    private readonly StringFormat stringFormat;
+    private Dictionary<ISymbolicExpressionTreeNode, VisualTreeNode<ISymbolicExpressionTreeNode>> visualTreeNodes;
+    private Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualTreeNodeConnection> visualLines;
+    private ILayoutEngine<ISymbolicExpressionTreeNode> layoutEngine;
+
+    public SymbolicExpressionTreeChart() {
+      InitializeComponent();
+      this.image = new Bitmap(Width, Height);
+      this.stringFormat = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center };
+      this.lineColor = Color.Black;
+      this.backgroundColor = Color.White;
+      this.textFont = new Font(FontFamily.GenericSansSerif, 8);
+
+      visualTreeNodes = new Dictionary<ISymbolicExpressionTreeNode, VisualTreeNode<ISymbolicExpressionTreeNode>>();
+      visualLines = new Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualTreeNodeConnection>();
+
+      layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(n => n.Subtrees) {
+        NodeWidth = PreferredNodeWidth,
+        NodeHeight = PreferredNodeHeight,
+        HorizontalSpacing = MinimumHorizontalDistance,
+        VerticalSpacing = MinimumVerticalDistance
+      };
+      reingoldTilfordToolStripMenuItem.Checked = true;
+    }
+
+    public SymbolicExpressionTreeChart(ISymbolicExpressionTree tree)
+      : this() {
+      this.Tree = tree;
+    }
+
+    #region Public properties
+    private int preferredNodeWidth = 70;
+    public int PreferredNodeWidth {
+      get { return preferredNodeWidth; }
+      set {
+        preferredNodeWidth = value;
+        Repaint();
+      }
+    }
+
+    private int preferredNodeHeight = 46;
+    public int PreferredNodeHeight {
+      get { return preferredNodeHeight; }
+      set {
+        preferredNodeHeight = value;
+        Repaint();
+      }
+    }
+
+    private int minHorizontalDistance = 30;
+    public int MinimumHorizontalDistance {
+      get { return minHorizontalDistance; }
+      set {
+        minHorizontalDistance = value;
+        Repaint();
+      }
+    }
+
+    private int minVerticalDistance = 30;
+    public int MinimumVerticalDistance {
+      get { return minVerticalDistance; }
+      set {
+        minVerticalDistance = value;
+        Repaint();
+      }
+    }
+
+    private int minHorizontalPadding = 20;
+    public int MinimumHorizontalPadding {
+      get { return minHorizontalPadding; }
+      set {
+        minHorizontalPadding = value;
+        Repaint();
+      }
+    }
+
+    private int minVerticalPadding = 20;
+    public int MinimumVerticalPadding {
+      get { return minVerticalPadding; }
+      set {
+        minVerticalPadding = value;
+        Repaint();
+      }
+    }
+
+    private Color lineColor;
+    public Color LineColor {
+      get { return this.lineColor; }
+      set {
+        this.lineColor = value;
+        this.Repaint();
+      }
+    }
+
+    private Color backgroundColor;
+    public Color BackgroundColor {
+      get { return this.backgroundColor; }
+      set {
+        this.backgroundColor = value;
+        this.Repaint();
+      }
+    }
+
+    private Font textFont;
+    public Font TextFont {
+      get { return this.textFont; }
+      set {
+        this.textFont = value;
+        this.Repaint();
+      }
+    }
+
+    private ISymbolicExpressionTree tree;
+    public ISymbolicExpressionTree Tree {
+      get { return this.tree; }
+      set {
+        tree = value;
+        Repaint();
+      }
+    }
+
+    private bool suspendRepaint;
+    public bool SuspendRepaint {
+      get { return suspendRepaint; }
+      set { suspendRepaint = value; }
+    }
+    #endregion
+
+    protected override void OnPaint(PaintEventArgs e) {
+      e.Graphics.DrawImage(image, 0, 0);
+      base.OnPaint(e);
+    }
+    protected override void OnResize(EventArgs e) {
+      base.OnResize(e);
+      if (this.Width <= 1 || this.Height <= 1)
+        this.image = new Bitmap(1, 1);
+      else {
+        this.image = new Bitmap(Width, Height);
+      }
+      this.Repaint();
+    }
+
+    public event EventHandler Repainted;//expose this event to notify the parent control that the tree was repainted
+    protected virtual void OnRepaint(object sender, EventArgs e) {
+      var repainted = Repainted;
+      if (repainted != null) {
+        repainted(sender, e);
+      }
+    }
+
+    public void Repaint() {
+      if (!suspendRepaint) {
+        this.GenerateImage();
+        this.Refresh();
+        OnRepaint(this, EventArgs.Empty);
+      }
+    }
+
+    public void RepaintNodes() {
+      if (!suspendRepaint) {
+        using (var graphics = Graphics.FromImage(image)) {
+          graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
+          graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+          foreach (var visualNode in visualTreeNodes.Values) {
+            DrawTreeNode(graphics, visualNode);
+            if (visualNode.Content.SubtreeCount > 0) {
+              foreach (var visualSubtree in visualNode.Content.Subtrees.Select(s => visualTreeNodes[s])) {
+                DrawLine(graphics, visualNode, visualSubtree);
+              }
+            }
+          }
+        }
+        this.Refresh();
+      }
+    }
+
+    public void RepaintNode(VisualTreeNode<ISymbolicExpressionTreeNode> visualNode) {
+      if (!suspendRepaint) {
+        using (var graphics = Graphics.FromImage(image)) {
+          graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
+          graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+          DrawTreeNode(graphics, visualNode);
+        }
+        this.Refresh();
+      }
+    }
+
+    private void GenerateImage() {
+      using (Graphics graphics = Graphics.FromImage(image)) {
+        graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
+        graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+        graphics.Clear(backgroundColor);
+        if (tree != null) {
+          DrawFunctionTree(graphics, PreferredNodeWidth, PreferredNodeHeight, MinimumHorizontalDistance, MinimumVerticalDistance);
+        }
+      }
+    }
+
+    public VisualTreeNode<ISymbolicExpressionTreeNode> GetVisualSymbolicExpressionTreeNode(ISymbolicExpressionTreeNode symbolicExpressionTreeNode) {
+      if (visualTreeNodes.ContainsKey(symbolicExpressionTreeNode))
+        return visualTreeNodes[symbolicExpressionTreeNode];
+      return null;
+    }
+
+    public VisualTreeNodeConnection GetVisualSymbolicExpressionTreeNodeConnection(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTreeNode child) {
+      if (child.Parent != parent) throw new ArgumentException();
+      var key = Tuple.Create(parent, child);
+      VisualTreeNodeConnection connection = null;
+      visualLines.TryGetValue(key, out connection);
+      return connection;
+    }
+
+    #region events
+    public event MouseEventHandler SymbolicExpressionTreeNodeClicked;
+    protected virtual void OnSymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
+      var clicked = SymbolicExpressionTreeNodeClicked;
+      if (clicked != null)
+        clicked(sender, e);
+    }
+
+    protected virtual void SymbolicExpressionTreeChart_MouseClick(object sender, MouseEventArgs e) {
+      var visualTreeNode = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
+      if (visualTreeNode != null) {
+        OnSymbolicExpressionTreeNodeClicked(visualTreeNode, e);
+      }
+    }
+
+    public event MouseEventHandler SymbolicExpressionTreeNodeDoubleClicked;
+    protected virtual void OnSymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) {
+      var doubleClicked = SymbolicExpressionTreeNodeDoubleClicked;
+      if (doubleClicked != null)
+        doubleClicked(sender, e);
+    }
+
+    protected virtual void SymbolicExpressionTreeChart_MouseDoubleClick(object sender, MouseEventArgs e) {
+      VisualTreeNode<ISymbolicExpressionTreeNode> visualTreeNode = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
+      if (visualTreeNode != null)
+        OnSymbolicExpressionTreeNodeDoubleClicked(visualTreeNode, e);
+    }
+
+    public event ItemDragEventHandler SymbolicExpressionTreeNodeDrag;
+    protected virtual void OnSymbolicExpressionTreeNodeDragDrag(object sender, ItemDragEventArgs e) {
+      var dragged = SymbolicExpressionTreeNodeDrag;
+      if (dragged != null)
+        dragged(sender, e);
+    }
+
+    private VisualTreeNode<ISymbolicExpressionTreeNode> draggedSymbolicExpressionTree;
+    private MouseButtons dragButtons;
+    private void SymbolicExpressionTreeChart_MouseDown(object sender, MouseEventArgs e) {
+      this.dragButtons = e.Button;
+      this.draggedSymbolicExpressionTree = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
+    }
+    private void SymbolicExpressionTreeChart_MouseUp(object sender, MouseEventArgs e) {
+      this.draggedSymbolicExpressionTree = null;
+      this.dragButtons = MouseButtons.None;
+    }
+
+    private void SymbolicExpressionTreeChart_MouseMove(object sender, MouseEventArgs e) {
+      VisualTreeNode<ISymbolicExpressionTreeNode> visualTreeNode = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
+      if (draggedSymbolicExpressionTree != null &&
+        draggedSymbolicExpressionTree != visualTreeNode) {
+        OnSymbolicExpressionTreeNodeDragDrag(draggedSymbolicExpressionTree, new ItemDragEventArgs(dragButtons, draggedSymbolicExpressionTree));
+        draggedSymbolicExpressionTree = null;
+      } else if (draggedSymbolicExpressionTree == null &&
+        visualTreeNode != null) {
+        string tooltipText = visualTreeNode.ToolTip;
+        if (this.toolTip.GetToolTip(this) != tooltipText)
+          this.toolTip.SetToolTip(this, tooltipText);
+
+      } else if (visualTreeNode == null)
+        this.toolTip.SetToolTip(this, "");
+    }
+
+    public VisualTreeNode<ISymbolicExpressionTreeNode> FindVisualSymbolicExpressionTreeNodeAt(int x, int y) {
+      foreach (var visualTreeNode in visualTreeNodes.Values) {
+        if (x >= visualTreeNode.X && x <= visualTreeNode.X + visualTreeNode.Width &&
+            y >= visualTreeNode.Y && y <= visualTreeNode.Y + visualTreeNode.Height)
+          return visualTreeNode;
+      }
+      return null;
+    }
+    #endregion
+
+    private void CalculateLayout(int preferredWidth, int preferredHeight, int minHDistance, int minVDistance) {
+      layoutEngine.NodeWidth = preferredWidth;
+      layoutEngine.NodeHeight = preferredHeight;
+      layoutEngine.HorizontalSpacing = minHDistance;
+      layoutEngine.VerticalSpacing = minVDistance;
+
+      var actualRoot = tree.Root;
+      if (actualRoot.Symbol is ProgramRootSymbol && actualRoot.SubtreeCount == 1) {
+        actualRoot = tree.Root.GetSubtree(0);
+      }
+      var visualNodes = layoutEngine.CalculateLayout(actualRoot, Width - MinimumHorizontalPadding, Height - MinimumVerticalPadding).ToList();
+      // add the padding
+      foreach (var vn in visualNodes) {
+        vn.X += MinimumHorizontalPadding / 2;
+        vn.Y += MinimumVerticalPadding / 2;
+      }
+
+      visualTreeNodes = visualNodes.ToDictionary(x => x.Content, x => x);
+      visualLines = new Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualTreeNodeConnection>();
+      foreach (var node in visualNodes.Select(n => n.Content)) {
+        foreach (var subtree in node.Subtrees) {
+          visualLines.Add(new Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(node, subtree), new VisualTreeNodeConnection());
+        }
+      }
+    }
+
+    #region methods for painting the symbolic expression tree
+    private void DrawFunctionTree(Graphics graphics, int preferredWidth, int preferredHeight, int minHDistance, int minVDistance, bool recalculateLayout = true) {
+      if (recalculateLayout)
+        CalculateLayout(preferredWidth, preferredHeight, minHDistance, minVDistance);
+
+      var visualNodes = visualTreeNodes.Values;
+      //draw nodes and connections
+      foreach (var visualNode in visualNodes) {
+        DrawTreeNode(graphics, visualNode);
+        var node = visualNode.Content;
+        foreach (var subtree in node.Subtrees) {
+          var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node, subtree);
+          var visualSubtree = visualTreeNodes[subtree];
+          var origin = new Point(visualNode.X + visualNode.Width / 2, visualNode.Y + visualNode.Height);
+          var target = new Point(visualSubtree.X + visualSubtree.Width / 2, visualSubtree.Y);
+          graphics.Clip = new Region(new Rectangle(Math.Min(origin.X, target.X), origin.Y, Math.Max(origin.X, target.X), target.Y));
+          using (var linePen = new Pen(visualLine.LineColor)) {
+            linePen.DashStyle = visualLine.DashStyle;
+            graphics.DrawLine(linePen, origin, target);
+          }
+        }
+      }
+    }
+
+    private Action<Brush, int, int, int, int> fill;
+    private Action<Pen, int, int, int, int> draw;
+    protected void DrawTreeNode(Graphics graphics, VisualTreeNode<ISymbolicExpressionTreeNode> visualTreeNode) {
+      graphics.Clip = new Region(new Rectangle(visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width + 1, visualTreeNode.Height + 1));
+      graphics.Clear(backgroundColor);
+      var node = visualTreeNode.Content;
+      using (var textBrush = new SolidBrush(visualTreeNode.TextColor))
+      using (var nodeLinePen = new Pen(visualTreeNode.LineColor))
+      using (var nodeFillBrush = new SolidBrush(visualTreeNode.FillColor)) {
+        var x = visualTreeNode.X;
+        var y = visualTreeNode.Y;
+        var w = visualTreeNode.Width - 1;  // allow 1px for the drawing of the line
+        var h = visualTreeNode.Height - 1; // allow 1px for the drawing of the line
+        // draw leaf nodes as rectangles and internal nodes as ellipses
+        if (node.SubtreeCount > 0) {
+          fill = graphics.FillEllipse; draw = graphics.DrawEllipse;
+        } else {
+          fill = graphics.FillRectangle; draw = graphics.DrawRectangle;
+        }
+        fill(nodeFillBrush, x, y, w, h);
+        draw(nodeLinePen, x, y, w, h);
+        //draw name of symbol
+        graphics.DrawString(node.ToString(), textFont, textBrush, new RectangleF(x, y, w, h), stringFormat);
+      }
+    }
+
+    protected void DrawLine(Graphics graphics, VisualTreeNode<ISymbolicExpressionTreeNode> startNode, VisualTreeNode<ISymbolicExpressionTreeNode> endNode) {
+      var origin = new Point(startNode.X + startNode.Width / 2, startNode.Y + startNode.Height);
+      var target = new Point(endNode.X + endNode.Width / 2, endNode.Y);
+      graphics.Clip = new Region(new Rectangle(Math.Min(origin.X, target.X), origin.Y, Math.Max(origin.X, target.X), target.Y));
+      var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(startNode.Content, endNode.Content);
+      using (var linePen = new Pen(visualLine.LineColor)) {
+        linePen.DashStyle = visualLine.DashStyle;
+        graphics.DrawLine(linePen, origin, target);
+      }
+    }
+    #endregion
+    #region save image
+    private void saveImageToolStripMenuItem_Click(object sender, EventArgs e) {
+      if (saveFileDialog.ShowDialog() == DialogResult.OK) {
+        string filename = saveFileDialog.FileName.ToLower();
+        if (filename.EndsWith("bmp")) SaveImageAsBitmap(filename);
+        else if (filename.EndsWith("emf")) SaveImageAsEmf(filename);
+        else SaveImageAsBitmap(filename);
+      }
+    }
+
+    public void SaveImageAsBitmap(string filename) {
+      if (tree == null) return;
+      Image bitmap = new Bitmap(Width, Height);
+      using (var g = Graphics.FromImage(bitmap)) {
+        DrawFunctionTree(g, PreferredNodeWidth, PreferredNodeHeight, MinimumHorizontalDistance, MinimumVerticalDistance, false);
+      }
+      bitmap.Save(filename);
+    }
+
+    public void SaveImageAsEmf(string filename) {
+      if (tree == null) return;
+      using (Graphics g = CreateGraphics()) {
+        using (Metafile file = new Metafile(filename, g.GetHdc())) {
+          using (Graphics emfFile = Graphics.FromImage(file)) {
+            DrawFunctionTree(emfFile, PreferredNodeWidth, PreferredNodeHeight, MinimumHorizontalDistance, MinimumVerticalDistance, false);
+          }
+        }
+        g.ReleaseHdc();
+      }
+    }
+    #endregion
+    #region export pgf/tikz
+    private void exportLatexToolStripMenuItem_Click(object sender, EventArgs e) {
+      var t = Tree;
+      if (t == null) return;
+      using (var dialog = new SaveFileDialog { Filter = "Tex (*.tex)|*.tex" }) {
+        if (dialog.ShowDialog() != DialogResult.OK) return;
+        string filename = dialog.FileName.ToLower();
+        var formatter = new SymbolicExpressionTreeLatexFormatter();
+        File.WriteAllText(filename, formatter.Format(t));
+      }
+    }
+    #endregion
+
+    private void reingoldTilfordToolStripMenuItem_Click(object sender, EventArgs e) {
+      layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(n => n.Subtrees) {
+        NodeWidth = PreferredNodeWidth,
+        NodeHeight = PreferredNodeHeight,
+        HorizontalSpacing = MinimumHorizontalDistance,
+        VerticalSpacing = MinimumVerticalDistance
+      };
+      reingoldTilfordToolStripMenuItem.Checked = true;
+      boxesToolStripMenuItem.Checked = false;
+      Repaint();
+    }
+
+    private void boxesToolStripMenuItem_Click(object sender, EventArgs e) {
+      layoutEngine = new BoxesLayoutEngine<ISymbolicExpressionTreeNode>(n => n.Subtrees, n => n.GetLength(), n => n.GetDepth()) {
+        NodeWidth = PreferredNodeWidth,
+        NodeHeight = PreferredNodeHeight,
+        HorizontalSpacing = MinimumHorizontalDistance,
+        VerticalSpacing = MinimumVerticalDistance
+      };
+      reingoldTilfordToolStripMenuItem.Checked = false;
+      boxesToolStripMenuItem.Checked = true;
+      Repaint();
+    }
+
+    private static string ShortLabel(ISymbolicExpressionTreeNode node) {
+      var name = node.ToString();
+
+      if (node.SubtreeCount > 0) {
+        switch (name) {
+          case "Addition":
+            return "Add";
+          case "Subtraction":
+            return "Sub";
+          case "Multiplication":
+            return "Mul";
+          case "Division":
+            return "Div";
+          case "Exponential":
+            return "Exp";
+          case "Logarithm":
+            return "Log";
+        }
+      }
+
+      return name;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.Designer.cs	(revision 16132)
@@ -0,0 +1,108 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Views {
+  partial class SymbolicExpressionView {
+    /// <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.formattersComboBox = new System.Windows.Forms.ComboBox();
+      this.formatterLabel = new System.Windows.Forms.Label();
+      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.BackColor = System.Drawing.Color.White;
+      this.textBox.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+      this.textBox.Location = new System.Drawing.Point(3, 30);
+      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(475, 282);
+      this.textBox.TabIndex = 0;
+      // 
+      // formattersComboBox
+      // 
+      this.formattersComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.formattersComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.formattersComboBox.FormattingEnabled = true;
+      this.formattersComboBox.Location = new System.Drawing.Point(72, 3);
+      this.formattersComboBox.Name = "formattersComboBox";
+      this.formattersComboBox.Size = new System.Drawing.Size(406, 21);
+      this.formattersComboBox.TabIndex = 1;
+      this.formattersComboBox.SelectedIndexChanged += new System.EventHandler(this.formattersComboBox_SelectedIndexChanged);
+      // 
+      // formatterLabel
+      // 
+      this.formatterLabel.AutoSize = true;
+      this.formatterLabel.Location = new System.Drawing.Point(3, 6);
+      this.formatterLabel.Name = "formatterLabel";
+      this.formatterLabel.Size = new System.Drawing.Size(54, 13);
+      this.formatterLabel.TabIndex = 2;
+      this.formatterLabel.Text = "Formatter:";
+      // 
+      // SymbolicExpressionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.formatterLabel);
+      this.Controls.Add(this.formattersComboBox);
+      this.Controls.Add(this.textBox);
+      this.Name = "SymbolicExpressionView";
+      this.Size = new System.Drawing.Size(481, 315);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.TextBox textBox;
+    private System.Windows.Forms.ComboBox formattersComboBox;
+    private System.Windows.Forms.Label formatterLabel;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.cs	(revision 16132)
@@ -0,0 +1,82 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("SymbolicExpression View")]
+  [Content(typeof(ISymbolicExpressionTree), false)]
+  public partial class SymbolicExpressionView : AsynchronousContentView {
+    private readonly List<ISymbolicExpressionTreeStringFormatter> treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>();
+
+    public new ISymbolicExpressionTree Content {
+      get { return (ISymbolicExpressionTree)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public SymbolicExpressionView() {
+      InitializeComponent();
+      IEnumerable<ISymbolicExpressionTreeStringFormatter> formatters = ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeStringFormatter>();
+      treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>();
+      foreach (ISymbolicExpressionTreeStringFormatter formatter in formatters) {
+        treeFormattersList.Add(formatter);
+        formattersComboBox.Items.Add(formatter.Name);
+      }
+      if (formattersComboBox.Items.Count > 0)
+        formattersComboBox.SelectedIndex = treeFormattersList.FindIndex(0, treeFormattersList.Count, (f) => f.Name.Contains("Default"));
+      else
+        formattersComboBox.SelectedIndex = -1;
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateTextbox();
+    }
+
+    private void UpdateTextbox() {
+      if (Content == null || formattersComboBox.SelectedIndex < 0)
+        textBox.Text = string.Empty;
+      else {
+        try {
+          textBox.Text = treeFormattersList[formattersComboBox.SelectedIndex].Format(Content);
+        }
+        catch (ArgumentException) { textBox.Text = "Cannot format the symbolic expression tree with the selected formatter."; }
+        catch (NotSupportedException) { textBox.Text = "Formatting of the symbolic expression tree is not supported by the selected formatter."; }
+      }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      textBox.Enabled = Content != null;
+      textBox.ReadOnly = ReadOnly;
+    }
+
+    private void formattersComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
+      UpdateTextbox();
+    }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualTreeNode.cs	(revision 16132)
@@ -0,0 +1,129 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Drawing;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public class VisualTreeNode<T> where T : class {
+    private static readonly Color defaultLineColor = Color.Black;
+    private static readonly Color defaultTextColor = Color.Black;
+    private static readonly Color defaultFillColor = Color.White;
+    private const int defaultPreferredWidth = 70;
+    private const int defaultPreferredHeight = 46;
+
+    public VisualTreeNode(T content) :
+      this(content, defaultLineColor) {
+    }
+
+    public VisualTreeNode(T content, Color lineColor) :
+      this(content, lineColor, defaultTextColor) {
+    }
+
+    public VisualTreeNode(T content, Color lineColor, Color textColor) :
+      this(content, lineColor, textColor, defaultFillColor) {
+    }
+
+    public VisualTreeNode(T content, Color lineColor, Color textColor, Color fillColor) :
+      this(content, lineColor, textColor, fillColor, defaultPreferredWidth, defaultPreferredHeight) {
+    }
+
+    public VisualTreeNode(T content, Color lineColor, Color textColor, Color fillColor, int width, int height) {
+      this.content = content;
+      this.lineColor = lineColor;
+      this.textColor = textColor;
+      this.fillColor = fillColor;
+      this.preferredWidth = width;
+      this.preferredHeight = height;
+      this.ToolTip = content.ToString();
+    }
+
+    #region members for internal use only
+    private int x;
+    public int X {
+      get { return x; }
+      internal set { this.x = value; }
+    }
+
+    private int y;
+    public int Y {
+      get { return y; }
+      internal set { this.y = value; }
+    }
+
+    private int width;
+    public int Width {
+      get { return this.width; }
+      internal set { this.width = value; }
+    }
+
+    private int height;
+    public int Height {
+      get { return this.height; }
+      internal set { this.height = value; }
+    }
+    #endregion
+
+    private T content;
+    public T Content {
+      get { return this.content; }
+      set {
+        content = value;
+        ToolTip = Content.ToString();
+      }
+    }
+
+    private int preferredWidth;
+    public int PreferredWidth {
+      get { return this.preferredWidth; }
+      set { this.preferredWidth = value; }
+    }
+
+    private int preferredHeight;
+    public int PreferredHeight {
+      get { return this.preferredHeight; }
+      set { this.preferredHeight = value; }
+    }
+
+    private Color lineColor;
+    public Color LineColor {
+      get { return this.lineColor; }
+      set { this.lineColor = value; }
+    }
+
+    private Color textColor;
+    public Color TextColor {
+      get { return this.textColor; }
+      set { this.textColor = value; }
+    }
+
+    private Color fillColor;
+    public Color FillColor {
+      get { return this.fillColor; }
+      set { this.fillColor = value; }
+    }
+
+    private string toolTip;
+    public string ToolTip {
+      get { return toolTip; }
+      set { toolTip = value; }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualTreeNodeConnection.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualTreeNodeConnection.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualTreeNodeConnection.cs	(revision 16132)
@@ -0,0 +1,48 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Drawing;
+using System.Drawing.Drawing2D;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public class VisualTreeNodeConnection {
+    private static readonly Color defaultLineColor = Color.Black;
+    private static readonly DashStyle defaultDashStyle = DashStyle.Solid;
+
+    private Color lineColor;
+    public Color LineColor {
+      get { return lineColor; }
+      set { lineColor = value; }
+    }
+
+    private DashStyle dashStyle;
+    public DashStyle DashStyle {
+      get { return dashStyle; }
+      set { dashStyle = value; }
+    }
+
+    public VisualTreeNodeConnection()
+      : base() {
+      lineColor = defaultLineColor;
+      dashStyle = defaultDashStyle;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/BestSymbolicExpressionTreeAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/BestSymbolicExpressionTreeAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/BestSymbolicExpressionTreeAnalyzer.cs	(revision 16132)
@@ -0,0 +1,132 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <summary>
+  /// An operator that tracks the best symbolic expression trees
+  /// </summary>
+  [Item("BestSymbolicExpressionTreeAnalyzer", "An operator that tracks the best symbolic expression trees")]
+  [StorableClass]
+  [NonDiscoverableType]
+  public sealed class BestSymbolicExpressionTreeAnalyzer : SingleSuccessorOperator, ISymbolicExpressionTreeAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ResultsParameterName = "Results";
+    private const string QualityParameterName = "Quality";
+    private const string BestTreeQualityParameterName = "BestTreeQuality";
+    private const string MaximizationParameterName = "Maximization";
+
+    #region Parameter properties
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    public ILookupParameter<BoolValue> MaximizationParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[MaximizationParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> BestTreeQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[BestTreeQualityParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public bool EnabledByDefault {
+      get { return true; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private BestSymbolicExpressionTreeAnalyzer(bool deserializing) : base(deserializing) { }
+    private BestSymbolicExpressionTreeAnalyzer(BestSymbolicExpressionTreeAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BestSymbolicExpressionTreeAnalyzer(this, cloner);
+    }
+    public BestSymbolicExpressionTreeAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees from which the best should be determined."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The quality value of a tree."));
+      Parameters.Add(new LookupParameter<BoolValue>(MaximizationParameterName, "The order relation for qualities of trees."));
+      Parameters.Add(new LookupParameter<DoubleValue>(BestTreeQualityParameterName, "The quality of the best tree so far."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The results collection where the best symbolic expression tree should be stored."));
+
+      SymbolicExpressionTreeParameter.Hidden = true;
+      QualityParameter.Hidden = true;
+      MaximizationParameter.Hidden = true;
+      ResultsParameter.Hidden = true;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+    }
+
+    public override IOperation Apply() {
+      var qualities = QualityParameter.ActualValue;
+      var trees = SymbolicExpressionTreeParameter.ActualValue;
+      bool maximization = MaximizationParameter.ActualValue.Value;
+      int bestIdx = 0;
+      double bestQuality = qualities[bestIdx].Value;
+      if (maximization) {
+        for (int i = 1; i < qualities.Length; i++)
+          if (qualities[i].Value > bestQuality) {
+            bestIdx = i;
+            bestQuality = qualities[i].Value;
+          }
+      } else {
+        for (int i = 1; i < qualities.Length; i++)
+          if (qualities[i].Value < bestQuality) {
+            bestIdx = i;
+            bestQuality = qualities[i].Value;
+          }
+      }
+      var bestTree = trees[bestIdx];
+
+      var res = ResultsParameter.ActualValue;
+      if (res.ContainsKey("Best tree")) {
+        var prevBestQuality = (DoubleValue)BestTreeQualityParameter.ActualValue;
+        if ((maximization && prevBestQuality.Value < bestQuality) ||
+            (!maximization && prevBestQuality.Value > bestQuality)) {
+          res["Best tree"].Value = bestTree;
+          prevBestQuality.Value = bestQuality;
+        }
+      } else {
+        BestTreeQualityParameter.ActualValue = new DoubleValue(bestQuality);
+        res.Add(new Result("Best tree", bestTree));
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs	(revision 16132)
@@ -0,0 +1,136 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <summary>
+  /// An operator that tracks the min average and max length of symbolic expression trees.
+  /// </summary>
+  [Item("MinAverageMaxSymbolicExpressionTreeLengthAnalyzer", "An operator that tracks the min avgerage and max length of symbolic expression trees.")]
+  [StorableClass]
+  public sealed class MinAverageMaxSymbolicExpressionTreeLengthAnalyzer : AlgorithmOperator, ISymbolicExpressionTreeAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string SymbolicExpressionTreeLengthParameterName = "SymbolicExpressionTreeLength";
+    private const string SymbolicExpressionTreeLengthsParameterName = "Symbolic expression tree length";
+    private const string MinTreeLengthParameterName = "Minimal symbolic expression tree length";
+    private const string AverageTreeLengthParameterName = "Average symbolic expression tree length";
+    private const string MaxTreeLengthParameterName = "Maximal symbolic expression tree length";
+    private const string ResultsParameterName = "Results";
+
+    public bool EnabledByDefault {
+      get { return true; }
+    }
+
+    #region parameter properties
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ScopeTreeLookupParameter<DoubleValue> SymbolicExpressionTreeLengthParameter {
+      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeLengthParameterName]; }
+    }
+    public ValueLookupParameter<DataTable> SymbolicExpressionTreeLengthsParameter {
+      get { return (ValueLookupParameter<DataTable>)Parameters[SymbolicExpressionTreeLengthsParameterName]; }
+    }
+    public ValueLookupParameter<VariableCollection> ResultsParameter {
+      get { return (ValueLookupParameter<VariableCollection>)Parameters[ResultsParameterName]; }
+    }
+
+    [Storable]
+    private MinAverageMaxValueAnalyzer valueAnalyzer;
+    [Storable]
+    private UniformSubScopesProcessor subScopesProcessor;
+
+    #endregion
+
+    [StorableConstructor]
+    private MinAverageMaxSymbolicExpressionTreeLengthAnalyzer(bool deserializing) : base() { }
+    private MinAverageMaxSymbolicExpressionTreeLengthAnalyzer(MinAverageMaxSymbolicExpressionTreeLengthAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+      valueAnalyzer = cloner.Clone(original.valueAnalyzer);
+      subScopesProcessor = cloner.Clone(original.subScopesProcessor);
+      AfterDeserialization();
+    }
+    public MinAverageMaxSymbolicExpressionTreeLengthAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose length should be calculated."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(SymbolicExpressionTreeLengthParameterName, "The length of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<DataTable>(SymbolicExpressionTreeLengthsParameterName, "The data table to store the symbolic expression tree lengths."));
+      Parameters.Add(new ValueLookupParameter<VariableCollection>(ResultsParameterName, "The results collection where the analysis values should be stored."));
+
+      subScopesProcessor = new UniformSubScopesProcessor();
+      SymbolicExpressionTreeLengthCalculator lengthCalculator = new SymbolicExpressionTreeLengthCalculator();
+      valueAnalyzer = new MinAverageMaxValueAnalyzer();
+
+      subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
+      lengthCalculator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+      lengthCalculator.SymbolicExpressionTreeLengthParameter.ActualName = SymbolicExpressionTreeLengthParameter.Name;
+      valueAnalyzer.ValueParameter.ActualName = lengthCalculator.SymbolicExpressionTreeLengthParameter.Name;
+      valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeLengthParameter.Depth;
+      valueAnalyzer.AverageValueParameter.ActualName = AverageTreeLengthParameterName;
+      valueAnalyzer.CollectAverageValueInResultsParameter.Value = new BoolValue(false);
+      valueAnalyzer.MaxValueParameter.ActualName = MaxTreeLengthParameterName;
+      valueAnalyzer.CollectMaxValueInResultsParameter.Value = new BoolValue(false);
+      valueAnalyzer.MinValueParameter.ActualName = MinTreeLengthParameterName;
+      valueAnalyzer.CollectMinValueInResultsParameter.Value = new BoolValue(false);
+      valueAnalyzer.ValuesParameter.ActualName = SymbolicExpressionTreeLengthsParameter.Name;
+
+      OperatorGraph.InitialOperator = subScopesProcessor;
+      subScopesProcessor.Operator = lengthCalculator;
+      lengthCalculator.Successor = null;
+      subScopesProcessor.Successor = valueAnalyzer;
+      valueAnalyzer.Successor = null;
+
+      AfterDeserialization();
+    }
+
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      SymbolicExpressionTreeParameter.DepthChanged += new EventHandler(SymbolicExpressionTreeParameter_DepthChanged);
+      SymbolicExpressionTreeLengthParameter.DepthChanged += new EventHandler(SymbolicExpressionTreeLengthParameter_DepthChanged);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer(this, cloner);
+    }
+
+    private void SymbolicExpressionTreeParameter_DepthChanged(object sender, EventArgs e) {
+      OnDepthParameterChanged();
+    }
+
+    private void SymbolicExpressionTreeLengthParameter_DepthChanged(object sender, EventArgs e) {
+      OnDepthParameterChanged();
+    }
+
+    private void OnDepthParameterChanged() {
+      valueAnalyzer.ValueParameter.Depth = SymbolicExpressionTreeParameter.Depth;
+      subScopesProcessor.Depth.Value = SymbolicExpressionTreeParameter.Depth;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs	(revision 16132)
@@ -0,0 +1,143 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <summary>
+  /// An operator that tracks the frequencies of distinct symbols in symbolic expression trees.
+  /// </summary>
+  [Item("SymbolicExpressionSymbolFrequencyAnalyzer", "An operator that tracks frequencies of symbols in symbolic expression trees.")]
+  [StorableClass]
+  public class SymbolicExpressionSymbolFrequencyAnalyzer : SingleSuccessorOperator, ISymbolicExpressionTreeAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ResultsParameterName = "Results";
+    private const string SymbolFrequenciesParameterName = "SymbolFrequencies";
+    private const string AggregateSymbolsWithDifferentSubtreeCountParameterName = "AggregateSymbolsWithDifferentSubtreeCount";
+
+    #region parameter properties
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<DataTable> SymbolFrequenciesParameter {
+      get { return (ILookupParameter<DataTable>)Parameters[SymbolFrequenciesParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    public IValueParameter<BoolValue> AggregateSymbolsWithDifferentSubtreeCountParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[AggregateSymbolsWithDifferentSubtreeCountParameterName]; }
+    }
+    #endregion
+    #region properties
+    public virtual bool EnabledByDefault {
+      get { return true; }
+    }
+    public BoolValue AggregrateSymbolsWithDifferentSubtreeCount {
+      get { return AggregateSymbolsWithDifferentSubtreeCountParameter.Value; }
+      set { AggregateSymbolsWithDifferentSubtreeCountParameter.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicExpressionSymbolFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionSymbolFrequencyAnalyzer(SymbolicExpressionSymbolFrequencyAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicExpressionSymbolFrequencyAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze."));
+      Parameters.Add(new LookupParameter<DataTable>(SymbolFrequenciesParameterName, "The data table to store the symbol frequencies."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the symbol frequencies should be stored."));
+      Parameters.Add(new ValueParameter<BoolValue>(AggregateSymbolsWithDifferentSubtreeCountParameterName, "Flag that indicates if the frequencies of symbols with the same name but different number of sub-trees should be aggregated.", new BoolValue(true)));
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionSymbolFrequencyAnalyzer(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      #region remove with HL 3.4
+      if (!Parameters.ContainsKey(AggregateSymbolsWithDifferentSubtreeCountParameterName))
+        Parameters.Add(new ValueParameter<BoolValue>(AggregateSymbolsWithDifferentSubtreeCountParameterName, "Flag that indicates if the frequencies of symbols with the same name but different number of sub-trees should be aggregated.", new BoolValue(true)));
+      #endregion
+    }
+
+    public override IOperation Apply() {
+      ItemArray<ISymbolicExpressionTree> expressions = SymbolicExpressionTreeParameter.ActualValue;
+      ResultCollection results = ResultsParameter.ActualValue;
+      DataTable symbolFrequencies = SymbolFrequenciesParameter.ActualValue;
+      if (symbolFrequencies == null) {
+        symbolFrequencies = new DataTable("Symbol frequencies", "Relative frequency of symbols aggregated over the whole population.");
+        symbolFrequencies.VisualProperties.YAxisTitle = "Relative Symbol Frequency";
+
+        SymbolFrequenciesParameter.ActualValue = symbolFrequencies;
+        results.Add(new Result("Symbol frequencies", symbolFrequencies));
+      }
+
+      // all rows must have the same number of values so we can just take the first
+      int numberOfValues = symbolFrequencies.Rows.Select(r => r.Values.Count).DefaultIfEmpty().First();
+
+      foreach (var pair in SymbolicExpressionSymbolFrequencyAnalyzer.CalculateSymbolFrequencies(expressions, AggregrateSymbolsWithDifferentSubtreeCount.Value)) {
+        if (!symbolFrequencies.Rows.ContainsKey(pair.Key)) {
+          // initialize a new row for the symbol and pad with zeros
+          DataRow row = new DataRow(pair.Key, "", Enumerable.Repeat(0.0, numberOfValues));
+          row.VisualProperties.StartIndexZero = true;
+          symbolFrequencies.Rows.Add(row);
+        }
+        symbolFrequencies.Rows[pair.Key].Values.Add(Math.Round(pair.Value, 3));
+      }
+
+      // add a zero for each data row that was not modified in the previous loop 
+      foreach (var row in symbolFrequencies.Rows.Where(r => r.Values.Count != numberOfValues + 1))
+        row.Values.Add(0.0);
+
+      return base.Apply();
+    }
+
+    public static IEnumerable<KeyValuePair<string, double>> CalculateSymbolFrequencies(IEnumerable<ISymbolicExpressionTree> trees, bool aggregateDifferentNumberOfSubtrees = true) {
+      Dictionary<string, double> symbolFrequencies = new Dictionary<string, double>();
+      int totalNumberOfSymbols = 0;
+
+      foreach (var tree in trees) {
+        foreach (var node in tree.IterateNodesPrefix()) {
+          string symbolName;
+          if (aggregateDifferentNumberOfSubtrees) symbolName = node.Symbol.Name;
+          else symbolName = node.Symbol.Name + "-" + node.SubtreeCount;
+          if (symbolFrequencies.ContainsKey(symbolName)) symbolFrequencies[symbolName] += 1;
+          else symbolFrequencies.Add(symbolName, 1);
+          totalNumberOfSymbols++;
+        }
+      }
+
+      foreach (var pair in symbolFrequencies)
+        yield return new KeyValuePair<string, double>(pair.Key, pair.Value / totalNumberOfSymbols);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs	(revision 16132)
@@ -0,0 +1,257 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <summary>
+  /// An operator that tracks tree lengths of Symbolic Expression Trees
+  /// </summary>
+  [Item("SymbolicExpressionTreeLengthAnalyzer", "An operator that tracks tree lengths of Symbolic Expression Trees")]
+  [StorableClass]
+  public sealed class SymbolicExpressionTreeLengthAnalyzer : SingleSuccessorOperator, ISymbolicExpressionTreeAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string SymbolicExpressionTreeLengthsParameterName = "SymbolicExpressionTreeLengthsTable";
+    private const string SymbolicExpressionTreeLengthsHistoryParameterName = "SymbolicExpressionTreeLengthsHistoryTable";
+    private const string ResultsParameterName = "Results";
+    private const string StoreHistoryParameterName = "StoreHistory";
+    private const string UpdateIntervalParameterName = "UpdateInterval";
+    private const string UpdateCounterParameterName = "UpdateCounter";
+
+    #region Parameter properties
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+
+    public ILookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public ValueLookupParameter<DataTable> SymbolicExpressionTreeLengthsParameter {
+      get { return (ValueLookupParameter<DataTable>)Parameters[SymbolicExpressionTreeLengthsParameterName]; }
+    }
+    public ValueLookupParameter<DataTableHistory> SymbolicExpressionTreeLengthsHistoryParameter {
+      get { return (ValueLookupParameter<DataTableHistory>)Parameters[SymbolicExpressionTreeLengthsHistoryParameterName]; }
+    }
+    public ValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (ValueLookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    // history
+    public ValueParameter<BoolValue> StoreHistoryParameter {
+      get { return (ValueParameter<BoolValue>)Parameters[StoreHistoryParameterName]; }
+    }
+    public ValueParameter<IntValue> UpdateIntervalParameter {
+      get { return (ValueParameter<IntValue>)Parameters[UpdateIntervalParameterName]; }
+    }
+    public ValueParameter<IntValue> UpdateCounterParameter {
+      get { return (ValueParameter<IntValue>)Parameters[UpdateCounterParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public bool EnabledByDefault {
+      get { return true; }
+    }
+    public IntValue UpdateInterval {
+      get { return UpdateIntervalParameter.Value; }
+    }
+    public IntValue UpdateCounter {
+      get { return UpdateCounterParameter.Value; }
+    }
+    public BoolValue StoreHistory {
+      get { return StoreHistoryParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicExpressionTreeLengthAnalyzer(bool deserializing) : base(deserializing) { }
+    private SymbolicExpressionTreeLengthAnalyzer(SymbolicExpressionTreeLengthAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeLengthAnalyzer(this, cloner);
+    }
+    public SymbolicExpressionTreeLengthAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose length should be calculated."));
+      Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum allowed symbolic expression tree length"));
+      Parameters.Add(new ValueLookupParameter<DataTable>(SymbolicExpressionTreeLengthsParameterName, "The data table to store the symbolic expression tree lengths."));
+      Parameters.Add(new ValueLookupParameter<DataTableHistory>(SymbolicExpressionTreeLengthsHistoryParameterName, "The data table to store the symbolic expression tree lengths history."));
+      Parameters.Add(new ValueLookupParameter<ResultCollection>(ResultsParameterName, "The results collection where the analysis values should be stored."));
+      Parameters.Add(new ValueParameter<BoolValue>(StoreHistoryParameterName, "True if the tree lengths history of the population should be stored.", new BoolValue(false)));
+      Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1)));
+      Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called since the last update", new IntValue(0)));
+
+      SymbolicExpressionTreeLengthsParameter.Hidden = true;
+      SymbolicExpressionTreeLengthsHistoryParameter.Hidden = true;
+      ResultsParameter.Hidden = true;
+      UpdateCounterParameter.Hidden = true;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // check if all the parameters are present and accounted for 
+      if (!Parameters.ContainsKey(StoreHistoryParameterName)) {
+        Parameters.Add(new ValueParameter<BoolValue>(StoreHistoryParameterName, "True if the tree lengths history of the population should be stored.", new BoolValue(false)));
+      }
+      if (!Parameters.ContainsKey(UpdateIntervalParameterName)) {
+        Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1)));
+      }
+      //necessary code to correct UpdateCounterParameter - type was changed from LookupParameter to ValueParameter
+      if (Parameters.ContainsKey(UpdateCounterParameterName) && (Parameters[UpdateCounterParameterName] is LookupParameter<IntValue>))
+        Parameters.Remove(UpdateCounterParameterName);
+      if (!Parameters.ContainsKey(UpdateCounterParameterName)) {
+        Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called since the last update", new IntValue(0)));
+        UpdateCounterParameter.Hidden = true;
+      }
+    }
+
+    #region IStatefulItem members
+    public override void InitializeState() {
+      base.InitializeState();
+      UpdateCounter.Value = 0;
+    }
+    public override void ClearState() {
+      base.ClearState();
+      UpdateCounter.Value = 0;
+    }
+    #endregion
+
+    public override IOperation Apply() {
+      UpdateCounter.Value++;
+      // the analyzer runs periodically, every 'updateInterval' times
+      if (UpdateCounter.Value == UpdateInterval.Value) {
+        UpdateCounter.Value = 0; // reset counter
+
+        // compute all tree lengths and store them in the lengthsTable
+        var solutions = SymbolicExpressionTreeParameter.ActualValue;
+
+        var treeLengthsTable = SymbolicExpressionTreeLengthsParameter.ActualValue;
+        // if the table was not created yet, we create it here
+        if (treeLengthsTable == null) {
+          treeLengthsTable = new DataTable("Tree Length Histogram");
+          SymbolicExpressionTreeLengthsParameter.ActualValue = treeLengthsTable;
+        }
+
+        // data table which stores tree length values
+        DataRow treeLengthsTableRow;
+
+        const string treeLengthsTableRowName = "Symbolic expression tree lengths";
+        const string treeLengthsTableRowDesc = "The distribution of symbolic expression tree lengths";
+        const string xAxisTitle = "Symbolic expression tree lengths";
+        const string yAxisTitle = "Frequency / Number of tree individuals";
+
+        var treeLengths = solutions.Select(s => (int)s.Length).ToList();
+
+        int maxLength = treeLengths.Max(t => t);
+        int minLength = treeLengths.Min(t => t);
+
+        if (!treeLengthsTable.Rows.ContainsKey(treeLengthsTableRowName)) {
+          treeLengthsTableRow = new DataRow(treeLengthsTableRowName, treeLengthsTableRowDesc, treeLengths.Select(x => (double)x));
+          treeLengthsTable.Rows.Add(treeLengthsTableRow);
+        } else {
+          treeLengthsTableRow = treeLengthsTable.Rows[treeLengthsTableRowName];
+          treeLengthsTableRow.Values.Replace(treeLengths.Select(x => (double)x));
+        }
+
+        double maximumAllowedTreeLength = MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value;
+
+        treeLengthsTableRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
+        treeLengthsTable.VisualProperties.HistogramExactBins = false;
+
+        int range = maxLength - minLength;
+        if (range == 0) range = 1;
+        // the following trick should result in an integer intervalWidth of 1,2,4,...
+        treeLengthsTable.VisualProperties.HistogramBins = range;
+
+        if (maxLength <= 25) // [0,25]
+          treeLengthsTableRow.VisualProperties.ScaleFactor = 1.0;
+        else if (maxLength <= 100) // [26,100]
+          treeLengthsTableRow.VisualProperties.ScaleFactor = 1.0 / 2.0;
+        else if (maxLength <= 250) // [101,250]
+          treeLengthsTableRow.VisualProperties.ScaleFactor = 1.0 / 5.0;
+        else if (maxLength <= 500) // [251,500]
+          treeLengthsTableRow.VisualProperties.ScaleFactor = 1.0 / 10.0;
+        else
+          treeLengthsTableRow.VisualProperties.ScaleFactor = 1.0 / 20.0; // [501,inf]
+
+        treeLengthsTableRow.VisualProperties.IsVisibleInLegend = false;
+
+        // visual properties for the X-axis
+        treeLengthsTable.VisualProperties.XAxisMinimumAuto = false;
+        treeLengthsTable.VisualProperties.XAxisMaximumAuto = false;
+        treeLengthsTable.VisualProperties.XAxisMinimumFixedValue = 0.0;
+        if (maxLength > maximumAllowedTreeLength + 1)
+          treeLengthsTable.VisualProperties.XAxisMaximumFixedValue = maxLength + 1; // +1 so the histogram column for the maximum length won't get trimmed
+        else
+          treeLengthsTable.VisualProperties.XAxisMaximumFixedValue = maximumAllowedTreeLength + 1;
+        treeLengthsTable.VisualProperties.XAxisTitle = xAxisTitle;
+        //visual properties for the Y-axis
+        treeLengthsTable.VisualProperties.YAxisMinimumAuto = false;
+        treeLengthsTable.VisualProperties.YAxisMaximumAuto = false;
+        treeLengthsTable.VisualProperties.YAxisMinimumFixedValue = 0.0;
+        int maxFreq = (int)Math.Round(solutions.GroupBy(s => s.Length).Max(g => g.Count()) / treeLengthsTableRow.VisualProperties.ScaleFactor);
+        if (maxFreq % 5 != 0)
+          maxFreq += (5 - maxFreq % 5);
+        double yAxisMaximumFixedValue = maxFreq;
+
+        treeLengthsTable.VisualProperties.YAxisMaximumFixedValue = yAxisMaximumFixedValue;
+        treeLengthsTable.VisualProperties.YAxisTitle = yAxisTitle;
+
+        var results = ResultsParameter.ActualValue;
+
+        if (!results.ContainsKey(treeLengthsTableRowName)) {
+          results.Add(new Result(treeLengthsTableRowName, treeLengthsTable));
+        } else {
+          results[treeLengthsTableRowName].Value = treeLengthsTable;
+        }
+
+        bool storeHistory = StoreHistoryParameter.Value.Value;
+        const string treeLengthHistoryTableName = "Tree lengths history";
+
+        if (storeHistory) {
+          var treeLengthsHistory = SymbolicExpressionTreeLengthsHistoryParameter.ActualValue;
+          if (treeLengthsHistory == null) {
+            treeLengthsHistory = new DataTableHistory();
+            SymbolicExpressionTreeLengthsHistoryParameter.ActualValue = treeLengthsHistory;
+          }
+          treeLengthsHistory.Add((DataTable)treeLengthsTable.Clone());
+
+          if (!results.ContainsKey(treeLengthHistoryTableName)) {
+            results.Add(new Result(treeLengthHistoryTableName, treeLengthsHistory));
+          } else {
+            results[treeLengthHistoryTableName].Value = treeLengthsHistory;
+          }
+        }
+      }
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthCalculator.cs	(revision 16132)
@@ -0,0 +1,76 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  /// <summary>
+  /// An operator that outputs the length of a symbolic expression tree.
+  /// </summary>
+  [Item("SymbolicExpressionTreeLengthCalculator", "An operator that outputs the length of a symbolic expression tree.")]
+  [StorableClass]
+  public sealed class SymbolicExpressionTreeLengthCalculator : SingleSuccessorOperator {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string SymbolicExpressionTreeLengthParameterName = "SymbolicExpressionTreeLength";
+
+    #region parameter properties
+    public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> SymbolicExpressionTreeLengthParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[SymbolicExpressionTreeLengthParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public DoubleValue SymbolicExpressionTreeLength {
+      get { return SymbolicExpressionTreeLengthParameter.ActualValue; }
+      set { SymbolicExpressionTreeLengthParameter.ActualValue = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicExpressionTreeLengthCalculator(bool deserializing) : base(deserializing) { }
+    private SymbolicExpressionTreeLengthCalculator(SymbolicExpressionTreeLengthCalculator original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicExpressionTreeLengthCalculator()
+      : base() {
+      Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose length should be calculated."));
+      Parameters.Add(new LookupParameter<DoubleValue>(SymbolicExpressionTreeLengthParameterName, "The length of the symbolic expression tree."));
+    }
+
+    public override IOperation Apply() {
+      SymbolicExpressionTreeLength = new DoubleValue(SymbolicExpressionTree.Length);
+      return base.Apply();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeLengthCalculator(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentCreater.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentCreater.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentCreater.cs	(revision 16132)
@@ -0,0 +1,215 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 106")]
+  [StorableClass]
+  public sealed class ArgumentCreater : SymbolicExpressionTreeArchitectureManipulator, ISymbolicExpressionTreeSizeConstraintOperator {
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    #region Parameter Properties
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+    #region Properties
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    private ArgumentCreater(bool deserializing) : base(deserializing) { }
+    private ArgumentCreater(ArgumentCreater original, Cloner cloner) : base(original, cloner) { }
+    public ArgumentCreater()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+    }
+
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      CreateNewArgument(random, symbolicExpressionTree, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ArgumentCreater(this, cloner);
+    }
+
+    public static bool CreateNewArgument(
+      IRandom random,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxTreeLength, int maxTreeDepth,
+      int maxFunctionDefinitions, 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.
+      ISymbolicExpressionTree clonedTree = (ISymbolicExpressionTree)symbolicExpressionTree.Clone();
+
+      var functionDefiningBranches = clonedTree.IterateNodesPrefix().OfType<DefunTreeNode>().ToList();
+      if (!functionDefiningBranches.Any())
+        // no function defining branch found => abort
+        return false;
+
+      // select a random function defining branch
+      var selectedDefunBranch = functionDefiningBranches.SampleRandom(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 length property might throw overflow exception
+      try {
+        if (CreateNewArgumentForDefun(random, clonedTree, selectedDefunBranch, newArgumentNode) && clonedTree.Length <= maxTreeLength && clonedTree.Depth <= maxTreeDepth) {
+
+          // 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, ISymbolicExpressionTree 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 &&
+                             !node.IterateNodesPrefix().OfType<ArgumentTreeNode>().Any() &&
+                             !node.IterateNodesPrefix().OfType<InvokeFunctionTreeNode>().Any()
+                       from subtree in node.Subtrees
+                       select new CutPoint(node, 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.Child;
+      selectedCutPoint.Parent.RemoveSubtree(selectedCutPoint.ChildIndex);
+      selectedCutPoint.Parent.InsertSubtree(selectedCutPoint.ChildIndex, 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<ISymbolicExpressionTreeNode> newlyAddedBranches = new List<ISymbolicExpressionTreeNode>();
+        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 = (ISymbolicExpressionTreeNode)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.SetSubtreeCount(newArgumentNode.Symbol, 0, 0);
+      // allow the argument as child of any other symbol
+      GrammarModifier.SetAllowedParentSymbols(defunBranch.Grammar, selectedCutPoint.Child.Symbol, newArgumentNode.Symbol);
+
+      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.SetSubtreeCount(matchingSymbol, defunBranch.NumberOfArguments, defunBranch.NumberOfArguments);
+          foreach (var symb in subtree.Grammar.Symbols) {
+            if (symb is StartSymbol || symb is ProgramRootSymbol) continue;
+            if (symb.Name == matchingSymbol.Name) continue; //don't allow invoke as child of invoke
+            if (subtree.Grammar.IsAllowedChildSymbol(selectedCutPoint.Parent.Symbol, symb, selectedCutPoint.ChildIndex))
+              subtree.Grammar.AddAllowedChildSymbol(matchingSymbol, symb, newArgumentNode.Symbol.ArgumentIndex);
+          }
+        }
+      }
+
+      return true;
+    }
+
+    private static ISymbolicExpressionTreeNode ReplaceArgumentsInBranch(ISymbolicExpressionTreeNode branch, IEnumerable<ISymbolicExpressionTreeNode> 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.ElementAt(argNode.Symbol.ArgumentIndex).Clone();
+      } else {
+        // call recursively for all subtree
+        List<ISymbolicExpressionTreeNode> subtrees = new List<ISymbolicExpressionTreeNode>(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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDeleter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDeleter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDeleter.cs	(revision 16132)
@@ -0,0 +1,108 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 112")]
+  [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,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      DeleteArgument(random, symbolicExpressionTree, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ArgumentDeleter(this, cloner);
+    }
+
+    public static bool DeleteArgument(
+      IRandom random,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
+
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>().ToList();
+      if (!functionDefiningBranches.Any())
+        // no function defining branch => abort
+        return false;
+
+      var selectedDefunBranch = functionDefiningBranches.SampleRandom(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>().Single(s => s.ArgumentIndex == removedArgument);
+      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>().SingleOrDefault(s => s.FunctionName == selectedDefunBranch.FunctionName);
+        if (matchingInvokeSymbol != null) {
+          subtree.Grammar.SetSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments, 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.SampleRandom(random);
+        argNode.Symbol = replacementSymbol;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDuplicater.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDuplicater.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentDuplicater.cs	(revision 16132)
@@ -0,0 +1,134 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 94")]
+  [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,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      DuplicateArgument(random, symbolicExpressionTree, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ArgumentDuplicater(this, cloner);
+    }
+
+    public static bool DuplicateArgument(
+      IRandom random,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>().ToList();
+
+      var allowedArgumentIndexes = Enumerable.Range(0, maxFunctionArguments);
+      if (!functionDefiningBranches.Any())
+        // no function defining branches => abort
+        return false;
+
+      var selectedDefunBranch = functionDefiningBranches.SampleRandom(random);
+
+      var argumentSymbols = selectedDefunBranch.Grammar.Symbols.OfType<Argument>().ToList();
+      if (!argumentSymbols.Any() || argumentSymbols.Count() >= maxFunctionArguments)
+        // when no argument or number of arguments is already at max allowed value => abort
+        return false;
+
+      var selectedArgumentSymbol = argumentSymbols.SampleRandom(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<ISymbolicExpressionTreeNode> newlyAddedBranches = new List<ISymbolicExpressionTreeNode>();
+        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.GetSubtree(selectedArgumentSymbol.ArgumentIndex);
+          var clonedArgumentBranch = (ISymbolicExpressionTreeNode)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.SetSubtreeCount(newArgSymbol, 0, 0);
+      // allow the duplicated argument as child of all other arguments where the orginal argument was allowed
+      GrammarModifier.SetAllowedParentSymbols(selectedDefunBranch.Grammar, selectedArgumentSymbol, newArgSymbol);
+      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.SetSubtreeCount(matchingInvokeSymbol, selectedDefunBranch.NumberOfArguments, selectedDefunBranch.NumberOfArguments);
+          foreach (var symb in subtree.Grammar.Symbols) {
+            if (symb is StartSymbol || symb is ProgramRootSymbol) continue;
+            if (subtree.Grammar.IsAllowedChildSymbol(matchingInvokeSymbol, symb, selectedArgumentSymbol.ArgumentIndex))
+              subtree.Grammar.AddAllowedChildSymbol(matchingInvokeSymbol, symb, newArgumentIndex);
+          }
+        }
+      }
+      return true;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/GrammarModifier.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/GrammarModifier.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/GrammarModifier.cs	(revision 16132)
@@ -0,0 +1,88 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding {
+  public static class GrammarModifier {
+    internal static void AddInvokeSymbol(ISymbolicExpressionTreeGrammar grammar, string functionName, int nArgs, CutPoint startCutPoint, IEnumerable<CutPoint> argumentCutPoints) {
+      if (!grammar.ContainsSymbol(startCutPoint.Child.Symbol)) return;
+
+      var invokeSym = new InvokeFunction(functionName);
+      grammar.AddSymbol(invokeSym);
+      grammar.SetSubtreeCount(invokeSym, nArgs, nArgs);
+
+      //allow invoke symbol everywhere, where the child of the startCutPoint was allowed
+      SetAllowedParentSymbols(grammar, startCutPoint.Child.Symbol, invokeSym);
+
+      if (nArgs > 0) {
+        //set allowed child symbols of invoke symbol 
+        foreach (ISymbol child in grammar.Symbols) {
+          if (child.Name == invokeSym.Name) continue;
+          int i = 0;
+          foreach (CutPoint argumentCutPoint in argumentCutPoints) {
+            if (grammar.IsAllowedChildSymbol(argumentCutPoint.Parent.Symbol, child, argumentCutPoint.ChildIndex))
+              grammar.AddAllowedChildSymbol(invokeSym, child, i);
+            i++;
+          }
+        }
+      }
+    }
+
+
+
+    internal static void AddArgumentSymbol(ISymbolicExpressionTreeGrammar originalGrammar, ISymbolicExpressionTreeGrammar grammar, IEnumerable<int> argumentIndexes, IEnumerable<CutPoint> argumentCutPoints) {
+      foreach (var pair in argumentIndexes.Zip(argumentCutPoints, (a, b) => new { Index = a, CutPoint = b })) {
+        var argSymbol = new Argument(pair.Index);
+        grammar.AddSymbol(argSymbol);
+        grammar.SetSubtreeCount(argSymbol, 0, 0);
+
+        foreach (var symb in grammar.Symbols) {
+          if (symb is ProgramRootSymbol || symb is StartSymbol) continue;
+          if (originalGrammar.IsAllowedChildSymbol(symb, pair.CutPoint.Child.Symbol))
+            grammar.AddAllowedChildSymbol(symb, argSymbol);
+          else {
+            for (int i = 0; i < grammar.GetMaximumSubtreeCount(symb); i++) {
+              if (originalGrammar.IsAllowedChildSymbol(symb, pair.CutPoint.Child.Symbol, i))
+                grammar.AddAllowedChildSymbol(symb, argSymbol, i);
+            }
+          }
+        }
+      }
+    }
+
+    internal static void SetAllowedParentSymbols(ISymbolicExpressionTreeGrammar grammar, ISymbol symbol, ISymbol newSymbol) {
+      foreach (var symb in grammar.Symbols) {
+        if (symb is ProgramRootSymbol) continue;
+        if (newSymbol is Argument && symb is StartSymbol) continue;
+        if (grammar.IsAllowedChildSymbol(symb, symbol))
+          grammar.AddAllowedChildSymbol(symb, newSymbol);
+        else {
+          for (int i = 0; i < grammar.GetMaximumSubtreeCount(symb); i++) {
+            if (grammar.IsAllowedChildSymbol(symb, symbol, i))
+              grammar.AddAllowedChildSymbol(symb, newSymbol, i);
+          }
+        }
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs	(revision 16132)
@@ -0,0 +1,143 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Collections;
+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.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [Item("MultiSymbolicExpressionTreeArchitectureManipulator", "Randomly selects and applies one of its architecture manipulators every time it is called.")]
+  [StorableClass]
+  public sealed class MultiSymbolicExpressionTreeArchitectureManipulator : StochasticMultiBranch<ISymbolicExpressionTreeManipulator>,
+    ISymbolicExpressionTreeArchitectureManipulator,
+    ISymbolicExpressionTreeSizeConstraintOperator,
+    IStochasticOperator {
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string MaximumFunctionArgumentsParameterName = "MaximumFunctionArguments";
+    private const string MaximumFunctionDefinitionsParameterName = "MaximumFunctionDefinitions";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    protected override bool CreateChildOperation {
+      get { return true; }
+    }
+    #region Parameter properties
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumFunctionDefinitionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumFunctionDefinitionsParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumFunctionArgumentsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumFunctionArgumentsParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+    #region Parameter Properties
+    public IntValue MaximumFunctionDefinitions {
+      get { return MaximumFunctionDefinitionsParameter.ActualValue; }
+    }
+    public IntValue MaximumFunctionArguments {
+      get { return MaximumFunctionArgumentsParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
+
+
+    [StorableConstructor]
+    private MultiSymbolicExpressionTreeArchitectureManipulator(bool deserializing) : base(deserializing) { }
+    private MultiSymbolicExpressionTreeArchitectureManipulator(MultiSymbolicExpressionTreeArchitectureManipulator original, Cloner cloner) : base(original, cloner) { }
+    public MultiSymbolicExpressionTreeArchitectureManipulator()
+      : base() {
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumFunctionDefinitionsParameterName, "The maximal allowed number of automatically defined functions."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumFunctionArgumentsParameterName, "The maximal allowed number of arguments of a automatically defined functions."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+
+      List<ISymbolicExpressionTreeManipulator> list = new List<ISymbolicExpressionTreeManipulator>();
+      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator))) {
+        if (this.GetType().Assembly != type.Assembly) continue;
+        if (typeof(IMultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type)) continue;
+        list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type));
+      }
+      CheckedItemList<ISymbolicExpressionTreeManipulator> checkedItemList = new CheckedItemList<ISymbolicExpressionTreeManipulator>();
+      checkedItemList.AddRange(list.OrderBy(op => op.Name));
+      Operators = checkedItemList.AsReadOnly();
+      Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>>(Operators.CheckedItems));
+
+      SelectedOperatorParameter.ActualName = "SelectedManipulationOperator";
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MultiSymbolicExpressionTreeArchitectureManipulator(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 (ISymbolicExpressionTreeArchitectureManipulator manipulator in Operators.OfType<ISymbolicExpressionTreeArchitectureManipulator>()) {
+        manipulator.MaximumFunctionArgumentsParameter.ActualName = MaximumFunctionArgumentsParameter.Name;
+        manipulator.MaximumFunctionDefinitionsParameter.ActualName = MaximumFunctionDefinitionsParameter.Name;
+      }
+      foreach (ISymbolicExpressionTreeSizeConstraintOperator manipulator in Operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) {
+        manipulator.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameter.Name;
+        manipulator.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter.Name;
+      }
+      foreach (ISymbolicExpressionTreeManipulator manipulator in Operators.OfType<ISymbolicExpressionTreeManipulator>()) {
+        manipulator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+      }
+      foreach (IStochasticOperator manipulator in Operators.OfType<IStochasticOperator>()) {
+        manipulator.RandomParameter.ActualName = RandomParameter.Name;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineCreater.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineCreater.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineCreater.cs	(revision 16132)
@@ -0,0 +1,250 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 97")]
+  [StorableClass]
+  public sealed class SubroutineCreater : SymbolicExpressionTreeArchitectureManipulator, ISymbolicExpressionTreeSizeConstraintOperator {
+    private const double ARGUMENT_CUTOFF_PROBABILITY = 0.05;
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    #region Parameter Properties
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+    #region Properties
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    private SubroutineCreater(bool deserializing) : base(deserializing) { }
+    private SubroutineCreater(SubroutineCreater original, Cloner cloner) : base(original, cloner) { }
+    public SubroutineCreater()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SubroutineCreater(this, cloner);
+    }
+
+    public override sealed void ModifyArchitecture(
+      IRandom random,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      CreateSubroutine(random, symbolicExpressionTree, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool CreateSubroutine(
+      IRandom random,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxTreeLength, int maxTreeDepth,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>();
+      if (functionDefiningBranches.Count() >= maxFunctionDefinitions)
+        // allowed maximum number of ADF reached => abort
+        return false;
+      if (symbolicExpressionTree.Length + 4 > maxTreeLength)
+        // defining a new function causes an length increase by 4 nodes (max) if the max tree length is reached => abort
+        return false;
+      string formatString = new StringBuilder().Append('0', (int)Math.Log10(maxFunctionDefinitions * 10 - 1)).ToString(); // >= 100 functions => ###
+      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefinitions)
+                                 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, Length = node.GetLength() };
+      var totalNumberOfBodyNodes = bodies.Select(x => x.Length).Sum();
+      int r = random.Next(totalNumberOfBodyNodes);
+      int aggregatedNumberOfBodyNodes = 0;
+      ISymbolicExpressionTreeNode selectedBody = null;
+      foreach (var body in bodies) {
+        aggregatedNumberOfBodyNodes += body.Length;
+        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 CutPoint(parent, subtree)).ToList();
+      if (!allCutPoints.Any())
+        // no cut points => abort
+        return false;
+      string newFunctionName = allowedFunctionNames.Except(functionDefiningBranches.Select(x => x.FunctionName)).First();
+      var selectedCutPoint = allCutPoints.SampleRandom(random);
+
+      // select random branches as argument cut-off points (replaced by argument terminal nodes in the function)
+      List<CutPoint> argumentCutPoints = SelectRandomArgumentBranches(selectedCutPoint.Child, random, ARGUMENT_CUTOFF_PROBABILITY, maxFunctionArguments);
+      ISymbolicExpressionTreeNode functionBody = selectedCutPoint.Child;
+      // disconnect the function body from the tree
+      selectedCutPoint.Parent.RemoveSubtree(selectedCutPoint.ChildIndex);
+      // disconnect the argument branches from the function
+      functionBody = DisconnectBranches(functionBody, argumentCutPoints);
+      // insert a function invocation symbol instead
+      var invokeNode = (InvokeFunctionTreeNode)(new InvokeFunction(newFunctionName)).CreateTreeNode();
+      selectedCutPoint.Parent.InsertSubtree(selectedCutPoint.ChildIndex, invokeNode);
+      // add the branches selected as argument as subtrees of the function invocation node
+      foreach (var argumentCutPoint in argumentCutPoints)
+        invokeNode.AddSubtree(argumentCutPoint.Child);
+
+      // 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((ISymbolicExpressionTreeGrammar)selectedBody.Grammar.Clone());
+
+      var allowedChildSymbols = selectedBody.Grammar.GetAllowedChildSymbols(selectedBody.Symbol);
+      foreach (var allowedChildSymbol in allowedChildSymbols)
+        defunNode.Grammar.AddAllowedChildSymbol(defunNode.Symbol, allowedChildSymbol);
+      var maxSubtrees = selectedBody.Grammar.GetMaximumSubtreeCount(selectedBody.Symbol);
+      for (int i = 0; i < maxSubtrees; i++) {
+        foreach (var allowedChildSymbol in selectedBody.Grammar.GetAllowedChildSymbols(selectedBody.Symbol, i))
+          defunNode.Grammar.AddAllowedChildSymbol(defunNode.Symbol, allowedChildSymbol);
+      }
+
+      // remove all argument symbols from grammar except that one contained in cutpoints
+      var oldArgumentSymbols = selectedBody.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.AddArgumentSymbol(selectedBody.Grammar, defunNode.Grammar, newArgumentIndexes, argumentCutPoints);
+      defunNode.NumberOfArguments = newArgumentIndexes.Count();
+      if (defunNode.NumberOfArguments != argumentCutPoints.Count) throw new InvalidOperationException();
+      // add invoke symbol for newly defined function to the original branch 
+      GrammarModifier.AddInvokeSymbol(selectedBody.Grammar, defunNode.FunctionName, defunNode.NumberOfArguments, selectedCutPoint, argumentCutPoints);
+
+      // 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) {
+            GrammarModifier.AddInvokeSymbol(subtree.Grammar, defunNode.FunctionName, defunNode.NumberOfArguments, selectedCutPoint, argumentCutPoints);
+          }
+        }
+      }
+      return true;
+    }
+
+    private static ISymbolicExpressionTreeNode DisconnectBranches(ISymbolicExpressionTreeNode node, List<CutPoint> argumentCutPoints) {
+      int argumentIndex = argumentCutPoints.FindIndex(x => x.Child == node);
+      if (argumentIndex != -1) {
+        var argSymbol = new Argument(argumentIndex);
+        return argSymbol.CreateTreeNode();
+      }
+      // remove the subtrees so that we can clone only the root node
+      List<ISymbolicExpressionTreeNode> subtrees = new List<ISymbolicExpressionTreeNode>(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, argumentCutPoints));
+      }
+      return node;
+    }
+
+    private static List<CutPoint> SelectRandomArgumentBranches(ISymbolicExpressionTreeNode 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<CutPoint> argumentBranches = new List<CutPoint>();
+      if (selectedRoot is ArgumentTreeNode) {
+        argumentBranches.Add(new CutPoint(selectedRoot.Parent, 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
+        //if we exceed the maxArguments return the same cutpoint as the start cutpoint to create a ADF that returns only its argument
+        var minNewArgumentsForSubtrees = numberOfArgumentsInSubtrees.Select(x => x > 0 ? 1 : 0).ToList();
+        if (minNewArgumentsForSubtrees.Sum() > maxArguments) {
+          argumentBranches.Add(new CutPoint(selectedRoot.Parent, 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.GetSubtree(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(new CutPoint(subtree.Parent, subtree));
+          }
+        }
+        return argumentBranches;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDeleter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDeleter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDeleter.cs	(revision 16132)
@@ -0,0 +1,121 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 108")]
+  [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,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      DeleteSubroutine(random, symbolicExpressionTree, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool DeleteSubroutine(
+      IRandom random,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>().ToList();
+
+      if (!functionDefiningBranches.Any())
+        // no ADF to delete => abort
+        return false;
+
+      var selectedDefunBranch = functionDefiningBranches.SampleRandom(random);
+      // remove the selected defun
+      int defunSubtreeIndex = symbolicExpressionTree.Root.IndexOfSubtree(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, ISymbolicExpressionTree 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 CutPoint(node, subtree)).FirstOrDefault();
+      while (invocationCutPoint != null) {
+        // deletion by random regeneration
+        ISymbolicExpressionTreeNode replacementTree = null;
+        var allowedSymbolsList = invocationCutPoint.Parent.Grammar.GetAllowedChildSymbols(invocationCutPoint.Parent.Symbol, invocationCutPoint.ChildIndex).ToList();
+        var weights = allowedSymbolsList.Select(s => s.InitialFrequency);
+
+#pragma warning disable 612, 618
+        var selectedSymbol = allowedSymbolsList.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+
+        int minPossibleLength = invocationCutPoint.Parent.Grammar.GetMinimumExpressionLength(selectedSymbol);
+        int maxLength = Math.Max(minPossibleLength, invocationCutPoint.Child.GetLength());
+        int minPossibleDepth = invocationCutPoint.Parent.Grammar.GetMinimumExpressionDepth(selectedSymbol);
+        int maxDepth = Math.Max(minPossibleDepth, invocationCutPoint.Child.GetDepth());
+        replacementTree = selectedSymbol.CreateTreeNode();
+        if (replacementTree.HasLocalParameters)
+          replacementTree.ResetLocalParameters(random);
+        invocationCutPoint.Parent.RemoveSubtree(invocationCutPoint.ChildIndex);
+        invocationCutPoint.Parent.InsertSubtree(invocationCutPoint.ChildIndex, replacementTree);
+
+        ProbabilisticTreeCreator.PTC2(random, replacementTree, maxLength, maxDepth);
+
+        invocationCutPoint = (from node in symbolicExpressionTree.IterateNodesPrefix()
+                              from subtree in node.Subtrees.OfType<InvokeFunctionTreeNode>()
+                              where subtree.Symbol.FunctionName == selectedDefunBranch.FunctionName
+                              select new CutPoint(node, subtree)).FirstOrDefault();
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineDuplicater.cs	(revision 16132)
@@ -0,0 +1,139 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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. As described in Koza, Bennett, Andre, Keane, Genetic Programming III - Darwinian Invention and Problem Solving, 1999, pp. 88")]
+  [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,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      IntValue maxFunctionDefinitions, IntValue maxFunctionArguments) {
+      DuplicateSubroutine(random, symbolicExpressionTree, maxFunctionDefinitions.Value, maxFunctionArguments.Value);
+    }
+
+    public static bool DuplicateSubroutine(
+      IRandom random,
+      ISymbolicExpressionTree symbolicExpressionTree,
+      int maxFunctionDefinitions, int maxFunctionArguments) {
+      var functionDefiningBranches = symbolicExpressionTree.IterateNodesPrefix().OfType<DefunTreeNode>().ToList();
+      if (!functionDefiningBranches.Any() || functionDefiningBranches.Count() == maxFunctionDefinitions)
+        // 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(maxFunctionDefinitions) + 1).ToString(); // >= 100 functions => ###
+      var allowedFunctionNames = from index in Enumerable.Range(0, maxFunctionDefinitions)
+                                 select "ADF" + index.ToString(formatString);
+
+      var selectedBranch = functionDefiningBranches.SampleRandom(random);
+      var duplicatedDefunBranch = (DefunTreeNode)selectedBranch.Clone();
+      string newFunctionName = allowedFunctionNames.Except(UsedFunctionNames(symbolicExpressionTree)).First();
+      duplicatedDefunBranch.FunctionName = newFunctionName;
+      symbolicExpressionTree.Root.AddSubtree(duplicatedDefunBranch);
+      duplicatedDefunBranch.SetGrammar((ISymbolicExpressionTreeGrammar)selectedBranch.Grammar.Clone());
+
+      var allowedChildSymbols = selectedBranch.Grammar.GetAllowedChildSymbols(selectedBranch.Symbol);
+      foreach (var allowedChildSymbol in allowedChildSymbols)
+        duplicatedDefunBranch.Grammar.AddAllowedChildSymbol(duplicatedDefunBranch.Symbol, allowedChildSymbol);
+      var maxSubtrees = selectedBranch.Grammar.GetMaximumSubtreeCount(selectedBranch.Symbol);
+      for (int i = 0; i < maxSubtrees; i++) {
+        foreach (var allowedChildSymbol in selectedBranch.Grammar.GetAllowedChildSymbols(selectedBranch.Symbol, i))
+          duplicatedDefunBranch.Grammar.AddAllowedChildSymbol(duplicatedDefunBranch.Symbol, allowedChildSymbol);
+      }
+
+      // 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) {
+          var invokeSymbol = new InvokeFunction(duplicatedDefunBranch.FunctionName);
+          subtree.Grammar.AddSymbol(invokeSymbol);
+          subtree.Grammar.SetSubtreeCount(invokeSymbol, duplicatedDefunBranch.NumberOfArguments, duplicatedDefunBranch.NumberOfArguments);
+
+          foreach (ISymbol symbol in subtree.Grammar.Symbols) {
+            if (subtree.Grammar.IsAllowedChildSymbol(symbol, matchingInvokeSymbol))
+              subtree.Grammar.AddAllowedChildSymbol(symbol, invokeSymbol);
+            else {
+              for (int i = 0; i < subtree.Grammar.GetMaximumSubtreeCount(symbol); i++)
+                if (subtree.Grammar.IsAllowedChildSymbol(symbol, matchingInvokeSymbol, i))
+                  subtree.Grammar.AddAllowedChildSymbol(symbol, invokeSymbol, i);
+            }
+          }
+
+          foreach (ISymbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol))
+            if (symbol != invokeSymbol) //avoid duplicate entry invokesymbol / invokesymbol
+              subtree.Grammar.AddAllowedChildSymbol(invokeSymbol, symbol);
+          for (int i = 0; i < subtree.Grammar.GetMaximumSubtreeCount(matchingInvokeSymbol); i++) {
+            foreach (ISymbol symbol in subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol, i).Except(subtree.Grammar.GetAllowedChildSymbols(matchingInvokeSymbol)))
+              subtree.Grammar.AddAllowedChildSymbol(invokeSymbol, symbol, i);
+          }
+        }
+        // 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(ISymbolicExpressionTree symbolicExpressionTree) {
+      return from node in symbolicExpressionTree.IterateNodesPrefix()
+             where node.Symbol is Defun
+             select ((DefunTreeNode)node).FunctionName;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SymbolicExpressionTreeArchitectureManipulator.cs	(revision 16132)
@@ -0,0 +1,74 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <summary>
+  /// Base class for architecture altering operators for symbolic expression trees.
+  /// </summary>
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeArchitectureManipulator : SymbolicExpressionTreeManipulator, ISymbolicExpressionTreeArchitectureManipulator {
+    private const string MaximumFunctionArgumentsParameterName = "MaximumFunctionArguments";
+    private const string MaximumFunctionDefinitionsParameterName = "MaximumFunctionDefinitions";
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    #region parameter properties
+    public IValueLookupParameter<IntValue> MaximumFunctionDefinitionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumFunctionDefinitionsParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumFunctionArgumentsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumFunctionArgumentsParameterName]; }
+    }
+    #endregion
+    #region properties
+    public IntValue MaximumFunctionDefinitions {
+      get { return MaximumFunctionDefinitionsParameter.ActualValue; }
+    }
+    public IntValue MaximumFunctionArguments {
+      get { return MaximumFunctionArgumentsParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    protected SymbolicExpressionTreeArchitectureManipulator(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeArchitectureManipulator(SymbolicExpressionTreeArchitectureManipulator original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicExpressionTreeArchitectureManipulator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumFunctionDefinitionsParameterName, "The maximal allowed number of automatically defined functions."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumFunctionArgumentsParameterName, "The maximal allowed number of arguments of a automatically defined functions."));
+    }
+
+    protected override sealed void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
+      ModifyArchitecture(random, symbolicExpressionTree, MaximumFunctionDefinitions, MaximumFunctionArguments);
+    }
+
+    public abstract void ModifyArchitecture(
+      IRandom random,
+      ISymbolicExpressionTree tree,
+      IntValue maxFunctionDefinitions,
+      IntValue maxFunctionArguments);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/Instruction.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/Instruction.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/Instruction.cs	(revision 16132)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  // total size of this class should be small to improve cache access while executing the code
+  public class Instruction {
+    // the tree node can hold additional data that is necessary for the execution of this instruction
+    public ISymbolicExpressionTreeNode dynamicNode;
+    // op code of the function that determines what operation should be executed
+    public byte opCode;
+    // number of arguments of the current instruction
+    public ushort nArguments;
+    // an optional object value (addresses for calls, argument index for arguments)
+    public object data;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/LinearInstruction.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/LinearInstruction.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/LinearInstruction.cs	(revision 16132)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  // total size of this class should be small to improve cache access while executing the code
+  public class LinearInstruction : Instruction {
+    public double value;
+    public int childIndex;
+    public bool skip;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs	(revision 16132)
@@ -0,0 +1,80 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public static class SymbolicExpressionTreeCompiler {
+
+    public static Instruction[] Compile(ISymbolicExpressionTree tree, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper) {
+      return Compile(tree, opCodeMapper, Enumerable.Empty<Func<Instruction, Instruction>>());
+    }
+    public static Instruction[] Compile(ISymbolicExpressionTree tree, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper, IEnumerable<Func<Instruction, Instruction>> postInstructionCompiledHooks) {
+      Dictionary<string, ushort> entryPoint = new Dictionary<string, ushort>();
+      List<Instruction> code = new List<Instruction>();
+      // compile main body branches
+      foreach (var branch in tree.Root.GetSubtree(0).Subtrees) {
+        code.AddRange(Compile(branch, opCodeMapper, postInstructionCompiledHooks));
+      }
+      // 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.GetSubtree(0), opCodeMapper, postInstructionCompiledHooks));
+      }
+      // 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.data = entryPoint[invokeNode.Symbol.FunctionName];
+        }
+      }
+
+      return code.ToArray();
+    }
+
+    private static IEnumerable<Instruction> Compile(ISymbolicExpressionTreeNode branch, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper, IEnumerable<Func<Instruction, Instruction>> postInstructionCompiledHooks) {
+      foreach (var node in branch.IterateNodesPrefix()) {
+        Instruction instr = new Instruction();
+        int subtreesCount = node.SubtreeCount;
+        if (subtreesCount > ushort.MaxValue) throw new ArgumentException("Number of subtrees is too big (> 65.535)");
+        instr.nArguments = (ushort)subtreesCount;
+        instr.opCode = opCodeMapper(node);
+        if (node.Symbol is Argument) {
+          var argNode = (ArgumentTreeNode)node;
+          instr.data = (ushort)argNode.Symbol.ArgumentIndex;
+        }
+        instr.dynamicNode = node;
+        foreach (var hook in postInstructionCompiledHooks) {
+          instr = hook(instr);
+        }
+        yield return instr;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeLinearCompiler.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeLinearCompiler.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeLinearCompiler.cs	(revision 16132)
@@ -0,0 +1,49 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding {
+  public static class SymbolicExpressionTreeLinearCompiler {
+    public static LinearInstruction[] Compile(ISymbolicExpressionTree tree, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper) {
+      var root = tree.Root.GetSubtree(0).GetSubtree(0);
+      return Compile(root, opCodeMapper);
+    }
+
+    public static LinearInstruction[] Compile(ISymbolicExpressionTreeNode root, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper) {
+      var code = new LinearInstruction[root.GetLength()];
+      if (root.SubtreeCount > ushort.MaxValue) throw new ArgumentException("Number of subtrees is too big (>65.535)");
+      code[0] = new LinearInstruction { dynamicNode = root, nArguments = (ushort)root.SubtreeCount, opCode = opCodeMapper(root) };
+      int c = 1, i = 0;
+      foreach (var node in root.IterateNodesBreadth()) {
+        for (int j = 0; j < node.SubtreeCount; ++j) {
+          var s = node.GetSubtree(j);
+          if (s.SubtreeCount > ushort.MaxValue) throw new ArgumentException("Number of subtrees is too big (>65.535)");
+          code[c + j] = new LinearInstruction { dynamicNode = s, nArguments = (ushort)s.SubtreeCount, opCode = opCodeMapper(s) };
+        }
+        code[i].childIndex = c;
+        c += node.SubtreeCount;
+        ++i;
+      }
+      return code;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs	(revision 16132)
@@ -0,0 +1,160 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [NonDiscoverableType]
+  [StorableClass]
+  [Item("FullTreeCreator", "An operator that creates new symbolic expression trees using the 'Full' method")]
+  public class FullTreeCreator : SymbolicExpressionTreeCreator,
+                                 ISymbolicExpressionTreeSizeConstraintOperator,
+                                 ISymbolicExpressionTreeGrammarBasedOperator {
+
+    [StorableConstructor]
+    protected FullTreeCreator(bool deserializing) : base(deserializing) { }
+    protected FullTreeCreator(FullTreeCreator original, Cloner cloner) : base(original, cloner) { }
+
+    public FullTreeCreator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FullTreeCreator(this, cloner);
+    }
+
+
+    protected override ISymbolicExpressionTree Create(IRandom random) {
+      return Create(random, ClonedSymbolicExpressionTreeGrammarParameter.ActualValue,
+          MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value, MaximumSymbolicExpressionTreeDepthParameter.ActualValue.Value);
+    }
+
+    public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
+      return Create(random, grammar, maxTreeLength, maxTreeDepth);
+    }
+
+    /// <summary>
+    /// Create a symbolic expression tree using the 'Full' method.
+    /// Function symbols are used for all nodes situated on a level above the maximum tree depth. 
+    /// Nodes on the last tree level will have Terminal symbols.
+    /// </summary>
+    /// <param name="random">Random generator</param>
+    /// <param name="grammar">Available tree grammar</param>
+    /// <param name="maxTreeDepth">Maximum tree depth</param>
+    /// <param name="maxTreeLength">Maximum tree length. This parameter is not used.</param>
+    /// <returns></returns>
+    public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
+      var tree = new SymbolicExpressionTree();
+      var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode();
+      if (rootNode.HasLocalParameters) rootNode.ResetLocalParameters(random);
+      rootNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+      var startNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
+      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
+      startNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+      rootNode.AddSubtree(startNode);
+
+      Create(random, startNode, maxTreeDepth-1);
+      tree.Root = rootNode;
+      return tree;
+    }
+
+    public static void Create(IRandom random, ISymbolicExpressionTreeNode seedNode, int maxDepth) {
+      // make sure it is possible to create a trees smaller than maxDepth
+      if (seedNode.Grammar.GetMinimumExpressionDepth(seedNode.Symbol) > maxDepth)
+        throw new ArgumentException("Cannot create trees of depth " + maxDepth + " or smaller because of grammar constraints.", "maxDepth");
+
+
+      int arity = seedNode.Grammar.GetMaximumSubtreeCount(seedNode.Symbol);
+      // Throw an exception if the seedNode happens to be a terminal, since in this case we cannot grow a tree.
+      if (arity <= 0)
+        throw new ArgumentException("Cannot grow tree. Seed node shouldn't have arity zero.");
+
+      var allowedSymbols = seedNode.Grammar.AllowedSymbols
+        .Where(s => s.InitialFrequency > 0.0 && seedNode.Grammar.GetMaximumSubtreeCount(s) > 0)
+        .ToList();
+
+      for (var i = 0; i < arity; i++) {
+        var possibleSymbols = allowedSymbols
+          .Where(s => seedNode.Grammar.IsAllowedChildSymbol(seedNode.Symbol, s, i)
+                   && seedNode.Grammar.GetMinimumExpressionDepth(s) <= maxDepth
+                   && seedNode.Grammar.GetMaximumExpressionDepth(s) >= maxDepth)
+          .ToList();
+        var weights = possibleSymbols.Select(s => s.InitialFrequency).ToList();
+
+#pragma warning disable 612, 618
+        var selectedSymbol = possibleSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+        var tree = selectedSymbol.CreateTreeNode();
+        if (tree.HasLocalParameters) tree.ResetLocalParameters(random);
+        seedNode.AddSubtree(tree);
+      }
+
+      // Only iterate over the non-terminal nodes (those which have arity > 0)
+      // Start from depth 2 since the first two levels are formed by the rootNode and the seedNode
+      foreach (var subTree in seedNode.Subtrees)
+        if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
+          RecursiveCreate(random, subTree, 2, maxDepth);
+    }
+
+    private static void RecursiveCreate(IRandom random, ISymbolicExpressionTreeNode root, int currentDepth, int maxDepth) {
+      var arity = root.Grammar.GetMaximumSubtreeCount(root.Symbol);
+      // In the 'Full' grow method, we cannot have terminals on the intermediate tree levels.
+      if (arity <= 0)
+        throw new ArgumentException("Cannot grow node of arity zero. Expected a function node.");
+
+      var allowedSymbols = root.Grammar.AllowedSymbols
+        .Where(s => s.InitialFrequency > 0.0)
+        .ToList();
+
+      for (var i = 0; i < arity; i++) {
+        var possibleSymbols = allowedSymbols
+          .Where(s => root.Grammar.IsAllowedChildSymbol(root.Symbol, s, i) &&
+            root.Grammar.GetMinimumExpressionDepth(s) - 1 <= maxDepth - currentDepth &&
+            root.Grammar.GetMaximumExpressionDepth(s) > maxDepth - currentDepth)
+          .ToList();
+        if (!possibleSymbols.Any())
+          throw new InvalidOperationException("No symbols are available for the tree.");
+        var weights = possibleSymbols.Select(s => s.InitialFrequency).ToList();
+
+#pragma warning disable 612, 618
+        var selectedSymbol = possibleSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+        var tree = selectedSymbol.CreateTreeNode();
+        if (tree.HasLocalParameters) tree.ResetLocalParameters(random);
+        root.AddSubtree(tree);
+      }
+
+      //additional levels should only be added if the maximum depth is not reached yet
+      if (maxDepth > currentDepth) {
+        foreach (var subTree in root.Subtrees)
+          if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
+            RecursiveCreate(random, subTree, currentDepth + 1, maxDepth);
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/GrowTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/GrowTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/GrowTreeCreator.cs	(revision 16132)
@@ -0,0 +1,150 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [NonDiscoverableType]
+  [StorableClass]
+  [Item("GrowTreeCreator", "An operator that creates new symbolic expression trees using the 'Grow' method")]
+  public class GrowTreeCreator : SymbolicExpressionTreeCreator {
+    [StorableConstructor]
+    protected GrowTreeCreator(bool deserializing) : base(deserializing) { }
+    protected GrowTreeCreator(GrowTreeCreator original, Cloner cloner) : base(original, cloner) { }
+
+    public GrowTreeCreator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GrowTreeCreator(this, cloner);
+    }
+
+
+    protected override ISymbolicExpressionTree Create(IRandom random) {
+      return Create(random, ClonedSymbolicExpressionTreeGrammarParameter.ActualValue,
+        MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value, MaximumSymbolicExpressionTreeDepthParameter.ActualValue.Value);
+    }
+
+    public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
+      return Create(random, grammar, maxTreeLength, maxTreeDepth);
+    }
+
+    /// <summary>
+    /// Create a symbolic expression tree using the 'Grow' method.
+    /// All symbols are allowed for nodes, so the resulting trees can be of any shape and size. 
+    /// </summary>
+    /// <param name="random">Random generator</param>
+    /// <param name="grammar">Available tree grammar</param>
+    /// <param name="maxTreeDepth">Maximum tree depth</param>
+    /// <param name="maxTreeLength">Maximum tree length. This parameter is not used.</param>
+    /// <returns></returns>
+    public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
+      var tree = new SymbolicExpressionTree();
+      var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode();
+      if (rootNode.HasLocalParameters) rootNode.ResetLocalParameters(random);
+      rootNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+
+      var startNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
+      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
+      startNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+      rootNode.AddSubtree(startNode);
+
+      Create(random, startNode, maxTreeDepth - 1);
+      tree.Root = rootNode;
+      return tree;
+    }
+
+    public static void Create(IRandom random, ISymbolicExpressionTreeNode seedNode, int maxDepth) {
+      // make sure it is possible to create a trees smaller than maxDepth
+      if (seedNode.Grammar.GetMinimumExpressionDepth(seedNode.Symbol) > maxDepth)
+        throw new ArgumentException("Cannot create trees of depth " + maxDepth + " or smaller because of grammar constraints.", "maxDepth");
+
+      var arity = SampleArity(random, seedNode);
+      // throw an exception if the seedNode happens to be a terminal, since in this case we cannot grow a tree
+      if (arity <= 0)
+        throw new ArgumentException("Cannot grow tree. Seed node shouldn't have arity zero.");
+
+      var allowedSymbols = seedNode.Grammar.AllowedSymbols.Where(s => s.InitialFrequency > 0.0).ToList();
+
+      for (var i = 0; i < arity; i++) {
+        var possibleSymbols = allowedSymbols.Where(s => seedNode.Grammar.IsAllowedChildSymbol(seedNode.Symbol, s, i)).ToList();
+        var weights = possibleSymbols.Select(s => s.InitialFrequency).ToList();
+
+#pragma warning disable 612, 618
+        var selectedSymbol = possibleSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+        var tree = selectedSymbol.CreateTreeNode();
+        if (tree.HasLocalParameters) tree.ResetLocalParameters(random);
+        seedNode.AddSubtree(tree);
+      }
+
+      // Only iterate over the non-terminal nodes (those which have arity > 0)
+      // Start from depth 2 since the first two levels are formed by the rootNode and the seedNode
+      foreach (var subTree in seedNode.Subtrees)
+        if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) > 0)
+          RecursiveCreate(random, subTree, 2, maxDepth);
+    }
+
+    private static void RecursiveCreate(IRandom random, ISymbolicExpressionTreeNode root, int currentDepth, int maxDepth) {
+      var arity = SampleArity(random, root);
+      if (arity == 0)
+        return;
+
+      var allowedSymbols = root.Grammar.AllowedSymbols.Where(s => s.InitialFrequency > 0.0).ToList();
+
+      for (var i = 0; i < arity; i++) {
+        var possibleSymbols = allowedSymbols.Where(s => root.Grammar.IsAllowedChildSymbol(root.Symbol, s, i) &&
+                                                        root.Grammar.GetMinimumExpressionDepth(s) - 1 <= maxDepth - currentDepth).ToList();
+
+        if (!possibleSymbols.Any())
+          throw new InvalidOperationException("No symbols are available for the tree.");
+
+        var weights = possibleSymbols.Select(s => s.InitialFrequency).ToList();
+#pragma warning disable 612, 618
+        var selectedSymbol = possibleSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+        var tree = selectedSymbol.CreateTreeNode();
+        if (tree.HasLocalParameters) tree.ResetLocalParameters(random);
+        root.AddSubtree(tree);
+      }
+
+      if (maxDepth > currentDepth)
+        foreach (var subTree in root.Subtrees)
+          if (subTree.Grammar.GetMaximumSubtreeCount(subTree.Symbol) != 0)
+            RecursiveCreate(random, subTree, currentDepth + 1, maxDepth);
+    }
+
+    private static int SampleArity(IRandom random, ISymbolicExpressionTreeNode node) {
+      var minArity = node.Grammar.GetMinimumSubtreeCount(node.Symbol);
+      var maxArity = node.Grammar.GetMaximumSubtreeCount(node.Symbol);
+
+      return random.Next(minArity, maxArity + 1);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs	(revision 16132)
@@ -0,0 +1,315 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [NonDiscoverableType]
+  [StorableClass]
+  [Item("ProbabilisticTreeCreator", "An operator that creates new symbolic expression trees with uniformly distributed length")]
+  public class ProbabilisticTreeCreator : SymbolicExpressionTreeCreator,
+    ISymbolicExpressionTreeSizeConstraintOperator, ISymbolicExpressionTreeGrammarBasedOperator {
+    private const int MAX_TRIES = 100;
+
+    [StorableConstructor]
+    protected ProbabilisticTreeCreator(bool deserializing) : base(deserializing) { }
+    protected ProbabilisticTreeCreator(ProbabilisticTreeCreator original, Cloner cloner) : base(original, cloner) { }
+    public ProbabilisticTreeCreator()
+      : base() {
+
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ProbabilisticTreeCreator(this, cloner);
+    }
+
+
+    protected override ISymbolicExpressionTree Create(IRandom random) {
+      return Create(random, ClonedSymbolicExpressionTreeGrammarParameter.ActualValue,
+        MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value, MaximumSymbolicExpressionTreeDepthParameter.ActualValue.Value);
+    }
+
+    public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
+      return Create(random, grammar, maxTreeLength, maxTreeDepth);
+    }
+
+    public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
+      SymbolicExpressionTree tree = new SymbolicExpressionTree();
+      var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode();
+      if (rootNode.HasLocalParameters) rootNode.ResetLocalParameters(random);
+      rootNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+      var startNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
+      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
+      startNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+      rootNode.AddSubtree(startNode);
+      PTC2(random, startNode, maxTreeLength, maxTreeDepth);
+      tree.Root = rootNode;
+      return tree;
+    }
+
+    public static ISymbolicExpressionTree CreateExpressionTree(IRandom random, ISymbolicExpressionGrammar grammar, int targetLength,
+      int maxTreeDepth) {
+      SymbolicExpressionTree tree = new SymbolicExpressionTree();
+      var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode();
+      if (rootNode.HasLocalParameters) rootNode.ResetLocalParameters(random);
+      rootNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+      var startNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
+      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
+      startNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+      rootNode.AddSubtree(startNode);
+      bool success = TryCreateFullTreeFromSeed(random, startNode, targetLength - 2, maxTreeDepth - 1);
+      if (!success) throw new InvalidOperationException(string.Format("Could not create a tree with target length {0} and max depth {1}", targetLength, maxTreeDepth));
+
+      tree.Root = rootNode;
+      return tree;
+
+    }
+
+    private class TreeExtensionPoint {
+      public ISymbolicExpressionTreeNode Parent { get; set; }
+      public int ChildIndex { get; set; }
+      public int ExtensionPointDepth { get; set; }
+      public int MaximumExtensionLength { get; set; }
+      public int MinimumExtensionLength { get; set; }
+    }
+
+    public static void PTC2(IRandom random, ISymbolicExpressionTreeNode seedNode,
+      int maxLength, int maxDepth) {
+      // make sure it is possible to create a trees smaller than maxLength and maxDepth
+      if (seedNode.Grammar.GetMinimumExpressionLength(seedNode.Symbol) > maxLength)
+        throw new ArgumentException("Cannot create trees of length " + maxLength + " or shorter because of grammar constraints.", "maxLength");
+      if (seedNode.Grammar.GetMinimumExpressionDepth(seedNode.Symbol) > maxDepth)
+        throw new ArgumentException("Cannot create trees of depth " + maxDepth + " or smaller because of grammar constraints.", "maxDepth");
+
+      // tree length is limited by the grammar and by the explicit size constraints
+      int allowedMinLength = seedNode.Grammar.GetMinimumExpressionLength(seedNode.Symbol);
+      int allowedMaxLength = Math.Min(maxLength, seedNode.Grammar.GetMaximumExpressionLength(seedNode.Symbol, maxDepth));
+      int tries = 0;
+      while (tries++ < MAX_TRIES) {
+        // select a target tree length uniformly in the possible range (as determined by explicit limits and limits of the grammar)
+        int targetTreeLength;
+        targetTreeLength = random.Next(allowedMinLength, allowedMaxLength + 1);
+        if (targetTreeLength <= 1 || maxDepth <= 1) return;
+
+        bool success = TryCreateFullTreeFromSeed(random, seedNode, targetTreeLength - 1, maxDepth - 1);
+
+        // if successful => check constraints and return the tree if everything looks ok        
+        if (success && seedNode.GetLength() <= maxLength && seedNode.GetDepth() <= maxDepth) {
+          return;
+        } else {
+          // clean seedNode
+          while (seedNode.Subtrees.Any()) seedNode.RemoveSubtree(0);
+        }
+        // try a different length MAX_TRIES times
+      }
+      throw new ArgumentException("Couldn't create a random valid tree.");
+    }
+
+    private static bool TryCreateFullTreeFromSeed(IRandom random, ISymbolicExpressionTreeNode root,
+      int targetLength, int maxDepth) {
+      List<TreeExtensionPoint> extensionPoints = new List<TreeExtensionPoint>();
+      int currentLength = 0;
+      int actualArity = SampleArity(random, root, targetLength, maxDepth);
+      if (actualArity < 0) return false;
+
+      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);
+        var x = new TreeExtensionPoint { Parent = root, ChildIndex = i, ExtensionPointDepth = 0 };
+        FillExtensionLengths(x, maxDepth);
+        extensionPoints.Add(x);
+      }
+      //necessary to use long data type as the extension point length could be int.MaxValue
+      long minExtensionPointsLength = extensionPoints.Select(x => (long)x.MinimumExtensionLength).Sum();
+      long maxExtensionPointsLength = extensionPoints.Select(x => (long)x.MaximumExtensionLength).Sum();
+
+      // while there are pending extension points and we have not reached the limit of adding new extension points
+      while (extensionPoints.Count > 0 && minExtensionPointsLength + currentLength <= targetLength) {
+        int randomIndex = random.Next(extensionPoints.Count);
+        TreeExtensionPoint nextExtension = extensionPoints[randomIndex];
+        extensionPoints.RemoveAt(randomIndex);
+        ISymbolicExpressionTreeNode parent = nextExtension.Parent;
+        int argumentIndex = nextExtension.ChildIndex;
+        int extensionDepth = nextExtension.ExtensionPointDepth;
+
+        if (parent.Grammar.GetMinimumExpressionDepth(parent.Symbol) > maxDepth - extensionDepth) {
+          ReplaceWithMinimalTree(random, root, parent, argumentIndex);
+          int insertedTreeLength = parent.GetSubtree(argumentIndex).GetLength();
+          currentLength += insertedTreeLength;
+          minExtensionPointsLength -= insertedTreeLength;
+          maxExtensionPointsLength -= insertedTreeLength;
+        } else {
+          //remove currently chosen extension point from calculation
+          minExtensionPointsLength -= nextExtension.MinimumExtensionLength;
+          maxExtensionPointsLength -= nextExtension.MaximumExtensionLength;
+
+          var symbols = from s in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, argumentIndex)
+                        where s.InitialFrequency > 0.0
+                        where parent.Grammar.GetMinimumExpressionDepth(s) <= maxDepth - extensionDepth
+                        where parent.Grammar.GetMinimumExpressionLength(s) <= targetLength - currentLength - minExtensionPointsLength
+                        select s;
+          if (maxExtensionPointsLength < targetLength - currentLength)
+            symbols = from s in symbols
+                      where parent.Grammar.GetMaximumExpressionLength(s, maxDepth - extensionDepth) >= targetLength - currentLength - maxExtensionPointsLength
+                      select s;
+          var allowedSymbols = symbols.ToList();
+
+          if (allowedSymbols.Count == 0) return false;
+          var weights = allowedSymbols.Select(x => x.InitialFrequency).ToList();
+
+#pragma warning disable 612, 618
+          var selectedSymbol = allowedSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+          ISymbolicExpressionTreeNode newTree = selectedSymbol.CreateTreeNode();
+          if (newTree.HasLocalParameters) newTree.ResetLocalParameters(random);
+          parent.RemoveSubtree(argumentIndex);
+          parent.InsertSubtree(argumentIndex, newTree);
+
+          var topLevelNode = newTree as SymbolicExpressionTreeTopLevelNode;
+          if (topLevelNode != null)
+            topLevelNode.SetGrammar((ISymbolicExpressionTreeGrammar)root.Grammar.Clone());
+
+          currentLength++;
+          actualArity = SampleArity(random, newTree, targetLength - currentLength, maxDepth - extensionDepth);
+          if (actualArity < 0) return false;
+          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);
+            var x = new TreeExtensionPoint { Parent = newTree, ChildIndex = i, ExtensionPointDepth = extensionDepth + 1 };
+            FillExtensionLengths(x, maxDepth);
+            extensionPoints.Add(x);
+            maxExtensionPointsLength += x.MaximumExtensionLength;
+            minExtensionPointsLength += x.MinimumExtensionLength;
+          }
+        }
+      }
+      // fill all pending extension points
+      while (extensionPoints.Count > 0) {
+        int randomIndex = random.Next(extensionPoints.Count);
+        TreeExtensionPoint nextExtension = extensionPoints[randomIndex];
+        extensionPoints.RemoveAt(randomIndex);
+        ISymbolicExpressionTreeNode parent = nextExtension.Parent;
+        int a = nextExtension.ChildIndex;
+        ReplaceWithMinimalTree(random, root, parent, a);
+      }
+      return true;
+    }
+
+    private static void ReplaceWithMinimalTree(IRandom random, ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode parent,
+      int childIndex) {
+      // determine possible symbols that will lead to the smallest possible tree
+      var possibleSymbols = (from s in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, childIndex)
+                             where s.InitialFrequency > 0.0
+                             group s by parent.Grammar.GetMinimumExpressionLength(s) into g
+                             orderby g.Key
+                             select g).First().ToList();
+      var weights = possibleSymbols.Select(x => x.InitialFrequency).ToList();
+
+#pragma warning disable 612, 618
+      var selectedSymbol = possibleSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+      var tree = selectedSymbol.CreateTreeNode();
+      if (tree.HasLocalParameters) tree.ResetLocalParameters(random);
+      parent.RemoveSubtree(childIndex);
+      parent.InsertSubtree(childIndex, tree);
+
+      var topLevelNode = tree as SymbolicExpressionTreeTopLevelNode;
+      if (topLevelNode != null)
+        topLevelNode.SetGrammar((ISymbolicExpressionTreeGrammar)root.Grammar.Clone());
+
+      for (int i = 0; i < tree.Grammar.GetMinimumSubtreeCount(tree.Symbol); 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);
+      }
+    }
+
+    private static void FillExtensionLengths(TreeExtensionPoint extension, int maxDepth) {
+      var grammar = extension.Parent.Grammar;
+      int maxLength = int.MinValue;
+      int minLength = int.MaxValue;
+      foreach (ISymbol s in grammar.GetAllowedChildSymbols(extension.Parent.Symbol, extension.ChildIndex)) {
+        if (s.InitialFrequency > 0.0) {
+          int max = grammar.GetMaximumExpressionLength(s, maxDepth - extension.ExtensionPointDepth);
+          maxLength = Math.Max(maxLength, max);
+          int min = grammar.GetMinimumExpressionLength(s);
+          minLength = Math.Min(minLength, min);
+        }
+      }
+
+      extension.MaximumExtensionLength = maxLength;
+      extension.MinimumExtensionLength = minLength;
+    }
+
+    private static int SampleArity(IRandom random, ISymbolicExpressionTreeNode node, int targetLength, int maxDepth) {
+      // select actualArity randomly with the constraint that the sub-trees in the minimal arity can become large enough
+      int minArity = node.Grammar.GetMinimumSubtreeCount(node.Symbol);
+      int maxArity = node.Grammar.GetMaximumSubtreeCount(node.Symbol);
+      if (maxArity > targetLength) {
+        maxArity = targetLength;
+      }
+      if (minArity == maxArity) return minArity;
+
+      // 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 length
+      // if 1..3 trees are possible and the largest possible first sub-tree is smaller larger than the target length then minArity should be at least 2
+      long aggregatedLongestExpressionLength = 0;
+      for (int i = 0; i < maxArity; i++) {
+        aggregatedLongestExpressionLength += (from s in node.Grammar.GetAllowedChildSymbols(node.Symbol, i)
+                                              where s.InitialFrequency > 0.0
+                                              select node.Grammar.GetMaximumExpressionLength(s, maxDepth)).Max();
+        if (i > minArity && aggregatedLongestExpressionLength < targetLength) minArity = i + 1;
+        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 length 
+      // if 1..3 trees are possible and the smallest possible first sub-tree is already larger than the target length then maxArity should be at most 0
+      long aggregatedShortestExpressionLength = 0;
+      for (int i = 0; i < maxArity; i++) {
+        aggregatedShortestExpressionLength += (from s in node.Grammar.GetAllowedChildSymbols(node.Symbol, i)
+                                               where s.InitialFrequency > 0.0
+                                               select node.Grammar.GetMinimumExpressionLength(s)).Min();
+        if (aggregatedShortestExpressionLength > targetLength) {
+          maxArity = i;
+          break;
+        }
+      }
+      if (minArity > maxArity) return -1;
+      return random.Next(minArity, maxArity + 1);
+    }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/RampedHalfAndHalfTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/RampedHalfAndHalfTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/RampedHalfAndHalfTreeCreator.cs	(revision 16132)
@@ -0,0 +1,83 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [NonDiscoverableType]
+  [StorableClass]
+  [Item("RampedHalfAndHalfTreeCreator", "An operator that creates new symbolic expression trees in an alternate way: half the trees are created usign the 'Grow' method while the other half are created using the 'Full' method")]
+  public class RampedHalfAndHalfTreeCreator : SymbolicExpressionTreeCreator {
+    [StorableConstructor]
+    protected RampedHalfAndHalfTreeCreator(bool deserializing) : base(deserializing) { }
+    protected RampedHalfAndHalfTreeCreator(RampedHalfAndHalfTreeCreator original, Cloner cloner) : base(original, cloner) { }
+
+    public RampedHalfAndHalfTreeCreator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RampedHalfAndHalfTreeCreator(this, cloner);
+    }
+
+    protected override ISymbolicExpressionTree Create(IRandom random) {
+      return Create(random, ClonedSymbolicExpressionTreeGrammarParameter.ActualValue,
+        MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value, MaximumSymbolicExpressionTreeDepthParameter.ActualValue.Value);
+    }
+
+    public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
+      return Create(random, grammar, maxTreeLength, maxTreeDepth);
+    }
+
+    /// <summary>
+    /// Create a symbolic expression tree using 'RampedHalfAndHalf' strategy.
+    /// Half the trees are created with the 'Grow' method, and the other half are created with the 'Full' method.
+    /// </summary>
+    /// <param name="random">Random generator</param>
+    /// <param name="grammar">Available tree grammar</param>
+    /// <param name="maxTreeLength">Maximum tree length (this parameter is ignored)</param>
+    /// <param name="maxTreeDepth">Maximum tree depth</param>
+    /// <returns></returns>
+    public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
+      var tree = new SymbolicExpressionTree();
+      var rootNode = (SymbolicExpressionTreeTopLevelNode)grammar.ProgramRootSymbol.CreateTreeNode();
+      if (rootNode.HasLocalParameters) rootNode.ResetLocalParameters(random);
+      rootNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+      var startNode = (SymbolicExpressionTreeTopLevelNode)grammar.StartSymbol.CreateTreeNode();
+      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
+      startNode.SetGrammar(grammar.CreateExpressionTreeGrammar());
+
+      rootNode.AddSubtree(startNode);
+
+      double p = random.NextDouble();
+
+      if (p < 0.5)
+        GrowTreeCreator.Create(random, startNode, maxTreeDepth - 2);
+      else
+        FullTreeCreator.Create(random, startNode, maxTreeDepth - 2);
+
+      tree.Root = rootNode;
+      return tree;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs	(revision 16132)
@@ -0,0 +1,91 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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 MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+
+    private const string SymbolicExpressionTreeGrammarParameterName = "SymbolicExpressionTreeGrammar";
+    private const string ClonedSymbolicExpressionTreeGrammarParameterName = "ClonedSymbolicExpressionTreeGrammar";
+
+    #region Parameter Properties
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    public IValueLookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionTreeGrammarParameter {
+      get { return (IValueLookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionTreeGrammarParameterName]; }
+    }
+
+    public ILookupParameter<ISymbolicExpressionGrammar> ClonedSymbolicExpressionTreeGrammarParameter {
+      get { return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[ClonedSymbolicExpressionTreeGrammarParameterName]; }
+    }
+    #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>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName, "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(ClonedSymbolicExpressionTreeGrammarParameterName))
+        Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
+    }
+
+    public override IOperation InstrumentedApply() {
+      if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) {
+        SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true;
+        IScope globalScope = ExecutionContext.Scope;
+        while (globalScope.Parent != null)
+          globalScope = globalScope.Parent;
+
+        globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName,
+          (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
+      }
+      SymbolicExpressionTreeParameter.ActualValue = Create(RandomParameter.ActualValue);
+      return base.InstrumentedApply();
+    }
+
+    protected abstract ISymbolicExpressionTree Create(IRandom random);
+    public abstract ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs	(revision 16132)
@@ -0,0 +1,212 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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("SubtreeSwappingCrossover", "An operator which performs subtree swapping crossover.")]
+  [StorableClass]
+  public class SubtreeCrossover : SymbolicExpressionTreeCrossover, ISymbolicExpressionTreeSizeConstraintOperator {
+    private const string InternalCrossoverPointProbabilityParameterName = "InternalCrossoverPointProbability";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+
+    #region Parameter Properties
+    public IValueLookupParameter<PercentValue> InternalCrossoverPointProbabilityParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[InternalCrossoverPointProbabilityParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+    #region Properties
+    public PercentValue InternalCrossoverPointProbability {
+      get { return InternalCrossoverPointProbabilityParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    protected SubtreeCrossover(bool deserializing) : base(deserializing) { }
+    protected SubtreeCrossover(SubtreeCrossover original, Cloner cloner) : base(original, cloner) { }
+    public SubtreeCrossover()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>(InternalCrossoverPointProbabilityParameterName, "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);
+    }
+
+    public override ISymbolicExpressionTree Crossover(IRandom random,
+      ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
+      return Cross(random, parent0, parent1, InternalCrossoverPointProbability.Value,
+        MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
+    }
+
+    public static ISymbolicExpressionTree Cross(IRandom random,
+      ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1,
+      double internalCrossoverPointProbability, int maxTreeLength, int maxTreeDepth) {
+      // select a random crossover point in the first parent 
+      CutPoint crossoverPoint0;
+      SelectCrossoverPoint(random, parent0, internalCrossoverPointProbability, maxTreeLength, maxTreeDepth, out crossoverPoint0);
+
+      int childLength = crossoverPoint0.Child != null ? crossoverPoint0.Child.GetLength() : 0;
+      // calculate the max length and depth that the inserted branch can have 
+      int maxInsertedBranchLength = Math.Max(0, maxTreeLength - (parent0.Length - childLength));
+      int maxInsertedBranchDepth = Math.Max(0, maxTreeDepth - parent0.Root.GetBranchLevel(crossoverPoint0.Parent));
+
+      List<ISymbolicExpressionTreeNode> allowedBranches = new List<ISymbolicExpressionTreeNode>();
+      parent1.Root.ForEachNodePostfix((n) => {
+        if (n.GetLength() <= maxInsertedBranchLength &&
+            n.GetDepth() <= maxInsertedBranchDepth && crossoverPoint0.IsMatchingPointType(n))
+          allowedBranches.Add(n);
+      });
+      // empty branch
+      if (crossoverPoint0.IsMatchingPointType(null)) allowedBranches.Add(null);
+
+      if (allowedBranches.Count == 0) {
+        return parent0;
+      } else {
+        var selectedBranch = SelectRandomBranch(random, allowedBranches, internalCrossoverPointProbability);
+
+        if (crossoverPoint0.Child != null) {
+          // manipulate the tree of parent0 in place
+          // replace the branch in tree0 with the selected branch from tree1
+          crossoverPoint0.Parent.RemoveSubtree(crossoverPoint0.ChildIndex);
+          if (selectedBranch != null) {
+            crossoverPoint0.Parent.InsertSubtree(crossoverPoint0.ChildIndex, selectedBranch);
+          }
+        } else {
+          // child is null (additional child should be added under the parent)
+          if (selectedBranch != null) {
+            crossoverPoint0.Parent.AddSubtree(selectedBranch);
+          }
+        }
+        return parent0;
+      }
+    }
+
+    private static void SelectCrossoverPoint(IRandom random, ISymbolicExpressionTree parent0, double internalNodeProbability, int maxBranchLength, int maxBranchDepth, out CutPoint crossoverPoint) {
+      if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");
+      List<CutPoint> internalCrossoverPoints = new List<CutPoint>();
+      List<CutPoint> leafCrossoverPoints = new List<CutPoint>();
+      parent0.Root.ForEachNodePostfix((n) => {
+        if (n.SubtreeCount > 0 && n != parent0.Root) {
+          //avoid linq to reduce memory pressure
+          for (int i = 0; i < n.SubtreeCount; i++) {
+            var child = n.GetSubtree(i);
+            if (child.GetLength() <= maxBranchLength &&
+                child.GetDepth() <= maxBranchDepth) {
+              if (child.SubtreeCount > 0)
+                internalCrossoverPoints.Add(new CutPoint(n, child));
+              else
+                leafCrossoverPoints.Add(new CutPoint(n, child));
+            }
+          }
+
+          // add one additional extension point if the number of sub trees for the symbol is not full
+          if (n.SubtreeCount < n.Grammar.GetMaximumSubtreeCount(n.Symbol)) {
+            // empty extension point
+            internalCrossoverPoints.Add(new CutPoint(n, n.SubtreeCount));
+          }
+        }
+      }
+    );
+
+      if (random.NextDouble() < internalNodeProbability) {
+        // select from internal node if possible
+        if (internalCrossoverPoints.Count > 0) {
+          // select internal crossover point or leaf
+          crossoverPoint = internalCrossoverPoints[random.Next(internalCrossoverPoints.Count)];
+        } else {
+          // otherwise select external node
+          crossoverPoint = leafCrossoverPoints[random.Next(leafCrossoverPoints.Count)];
+        }
+      } else if (leafCrossoverPoints.Count > 0) {
+        // select from leaf crossover point if possible
+        crossoverPoint = leafCrossoverPoints[random.Next(leafCrossoverPoints.Count)];
+      } else {
+        // otherwise select internal crossover point
+        crossoverPoint = internalCrossoverPoints[random.Next(internalCrossoverPoints.Count)];
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode SelectRandomBranch(IRandom random, IEnumerable<ISymbolicExpressionTreeNode> branches, double internalNodeProbability) {
+      if (internalNodeProbability < 0.0 || internalNodeProbability > 1.0) throw new ArgumentException("internalNodeProbability");
+      List<ISymbolicExpressionTreeNode> allowedInternalBranches;
+      List<ISymbolicExpressionTreeNode> allowedLeafBranches;
+      if (random.NextDouble() < internalNodeProbability) {
+        // select internal node if possible
+        allowedInternalBranches = (from branch in branches
+                                   where branch != null && branch.SubtreeCount > 0
+                                   select branch).ToList();
+        if (allowedInternalBranches.Count > 0) {
+          return allowedInternalBranches.SampleRandom(random);
+
+        } else {
+          // no internal nodes allowed => select leaf nodes
+          allowedLeafBranches = (from branch in branches
+                                 where branch == null || branch.SubtreeCount == 0
+                                 select branch).ToList();
+          return allowedLeafBranches.SampleRandom(random);
+        }
+      } else {
+        // select leaf node if possible
+        allowedLeafBranches = (from branch in branches
+                               where branch == null || branch.SubtreeCount == 0
+                               select branch).ToList();
+        if (allowedLeafBranches.Count > 0) {
+          return allowedLeafBranches.SampleRandom(random);
+        } else {
+          allowedInternalBranches = (from branch in branches
+                                     where branch != null && branch.SubtreeCount > 0
+                                     select branch).ToList();
+          return allowedInternalBranches.SampleRandom(random);
+
+        }
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs	(revision 16132)
@@ -0,0 +1,84 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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";
+    #region Parameter Properties
+    public ILookupParameter<ItemArray<ISymbolicExpressionTree>> ParentsParameter {
+      get { return (ScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[ParentsParameterName]; }
+    }
+    #endregion
+    #region Properties
+    private ItemArray<ISymbolicExpressionTree> Parents {
+      get { return ParentsParameter.ActualValue; }
+    }
+    private ISymbolicExpressionTree Child {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+      set { SymbolicExpressionTreeParameter.ActualValue = value; }
+    }
+    #endregion
+    [StorableConstructor]
+    protected SymbolicExpressionTreeCrossover(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeCrossover(SymbolicExpressionTreeCrossover original, Cloner cloner) : base(original, cloner) { }
+    protected SymbolicExpressionTreeCrossover()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed."));
+      ParentsParameter.ActualName = "SymbolicExpressionTree";
+    }
+
+    public sealed override IOperation InstrumentedApply() {
+      if (Parents.Length != 2)
+        throw new ArgumentException("Number of parents must be exactly two for symbolic expression tree crossover operators.");
+
+      ISymbolicExpressionTree result = Crossover(RandomParameter.ActualValue, Parents[0], Parents[1]);
+
+      Child = result;
+      return base.InstrumentedApply();
+    }
+
+    public abstract ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1);
+
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.4
+      #region Backwards compatible code, remove with 3.5
+      if (Parameters.ContainsKey("Child")) {
+        var oldChildParameter = (ILookupParameter<ISymbolicExpressionTree>)Parameters["Child"];
+        Parameters.Remove("Child");
+        SymbolicExpressionTreeParameter.ActualName = oldChildParameter.ActualName;
+      }
+      #endregion
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/CutPoint.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/CutPoint.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/CutPoint.cs	(revision 16132)
@@ -0,0 +1,69 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  public class CutPoint {
+    public ISymbolicExpressionTreeNode Parent { get; private set; }
+    public ISymbolicExpressionTreeNode Child { get; private set; }
+    private readonly ISymbolicExpressionTreeGrammar grammar;
+
+    public int ChildIndex { get; private set; }
+
+    public CutPoint(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTreeNode child) {      
+      this.Parent = parent;
+      this.Child = child;
+      this.ChildIndex = parent.IndexOfSubtree(child);
+      this.grammar = parent.Grammar;
+    }
+    public CutPoint(ISymbolicExpressionTreeNode parent, int childIndex) {
+      this.Parent = parent;
+      this.ChildIndex = childIndex;
+      this.Child = null;
+      this.grammar = parent.Grammar;
+    }
+
+    public bool IsMatchingPointType(ISymbolicExpressionTreeNode newChild) {
+      var parent = this.Parent;
+      if (newChild == null) {
+        // make sure that one subtree can be removed and that only the last subtree is removed 
+        return grammar.GetMinimumSubtreeCount(parent.Symbol) < parent.SubtreeCount &&
+          this.ChildIndex == parent.SubtreeCount - 1;
+      } else {
+        // check syntax constraints of direct parent - child relation
+        if (!grammar.ContainsSymbol(newChild.Symbol) ||
+            !grammar.IsAllowedChildSymbol(parent.Symbol, newChild.Symbol, this.ChildIndex))
+          return false;
+
+        bool result = true;
+        // check point type for the whole branch
+        newChild.ForEachNodePostfix((n) => {
+          result =
+            result &&
+            grammar.ContainsSymbol(n.Symbol) &&
+            n.SubtreeCount >= grammar.GetMinimumSubtreeCount(n.Symbol) &&
+            n.SubtreeCount <= grammar.GetMaximumSubtreeCount(n.Symbol);
+        });
+        return result;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/EnumerableExtensions.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/EnumerableExtensions.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/EnumerableExtensions.cs	(revision 16132)
@@ -0,0 +1,66 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Core;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+
+  //This class should not be used anymore. Use HeuristicLab.Random.RandomEnumberable instead
+  //This could not be fixed right now, because the algorithm behavior would be modified => version increment
+  [Obsolete("This class will be removed in the future, because the functionality is provided in HeuristicLab.Random.RandomEnumerable.")]
+  public static class EnumerableExtensions {
+    [Obsolete("This method should not be used anymore. Use the extensions provided by HeuristicLab.Random.RandomEnumberable instead.")]
+    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)];
+      }
+    }
+    [Obsolete("This method should not be used anymore. Use the extensions provided by HeuristicLab.Random.RandomEnumberable instead.")]
+    public static T SelectRandom<T>(this IEnumerable<T> xs, IEnumerable<double> weights, IRandom random) {
+      var list = xs as IList<T>;
+      var weightsList = weights as IList<double>;
+      if (list == null) {
+        list = xs.ToList();
+      }
+      if (weightsList == null) {
+        weightsList = weights.ToList();
+      }
+      if (list.Count != weightsList.Count) throw new ArgumentException("Number of elements in enumerations doesn't match.");
+      if (list.Count == 0) throw new ArgumentException("Enumeration is empty", "xs");
+
+      double sum = weightsList.Sum();
+      double r = random.NextDouble() * sum;
+      double agg = 0;
+      for (int i = 0; i < list.Count; i++) {
+        agg += weightsList[i];
+        if (agg > r) return list[i];
+      }
+      return list[random.Next(list.Count)];
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeGraphvizFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeGraphvizFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeGraphvizFormatter.cs	(revision 16132)
@@ -0,0 +1,95 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [Item("GraphViz String Formatter", "Formatter for symbolic expression trees for visualization with GraphViz.")]
+  public sealed class SymbolicExpressionTreeGraphvizFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+    public bool Indent { get; set; }
+
+    private readonly static Dictionary<string, string> symbolNameMap = new Dictionary<string, string>() {
+      // match Koza style
+      {"ProgramRootSymbol", "Prog"},
+      {"StartSymbol", "RPB"}, 
+    };
+
+    public SymbolicExpressionTreeGraphvizFormatter()
+      : base("GraphViz String Formatter", "Formatter for symbolic expression trees for visualization with GraphViz.") {
+      Indent = true;
+    }
+    private SymbolicExpressionTreeGraphvizFormatter(SymbolicExpressionTreeGraphvizFormatter original, Cloner cloner)
+      : base(original, cloner) {
+      this.Indent = original.Indent;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeGraphvizFormatter(this, cloner);
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      int nodeCounter = 1;
+      StringBuilder strBuilder = new StringBuilder();
+      strBuilder.AppendLine("graph {");
+      strBuilder.AppendLine(FormatRecursively(symbolicExpressionTree.Root, 0, ref nodeCounter));
+      strBuilder.AppendLine("}");
+      return strBuilder.ToString();
+    }
+
+    private string FormatRecursively(ISymbolicExpressionTreeNode node, int indentLength, ref int nodeId) {
+      // save id of current node
+      int currentNodeId = nodeId;
+      // increment id for next node
+      nodeId++;
+
+      StringBuilder strBuilder = new StringBuilder();
+      if (Indent) strBuilder.Append(' ', indentLength);
+
+      // get label for node and map if necessary
+      string nodeLabel = node.ToString();
+      if (symbolNameMap.ContainsKey(nodeLabel)) {
+        nodeLabel = symbolNameMap[nodeLabel];
+      }
+
+      strBuilder.Append("node" + currentNodeId + "[label=\"" + nodeLabel + "\"");
+      // leaf nodes should have box shape
+      if (node.SubtreeCount == 0) {
+        strBuilder.AppendLine(", shape=\"box\"];");
+      } else {
+        strBuilder.AppendLine("];");
+      }
+
+      // internal nodes or leaf nodes?
+      foreach (ISymbolicExpressionTreeNode subTree in node.Subtrees) {
+        // add an edge 
+        if (Indent) strBuilder.Append(' ', indentLength);
+        strBuilder.AppendLine("node" + currentNodeId + " -- node" + nodeId + ";");
+        // format the whole subtree
+        strBuilder.Append(FormatRecursively(subTree, indentLength + 2, ref nodeId));
+      }
+
+      return strBuilder.ToString();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeHierarchicalFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeHierarchicalFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeHierarchicalFormatter.cs	(revision 16132)
@@ -0,0 +1,91 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.IO;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [Item("Hierarchical Formatter", "Formatter for symbolic expression trees that uses special characters for drawing a tree in text-mode.")]
+  public sealed class SymbolicExpressionTreeHierarchicalFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+    private SymbolicExpressionTreeHierarchicalFormatter(SymbolicExpressionTreeHierarchicalFormatter original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeHierarchicalFormatter(this, cloner);
+    }
+
+    public SymbolicExpressionTreeHierarchicalFormatter() :
+      base("Hierarchical Formatter", "Formatter for symbolic expression trees that uses special characters for drawing a tree in text-mode.") { }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      var sw = new StringWriter();
+      RenderTree(sw, symbolicExpressionTree);
+      return sw.ToString();
+    }
+
+    private static void RenderTree(TextWriter writer, ISymbolicExpressionTree tree) {
+      RenderNode(writer, tree.Root, string.Empty);
+    }
+
+    public static void RenderNode(TextWriter writer, ISymbolicExpressionTreeNode node, string prefix) {
+      string label = node.ToString();
+      writer.Write(label);
+      if (node.SubtreeCount > 0) {
+        var padding = prefix + new string(' ', label.Length);
+        for (int i = 0; i != node.SubtreeCount; ++i) {
+          char connector, extender = ' ';
+          if (i == 0) {
+            if (node.SubtreeCount > 1) {
+              connector = RenderChars.JunctionDown;
+              extender = RenderChars.VerticalLine;
+            } else {
+              connector = RenderChars.HorizontalLine;
+              extender = ' ';
+            }
+          } else {
+            writer.Write(padding);
+            if (i == node.SubtreeCount - 1) {
+              connector = RenderChars.CornerRight;
+              extender = ' ';
+            } else {
+              connector = RenderChars.JunctionRight;
+              extender = RenderChars.VerticalLine;
+            }
+          }
+          writer.Write(string.Concat(connector, RenderChars.HorizontalLine));
+          var newPrefix = string.Concat(padding, extender, ' ');
+          RenderNode(writer, node.GetSubtree(i), newPrefix);
+        }
+      } else
+        writer.WriteLine();
+    }
+
+    // helper class providing characters for displaying a tree in the console
+    public static class RenderChars {
+      public const char JunctionDown = '┬';
+      public const char HorizontalLine = '─';
+      public const char VerticalLine = '│';
+      public const char JunctionRight = '├';
+      public const char CornerRight = '└';
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeStringFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeStringFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeStringFormatter.cs	(revision 16132)
@@ -0,0 +1,95 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+
+  [Item("Default String Formatter", "The default string formatter for symbolic expression trees.")]
+  [StorableClass]
+  public class SymbolicExpressionTreeStringFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+
+    public bool Indent { get; set; }
+    public bool AppendNewLines { get; set; }
+
+    private static readonly Dictionary<string, string> PrettyNames = new Dictionary<string, string> {
+      { "Addition", "+"}, {"Subtraction", "-" }, {"Multiplication", "*" }, {"Division", "/" }, {"Logarithm", "log" }, {"Exponential", "exp" }
+    };
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeStringFormatter(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeStringFormatter(SymbolicExpressionTreeStringFormatter original, Cloner cloner)
+      : base(original, cloner) {
+      Indent = original.Indent;
+    }
+    public SymbolicExpressionTreeStringFormatter()
+      : base() {
+      Name = "Default String Formatter";
+      Indent = true;
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      return FormatRecursively(symbolicExpressionTree.Root, 0);
+    }
+
+    public string Format(ISymbolicExpressionTreeNode symbolicExpressionTreeNode) {
+      return FormatRecursively(symbolicExpressionTreeNode, 0);
+    }
+
+    private string FormatRecursively(ISymbolicExpressionTreeNode node, int indentLength) {
+      StringBuilder strBuilder = new StringBuilder();
+      if (Indent) strBuilder.Append(' ', indentLength);
+      strBuilder.Append("(");
+      // internal nodes or leaf nodes?
+      if (node.SubtreeCount > 0) {
+        // symbol on same line as '('
+        string name;
+        PrettyNames.TryGetValue(node.ToString(), out name);
+        if (name == null) name = node.ToString();
+        strBuilder.Append(name);
+        if (AppendNewLines)
+          strBuilder.AppendLine();
+        // each subtree expression on a new line
+        // and closing ')' also on new line
+        foreach (var subtree in node.Subtrees) {
+          strBuilder.Append(FormatRecursively(subtree, indentLength + 2));
+          if (AppendNewLines)
+            strBuilder.AppendLine();
+        }
+        if (Indent) strBuilder.Append(' ', indentLength);
+        strBuilder.Append(") ");
+      } else {
+        // symbol in the same line with as '(' and ')'
+        strBuilder.Append(node);
+        strBuilder.Append(") ");
+      }
+      return strBuilder.ToString();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeStringFormatter(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/EmptySymbolicExpressionTreeGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/EmptySymbolicExpressionTreeGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/EmptySymbolicExpressionTreeGrammar.cs	(revision 16132)
@@ -0,0 +1,123 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding {
+
+  [StorableClass]
+  internal sealed class EmptySymbolicExpressionTreeGrammar : NamedItem, ISymbolicExpressionTreeGrammar {
+    [Storable]
+    private ISymbolicExpressionGrammar grammar;
+
+    [StorableConstructor]
+    private EmptySymbolicExpressionTreeGrammar(bool deserializing) : base(deserializing) { }
+    internal EmptySymbolicExpressionTreeGrammar(ISymbolicExpressionGrammar grammar)
+      : base() {
+      if (grammar == null) throw new ArgumentNullException();
+      this.grammar = grammar;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return this;
+    }
+
+    public IEnumerable<ISymbol> Symbols {
+      get { return grammar.Symbols; }
+    }
+    public IEnumerable<ISymbol> AllowedSymbols {
+      get { return grammar.AllowedSymbols; }
+    }
+
+    public ISymbol GetSymbol(string symbolName) {
+      return grammar.GetSymbol(symbolName);
+    }
+
+    public bool ContainsSymbol(ISymbol symbol) {
+      return grammar.ContainsSymbol(symbol);
+    }
+
+    public bool IsAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      return grammar.IsAllowedChildSymbol(parent, child);
+    }
+    public bool IsAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      return grammar.IsAllowedChildSymbol(parent, child, argumentIndex);
+    }
+
+    public IEnumerable<ISymbol> GetAllowedChildSymbols(ISymbol parent) {
+      return grammar.GetAllowedChildSymbols(parent);
+    }
+
+    public IEnumerable<ISymbol> GetAllowedChildSymbols(ISymbol parent, int argumentIndex) {
+      return grammar.GetAllowedChildSymbols(parent, argumentIndex);
+    }
+
+    public int GetMinimumSubtreeCount(ISymbol symbol) {
+      return grammar.GetMinimumSubtreeCount(symbol);
+    }
+    public int GetMaximumSubtreeCount(ISymbol symbol) {
+      return grammar.GetMaximumSubtreeCount(symbol);
+    }
+
+    public int GetMinimumExpressionDepth(ISymbol symbol) {
+      return grammar.GetMinimumExpressionDepth(symbol);
+    }
+    public int GetMaximumExpressionDepth(ISymbol symbol) {
+      return grammar.GetMaximumExpressionDepth(symbol);
+    }
+    public int GetMinimumExpressionLength(ISymbol symbol) {
+      return grammar.GetMinimumExpressionLength(symbol);
+    }
+    public int GetMaximumExpressionLength(ISymbol symbol, int maxDepth) {
+      return grammar.GetMaximumExpressionLength(symbol, maxDepth);
+    }
+
+    public void AddSymbol(ISymbol symbol) { throw new NotSupportedException(); }
+    public void RemoveSymbol(ISymbol symbol) { throw new NotSupportedException(); }
+    public void AddAllowedChildSymbol(ISymbol parent, ISymbol child) { throw new NotSupportedException(); }
+    public void AddAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) { throw new NotSupportedException(); }
+    public void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child) { throw new NotSupportedException(); }
+    public void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) { throw new NotSupportedException(); }
+    public void SetSubtreeCount(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount) { throw new NotSupportedException(); }
+
+
+    #region ISymbolicExpressionTreeGrammar Members
+    public IEnumerable<ISymbol> ModifyableSymbols {
+      get { return Enumerable.Empty<ISymbol>(); }
+    }
+
+    public bool IsModifyableSymbol(ISymbol symbol) {
+      return false;
+    }
+
+#pragma warning disable 0067 //disable usage warning
+    public event EventHandler Changed;
+#pragma warning restore 0067
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/GrammarUtils.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/GrammarUtils.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/GrammarUtils.cs	(revision 16132)
@@ -0,0 +1,166 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public static class GrammarUtils {
+    private static IEnumerable<ISymbol> GetTopmostSymbols(this ISymbolicExpressionGrammarBase grammar) {
+      // build parents list so we can find out the topmost symbol(s)
+      var parents = new Dictionary<ISymbol, List<ISymbol>>();
+      foreach (var symbol in grammar.Symbols.Where(x => grammar.GetMinimumSubtreeCount(x) > 0)) {
+        var minSubtreeCount = grammar.GetMinimumSubtreeCount(symbol);
+        for (int argIndex = 0; argIndex < minSubtreeCount; ++argIndex) {
+          foreach (var childSymbol in grammar.GetAllowedActiveSymbols(symbol, argIndex)) {
+            if (!parents.ContainsKey(childSymbol))
+              parents[childSymbol] = new List<ISymbol>();
+            parents[childSymbol].Add(symbol);
+          }
+        }
+      }
+      // the topmost symbols have no parents
+      return parents.Values.SelectMany(x => x).Distinct().Where(x => !parents.ContainsKey(x));
+    }
+
+    private static IReadOnlyCollection<ISymbol> IterateBreadthReverse(this ISymbolicExpressionGrammarBase grammar, ISymbol topSymbol) {
+      // sort symbols in reverse breadth order (starting from the topSymbol)
+      // each symbol is visited only once (this avoids infinite recursion)
+      var symbols = new List<ISymbol> { topSymbol };
+      var visited = new HashSet<ISymbol> { topSymbol };
+      int i = 0;
+      while (i < symbols.Count) {
+        var symbol = symbols[i];
+        var minSubtreeCount = grammar.GetMinimumSubtreeCount(symbol);
+
+        for (int argIndex = 0; argIndex < minSubtreeCount; ++argIndex) {
+          foreach (var childSymbol in grammar.GetAllowedActiveSymbols(symbol, argIndex)) {
+            if (grammar.GetMinimumSubtreeCount(childSymbol) == 0)
+              continue;
+
+            if (visited.Add(childSymbol))
+              symbols.Add(childSymbol);
+          }
+        }
+        ++i;
+      }
+      symbols.Reverse();
+      return symbols;
+    }
+
+    private static IEnumerable<ISymbol> GetAllowedActiveSymbols(this ISymbolicExpressionGrammarBase grammar, ISymbol symbol, int argIndex) {
+      return grammar.GetAllowedChildSymbols(symbol, argIndex).Where(s => s.InitialFrequency > 0);
+    }
+
+    public static void CalculateMinimumExpressionLengths(ISymbolicExpressionGrammarBase grammar,
+      Dictionary<string, int> minimumExpressionLengths) {
+      minimumExpressionLengths.Clear();
+      //terminal symbols => minimum expression length = 1
+      foreach (var s in grammar.Symbols) {
+        if (grammar.GetMinimumSubtreeCount(s) == 0)
+          minimumExpressionLengths[s.Name] = 1;
+        else
+          minimumExpressionLengths[s.Name] = int.MaxValue;
+      }
+
+      foreach (var topSymbol in grammar.GetTopmostSymbols()) {
+        // get all symbols below in reverse breadth order
+        // this way we ensure lengths are calculated bottom-up
+        var symbols = grammar.IterateBreadthReverse(topSymbol);
+        foreach (var symbol in symbols) {
+          long minLength = 1;
+          for (int argIndex = 0; argIndex < grammar.GetMinimumSubtreeCount(symbol); ++argIndex) {
+            long length = grammar.GetAllowedActiveSymbols(symbol, argIndex)
+              .Where(x => minimumExpressionLengths.ContainsKey(x.Name))
+              .Select(x => minimumExpressionLengths[x.Name]).DefaultIfEmpty(int.MaxValue).Min();
+            minLength += length;
+          }
+          int oldLength;
+          if (minimumExpressionLengths.TryGetValue(symbol.Name, out oldLength))
+            minLength = Math.Min(minLength, oldLength);
+          minimumExpressionLengths[symbol.Name] = (int)Math.Min(int.MaxValue, minLength);
+        }
+        // correction step for cycles
+        bool changed = true;
+        while (changed) {
+          changed = false;
+          foreach (var symbol in symbols) {
+            long minLength = Enumerable.Range(0, grammar.GetMinimumSubtreeCount(symbol))
+              .Sum(x => grammar.GetAllowedActiveSymbols(symbol, x)
+              .Select(s => (long)minimumExpressionLengths[s.Name]).DefaultIfEmpty(int.MaxValue).Min()) + 1;
+            if (minLength < minimumExpressionLengths[symbol.Name]) {
+              minimumExpressionLengths[symbol.Name] = (int)Math.Min(minLength, int.MaxValue);
+              changed = true;
+            }
+          }
+        }
+      }
+    }
+
+    public static void CalculateMinimumExpressionDepth(ISymbolicExpressionGrammarBase grammar,
+      Dictionary<string, int> minimumExpressionDepths) {
+
+      minimumExpressionDepths.Clear();
+      //terminal symbols => minimum expression depth = 1
+      foreach (var s in grammar.Symbols) {
+        if (grammar.GetMinimumSubtreeCount(s) == 0)
+          minimumExpressionDepths[s.Name] = 1;
+        else
+          minimumExpressionDepths[s.Name] = int.MaxValue;
+      }
+
+      foreach (var topSymbol in grammar.GetTopmostSymbols()) {
+        // get all symbols below in reverse breadth order
+        // this way we ensure lengths are calculated bottom-up
+        var symbols = grammar.IterateBreadthReverse(topSymbol);
+        foreach (var symbol in symbols) {
+          long minDepth = -1;
+          for (int argIndex = 0; argIndex < grammar.GetMinimumSubtreeCount(symbol); ++argIndex) {
+            long depth = grammar.GetAllowedActiveSymbols(symbol, argIndex)
+              .Where(x => minimumExpressionDepths.ContainsKey(x.Name))
+              .Select(x => (long)minimumExpressionDepths[x.Name]).DefaultIfEmpty(int.MaxValue).Min() + 1;
+            minDepth = Math.Max(minDepth, depth);
+          }
+          int oldDepth;
+          if (minimumExpressionDepths.TryGetValue(symbol.Name, out oldDepth))
+            minDepth = Math.Min(minDepth, oldDepth);
+          minimumExpressionDepths[symbol.Name] = (int)Math.Min(int.MaxValue, minDepth);
+        }
+        // correction step for cycles
+        bool changed = true;
+        while (changed) {
+          changed = false;
+          foreach (var symbol in symbols) {
+            long minDepth = Enumerable.Range(0, grammar.GetMinimumSubtreeCount(symbol))
+              .Max(x => grammar.GetAllowedActiveSymbols(symbol, x)
+              .Select(s => (long)minimumExpressionDepths[s.Name]).DefaultIfEmpty(int.MaxValue).Min()) + 1;
+            if (minDepth < minimumExpressionDepths[symbol.Name]) {
+              minimumExpressionDepths[symbol.Name] = (int)Math.Min(minDepth, int.MaxValue);
+              changed = true;
+            }
+          }
+        }
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SimpleSymbolicExpressionGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SimpleSymbolicExpressionGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SimpleSymbolicExpressionGrammar.cs	(revision 16132)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public sealed class SimpleSymbolicExpressionGrammar : SymbolicExpressionGrammar {
+    [StorableConstructor]
+    private SimpleSymbolicExpressionGrammar(bool deserializing) : base(deserializing) { }
+    private SimpleSymbolicExpressionGrammar(SimpleSymbolicExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleSymbolicExpressionGrammar(this, cloner);
+    }
+
+    public SimpleSymbolicExpressionGrammar()
+      : base("Simple Grammar", "A simple grammar containing symbols that differ only in their name.") {
+    }
+
+    public void AddSymbol(string symbolName, int minimumArity, int maximumArity) {
+      AddSymbol(symbolName, string.Empty, minimumArity, maximumArity);
+    }
+    public void AddSymbol(string symbolName, string description, int minimumArity, int maximumArity) {
+      var symbol = new SimpleSymbol(symbolName, description, minimumArity, maximumArity);
+      AddSymbol(symbol);
+      SetSubtreeCount(symbol, symbol.MinimumArity, symbol.MaximumArity);
+
+      foreach (var s in Symbols) {
+        if (s == ProgramRootSymbol) continue;
+        if (s.MaximumArity > 0) AddAllowedChildSymbol(s, symbol);
+
+        if (s == DefunSymbol) continue;
+        if (s == StartSymbol) continue;
+        if (symbol.MaximumArity > 0) AddAllowedChildSymbol(symbol, s);
+      }
+    }
+    public void AddSymbols(IEnumerable<string> symbolNames, int minimumArity, int maximiumArity) {
+      foreach (var symbolName in symbolNames) AddSymbol(symbolName, minimumArity, maximiumArity);
+    }
+
+    public void AddTerminalSymbol(string symbolName) {
+      AddTerminalSymbol(symbolName, string.Empty);
+    }
+    public void AddTerminalSymbol(string symbolName, string description) {
+      AddSymbol(symbolName, description, 0, 0);
+    }
+    public void AddTerminalSymbols(IEnumerable<string> symbolNames) {
+      foreach (var symbolName in symbolNames) AddTerminalSymbol(symbolName);
+    }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammar.cs	(revision 16132)
@@ -0,0 +1,359 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public abstract class SymbolicExpressionGrammar : SymbolicExpressionGrammarBase, ISymbolicExpressionGrammar {
+    #region fields & properties
+    [Storable(DefaultValue = false)]
+    private bool readOnly;
+    public bool ReadOnly {
+      get { return readOnly; }
+      set {
+        if (readOnly != value) {
+          readOnly = value;
+          OnReadOnlyChanged();
+        }
+      }
+    }
+
+    [Storable]
+    private int minimumFunctionDefinitions;
+    public int MinimumFunctionDefinitions {
+      get { return minimumFunctionDefinitions; }
+      set {
+        minimumFunctionDefinitions = value;
+        UpdateAdfConstraints();
+      }
+    }
+    [Storable]
+    private int maximumFunctionDefinitions;
+    public int MaximumFunctionDefinitions {
+      get { return maximumFunctionDefinitions; }
+      set {
+        maximumFunctionDefinitions = value;
+        UpdateAdfConstraints();
+      }
+    }
+    [Storable]
+    private int minimumFunctionArguments;
+    public int MinimumFunctionArguments {
+      get { return minimumFunctionArguments; }
+      set { minimumFunctionArguments = value; }
+    }
+    [Storable]
+    private int maximumFunctionArguments;
+    public int MaximumFunctionArguments {
+      get { return maximumFunctionArguments; }
+      set { maximumFunctionArguments = value; }
+    }
+
+    private ProgramRootSymbol programRootSymbol;
+    public ProgramRootSymbol ProgramRootSymbol {
+      get { return programRootSymbol; }
+    }
+    ISymbol ISymbolicExpressionGrammar.ProgramRootSymbol {
+      get { return ProgramRootSymbol; }
+    }
+    [Storable(Name = "ProgramRootSymbol")]
+    private ISymbol StorableProgramRootSymbol {
+      get { return programRootSymbol; }
+      set { programRootSymbol = (ProgramRootSymbol)value; }
+    }
+
+    private StartSymbol startSymbol;
+    public StartSymbol StartSymbol {
+      get { return startSymbol; }
+    }
+    ISymbol ISymbolicExpressionGrammar.StartSymbol {
+      get { return StartSymbol; }
+    }
+    [Storable(Name = "StartSymbol")]
+    private ISymbol StorableStartSymbol {
+      get { return startSymbol; }
+      set { startSymbol = (StartSymbol)value; }
+    }
+
+    private Defun defunSymbol;
+    protected Defun DefunSymbol {
+      get { return defunSymbol; }
+    }
+    [Storable(Name = "DefunSymbol")]
+    private ISymbol StorableDefunSymbol {
+      get { return defunSymbol; }
+      set { defunSymbol = (Defun)value; }
+    }
+
+    private readonly ISymbolicExpressionTreeGrammar emptyGrammar;
+    #endregion
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      foreach (ISymbol symbol in symbols.Values)
+        RegisterSymbolEvents(symbol);
+    }
+
+    [StorableConstructor]
+    protected SymbolicExpressionGrammar(bool deserializing)
+      : base(deserializing) {
+      emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this);
+    }
+    protected SymbolicExpressionGrammar(SymbolicExpressionGrammar original, Cloner cloner)
+      : base(original, cloner) {
+      emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this);
+
+      foreach (ISymbol symbol in symbols.Values)
+        RegisterSymbolEvents(symbol);
+
+      programRootSymbol = cloner.Clone(original.programRootSymbol);
+      startSymbol = cloner.Clone(original.StartSymbol);
+      defunSymbol = cloner.Clone(original.defunSymbol);
+
+      maximumFunctionArguments = original.maximumFunctionArguments;
+      minimumFunctionArguments = original.minimumFunctionArguments;
+      maximumFunctionDefinitions = original.maximumFunctionDefinitions;
+      minimumFunctionDefinitions = original.minimumFunctionDefinitions;
+    }
+
+    protected SymbolicExpressionGrammar(string name, string description)
+      : base(name, description) {
+      emptyGrammar = new EmptySymbolicExpressionTreeGrammar(this);
+
+      programRootSymbol = new ProgramRootSymbol();
+      AddSymbol(programRootSymbol);
+      SetSubtreeCount(programRootSymbol, 1, 1);
+
+      startSymbol = new StartSymbol();
+      AddSymbol(startSymbol);
+      SetSubtreeCount(startSymbol, 1, 1);
+
+      defunSymbol = new Defun();
+      AddSymbol(defunSymbol);
+      SetSubtreeCount(defunSymbol, 1, 1);
+
+      AddAllowedChildSymbol(programRootSymbol, startSymbol, 0);
+      UpdateAdfConstraints();
+    }
+
+    private void UpdateAdfConstraints() {
+      SetSubtreeCount(programRootSymbol, minimumFunctionDefinitions + 1, maximumFunctionDefinitions + 1);
+
+      // ADF branches maxFunctionDefinitions 
+      for (int argumentIndex = 1; argumentIndex < maximumFunctionDefinitions + 1; argumentIndex++) {
+        RemoveAllowedChildSymbol(programRootSymbol, defunSymbol, argumentIndex);
+        AddAllowedChildSymbol(programRootSymbol, defunSymbol, argumentIndex);
+      }
+    }
+
+    public ISymbolicExpressionTreeGrammar CreateExpressionTreeGrammar() {
+      if (MaximumFunctionDefinitions == 0) return emptyGrammar;
+      else return new SymbolicExpressionTreeGrammar(this);
+    }
+
+    public override sealed void AddSymbol(ISymbol symbol) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.AddSymbol(symbol);
+      RegisterSymbolEvents(symbol);
+      OnChanged();
+    }
+    public override sealed void RemoveSymbol(ISymbol symbol) {
+      if (ReadOnly) throw new InvalidOperationException();
+      DeregisterSymbolEvents(symbol);
+      base.RemoveSymbol(symbol);
+      OnChanged();
+    }
+
+    public event EventHandler ReadOnlyChanged;
+    protected virtual void OnReadOnlyChanged() {
+      var handler = ReadOnlyChanged;
+      if (handler != null)
+        handler(this, EventArgs.Empty);
+    }
+
+    #region IStatefulItem methods
+    void IStatefulItem.InitializeState() {
+      ReadOnly = false;
+    }
+    void IStatefulItem.ClearState() {
+      ReadOnly = false;
+    }
+    #endregion
+
+    public sealed override void AddAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.AddAllowedChildSymbol(parent, child);
+    }
+    public sealed override void AddAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.AddAllowedChildSymbol(parent, child, argumentIndex);
+    }
+    public sealed override void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.RemoveAllowedChildSymbol(parent, child);
+    }
+    public sealed override void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.RemoveAllowedChildSymbol(parent, child, argumentIndex);
+    }
+
+    public sealed override void SetSubtreeCount(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount) {
+      if (ReadOnly) throw new InvalidOperationException();
+      base.SetSubtreeCount(symbol, minimumSubtreeCount, maximumSubtreeCount);
+    }
+
+    private bool suppressEvents = false;
+    public void StartGrammarManipulation() {
+      suppressEvents = true;
+    }
+    public void FinishedGrammarManipulation() {
+      suppressEvents = false;
+      OnChanged();
+    }
+
+    protected sealed override void OnChanged() {
+      if (suppressEvents) return;
+      base.OnChanged();
+    }
+
+    #region symbol events
+    private void RegisterSymbolEvents(ISymbol symbol) {
+      foreach (var s in symbol.Flatten()) {
+        s.NameChanging += new EventHandler<CancelEventArgs<string>>(Symbol_NameChanging);
+        s.NameChanged += new EventHandler(Symbol_NameChanged);
+
+        var groupSymbol = s as GroupSymbol;
+        if (groupSymbol != null) RegisterGroupSymbolEvents(groupSymbol);
+        else s.Changed += new EventHandler(Symbol_Changed);
+      }
+    }
+    private void DeregisterSymbolEvents(ISymbol symbol) {
+      foreach (var s in symbol.Flatten()) {
+        s.NameChanging -= new EventHandler<CancelEventArgs<string>>(Symbol_NameChanging);
+        s.NameChanged -= new EventHandler(Symbol_NameChanged);
+
+        var groupSymbol = s as GroupSymbol;
+        if (groupSymbol != null) DeregisterGroupSymbolEvents(groupSymbol);
+        else s.Changed -= new EventHandler(Symbol_Changed);
+      }
+    }
+
+    private void RegisterGroupSymbolEvents(GroupSymbol groupSymbol) {
+      groupSymbol.Changed += new EventHandler(GroupSymbol_Changed);
+      groupSymbol.SymbolsCollection.ItemsAdded += new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_ItemsAdded);
+      groupSymbol.SymbolsCollection.ItemsRemoved += new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_ItemsRemoved);
+      groupSymbol.SymbolsCollection.CollectionReset += new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_CollectionReset);
+    }
+    private void DeregisterGroupSymbolEvents(GroupSymbol groupSymbol) {
+      groupSymbol.Changed -= new EventHandler(GroupSymbol_Changed);
+      groupSymbol.SymbolsCollection.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_ItemsAdded);
+      groupSymbol.SymbolsCollection.ItemsRemoved -= new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_ItemsRemoved);
+      groupSymbol.SymbolsCollection.CollectionReset -= new Collections.CollectionItemsChangedEventHandler<ISymbol>(GroupSymbol_CollectionReset);
+    }
+
+    private void Symbol_Changed(object sender, EventArgs e) {
+      ClearCaches();
+      OnChanged();
+    }
+
+    private void GroupSymbol_Changed(object sender, EventArgs e) {
+      GroupSymbol groupSymbol = (GroupSymbol)sender;
+      foreach (ISymbol symbol in groupSymbol.Flatten())
+        symbol.Enabled = groupSymbol.Enabled;
+
+      ClearCaches();
+      OnChanged();
+    }
+
+    private void Symbol_NameChanging(object sender, CancelEventArgs<string> e) {
+      if (symbols.ContainsKey(e.Value)) e.Cancel = true;
+    }
+    private void Symbol_NameChanged(object sender, EventArgs e) {
+      ISymbol symbol = (ISymbol)sender;
+      string oldName = symbols.First(x => x.Value == symbol).Key;
+      string newName = symbol.Name;
+
+      symbols.Remove(oldName);
+      symbols.Add(newName, symbol);
+
+      var subtreeCount = symbolSubtreeCount[oldName];
+      symbolSubtreeCount.Remove(oldName);
+      symbolSubtreeCount.Add(newName, subtreeCount);
+
+      List<string> allowedChilds;
+      if (allowedChildSymbols.TryGetValue(oldName, out allowedChilds)) {
+        allowedChildSymbols.Remove(oldName);
+        allowedChildSymbols.Add(newName, allowedChilds);
+      }
+
+      for (int i = 0; i < GetMaximumSubtreeCount(symbol); i++) {
+        if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(oldName, i), out allowedChilds)) {
+          allowedChildSymbolsPerIndex.Remove(Tuple.Create(oldName, i));
+          allowedChildSymbolsPerIndex.Add(Tuple.Create(newName, i), allowedChilds);
+        }
+      }
+
+      foreach (var parent in Symbols) {
+        if (allowedChildSymbols.TryGetValue(parent.Name, out allowedChilds))
+          if (allowedChilds.Remove(oldName))
+            allowedChilds.Add(newName);
+
+        for (int i = 0; i < GetMaximumSubtreeCount(parent); i++) {
+          if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(parent.Name, i), out allowedChilds))
+            if (allowedChilds.Remove(oldName)) allowedChilds.Add(newName);
+        }
+      }
+
+      ClearCaches();
+      OnChanged();
+    }
+
+    private void GroupSymbol_ItemsAdded(object sender, CollectionItemsChangedEventArgs<ISymbol> e) {
+      foreach (ISymbol symbol in e.Items)
+        if (!ContainsSymbol(symbol))
+          AddSymbol(symbol);
+      OnChanged();
+    }
+    private void GroupSymbol_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<ISymbol> e) {
+      foreach (ISymbol symbol in e.Items)
+        if (ContainsSymbol(symbol))
+          RemoveSymbol(symbol);
+      OnChanged();
+    }
+    private void GroupSymbol_CollectionReset(object sender, CollectionItemsChangedEventArgs<ISymbol> e) {
+      foreach (ISymbol symbol in e.Items)
+        if (!ContainsSymbol(symbol))
+          AddSymbol(symbol);
+      foreach (ISymbol symbol in e.OldItems)
+        if (ContainsSymbol(symbol))
+          RemoveSymbol(symbol);
+      OnChanged();
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammarBase.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammarBase.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammarBase.cs	(revision 16132)
@@ -0,0 +1,474 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.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]
+  public abstract class SymbolicExpressionGrammarBase : NamedItem, ISymbolicExpressionGrammarBase {
+
+    #region properties for separation between implementation and persistence
+    [Storable(Name = "Symbols")]
+    private IEnumerable<ISymbol> StorableSymbols {
+      get { return symbols.Values.ToArray(); }
+      set { foreach (var s in value) symbols.Add(s.Name, s); }
+    }
+
+    [Storable(Name = "SymbolSubtreeCount")]
+    private IEnumerable<KeyValuePair<ISymbol, Tuple<int, int>>> StorableSymbolSubtreeCount {
+      get { return symbolSubtreeCount.Select(x => new KeyValuePair<ISymbol, Tuple<int, int>>(GetSymbol(x.Key), x.Value)).ToArray(); }
+      set { foreach (var pair in value) symbolSubtreeCount.Add(pair.Key.Name, pair.Value); }
+    }
+
+    [Storable(Name = "AllowedChildSymbols")]
+    private IEnumerable<KeyValuePair<ISymbol, IEnumerable<ISymbol>>> StorableAllowedChildSymbols {
+      get { return allowedChildSymbols.Select(x => new KeyValuePair<ISymbol, IEnumerable<ISymbol>>(GetSymbol(x.Key), x.Value.Select(GetSymbol).ToArray())).ToArray(); }
+      set { foreach (var pair in value) allowedChildSymbols.Add(pair.Key.Name, pair.Value.Select(y => y.Name).ToList()); }
+    }
+
+    [Storable(Name = "AllowedChildSymbolsPerIndex")]
+    private IEnumerable<KeyValuePair<Tuple<ISymbol, int>, IEnumerable<ISymbol>>> StorableAllowedChildSymbolsPerIndex {
+      get { return allowedChildSymbolsPerIndex.Select(x => new KeyValuePair<Tuple<ISymbol, int>, IEnumerable<ISymbol>>(Tuple.Create(GetSymbol(x.Key.Item1), x.Key.Item2), x.Value.Select(GetSymbol).ToArray())).ToArray(); }
+      set {
+        foreach (var pair in value)
+          allowedChildSymbolsPerIndex.Add(Tuple.Create(pair.Key.Item1.Name, pair.Key.Item2), pair.Value.Select(y => y.Name).ToList());
+      }
+    }
+    #endregion
+
+    private bool suppressEvents;
+    protected readonly Dictionary<string, ISymbol> symbols;
+    protected readonly Dictionary<string, Tuple<int, int>> symbolSubtreeCount;
+    protected readonly Dictionary<string, List<string>> allowedChildSymbols;
+    protected readonly Dictionary<Tuple<string, int>, List<string>> allowedChildSymbolsPerIndex;
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    [StorableConstructor]
+    protected SymbolicExpressionGrammarBase(bool deserializing)
+      : base(deserializing) {
+
+      symbols = new Dictionary<string, ISymbol>();
+      symbolSubtreeCount = new Dictionary<string, Tuple<int, int>>();
+      allowedChildSymbols = new Dictionary<string, List<string>>();
+      allowedChildSymbolsPerIndex = new Dictionary<Tuple<string, int>, List<string>>();
+
+      suppressEvents = false;
+    }
+
+    protected SymbolicExpressionGrammarBase(SymbolicExpressionGrammarBase original, Cloner cloner)
+      : base(original, cloner) {
+
+      symbols = original.symbols.ToDictionary(x => x.Key, y => cloner.Clone(y.Value));
+      symbolSubtreeCount = new Dictionary<string, Tuple<int, int>>(original.symbolSubtreeCount);
+
+      allowedChildSymbols = new Dictionary<string, List<string>>();
+      foreach (var element in original.allowedChildSymbols)
+        allowedChildSymbols.Add(element.Key, new List<string>(element.Value));
+
+      allowedChildSymbolsPerIndex = new Dictionary<Tuple<string, int>, List<string>>();
+      foreach (var element in original.allowedChildSymbolsPerIndex)
+        allowedChildSymbolsPerIndex.Add(element.Key, new List<string>(element.Value));
+
+      suppressEvents = false;
+    }
+
+    protected SymbolicExpressionGrammarBase(string name, string description)
+      : base(name, description) {
+      symbols = new Dictionary<string, ISymbol>();
+      symbolSubtreeCount = new Dictionary<string, Tuple<int, int>>();
+      allowedChildSymbols = new Dictionary<string, List<string>>();
+      allowedChildSymbolsPerIndex = new Dictionary<Tuple<string, int>, List<string>>();
+
+      suppressEvents = false;
+    }
+
+    #region protected grammar manipulation methods
+    public virtual void AddSymbol(ISymbol symbol) {
+      if (ContainsSymbol(symbol)) throw new ArgumentException("Symbol " + symbol + " is already defined.");
+      foreach (var s in symbol.Flatten()) {
+        symbols.Add(s.Name, s);
+        int maxSubTreeCount = Math.Min(s.MinimumArity + 1, s.MaximumArity);
+        symbolSubtreeCount.Add(s.Name, Tuple.Create(s.MinimumArity, maxSubTreeCount));
+      }
+      ClearCaches();
+    }
+
+    public virtual void RemoveSymbol(ISymbol symbol) {
+      foreach (var s in symbol.Flatten()) {
+        symbols.Remove(s.Name);
+        allowedChildSymbols.Remove(s.Name);
+        for (int i = 0; i < GetMaximumSubtreeCount(s); i++)
+          allowedChildSymbolsPerIndex.Remove(Tuple.Create(s.Name, i));
+        symbolSubtreeCount.Remove(s.Name);
+
+        foreach (var parent in Symbols) {
+          List<string> allowedChilds;
+          if (allowedChildSymbols.TryGetValue(parent.Name, out allowedChilds))
+            allowedChilds.Remove(s.Name);
+
+          for (int i = 0; i < GetMaximumSubtreeCount(parent); i++) {
+            if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(parent.Name, i), out allowedChilds))
+              allowedChilds.Remove(s.Name);
+          }
+        }
+        suppressEvents = true;
+        foreach (var groupSymbol in Symbols.OfType<GroupSymbol>())
+          groupSymbol.SymbolsCollection.Remove(symbol);
+        suppressEvents = false;
+      }
+      ClearCaches();
+    }
+
+    public virtual ISymbol GetSymbol(string symbolName) {
+      ISymbol symbol;
+      if (symbols.TryGetValue(symbolName, out symbol)) return symbol;
+      return null;
+    }
+
+    public virtual void AddAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      bool changed = false;
+
+      foreach (ISymbol p in parent.Flatten().Where(p => !(p is GroupSymbol)))
+        changed |= AddAllowedChildSymbolToDictionaries(p, child);
+
+      if (changed) {
+        ClearCaches();
+        OnChanged();
+      }
+    }
+
+    private bool AddAllowedChildSymbolToDictionaries(ISymbol parent, ISymbol child) {
+      List<string> childSymbols;
+      if (!allowedChildSymbols.TryGetValue(parent.Name, out childSymbols)) {
+        childSymbols = new List<string>();
+        allowedChildSymbols.Add(parent.Name, childSymbols);
+      }
+      if (childSymbols.Contains(child.Name)) return false;
+
+      suppressEvents = true;
+      for (int argumentIndex = 0; argumentIndex < GetMaximumSubtreeCount(parent); argumentIndex++)
+        RemoveAllowedChildSymbol(parent, child, argumentIndex);
+      suppressEvents = false;
+
+      childSymbols.Add(child.Name);
+      return true;
+    }
+
+    public virtual void AddAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      bool changed = false;
+
+      foreach (ISymbol p in parent.Flatten().Where(p => !(p is GroupSymbol)))
+        changed |= AddAllowedChildSymbolToDictionaries(p, child, argumentIndex);
+
+      if (changed) {
+        ClearCaches();
+        OnChanged();
+      }
+    }
+
+
+    private bool AddAllowedChildSymbolToDictionaries(ISymbol parent, ISymbol child, int argumentIndex) {
+      List<string> childSymbols;
+      if (!allowedChildSymbols.TryGetValue(parent.Name, out childSymbols)) {
+        childSymbols = new List<string>();
+        allowedChildSymbols.Add(parent.Name, childSymbols);
+      }
+      if (childSymbols.Contains(child.Name)) return false;
+
+
+      var key = Tuple.Create(parent.Name, argumentIndex);
+      if (!allowedChildSymbolsPerIndex.TryGetValue(key, out childSymbols)) {
+        childSymbols = new List<string>();
+        allowedChildSymbolsPerIndex.Add(key, childSymbols);
+      }
+
+      if (childSymbols.Contains(child.Name)) return false;
+
+      childSymbols.Add(child.Name);
+      return true;
+    }
+
+    public virtual void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      bool changed = false;
+      List<string> childSymbols;
+      if (allowedChildSymbols.TryGetValue(child.Name, out childSymbols)) {
+        changed |= childSymbols.Remove(child.Name);
+      }
+
+      for (int argumentIndex = 0; argumentIndex < GetMaximumSubtreeCount(parent); argumentIndex++) {
+        var key = Tuple.Create(parent.Name, argumentIndex);
+        if (allowedChildSymbolsPerIndex.TryGetValue(key, out childSymbols))
+          changed |= childSymbols.Remove(child.Name);
+      }
+
+      if (changed) {
+        ClearCaches();
+        OnChanged();
+      }
+    }
+
+    public virtual void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      bool changed = false;
+
+      suppressEvents = true;
+      List<string> childSymbols;
+      if (allowedChildSymbols.TryGetValue(parent.Name, out childSymbols)) {
+        if (childSymbols.Remove(child.Name)) {
+          for (int i = 0; i < GetMaximumSubtreeCount(parent); i++) {
+            if (i != argumentIndex) AddAllowedChildSymbol(parent, child, i);
+          }
+          changed = true;
+        }
+      }
+      suppressEvents = false;
+
+      var key = Tuple.Create(parent.Name, argumentIndex);
+      if (allowedChildSymbolsPerIndex.TryGetValue(key, out childSymbols))
+        changed |= childSymbols.Remove(child.Name);
+
+      if (changed) {
+        ClearCaches();
+        OnChanged();
+      }
+    }
+
+    public virtual void SetSubtreeCount(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount) {
+      var symbols = symbol.Flatten().Where(s => !(s is GroupSymbol));
+      if (symbols.Any(s => s.MinimumArity > minimumSubtreeCount)) throw new ArgumentException("Invalid minimum subtree count " + minimumSubtreeCount + " for " + symbol);
+      if (symbols.Any(s => s.MaximumArity < maximumSubtreeCount)) throw new ArgumentException("Invalid maximum subtree count " + maximumSubtreeCount + " for " + symbol);
+
+      foreach (ISymbol s in symbols)
+        SetSubTreeCountInDictionaries(s, minimumSubtreeCount, maximumSubtreeCount);
+
+      ClearCaches();
+      OnChanged();
+    }
+
+    private void SetSubTreeCountInDictionaries(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount) {
+      for (int i = maximumSubtreeCount; i < GetMaximumSubtreeCount(symbol); i++) {
+        var key = Tuple.Create(symbol.Name, i);
+        allowedChildSymbolsPerIndex.Remove(key);
+      }
+
+      symbolSubtreeCount[symbol.Name] = Tuple.Create(minimumSubtreeCount, maximumSubtreeCount);
+    }
+    #endregion
+
+    public virtual IEnumerable<ISymbol> Symbols {
+      get { return symbols.Values; }
+    }
+    public virtual IEnumerable<ISymbol> AllowedSymbols {
+      get { return Symbols.Where(s => s.Enabled); }
+    }
+    public virtual bool ContainsSymbol(ISymbol symbol) {
+      return symbols.ContainsKey(symbol.Name);
+    }
+
+    private readonly Dictionary<Tuple<string, string>, bool> cachedIsAllowedChildSymbol = new Dictionary<Tuple<string, string>, bool>();
+    public virtual bool IsAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      if (allowedChildSymbols.Count == 0) return false;
+      if (!child.Enabled) return false;
+
+      bool result;
+      var key = Tuple.Create(parent.Name, child.Name);
+      if (cachedIsAllowedChildSymbol.TryGetValue(key, out result)) return result;
+
+      // value has to be calculated and cached make sure this is done in only one thread
+      lock (cachedIsAllowedChildSymbol) {
+        // in case the value has been calculated on another thread in the meanwhile
+        if (cachedIsAllowedChildSymbol.TryGetValue(key, out result)) return result;
+
+        List<string> temp;
+        if (allowedChildSymbols.TryGetValue(parent.Name, out temp)) {
+          for (int i = 0; i < temp.Count; i++) {
+            var symbol = GetSymbol(temp[i]);
+            foreach (var s in symbol.Flatten())
+              if (s.Name == child.Name) {
+                cachedIsAllowedChildSymbol.Add(key, true);
+                return true;
+              }
+          }
+        }
+        cachedIsAllowedChildSymbol.Add(key, false);
+        return false;
+      }
+    }
+
+    private readonly Dictionary<Tuple<string, string, int>, bool> cachedIsAllowedChildSymbolIndex = new Dictionary<Tuple<string, string, int>, bool>();
+    public virtual bool IsAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      if (!child.Enabled) return false;
+      if (IsAllowedChildSymbol(parent, child)) return true;
+      if (allowedChildSymbolsPerIndex.Count == 0) return false;
+
+      bool result;
+      var key = Tuple.Create(parent.Name, child.Name, argumentIndex);
+      if (cachedIsAllowedChildSymbolIndex.TryGetValue(key, out result)) return result;
+
+      // value has to be calculated and cached make sure this is done in only one thread
+      lock (cachedIsAllowedChildSymbolIndex) {
+        // in case the value has been calculated on another thread in the meanwhile
+        if (cachedIsAllowedChildSymbolIndex.TryGetValue(key, out result)) return result;
+
+        List<string> temp;
+        if (allowedChildSymbolsPerIndex.TryGetValue(Tuple.Create(parent.Name, argumentIndex), out temp)) {
+          for (int i = 0; i < temp.Count; i++) {
+            var symbol = GetSymbol(temp[i]);
+            foreach (var s in symbol.Flatten())
+              if (s.Name == child.Name) {
+                cachedIsAllowedChildSymbolIndex.Add(key, true);
+                return true;
+              }
+          }
+        }
+        cachedIsAllowedChildSymbolIndex.Add(key, false);
+        return false;
+      }
+    }
+
+    public IEnumerable<ISymbol> GetAllowedChildSymbols(ISymbol parent) {
+      foreach (ISymbol child in AllowedSymbols) {
+        if (IsAllowedChildSymbol(parent, child)) yield return child;
+      }
+    }
+
+    public IEnumerable<ISymbol> GetAllowedChildSymbols(ISymbol parent, int argumentIndex) {
+      foreach (ISymbol child in AllowedSymbols) {
+        if (IsAllowedChildSymbol(parent, child, argumentIndex)) yield return child;
+      }
+    }
+
+    public virtual int GetMinimumSubtreeCount(ISymbol symbol) {
+      return symbolSubtreeCount[symbol.Name].Item1;
+    }
+    public virtual int GetMaximumSubtreeCount(ISymbol symbol) {
+      return symbolSubtreeCount[symbol.Name].Item2;
+    }
+
+    protected void ClearCaches() {
+      cachedMinExpressionLength.Clear();
+      cachedMaxExpressionLength.Clear();
+      cachedMinExpressionDepth.Clear();
+      cachedMaxExpressionDepth.Clear();
+
+      cachedIsAllowedChildSymbol.Clear();
+      cachedIsAllowedChildSymbolIndex.Clear();
+    }
+
+    private readonly Dictionary<string, int> cachedMinExpressionLength = new Dictionary<string, int>();
+    public int GetMinimumExpressionLength(ISymbol symbol) {
+      int res;
+      if (cachedMinExpressionLength.TryGetValue(symbol.Name, out res))
+        return res;
+
+      // value has to be calculated and cached make sure this is done in only one thread
+      lock (cachedMinExpressionLength) {
+        // in case the value has been calculated on another thread in the meanwhile
+        if (cachedMinExpressionLength.TryGetValue(symbol.Name, out res)) return res;
+
+        GrammarUtils.CalculateMinimumExpressionLengths(this, cachedMinExpressionLength);
+        return cachedMinExpressionLength[symbol.Name];
+      }
+    }
+
+
+    private readonly Dictionary<Tuple<string, int>, int> cachedMaxExpressionLength = new Dictionary<Tuple<string, int>, int>();
+    public int GetMaximumExpressionLength(ISymbol symbol, int maxDepth) {
+      int temp;
+      var key = Tuple.Create(symbol.Name, maxDepth);
+      if (cachedMaxExpressionLength.TryGetValue(key, out temp)) return temp;
+      // value has to be calculated and cached make sure this is done in only one thread
+      lock (cachedMaxExpressionLength) {
+        // in case the value has been calculated on another thread in the meanwhile
+        if (cachedMaxExpressionLength.TryGetValue(key, out temp)) return temp;
+
+        cachedMaxExpressionLength[key] = int.MaxValue; // prevent infinite recursion
+        long sumOfMaxTrees = 1 + (from argIndex in Enumerable.Range(0, GetMaximumSubtreeCount(symbol))
+                                  let maxForSlot = (long)(from s in GetAllowedChildSymbols(symbol, argIndex)
+                                                          where s.InitialFrequency > 0.0
+                                                          where GetMinimumExpressionDepth(s) < maxDepth
+                                                          select GetMaximumExpressionLength(s, maxDepth - 1)).DefaultIfEmpty(0).Max()
+                                  select maxForSlot).DefaultIfEmpty(0).Sum();
+        cachedMaxExpressionLength[key] = (int)Math.Min(sumOfMaxTrees, int.MaxValue);
+        return cachedMaxExpressionLength[key];
+      }
+    }
+
+    private readonly Dictionary<string, int> cachedMinExpressionDepth = new Dictionary<string, int>();
+    public int GetMinimumExpressionDepth(ISymbol symbol) {
+      int res;
+      if (cachedMinExpressionDepth.TryGetValue(symbol.Name, out res))
+        return res;
+
+      // value has to be calculated and cached make sure this is done in only one thread
+      lock (cachedMinExpressionDepth) {
+        // in case the value has been calculated on another thread in the meanwhile
+        if (cachedMinExpressionDepth.TryGetValue(symbol.Name, out res)) return res;
+
+        GrammarUtils.CalculateMinimumExpressionDepth(this, cachedMinExpressionDepth);
+        return cachedMinExpressionDepth[symbol.Name];
+      }
+    }
+
+    private readonly Dictionary<string, int> cachedMaxExpressionDepth = new Dictionary<string, int>();
+    public int GetMaximumExpressionDepth(ISymbol symbol) {
+      int temp;
+      if (cachedMaxExpressionDepth.TryGetValue(symbol.Name, out temp)) return temp;
+      // value has to be calculated and cached make sure this is done in only one thread
+      lock (cachedMaxExpressionDepth) {
+        // in case the value has been calculated on another thread in the meanwhile
+        if (cachedMaxExpressionDepth.TryGetValue(symbol.Name, out temp)) return temp;
+
+        cachedMaxExpressionDepth[symbol.Name] = int.MaxValue;
+        long maxDepth = 1 + (from argIndex in Enumerable.Range(0, GetMaximumSubtreeCount(symbol))
+                             let maxForSlot = (long)(from s in GetAllowedChildSymbols(symbol, argIndex)
+                                                     where s.InitialFrequency > 0.0
+                                                     select GetMaximumExpressionDepth(s)).DefaultIfEmpty(0).Max()
+                             select maxForSlot).DefaultIfEmpty(0).Max();
+        cachedMaxExpressionDepth[symbol.Name] = (int)Math.Min(maxDepth, int.MaxValue);
+        return cachedMaxExpressionDepth[symbol.Name];
+      }
+    }
+
+    public event EventHandler Changed;
+    protected virtual void OnChanged() {
+      if (suppressEvents) return;
+      var handler = Changed;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionTreeGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionTreeGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionTreeGrammar.cs	(revision 16132)
@@ -0,0 +1,100 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  internal sealed class SymbolicExpressionTreeGrammar : SymbolicExpressionGrammarBase, ISymbolicExpressionTreeGrammar {
+    [StorableConstructor]
+    private SymbolicExpressionTreeGrammar(bool deserializing) : base(deserializing) { }
+    private SymbolicExpressionTreeGrammar(SymbolicExpressionTreeGrammar original, Cloner cloner)
+      : base(original, cloner) {
+      this.grammar = original.grammar;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      foreach (ISymbol symbol in base.Symbols)
+        if (!cloner.ClonedObjectRegistered(symbol))
+          cloner.RegisterClonedObject(symbol, symbol);
+      return new SymbolicExpressionTreeGrammar(this, cloner);
+    }
+
+    [Storable]
+    private ISymbolicExpressionGrammar grammar;
+    public SymbolicExpressionTreeGrammar(ISymbolicExpressionGrammar grammar)
+      : base("SymbolicExpressionTreeGrammar", "A grammar that is used held by symbolic expression trees and allows extensions to the wrapped grammar.") {
+      if (grammar == null) throw new ArgumentNullException();
+      this.grammar = grammar;
+    }
+
+    public override IEnumerable<ISymbol> Symbols {
+      get {
+        foreach (var s in grammar.Symbols) yield return s;
+        foreach (var s in base.symbols.Values) yield return s;
+      }
+    }
+    public IEnumerable<ISymbol> ModifyableSymbols {
+      get { return base.symbols.Values; }
+    }
+    public bool IsModifyableSymbol(ISymbol symbol) {
+      return base.symbols.ContainsKey(symbol.Name);
+    }
+
+    public override bool ContainsSymbol(ISymbol symbol) {
+      return grammar.ContainsSymbol(symbol) || base.ContainsSymbol(symbol);
+    }
+    public override ISymbol GetSymbol(string symbolName) {
+      var symbol = grammar.GetSymbol(symbolName);
+      if (symbol != null) return symbol;
+      symbol = base.GetSymbol(symbolName);
+      if (symbol != null) return symbol;
+      throw new ArgumentException();
+    }
+
+    public override void RemoveSymbol(ISymbol symbol) {
+      if (!IsModifyableSymbol(symbol)) throw new InvalidOperationException();
+      base.RemoveSymbol(symbol);
+    }
+
+    public override int GetMinimumSubtreeCount(ISymbol symbol) {
+      if (grammar.ContainsSymbol(symbol)) return grammar.GetMinimumSubtreeCount(symbol);
+      return base.GetMinimumSubtreeCount(symbol);
+    }
+    public override int GetMaximumSubtreeCount(ISymbol symbol) {
+      if (grammar.ContainsSymbol(symbol)) return grammar.GetMaximumSubtreeCount(symbol);
+      return base.GetMaximumSubtreeCount(symbol);
+    }
+    public override void SetSubtreeCount(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount) {
+      if (!IsModifyableSymbol(symbol)) throw new InvalidOperationException();
+      base.SetSubtreeCount(symbol, minimumSubtreeCount, maximumSubtreeCount);
+    }
+
+    public override bool IsAllowedChildSymbol(ISymbol parent, ISymbol child) {
+      return grammar.IsAllowedChildSymbol(parent, child) || base.IsAllowedChildSymbol(parent, child);
+    }
+    public override bool IsAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex) {
+      return grammar.IsAllowedChildSymbol(parent, child, argumentIndex) || base.IsAllowedChildSymbol(parent, child, argumentIndex);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 16132)
@@ -0,0 +1,303 @@
+﻿<?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>{06D4A186-9319-48A0-BADE-A2058D462EEA}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding</RootNamespace>
+    <AssemblyName>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <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>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+      <Private>False</Private>
+    </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="Analyzers\BestSymbolicExpressionTreeAnalyzer.cs" />
+    <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicExpressionSymbolFrequencyAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicExpressionTreeLengthAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicExpressionTreeLengthCalculator.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="Grammars\GrammarUtils.cs" />
+    <Compile Include="SymbolicExpressionTreeProblem.cs" />
+    <Compile Include="Compiler\Instruction.cs" />
+    <Compile Include="Compiler\LinearInstruction.cs" />
+    <Compile Include="Compiler\SymbolicExpressionTreeCompiler.cs" />
+    <Compile Include="Compiler\SymbolicExpressionTreeLinearCompiler.cs" />
+    <Compile Include="Creators\FullTreeCreator.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Creators\GrowTreeCreator.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Creators\RampedHalfAndHalfTreeCreator.cs" />
+    <Compile Include="Formatters\SymbolicExpressionTreeGraphvizFormatter.cs" />
+    <Compile Include="Formatters\SymbolicExpressionTreeHierarchicalFormatter.cs" />
+    <Compile Include="Grammars\EmptySymbolicExpressionTreeGrammar.cs" />
+    <Compile Include="Grammars\SimpleSymbolicExpressionGrammar.cs" />
+    <Compile Include="Interfaces\IReadOnlySymbol.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionGrammar.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionGrammarBase.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeGrammar.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeNodeComparer.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeNodeEqualityComparer.cs" />
+    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeArchitectureAlteringOperator.cs" />
+    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeGrammarBasedOperator.cs" />
+    <Compile Include="Creators\SymbolicExpressionTreeCreator.cs" />
+    <Compile Include="CutPoint.cs" />
+    <Compile Include="Crossovers\SymbolicExpressionTreeCrossover.cs" />
+    <Compile Include="Formatters\SymbolicExpressionTreeStringFormatter.cs" />
+    <Compile Include="Interfaces\ISymbol.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTree.cs" />
+    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeAnalyzer.cs" />
+    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeArchitectureManipulator.cs" />
+    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeCreator.cs" />
+    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeCrossover.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeNode.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeStringFormatter.cs" />
+    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeSizeConstraintOperator.cs" />
+    <Compile Include="Manipulators\ChangeNodeTypeManipulation.cs" />
+    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeManipulator.cs" />
+    <Compile Include="Manipulators\RemoveBranchManipulation.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="Plugin.cs" />
+    <Compile Include="Grammars\SymbolicExpressionGrammarBase.cs" />
+    <Compile Include="Grammars\SymbolicExpressionGrammar.cs" />
+    <Compile Include="Grammars\SymbolicExpressionTreeGrammar.cs" />
+    <Compile Include="SymbolicExpressionTreeEncoding.cs" />
+    <Compile Include="SymbolicExpressionTreeTopLevelNode.cs" />
+    <Compile Include="Crossovers\SubtreeCrossover.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="EnumerableExtensions.cs" />
+    <Compile Include="SymbolicExpressionTreeOperator.cs" />
+    <Compile Include="SymbolicExpressionTreeTerminalNode.cs" />
+    <Compile Include="Creators\ProbabilisticTreeCreator.cs" />
+    <Compile Include="Interfaces\Operators\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\GroupSymbol.cs" />
+    <Compile Include="Symbols\SimpleSymbol.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="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.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 Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/IReadOnlySymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/IReadOnlySymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/IReadOnlySymbol.cs	(revision 16132)
@@ -0,0 +1,24 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  public interface IReadOnlySymbol : ISymbol {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbol.cs	(revision 16132)
@@ -0,0 +1,39 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Core;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbol : INamedItem {
+    ISymbolicExpressionTreeNode CreateTreeNode();
+    double InitialFrequency { get; set; }
+    bool Enabled { get; set; }
+
+    int MinimumArity { get; }
+    int MaximumArity { get; }
+
+    IEnumerable<ISymbol> Flatten();
+
+    event EventHandler Changed;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammar.cs	(revision 16132)
@@ -0,0 +1,43 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Core;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionGrammar : ISymbolicExpressionGrammarBase, IStatefulItem {
+    ISymbol ProgramRootSymbol { get; }
+    ISymbol StartSymbol { get; }
+
+    int MinimumFunctionDefinitions { get; set; }
+    int MaximumFunctionDefinitions { get; set; }
+    int MinimumFunctionArguments { get; set; }
+    int MaximumFunctionArguments { get; set; }
+
+    bool ReadOnly { get; set; }
+    event EventHandler ReadOnlyChanged;
+
+    void StartGrammarManipulation();
+    void FinishedGrammarManipulation();
+
+    ISymbolicExpressionTreeGrammar CreateExpressionTreeGrammar();
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammarBase.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammarBase.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionGrammarBase.cs	(revision 16132)
@@ -0,0 +1,59 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Core;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionGrammarBase : INamedItem {
+    IEnumerable<ISymbol> Symbols { get; }
+    IEnumerable<ISymbol> AllowedSymbols { get; }
+
+    bool ContainsSymbol(ISymbol symbol);
+    ISymbol GetSymbol(string symbolName);
+
+    void AddSymbol(ISymbol symbol);
+    void RemoveSymbol(ISymbol symbol);
+
+    bool IsAllowedChildSymbol(ISymbol parent, ISymbol child);
+    bool IsAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex);
+    IEnumerable<ISymbol> GetAllowedChildSymbols(ISymbol parent);
+    IEnumerable<ISymbol> GetAllowedChildSymbols(ISymbol parent, int argumentIndex);
+
+    void AddAllowedChildSymbol(ISymbol parent, ISymbol child);
+    void AddAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex);
+    void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child);
+    void RemoveAllowedChildSymbol(ISymbol parent, ISymbol child, int argumentIndex);
+
+
+    int GetMinimumSubtreeCount(ISymbol symbol);
+    int GetMaximumSubtreeCount(ISymbol symbol);
+    void SetSubtreeCount(ISymbol symbol, int minimumSubtreeCount, int maximumSubtreeCount);
+
+    int GetMinimumExpressionDepth(ISymbol start);
+    int GetMaximumExpressionDepth(ISymbol start);
+    int GetMinimumExpressionLength(ISymbol start);
+    int GetMaximumExpressionLength(ISymbol start, int maxDepth);
+
+    event EventHandler Changed;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTree.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTree.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTree.cs	(revision 16132)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionTree : IItem {
+    ISymbolicExpressionTreeNode Root { get; set; }
+    int Length { get; }
+    int Depth { get; }
+
+    IEnumerable<ISymbolicExpressionTreeNode> IterateNodesBreadth();
+    IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix();
+    IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix();
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeGrammar.cs	(revision 16132)
@@ -0,0 +1,28 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionTreeGrammar : ISymbolicExpressionGrammarBase {
+    IEnumerable<ISymbol> ModifyableSymbols { get; }
+    bool IsModifyableSymbol(ISymbol symbol);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 16132)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionTreeNode : IDeepCloneable {
+    ISymbolicExpressionTreeGrammar Grammar { get; }
+    ISymbolicExpressionTreeNode Parent { get; set; }
+    ISymbol Symbol { get; }
+    bool HasLocalParameters { get; }
+
+    int GetDepth();
+    int GetLength();
+    int GetBranchLevel(ISymbolicExpressionTreeNode child);
+
+    double NodeWeight { get; set; }
+
+    IEnumerable<ISymbolicExpressionTreeNode> IterateNodesBreadth();
+    IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix();
+    IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix();
+    void ForEachNodePostfix(Action<ISymbolicExpressionTreeNode> a);
+    void ForEachNodePrefix(Action<ISymbolicExpressionTreeNode> a);
+
+    IEnumerable<ISymbolicExpressionTreeNode> Subtrees { get; }
+    int SubtreeCount { get; }
+    ISymbolicExpressionTreeNode GetSubtree(int index);
+    int IndexOfSubtree(ISymbolicExpressionTreeNode tree);
+    void AddSubtree(ISymbolicExpressionTreeNode tree);
+    void InsertSubtree(int index, ISymbolicExpressionTreeNode tree);
+    void RemoveSubtree(int index);
+
+    void ResetLocalParameters(IRandom random);
+    void ShakeLocalParameters(IRandom random, double shakingFactor);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeComparer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeComparer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeComparer.cs	(revision 16132)
@@ -0,0 +1,5 @@
+﻿using System.Collections.Generic;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionTreeNodeComparer : IComparer<ISymbolicExpressionTreeNode> { }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeEqualityComparer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeEqualityComparer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeEqualityComparer.cs	(revision 16132)
@@ -0,0 +1,10 @@
+﻿using System.Collections.Generic;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionTreeNodeEqualityComparer : IEqualityComparer<ISymbolicExpressionTreeNode>, IItem {
+    bool MatchConstantValues { get; set; }
+    bool MatchVariableWeights { get; set; }
+    bool MatchVariableNames { get; set; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeStringFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeStringFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeStringFormatter.cs	(revision 16132)
@@ -0,0 +1,28 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionTreeStringFormatter : INamedItem {
+    string Format(ISymbolicExpressionTree symbolicExpressionTree);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeAnalyzer.cs	(revision 16132)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  /// <summary>
+  /// Interface for analyzers that can be applied to symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeAnalyzer : IAnalyzer {
+    IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeArchitectureAlteringOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeArchitectureAlteringOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeArchitectureAlteringOperator.cs	(revision 16132)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  public interface ISymbolicExpressionTreeArchitectureAlteringOperator : ISymbolicExpressionTreeOperator {
+    IValueLookupParameter<IntValue> MaximumFunctionDefinitionsParameter { get; }
+    IValueLookupParameter<IntValue> MaximumFunctionArgumentsParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeArchitectureManipulator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeArchitectureManipulator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeArchitectureManipulator.cs	(revision 16132)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  /// <summary>
+  /// Interface for operators that manipulate symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeArchitectureManipulator : ISymbolicExpressionTreeManipulator, ISymbolicExpressionTreeArchitectureAlteringOperator {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCreator.cs	(revision 16132)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  /// <summary>
+  /// Interface for operators that create symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeCreator : ISolutionCreator, ISymbolicExpressionTreeSizeConstraintOperator, ISymbolicExpressionTreeGrammarBasedOperator {
+    ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCrossover.cs	(revision 16132)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  /// <summary>
+  /// Interface for crossover operators that can be applied to symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeCrossover : ISymbolicExpressionTreeOperator, ICrossover {
+    ILookupParameter<ItemArray<ISymbolicExpressionTree>> ParentsParameter { get; }
+    ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeGrammarBasedOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeGrammarBasedOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeGrammarBasedOperator.cs	(revision 16132)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <summary>
+  /// Interface for operators that can be applied to symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeGrammarBasedOperator : ISymbolicExpressionTreeOperator {
+    IValueLookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionTreeGrammarParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeManipulator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeManipulator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeManipulator.cs	(revision 16132)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  /// <summary>
+  /// Interface for operators that manipulate symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeManipulator : ISymbolicExpressionTreeOperator, IManipulator {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeOperator.cs	(revision 16132)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <summary>
+  /// Interface for operators that can be applied to symbolic expression trees.
+  /// </summary>
+  public interface ISymbolicExpressionTreeOperator : IOperator {
+    ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeSizeConstraintOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeSizeConstraintOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeSizeConstraintOperator.cs	(revision 16132)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  public interface ISymbolicExpressionTreeSizeConstraintOperator : ISymbolicExpressionTreeOperator {
+    IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter { get; }
+    IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs	(revision 16132)
@@ -0,0 +1,102 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  [Item("ChangeNodeTypeManipulation", "Selects a random tree node and changes the symbol.")]
+  public sealed class ChangeNodeTypeManipulation : SymbolicExpressionTreeManipulator {
+    private const int MAX_TRIES = 100;
+
+    [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, ISymbolicExpressionTree symbolicExpressionTree) {
+      ChangeNodeType(random, symbolicExpressionTree);
+    }
+
+    public static void ChangeNodeType(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
+      List<ISymbol> allowedSymbols = new List<ISymbol>();
+      ISymbolicExpressionTreeNode parent;
+      int childIndex;
+      ISymbolicExpressionTreeNode child;
+      // repeat until a fitting parent and child are found (MAX_TRIES times)
+      int tries = 0;
+      do {
+
+#pragma warning disable 612, 618
+        parent = symbolicExpressionTree.Root.IterateNodesPrefix().Skip(1).Where(n => n.SubtreeCount > 0).SelectRandom(random);
+#pragma warning restore 612, 618
+
+        childIndex = random.Next(parent.SubtreeCount);
+
+        child = parent.GetSubtree(childIndex);
+        int existingSubtreeCount = child.SubtreeCount;
+        allowedSymbols.Clear();
+        foreach (var symbol in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, childIndex)) {
+          // check basic properties that the new symbol must have
+          if (symbol.Name != child.Symbol.Name &&
+            symbol.InitialFrequency > 0 &&
+            existingSubtreeCount <= parent.Grammar.GetMinimumSubtreeCount(symbol) &&
+            existingSubtreeCount >= parent.Grammar.GetMaximumSubtreeCount(symbol)) {
+            // check that all existing subtrees are also allowed for the new symbol
+            bool allExistingSubtreesAllowed = true;
+            for (int existingSubtreeIndex = 0; existingSubtreeIndex < existingSubtreeCount && allExistingSubtreesAllowed; existingSubtreeIndex++) {
+              var existingSubtree = child.GetSubtree(existingSubtreeIndex);
+              allExistingSubtreesAllowed &= parent.Grammar.IsAllowedChildSymbol(symbol, existingSubtree.Symbol, existingSubtreeIndex);
+            }
+            if (allExistingSubtreesAllowed) {
+              allowedSymbols.Add(symbol);
+            }
+          }
+        }
+        tries++;
+      } while (tries < MAX_TRIES && allowedSymbols.Count == 0);
+
+      if (tries < MAX_TRIES) {
+        var weights = allowedSymbols.Select(s => s.InitialFrequency).ToList();
+#pragma warning disable 612, 618
+        var newSymbol = allowedSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+        // replace the old node with the new node
+        var newNode = newSymbol.CreateTreeNode();
+        if (newNode.HasLocalParameters)
+          newNode.ResetLocalParameters(random);
+        foreach (var subtree in child.Subtrees)
+          newNode.AddSubtree(subtree);
+        parent.RemoveSubtree(childIndex);
+        parent.InsertSubtree(childIndex, newNode);
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs	(revision 16132)
@@ -0,0 +1,64 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  [Item("FullTreeShaker", "Manipulates all nodes that have local parameters.")]
+  public sealed class FullTreeShaker : SymbolicExpressionTreeManipulator {
+    private const string ShakingFactorParameterName = "ShakingFactor";
+    #region parameter properties
+    public IValueParameter<DoubleValue> ShakingFactorParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[ShakingFactorParameterName]; }
+    }
+    #endregion
+    #region properties
+    public double ShakingFactor {
+      get { return ShakingFactorParameter.Value.Value; }
+      set { ShakingFactorParameter.Value.Value = value; }
+    }
+    #endregion
+    [StorableConstructor]
+    private FullTreeShaker(bool deserializing) : base(deserializing) { }
+    private FullTreeShaker(FullTreeShaker original, Cloner cloner) : base(original, cloner) { }
+    public FullTreeShaker()
+      : base() {
+      Parameters.Add(new FixedValueParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of constants (default=1.0).", new DoubleValue(1.0)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FullTreeShaker(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, ISymbolicExpressionTree tree) {
+      tree.Root.ForEachNodePostfix(node => {
+        if (node.HasLocalParameters) {
+          node.ShakeLocalParameters(random, ShakingFactor);
+        }
+      });
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs	(revision 16132)
@@ -0,0 +1,116 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Collections;
+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.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [Item("MultiSymbolicExpressionTreeManipulator", "Randomly selects and applies one of its manipulators every time it is called.")]
+  [StorableClass]
+  public sealed class MultiSymbolicExpressionTreeManipulator : StochasticMultiBranch<ISymbolicExpressionTreeManipulator>,
+    ISymbolicExpressionTreeManipulator,
+    IStochasticOperator,
+    ISymbolicExpressionTreeSizeConstraintOperator {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    protected override bool CreateChildOperation {
+      get { return true; }
+    }
+
+    #region Parameter Properties
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private MultiSymbolicExpressionTreeManipulator(bool deserializing) : base(deserializing) { }
+    private MultiSymbolicExpressionTreeManipulator(MultiSymbolicExpressionTreeManipulator original, Cloner cloner) : base(original, cloner) { }
+    public MultiSymbolicExpressionTreeManipulator()
+      : base() {
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+
+      List<ISymbolicExpressionTreeManipulator> list = new List<ISymbolicExpressionTreeManipulator>();
+      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator))) {
+        if (this.GetType().Assembly != type.Assembly) continue;
+        if (typeof(IMultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type)) continue;
+        if (typeof(ISymbolicExpressionTreeArchitectureAlteringOperator).IsAssignableFrom(type)) continue;
+        list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type));
+      }
+      CheckedItemList<ISymbolicExpressionTreeManipulator> checkedItemList = new CheckedItemList<ISymbolicExpressionTreeManipulator>();
+      checkedItemList.AddRange(list.OrderBy(op => op.Name));
+      Operators = checkedItemList.AsReadOnly();
+      Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>>(Operators.CheckedItems));
+
+      SelectedOperatorParameter.ActualName = "SelectedManipulationOperator";
+    }
+
+    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 (IStochasticOperator manipulator in Operators.OfType<IStochasticOperator>()) {
+        manipulator.RandomParameter.ActualName = RandomParameter.Name;
+      }
+      foreach (ISymbolicExpressionTreeManipulator manipulator in Operators.OfType<ISymbolicExpressionTreeManipulator>()) {
+        manipulator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+      }
+      foreach (ISymbolicExpressionTreeSizeConstraintOperator manipulator in Operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) {
+        manipulator.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameter.Name;
+        manipulator.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter.Name;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs	(revision 16132)
@@ -0,0 +1,73 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  [Item("OnePointShaker", "Selects a random node with local parameters and manipulates the selected node.")]
+  public sealed class OnePointShaker : SymbolicExpressionTreeManipulator {
+    private const string ShakingFactorParameterName = "ShakingFactor";
+    #region parameter properties
+    public IValueParameter<DoubleValue> ShakingFactorParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[ShakingFactorParameterName]; }
+    }
+    #endregion
+    #region properties
+    public double ShakingFactor {
+      get { return ShakingFactorParameter.Value.Value; }
+      set { ShakingFactorParameter.Value.Value = value; }
+    }
+    #endregion
+    [StorableConstructor]
+    private OnePointShaker(bool deserializing) : base(deserializing) { }
+    private OnePointShaker(OnePointShaker original, Cloner cloner) : base(original, cloner) { }
+    public OnePointShaker()
+      : base() {
+      Parameters.Add(new FixedValueParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of constants (default=1.0).", new DoubleValue(1.0)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new OnePointShaker(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, ISymbolicExpressionTree tree) {
+      OnePointShaker.Shake(random, tree, ShakingFactor);
+    }
+
+    public static void Shake(IRandom random, ISymbolicExpressionTree tree, double shakingFactor) {
+      List<ISymbolicExpressionTreeNode> parametricNodes = new List<ISymbolicExpressionTreeNode>();
+      tree.Root.ForEachNodePostfix(n => {
+        if (n.HasLocalParameters) parametricNodes.Add(n);
+      });
+      if (parametricNodes.Count > 0) {
+        var selectedPoint = parametricNodes.SampleRandom(random);
+        selectedPoint.ShakeLocalParameters(random, shakingFactor);
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/RemoveBranchManipulation.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/RemoveBranchManipulation.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/RemoveBranchManipulation.cs	(revision 16132)
@@ -0,0 +1,138 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  [Item("RemoveBranchManipulation", "Removes a random sub-tree of the input tree and fixes the tree by generating random subtrees if necessary..")]
+  public sealed class RemoveBranchManipulation : SymbolicExpressionTreeManipulator, ISymbolicExpressionTreeSizeConstraintOperator {
+    private const int MAX_TRIES = 100;
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    #region Parameter Properties
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+    #region Properties
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private RemoveBranchManipulation(bool deserializing) : base(deserializing) { }
+    private RemoveBranchManipulation(RemoveBranchManipulation original, Cloner cloner) : base(original, cloner) { }
+    public RemoveBranchManipulation()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RemoveBranchManipulation(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
+      RemoveRandomBranch(random, symbolicExpressionTree, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
+    }
+
+    public static void RemoveRandomBranch(IRandom random, ISymbolicExpressionTree symbolicExpressionTree, int maxTreeLength, int maxTreeDepth) {
+      var allowedSymbols = new List<ISymbol>();
+      ISymbolicExpressionTreeNode parent;
+      int childIndex;
+      int maxLength;
+      int maxDepth;
+      // repeat until a fitting parent and child are found (MAX_TRIES times)
+      int tries = 0;
+
+      var nodes = symbolicExpressionTree.Root.IterateNodesPrefix().Skip(1).Where(n => n.SubtreeCount > 0).ToList();
+      do {
+        parent = nodes.SampleRandom(random);
+
+        childIndex = random.Next(parent.SubtreeCount);
+        var child = parent.GetSubtree(childIndex);
+        maxLength = maxTreeLength - symbolicExpressionTree.Length + child.GetLength();
+        maxDepth = maxTreeDepth - symbolicExpressionTree.Depth + child.GetDepth();
+
+        allowedSymbols.Clear();
+        foreach (var symbol in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, childIndex)) {
+          // check basic properties that the new symbol must have
+          if (symbol.Name != child.Symbol.Name &&
+            symbol.InitialFrequency > 0 &&
+            parent.Grammar.GetMinimumExpressionDepth(symbol) + 1 <= maxDepth &&
+            parent.Grammar.GetMinimumExpressionLength(symbol) <= maxLength) {
+            allowedSymbols.Add(symbol);
+          }
+        }
+        tries++;
+      } while (tries < MAX_TRIES && allowedSymbols.Count == 0);
+
+      if (tries >= MAX_TRIES) return;
+      ReplaceWithMinimalTree(random, symbolicExpressionTree.Root, parent, childIndex);
+    }
+
+    private static void ReplaceWithMinimalTree(IRandom random, ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode parent, int childIndex) {
+      // determine possible symbols that will lead to the smallest possible tree
+      var possibleSymbols = (from s in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, childIndex)
+                             where s.InitialFrequency > 0.0
+                             group s by parent.Grammar.GetMinimumExpressionLength(s) into g
+                             orderby g.Key
+                             select g).First().ToList();
+      var weights = possibleSymbols.Select(x => x.InitialFrequency).ToList();
+
+#pragma warning disable 612, 618
+      var selectedSymbol = possibleSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+      var newTreeNode = selectedSymbol.CreateTreeNode();
+      if (newTreeNode.HasLocalParameters) newTreeNode.ResetLocalParameters(random);
+      parent.RemoveSubtree(childIndex);
+      parent.InsertSubtree(childIndex, newTreeNode);
+
+      var topLevelNode = newTreeNode as SymbolicExpressionTreeTopLevelNode;
+      if (topLevelNode != null)
+        topLevelNode.SetGrammar((ISymbolicExpressionTreeGrammar)root.Grammar.Clone());
+
+      for (int i = 0; i < newTreeNode.Grammar.GetMinimumSubtreeCount(newTreeNode.Symbol); i++) {
+        // insert a dummy sub-tree and add the pending extension to the list
+        var dummy = new SymbolicExpressionTreeNode();
+        newTreeNode.AddSubtree(dummy);
+        // replace the just inserted dummy by recursive application
+        ReplaceWithMinimalTree(random, root, newTreeNode, i);
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs	(revision 16132)
@@ -0,0 +1,119 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [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, ISymbolicExpressionTreeSizeConstraintOperator {
+    private const int MAX_TRIES = 100;
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    #region Parameter Properties
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+    #region Properties
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private ReplaceBranchManipulation(bool deserializing) : base(deserializing) { }
+    private ReplaceBranchManipulation(ReplaceBranchManipulation original, Cloner cloner) : base(original, cloner) { }
+    public ReplaceBranchManipulation()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ReplaceBranchManipulation(this, cloner);
+    }
+
+    protected override void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
+      ReplaceRandomBranch(random, symbolicExpressionTree, MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value);
+    }
+
+    public static void ReplaceRandomBranch(IRandom random, ISymbolicExpressionTree symbolicExpressionTree, int maxTreeLength, int maxTreeDepth) {
+      var allowedSymbols = new List<ISymbol>();
+      ISymbolicExpressionTreeNode parent;
+      int childIndex;
+      int maxLength;
+      int maxDepth;
+      // repeat until a fitting parent and child are found (MAX_TRIES times)
+      int tries = 0;
+      do {
+#pragma warning disable 612, 618
+        parent = symbolicExpressionTree.Root.IterateNodesPrefix().Skip(1).Where(n => n.SubtreeCount > 0).SelectRandom(random);
+#pragma warning restore 612, 618
+
+        childIndex = random.Next(parent.SubtreeCount);
+        var child = parent.GetSubtree(childIndex);
+        maxLength = maxTreeLength - symbolicExpressionTree.Length + child.GetLength();
+        maxDepth = maxTreeDepth - symbolicExpressionTree.Depth + child.GetDepth();
+
+        allowedSymbols.Clear();
+        foreach (var symbol in parent.Grammar.GetAllowedChildSymbols(parent.Symbol, childIndex)) {
+          // check basic properties that the new symbol must have
+          if (symbol.Name != child.Symbol.Name &&
+            symbol.InitialFrequency > 0 &&
+            parent.Grammar.GetMinimumExpressionDepth(symbol) + 1 <= maxDepth &&
+            parent.Grammar.GetMinimumExpressionLength(symbol) <= maxLength) {
+            allowedSymbols.Add(symbol);
+          }
+        }
+        tries++;
+      } while (tries < MAX_TRIES && allowedSymbols.Count == 0);
+
+      if (tries < MAX_TRIES) {
+        var weights = allowedSymbols.Select(s => s.InitialFrequency).ToList();
+#pragma warning disable 612, 618
+        var seedSymbol = allowedSymbols.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+
+        // replace the old node with the new node
+        var seedNode = seedSymbol.CreateTreeNode();
+        if (seedNode.HasLocalParameters)
+          seedNode.ResetLocalParameters(random);
+
+        parent.RemoveSubtree(childIndex);
+        parent.InsertSubtree(childIndex, seedNode);
+        ProbabilisticTreeCreator.PTC2(random, seedNode, maxLength, maxDepth);
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs	(revision 16132)
@@ -0,0 +1,51 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  /// <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 {
+    [StorableConstructor]
+    protected SymbolicExpressionTreeManipulator(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeManipulator(SymbolicExpressionTreeManipulator original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicExpressionTreeManipulator()
+      : base() {
+      
+    }
+
+    public sealed override IOperation InstrumentedApply() {
+      ISymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
+      Manipulate(RandomParameter.ActualValue, tree);
+
+      return base.InstrumentedApply();
+    }
+
+    protected abstract void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs.frame	(revision 16132)
@@ -0,0 +1,43 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.11.$WCREV$")]
+  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll", PluginFileType.Assembly)]
+  [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.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 HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin : PluginBase {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
@@ -0,0 +1,47 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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("Provides operators and related classes for the symbolic expression tree encoding.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 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("B4A9B316-6336-478B-84E5-16F773DE2512")]
+
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.11.$WCREV$")]
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTree.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTree.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTree.cs	(revision 16132)
@@ -0,0 +1,99 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  [Item("SymbolicExpressionTree", "Represents a symbolic expression tree.")]
+  public class SymbolicExpressionTree : Item, ISymbolicExpressionTree {
+    public static new Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; }
+    }
+    [Storable]
+    private ISymbolicExpressionTreeNode root;
+    public ISymbolicExpressionTreeNode Root {
+      get { return root; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        else if (value != root) {
+          root = value;
+          OnToStringChanged();
+        }
+      }
+    }
+
+    public int Length {
+      get {
+        if (root == null)
+          return 0;
+        return root.GetLength();
+      }
+    }
+
+    public int Depth {
+      get {
+        if (root == null)
+          return 0;
+        return root.GetDepth();
+      }
+    }
+
+    [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(ISymbolicExpressionTreeNode root)
+      : base() {
+      this.Root = root;
+    }
+
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesBreadth() {
+      if (root == null)
+        return Enumerable.Empty<SymbolicExpressionTreeNode>();
+      return root.IterateNodesBreadth();
+    }
+
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix() {
+      if (root == null)
+        return Enumerable.Empty<SymbolicExpressionTreeNode>();
+      return root.IterateNodesPrefix();
+    }
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix() {
+      if (root == null)
+        return Enumerable.Empty<SymbolicExpressionTreeNode>();
+      return root.IterateNodesPostfix();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTree(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeEncoding.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeEncoding.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeEncoding.cs	(revision 16132)
@@ -0,0 +1,369 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [Item("SymbolicExpressionTreeEncoding", "Describes a symbolic expression tree encoding.")]
+  [StorableClass]
+  public sealed class SymbolicExpressionTreeEncoding : Encoding<ISymbolicExpressionTreeCreator> {
+    #region Encoding Parameters
+    [Storable]
+    private IFixedValueParameter<IntValue> treeLengthParameter;
+    public IFixedValueParameter<IntValue> TreeLengthParameter {
+      get { return treeLengthParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Tree length parameter must not be null.");
+        if (value.Value == null) throw new ArgumentNullException("Tree length parameter value must not be null.");
+        if (treeLengthParameter == value) return;
+
+        if (treeLengthParameter != null)
+          Parameters.Remove(treeLengthParameter);
+
+        treeLengthParameter = value;
+        Parameters.Add(treeLengthParameter);
+        OnLengthParameterChanged();
+      }
+    }
+
+    [Storable]
+    private IFixedValueParameter<IntValue> treeDepthParameter;
+    public IFixedValueParameter<IntValue> TreeDepthParameter {
+      get { return treeDepthParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Tree length parameter must not be null.");
+        if (value.Value == null) throw new ArgumentNullException("Tree length parameter value must not be null.");
+        if (treeDepthParameter == value) return;
+
+        if (treeDepthParameter != null)
+          Parameters.Remove(treeDepthParameter);
+
+        treeDepthParameter = value;
+        Parameters.Add(treeDepthParameter);
+        OnDepthParameterChanged();
+      }
+    }
+
+    [Storable]
+    private IValueParameter<ISymbolicExpressionGrammar> grammarParameter;
+    public IValueParameter<ISymbolicExpressionGrammar> GrammarParameter {
+      get { return grammarParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Grammar parameter must not be null.");
+        if (value.Value == null) throw new ArgumentNullException("Grammar parameter value must not be null.");
+        if (grammarParameter == value) return;
+
+        if (grammarParameter != null)
+          Parameters.Remove(grammarParameter);
+
+        grammarParameter = value;
+        Parameters.Add(grammarParameter);
+        OnGrammarParameterChanged();
+      }
+    }
+
+
+    [Storable]
+    private IFixedValueParameter<IntValue> functionDefinitionsParameter;
+    public IFixedValueParameter<IntValue> FunctionDefinitionsParameter {
+      get { return functionDefinitionsParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Function definitions parameter must not be null.");
+        if (value.Value == null) throw new ArgumentNullException("Function definitions parameter value must not be null.");
+        if (functionDefinitionsParameter == value) return;
+
+        if (functionDefinitionsParameter != null)
+          Parameters.Remove(functionDefinitionsParameter);
+
+        functionDefinitionsParameter = value;
+        Parameters.Add(functionDefinitionsParameter);
+        OnFunctionDefinitionsParameterChanged();
+      }
+    }
+
+    [Storable]
+    private IFixedValueParameter<IntValue> functionArgumentsParameter;
+    public IFixedValueParameter<IntValue> FunctionArgumentsParameter {
+      get { return functionArgumentsParameter; }
+      set {
+        if (value == null) throw new ArgumentNullException("Function arguments parameter must not be null.");
+        if (value.Value == null) throw new ArgumentNullException("Function arguments parameter value must not be null.");
+        if (functionArgumentsParameter == value) return;
+
+        if (functionArgumentsParameter != null)
+          Parameters.Remove(functionArgumentsParameter);
+
+        functionArgumentsParameter = value;
+        Parameters.Add(functionArgumentsParameter);
+        OnFunctionArgumentsParameterChanged();
+      }
+    }
+    #endregion
+
+    #region Parameter properties
+    public int TreeLength {
+      get { return TreeLengthParameter.Value.Value; }
+      set { TreeLengthParameter.Value.Value = value; }
+    }
+
+    public int TreeDepth {
+      get { return TreeDepthParameter.Value.Value; }
+      set { TreeDepthParameter.Value.Value = value; }
+    }
+
+    public ISymbolicExpressionGrammar Grammar {
+      get { return GrammarParameter.Value; }
+      set { GrammarParameter.Value = value; }
+    }
+
+    public int FunctionDefinitions {
+      get { return FunctionDefinitionsParameter.Value.Value; }
+      set { FunctionDefinitionsParameter.Value.Value = value; }
+    }
+
+    public int FunctionArguments {
+      get { return FunctionArgumentsParameter.Value.Value; }
+      set { FunctionArgumentsParameter.Value.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicExpressionTreeEncoding(bool deserializing) : base(deserializing) { }
+    public SymbolicExpressionTreeEncoding() : this(new SimpleSymbolicExpressionGrammar()) { }
+    public SymbolicExpressionTreeEncoding(ISymbolicExpressionGrammar grammar) : this("SymbolicExpressionTree", grammar, 50, 50) { }
+    public SymbolicExpressionTreeEncoding(ISymbolicExpressionGrammar grammar, int maximumLength, int maximumDepth) : this("SymbolicExpressionTree", grammar, maximumLength, maximumDepth) { }
+    public SymbolicExpressionTreeEncoding(string name, ISymbolicExpressionGrammar grammar, int maximumLength, int maximumDepth)
+      : base(name) {
+      treeLengthParameter = new FixedValueParameter<IntValue>(Name + ".Maximum Tree Length", "Maximal length of the symbolic expression.", new IntValue(maximumLength));
+      treeDepthParameter = new FixedValueParameter<IntValue>(Name + ".Maximum Tree Depth", "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(maximumDepth));
+      grammarParameter = new ValueParameter<ISymbolicExpressionGrammar>(Name + ".Grammar", "The grammar that should be used for symbolic expression tree.", grammar);
+      functionDefinitionsParameter = new FixedValueParameter<IntValue>(Name + ".Function Definitions", "Maximal number of automatically defined functions", new IntValue(0));
+      functionArgumentsParameter = new FixedValueParameter<IntValue>(Name + ".Function Arguments", "Maximal number of arguments of automatically defined functions.", new IntValue(0));
+
+      Parameters.Add(treeLengthParameter);
+      Parameters.Add(treeDepthParameter);
+      Parameters.Add(grammarParameter);
+      Parameters.Add(functionDefinitionsParameter);
+      Parameters.Add(functionArgumentsParameter);
+
+      SolutionCreator = new ProbabilisticTreeCreator();
+      RegisterParameterEvents();
+      DiscoverOperators();
+    }
+
+    private SymbolicExpressionTreeEncoding(SymbolicExpressionTreeEncoding original, Cloner cloner)
+      : base(original, cloner) {
+      treeLengthParameter = cloner.Clone(original.TreeLengthParameter);
+      treeDepthParameter = cloner.Clone(original.TreeDepthParameter);
+      grammarParameter = cloner.Clone(original.GrammarParameter);
+      functionDefinitionsParameter = cloner.Clone(original.FunctionDefinitionsParameter);
+      functionArgumentsParameter = cloner.Clone(original.FunctionArgumentsParameter);
+      RegisterParameterEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeEncoding(this, cloner);
+    }
+
+    #region changed events
+    private void OnLengthParameterChanged() {
+      RegisterLengthParameterEvents();
+      ConfigureOperators(Operators);
+    }
+    private void OnDepthParameterChanged() {
+      RegisterDepthParameterEvents();
+      ConfigureOperators(Operators);
+    }
+    private void OnGrammarParameterChanged() {
+      RegisterGrammarParameterEvents();
+      FunctionArguments = Grammar.MaximumFunctionArguments;
+      FunctionDefinitions = Grammar.MaximumFunctionDefinitions;
+      ConfigureOperators(Operators);
+    }
+
+    private void OnFunctionDefinitionsParameterChanged() {
+      RegisterFunctionDefinitionsParameterEvents();
+      Grammar.MaximumFunctionDefinitions = FunctionDefinitions;
+    }
+
+    private void OnFunctionArgumentsParameterChanged() {
+      RegisterFunctionArgumentsParameterEvetns();
+      Grammar.MaximumFunctionArguments = FunctionArguments;
+    }
+
+    private void RegisterParameterEvents() {
+      RegisterLengthParameterEvents();
+      RegisterLengthParameterEvents();
+      RegisterGrammarParameterEvents();
+      RegisterFunctionDefinitionsParameterEvents();
+      RegisterFunctionArgumentsParameterEvetns();
+    }
+
+
+    private void RegisterLengthParameterEvents() { }
+    private void RegisterDepthParameterEvents() { }
+
+    private void RegisterGrammarParameterEvents() {
+      GrammarParameter.ValueChanged += (o, s) => {
+        FunctionArguments = Grammar.MaximumFunctionArguments;
+        FunctionDefinitions = Grammar.MaximumFunctionDefinitions;
+        ConfigureOperators(Operators);
+      };
+      GrammarParameter.Value.Changed += (o, s) => {
+        FunctionArguments = Grammar.MaximumFunctionArguments;
+        FunctionDefinitions = Grammar.MaximumFunctionDefinitions;
+        ConfigureOperators(Operators);
+      };
+    }
+
+    private void RegisterFunctionDefinitionsParameterEvents() {
+      FunctionDefinitionsParameter.Value.ValueChanged += (o, s) => Grammar.MaximumFunctionDefinitions = FunctionDefinitions;
+    }
+    private void RegisterFunctionArgumentsParameterEvetns() {
+      FunctionArgumentsParameter.Value.ValueChanged += (o, s) => Grammar.MaximumFunctionArguments = FunctionArguments;
+    }
+    #endregion
+
+    #region Operator discovery
+    private static readonly IEnumerable<Type> encodingSpecificOperatorTypes;
+    static SymbolicExpressionTreeEncoding() {
+      encodingSpecificOperatorTypes = new List<Type>
+      {
+        typeof(ISymbolicExpressionTreeOperator),
+        typeof(ISymbolicExpressionTreeCreator),
+        typeof(ISymbolicExpressionTreeCrossover),
+        typeof(ISymbolicExpressionTreeManipulator),
+        typeof(ISymbolicExpressionTreeArchitectureAlteringOperator),
+        typeof(ISymbolicExpressionTreeAnalyzer),
+      };
+    }
+
+    private void DiscoverOperators() {
+      var assembly = typeof(ISymbolicExpressionTreeOperator).Assembly;
+      var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, assembly, true, false, false);
+      var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t));
+      var newOperators = operators.Except(Operators, new TypeEqualityComparer<IOperator>()).ToList();
+
+      ConfigureOperators(newOperators);
+      foreach (var @operator in newOperators)
+        AddOperator(@operator);
+    }
+    #endregion
+
+    #region Specific operator wiring
+
+    public override void ConfigureOperators(IEnumerable<IOperator> operators) {
+      ConfigureTreeOperators(operators.OfType<ISymbolicExpressionTreeOperator>());
+      ConfigureSizeConstraintOperators(operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>());
+      ConfigureGrammarBaseOperators(operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>());
+      ConfigureArchitectureAlteringOperators(operators.OfType<ISymbolicExpressionTreeArchitectureAlteringOperator>());
+
+      ConfigureAnalyzers(operators.OfType<ISymbolicExpressionTreeAnalyzer>());
+      ConfigureCreators(operators.OfType<ISymbolicExpressionTreeCreator>());
+      ConfigureCrossovers(operators.OfType<ISymbolicExpressionTreeCrossover>());
+      ConfigureManipulators(operators.OfType<ISymbolicExpressionTreeManipulator>());
+    }
+
+    private void ConfigureTreeOperators(IEnumerable<ISymbolicExpressionTreeOperator> treeOperators) {
+      foreach (var treeOperator in treeOperators) {
+        treeOperator.SymbolicExpressionTreeParameter.ActualName = Name;
+        treeOperator.SymbolicExpressionTreeParameter.Hidden = true;
+      }
+    }
+
+    private void ConfigureSizeConstraintOperators(IEnumerable<ISymbolicExpressionTreeSizeConstraintOperator> sizeConstraintOperators) {
+      foreach (var sizeConstraintOperator in sizeConstraintOperators) {
+        sizeConstraintOperator.MaximumSymbolicExpressionTreeLengthParameter.ActualName = TreeLengthParameter.Name;
+        sizeConstraintOperator.MaximumSymbolicExpressionTreeLengthParameter.Hidden = true;
+        sizeConstraintOperator.MaximumSymbolicExpressionTreeDepthParameter.ActualName = TreeDepthParameter.Name;
+        sizeConstraintOperator.MaximumSymbolicExpressionTreeDepthParameter.Hidden = true;
+      }
+    }
+
+    private void ConfigureGrammarBaseOperators(IEnumerable<ISymbolicExpressionTreeGrammarBasedOperator> grammarBasedOperators) {
+      foreach (var grammarBasedOperator in grammarBasedOperators) {
+        grammarBasedOperator.SymbolicExpressionTreeGrammarParameter.ActualName = GrammarParameter.Name;
+        grammarBasedOperator.SymbolicExpressionTreeGrammarParameter.Hidden = true;
+      }
+    }
+
+    private void ConfigureArchitectureAlteringOperators(IEnumerable<ISymbolicExpressionTreeArchitectureAlteringOperator> architectureAlteringOperators) {
+      foreach (var architectureAlteringOperator in architectureAlteringOperators) {
+        architectureAlteringOperator.MaximumFunctionDefinitionsParameter.ActualName = FunctionDefinitionsParameter.Name;
+        architectureAlteringOperator.MaximumFunctionDefinitionsParameter.Hidden = true;
+        architectureAlteringOperator.MaximumFunctionArgumentsParameter.ActualName = FunctionArgumentsParameter.Name;
+        architectureAlteringOperator.MaximumFunctionArgumentsParameter.Hidden = true;
+      }
+
+    }
+
+    private void ConfigureAnalyzers(IEnumerable<ISymbolicExpressionTreeAnalyzer> analyzers) {
+      foreach (var analyzer in analyzers) {
+        analyzer.SymbolicExpressionTreeParameter.ActualName = Name;
+        analyzer.SymbolicExpressionTreeParameter.Hidden = true;
+      }
+      foreach (var analyzer in analyzers.OfType<SymbolicExpressionTreeLengthAnalyzer>()) {
+        analyzer.MaximumSymbolicExpressionTreeLengthParameter.ActualName = TreeLengthParameter.Name;
+        analyzer.MaximumSymbolicExpressionTreeLengthParameter.Hidden = true;
+      }
+    }
+
+    private void ConfigureCreators(IEnumerable<ISymbolicExpressionTreeCreator> creators) {
+      //Empty interface
+      foreach (var creator in creators) { }
+    }
+
+    private void ConfigureCrossovers(IEnumerable<ISymbolicExpressionTreeCrossover> crossovers) {
+      foreach (var crossover in crossovers) {
+        crossover.ParentsParameter.ActualName = Name;
+        crossover.ParentsParameter.Hidden = true;
+      }
+    }
+
+    private void ConfigureManipulators(IEnumerable<ISymbolicExpressionTreeManipulator> manipulators) {
+      //Empty interface
+      foreach (var manipulator in manipulators) { }
+    }
+    #endregion
+  }
+
+  public static class IndividualExtensionMethods {
+    public static ISymbolicExpressionTree SymbolicExpressionTree(this Individual individual) {
+      var encoding = individual.GetEncoding<SymbolicExpressionTreeEncoding>();
+      return individual.SymbolicExpressionTree(encoding.Name);
+    }
+
+    public static ISymbolicExpressionTree SymbolicExpressionTree(this Individual individual, string name) {
+      return (ISymbolicExpressionTree)individual[name];
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 16132)
@@ -0,0 +1,238 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public class SymbolicExpressionTreeNode : DeepCloneable, ISymbolicExpressionTreeNode {
+    [Storable]
+    private IList<ISymbolicExpressionTreeNode> subtrees;
+    [Storable]
+    private ISymbol symbol;
+
+    // cached values to prevent unnecessary tree iterations
+    private ushort length;
+    private ushort depth;
+
+    public ISymbol Symbol {
+      get { return symbol; }
+      protected set { symbol = value; }
+    }
+
+    [Storable]
+    private ISymbolicExpressionTreeNode parent;
+    public ISymbolicExpressionTreeNode Parent {
+      get { return parent; }
+      set { parent = value; }
+    }
+
+    [Storable]
+    public double NodeWeight { get; set; }
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeNode(bool deserializing) { }
+    protected SymbolicExpressionTreeNode(SymbolicExpressionTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      symbol = original.symbol; // symbols are reused
+      length = original.length;
+      depth = original.depth;
+      NodeWeight = original.NodeWeight;
+      if (original.subtrees != null) {
+        subtrees = new List<ISymbolicExpressionTreeNode>(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(ISymbol symbol)
+      : base() {
+      subtrees = new List<ISymbolicExpressionTreeNode>(3);
+      this.symbol = symbol;
+    }
+
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (subtrees != null) {
+        foreach (var subtree in subtrees)
+          if (subtree.Parent == null)
+            subtree.Parent = this;
+      }
+    }
+
+    public virtual bool HasLocalParameters {
+      get { return false; }
+    }
+
+    public virtual IEnumerable<ISymbolicExpressionTreeNode> Subtrees {
+      get { return subtrees; }
+    }
+
+    public virtual ISymbolicExpressionTreeGrammar Grammar {
+      get { return parent.Grammar; }
+    }
+
+    public int GetLength() {
+      if (length > 0) return length;
+      else {
+        ushort l = 1;
+        if (subtrees != null) {
+          for (int i = 0; i < subtrees.Count; i++) {
+            checked { l += (ushort)subtrees[i].GetLength(); }
+          }
+        }
+        length = l;
+        return length;
+      }
+    }
+
+    public int GetDepth() {
+      if (depth > 0) return depth;
+      else {
+        ushort d = 0;
+        if (subtrees != null) {
+          for (int i = 0; i < subtrees.Count; i++) d = Math.Max(d, (ushort)subtrees[i].GetDepth());
+        }
+        d++;
+        depth = d;
+        return depth;
+      }
+    }
+
+    public int GetBranchLevel(ISymbolicExpressionTreeNode child) {
+      return GetBranchLevel(this, child);
+    }
+
+    private static int GetBranchLevel(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode 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;
+    }
+
+    public virtual void ResetLocalParameters(IRandom random) { }
+    public virtual void ShakeLocalParameters(IRandom random, double shakingFactor) { }
+
+    public int SubtreeCount {
+      get {
+        if (subtrees == null) return 0;
+        return subtrees.Count;
+      }
+    }
+
+    public virtual ISymbolicExpressionTreeNode GetSubtree(int index) {
+      return subtrees[index];
+    }
+    public virtual int IndexOfSubtree(ISymbolicExpressionTreeNode tree) {
+      return subtrees.IndexOf(tree);
+    }
+    public virtual void AddSubtree(ISymbolicExpressionTreeNode tree) {
+      subtrees.Add(tree);
+      tree.Parent = this;
+      ResetCachedValues();
+    }
+    public virtual void InsertSubtree(int index, ISymbolicExpressionTreeNode 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<ISymbolicExpressionTreeNode> IterateNodesBreadth() {
+      var list = new List<ISymbolicExpressionTreeNode>(GetLength()) { this };
+      int i = 0;
+      while (i != list.Count) {
+        for (int j = 0; j != list[i].SubtreeCount; ++j)
+          list.Add(list[i].GetSubtree(j));
+        ++i;
+      }
+      return list;
+    }
+
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix() {
+      List<ISymbolicExpressionTreeNode> list = new List<ISymbolicExpressionTreeNode>();
+      ForEachNodePrefix((n) => list.Add(n));
+      return list;
+    }
+
+    public void ForEachNodePrefix(Action<ISymbolicExpressionTreeNode> a) {
+      a(this);
+      if (subtrees != null) {
+        //avoid linq to reduce memory pressure
+        for (int i = 0; i < subtrees.Count; i++) {
+          subtrees[i].ForEachNodePrefix(a);
+        }
+      }
+    }
+
+    public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix() {
+      List<ISymbolicExpressionTreeNode> list = new List<ISymbolicExpressionTreeNode>();
+      ForEachNodePostfix((n) => list.Add(n));
+      return list;
+    }
+
+    public void ForEachNodePostfix(Action<ISymbolicExpressionTreeNode> a) {
+      if (subtrees != null) {
+        //avoid linq to reduce memory pressure
+        for (int i = 0; i < subtrees.Count; i++) {
+          subtrees[i].ForEachNodePostfix(a);
+        }
+      }
+      a(this);
+    }
+
+    public override string ToString() {
+      if (Symbol != null) return Symbol.Name;
+      return "SymbolicExpressionTreeNode";
+    }
+
+    private void ResetCachedValues() {
+      length = 0; depth = 0;
+      SymbolicExpressionTreeNode parentNode = parent as SymbolicExpressionTreeNode;
+      if (parentNode != null) parentNode.ResetCachedValues();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeOperator.cs	(revision 16132)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.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 : InstrumentedOperator, IStochasticOperator, ISymbolicExpressionTreeOperator {
+    private const string RandomParameterName = "Random";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    #region Parameter Properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (LookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    #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 LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      if (!Parameters.ContainsKey(SymbolicExpressionTreeParameterName))
+        Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      #endregion
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeProblem.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeProblem.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeProblem.cs	(revision 16132)
@@ -0,0 +1,83 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeProblem : SingleObjectiveBasicProblem<SymbolicExpressionTreeEncoding> {
+
+    // persistence
+    [StorableConstructor]
+    protected SymbolicExpressionTreeProblem(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() { }
+
+
+    // cloning
+    protected SymbolicExpressionTreeProblem(SymbolicExpressionTreeProblem original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    protected SymbolicExpressionTreeProblem() : base() { }
+
+    public virtual bool IsBetter(double quality, double bestQuality) {
+      return (Maximization && quality > bestQuality || !Maximization && quality < bestQuality);
+    }
+
+    public abstract double Evaluate(ISymbolicExpressionTree tree, IRandom random);
+    public sealed override double Evaluate(Individual individual, IRandom random) {
+      return Evaluate(individual.SymbolicExpressionTree(), random);
+    }
+
+    public virtual void Analyze(ISymbolicExpressionTree[] trees, double[] qualities, ResultCollection results,
+      IRandom random) {
+      if (!results.ContainsKey("Best Solution Quality")) {
+        results.Add(new Result("Best Solution Quality", typeof(DoubleValue)));
+      }
+      if (!results.ContainsKey("Best Solution")) {
+        results.Add(new Result("Best Solution", typeof(ISymbolicExpressionTree)));
+      }
+
+      var bestQuality = Maximization ? qualities.Max() : qualities.Min();
+
+      if (results["Best Solution Quality"].Value == null ||
+          IsBetter(bestQuality, ((DoubleValue)results["Best Solution Quality"].Value).Value)) {
+        var bestIdx = Array.IndexOf(qualities, bestQuality);
+        var bestClone = (IItem)trees[bestIdx].Clone();
+        results["Best Solution"].Value = bestClone;
+        results["Best Solution Quality"].Value = new DoubleValue(bestQuality);
+      }
+    }
+
+    public sealed override void Analyze(Individual[] individuals, double[] qualities, ResultCollection results, IRandom random) {
+      Analyze(individuals.Select(ind => ind.SymbolicExpressionTree()).ToArray(), qualities, results, random);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs	(revision 16132)
@@ -0,0 +1,62 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public abstract class SymbolicExpressionTreeTerminalNode : SymbolicExpressionTreeNode {
+    public override IEnumerable<ISymbolicExpressionTreeNode> Subtrees {
+      get { return Enumerable.Empty<ISymbolicExpressionTreeNode>(); }
+    }
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeTerminalNode(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeTerminalNode(SymbolicExpressionTreeTerminalNode original, Cloner cloner) : base(original, cloner) { }
+    protected SymbolicExpressionTreeTerminalNode() : base() { }
+
+    protected SymbolicExpressionTreeTerminalNode(ISymbol symbol)
+      : base() {
+      // symbols are reused
+      this.Symbol = symbol;
+    }
+
+    public override int IndexOfSubtree(ISymbolicExpressionTreeNode tree) {
+      return -1;
+    }
+    public override ISymbolicExpressionTreeNode GetSubtree(int index) {
+      throw new NotSupportedException();
+    }
+    public override void AddSubtree(ISymbolicExpressionTreeNode tree) {
+      throw new NotSupportedException();
+    }
+    public override void InsertSubtree(int index, ISymbolicExpressionTreeNode tree) {
+      throw new NotSupportedException();
+    }
+    public override void RemoveSubtree(int index) {
+      throw new NotSupportedException();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTopLevelNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTopLevelNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTopLevelNode.cs	(revision 16132)
@@ -0,0 +1,51 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  public class SymbolicExpressionTreeTopLevelNode : SymbolicExpressionTreeNode {
+    [Storable]
+    private ISymbolicExpressionTreeGrammar grammar;
+    public override ISymbolicExpressionTreeGrammar Grammar {
+      get { return grammar; }
+    }
+    public void SetGrammar(ISymbolicExpressionTreeGrammar 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(ISymbol symbol) : base(symbol) { }
+
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeTopLevelNode(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs	(revision 16132)
@@ -0,0 +1,71 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  /// <summary>
+  /// Symbol for function arguments
+  /// </summary>
+  [StorableClass]
+  [Item(Argument.ArgumentName, Argument.ArgumentDescription)]
+  public sealed class Argument : Symbol, IReadOnlySymbol {
+    public const string ArgumentName = "Argument";
+    public const string ArgumentDescription = "Symbol that represents a function argument.";
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [Storable]
+    private int argumentIndex;
+    public int ArgumentIndex {
+      get { return argumentIndex; }
+    }
+
+    [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 ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new ArgumentTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Argument(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ArgumentTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ArgumentTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ArgumentTreeNode.cs	(revision 16132)
@@ -0,0 +1,46 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs	(revision 16132)
@@ -0,0 +1,57 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  /// <summary>
+  /// Symbol for function defining branches
+  /// </summary>
+  [StorableClass]
+  [Item(Defun.DefunName, Defun.DefunDescription)]
+  public sealed class Defun : Symbol, IReadOnlySymbol {
+    public const string DefunName = "Defun";
+    public const string DefunDescription = "Symbol that represents a function defining node.";
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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 ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new DefunTreeNode(this);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/DefunTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/DefunTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/DefunTreeNode.cs	(revision 16132)
@@ -0,0 +1,58 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/GroupSymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/GroupSymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/GroupSymbol.cs	(revision 16132)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  public sealed class GroupSymbol : Symbol {
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    private ObservableSet<ISymbol> symbols;
+    public IObservableSet<ISymbol> SymbolsCollection {
+      get { return symbols; }
+    }
+    [Storable]
+    public IEnumerable<ISymbol> Symbols {
+      get { return symbols; }
+      private set { symbols = new ObservableSet<ISymbol>(value); }
+    }
+
+    [StorableConstructor]
+    private GroupSymbol(bool deserializing) : base(deserializing) { }
+    private GroupSymbol(GroupSymbol original, Cloner cloner)
+      : base(original, cloner) {
+      symbols = new ObservableSet<ISymbol>(original.Symbols.Select(s => cloner.Clone(s)));
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GroupSymbol(this, cloner);
+    }
+
+    public GroupSymbol() : this("Group Symbol", Enumerable.Empty<ISymbol>()) { }
+    public GroupSymbol(string name, IEnumerable<ISymbol> symbols)
+      : base(name, "A symbol which groups other symbols") {
+      this.symbols = new ObservableSet<ISymbol>(symbols);
+      InitialFrequency = 0.0;
+    }
+
+    public override IEnumerable<ISymbol> Flatten() {
+      return base.Flatten().Union(symbols.SelectMany(s => s.Flatten()));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs	(revision 16132)
@@ -0,0 +1,70 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  /// <summary>
+  /// Symbol for invoking automatically defined functions
+  /// </summary>
+  [StorableClass]
+  [Item(InvokeFunction.InvokeFunctionName, InvokeFunction.InvokeFunctionDescription)]
+  public sealed class InvokeFunction : Symbol, IReadOnlySymbol {
+    public const string InvokeFunctionName = "InvokeFunction";
+    public const string InvokeFunctionDescription = "Symbol that the invocation of another function.";
+    private const int minimumArity = 0;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [Storable]
+    private string functionName;
+    public string FunctionName {
+      get { return functionName; }
+    }
+
+    [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 ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new InvokeFunctionTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new InvokeFunction(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunctionTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunctionTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunctionTreeNode.cs	(revision 16132)
@@ -0,0 +1,46 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs	(revision 16132)
@@ -0,0 +1,53 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item(ProgramRootSymbol.ProgramRootSymbolName, ProgramRootSymbol.ProgramRootSymbolDescription)]
+  public sealed class ProgramRootSymbol : Symbol, IReadOnlySymbol {
+    public const string ProgramRootSymbolName = "ProgramRootSymbol";
+    public const string ProgramRootSymbolDescription = "Special symbol that represents the program root node of a symbolic expression tree.";
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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 ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new SymbolicExpressionTreeTopLevelNode(this);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/SimpleSymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/SimpleSymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/SimpleSymbol.cs	(revision 16132)
@@ -0,0 +1,74 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  [Item("SimpleSymbol", "Represents a symbol that is identified by its name.")]
+  [NonDiscoverableType]
+  public sealed class SimpleSymbol : Symbol {
+    [Storable]
+    private readonly int minimumArity;
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+
+    [Storable]
+    private readonly int maximumArity = byte.MaxValue;
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    [StorableConstructor]
+    private SimpleSymbol(bool deserializing) : base(deserializing) { }
+
+    private SimpleSymbol(SimpleSymbol original, Cloner cloner)
+      : base(original, cloner) {
+      minimumArity = original.minimumArity;
+      maximumArity = original.maximumArity;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SimpleSymbol(this, cloner);
+    }
+
+    public SimpleSymbol(string name, int arity)
+      : this(name, string.Empty, arity, arity) {
+    }
+
+    public SimpleSymbol(string name, string description, int minimumArity, int maximumArity)
+      : base(name, description) {
+      this.minimumArity = minimumArity;
+      this.maximumArity = maximumArity;
+    }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs	(revision 16132)
@@ -0,0 +1,56 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item(StartSymbol.StartSymbolName, StartSymbol.StartSymbolDescription)]
+  public sealed class StartSymbol : Symbol, IReadOnlySymbol {
+    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.";
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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 ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new SymbolicExpressionTreeTopLevelNode(this);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs	(revision 16132)
@@ -0,0 +1,121 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [StorableClass]
+  [Item("Symbol", "Represents a symbol in a symbolic function tree.")]
+  public abstract class Symbol : NamedItem, ISymbol {
+    #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);
+        }
+      }
+    }
+
+    [Storable(DefaultValue = true)]
+    private bool enabled;
+    public virtual bool Enabled {
+      get { return enabled; }
+      set {
+        if (value != enabled) {
+          enabled = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    [Storable(DefaultValue = false)]
+    private bool @fixed;
+    public bool Fixed {
+      get { return @fixed; }
+      set {
+        if (value != @fixed) {
+          @fixed = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    public override bool CanChangeName {
+      get { return !(this is IReadOnlySymbol); }
+    }
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    public abstract int MinimumArity { get; }
+    public abstract int MaximumArity { get; }
+    #endregion
+
+    [StorableConstructor]
+    protected Symbol(bool deserializing) : base(deserializing) { }
+    protected Symbol(Symbol original, Cloner cloner)
+      : base(original, cloner) {
+      initialFrequency = original.initialFrequency;
+      enabled = original.enabled;
+      @fixed = original.@fixed;
+    }
+
+    protected Symbol(string name, string description)
+      : base(name, description) {
+      initialFrequency = 1.0;
+      enabled = true;
+      @fixed = false;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      if (initialFrequency.IsAlmost(0.0) && !(this is GroupSymbol)) enabled = false;
+      #endregion
+
+    }
+
+    public virtual ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new SymbolicExpressionTreeNode(this);
+    }
+
+    public virtual IEnumerable<ISymbol> Flatten() {
+      yield return this;
+    }
+
+    public event EventHandler Changed;
+    protected virtual void OnChanged(EventArgs e) {
+      EventHandler handlers = Changed;
+      if (handlers != null)
+        handlers(this, e);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/GenealogyOperationsPerformanceTests.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/GenealogyOperationsPerformanceTests.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/GenealogyOperationsPerformanceTests.cs	(revision 16132)
@@ -0,0 +1,73 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.Persistence.Default.Xml;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.EvolutionTracking.Tests {
+  [TestClass]
+  public class GenealogyOperationsPerformanceTests {
+    private readonly IGenealogyGraph<ISymbolicExpressionTree> graph;
+
+    public GenealogyOperationsPerformanceTests() {
+      graph = XmlParser.Deserialize<IGenealogyGraph<ISymbolicExpressionTree>>("genealogyGraph.hl");
+    }
+
+    [TestMethod]
+    public void TestTracingPerformance() {
+      var tc = new TraceCalculator();
+      //      var bestIndividual = (IGenealogyGraphNode<ISymbolicExpressionTree>)graph.Ranks.Last().Value.OrderBy(x => x.Quality).Last();
+      var sw = new Stopwatch();
+      sw.Start();
+      //      double s = graph.Ranks.Last().Value.Average(x => tc.Trace((IGenealogyGraphNode<ISymbolicExpressionTree>) x, 2));  
+      double s = graph.Ranks.Last().Value.Aggregate<IGenealogyGraphNode, double>(0, (current, individual) => current + tc.Trace((IGenealogyGraphNode<ISymbolicExpressionTree>)individual, 2).Vertices.Count());
+      //      var trace = tc.Trace(bestIndividual, 2);
+      sw.Stop();
+      Console.WriteLine("Avg trace size: {0}", s / graph.Ranks.Last().Value.Count());
+      //      var ancestry = bestIndividual.Ancestors;
+      //      Console.WriteLine("Ancestry size: {0}", ancestry.Count());
+      //      Console.WriteLine("Trace size: {0}", trace.Vertices.Count());
+      Console.WriteLine("Elapsed time: {0}", sw.ElapsedMilliseconds / 1000.0);
+    }
+
+    [TestMethod]
+    public void TestAncestorsPerformance() {
+      var sw = new Stopwatch();
+      sw.Start();
+      List<IEnumerable<IGenealogyGraphNode>> ancestries = graph.Ranks.Last().Value.Select(x => x.Ancestors).ToList();
+      sw.Stop();
+      Console.WriteLine("Average ancestry size: {0}", ancestries.Average(x => x.Count()));
+      Console.WriteLine("Elapsed time: {0}", sw.ElapsedMilliseconds / 1000.0);
+
+      sw.Restart();
+      var overlap = ancestries[0].Intersect(ancestries[1]).Count();
+      sw.Stop();
+      Console.WriteLine("Overlap: {0}", overlap);
+      Console.WriteLine("Elapsed time: {0}", sw.ElapsedMilliseconds / 1000.0);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/HeuristicLab.EvolutionTracking.Tests.csproj
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/HeuristicLab.EvolutionTracking.Tests.csproj	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/HeuristicLab.EvolutionTracking.Tests.csproj	(revision 16132)
@@ -0,0 +1,131 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{F065C97D-A66B-401C-AD1B-78D59E14BEDA}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.EvolutionTracking.Tests</RootNamespace>
+    <AssemblyName>HeuristicLab.EvolutionTracking.Tests</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
+    <IsCodedUITest>False</IsCodedUITest>
+    <TestProjectType>UnitTest</TestProjectType>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System" />
+  </ItemGroup>
+  <Choose>
+    <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
+      <ItemGroup>
+        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+      </ItemGroup>
+    </When>
+    <Otherwise>
+      <ItemGroup>
+        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework">
+          <Private>False</Private>
+        </Reference>
+      </ItemGroup>
+    </Otherwise>
+  </Choose>
+  <ItemGroup>
+    <Compile Include="GenealogyOperationsPerformanceTests.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="QueryMatchPerformanceTest.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
+      <Project>{06d4a186-9319-48a0-bade-a2058d462eea}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.EvolutionTracking\3.4\HeuristicLab.EvolutionTracking-3.4.csproj">
+      <Project>{1f75cea3-464f-4a6f-b2f0-04b9841ebc16}</Project>
+      <Name>HeuristicLab.EvolutionTracking-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
+      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+  </ItemGroup>
+  <Choose>
+    <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
+      <ItemGroup>
+        <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+          <Private>False</Private>
+        </Reference>
+        <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+          <Private>False</Private>
+        </Reference>
+        <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+          <Private>False</Private>
+        </Reference>
+        <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+          <Private>False</Private>
+        </Reference>
+      </ItemGroup>
+    </When>
+  </Choose>
+  <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
+  <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>
+  -->
+</Project>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/Properties/AssemblyInfo.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/Properties/AssemblyInfo.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/Properties/AssemblyInfo.cs	(revision 16132)
@@ -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("HeuristicLab.EvolutionTracking.Tests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("FH-Hagenberg")]
+[assembly: AssemblyProduct("HeuristicLab.EvolutionTracking.Tests")]
+[assembly: AssemblyCopyright("Copyright © FH-Hagenberg 2014")]
+[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("1b79ee76-b800-4408-9c61-c9e25a0db0cf")]
+
+// 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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/QueryMatchPerformanceTest.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/QueryMatchPerformanceTest.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/QueryMatchPerformanceTest.cs	(revision 16132)
@@ -0,0 +1,54 @@
+﻿using System;
+using System.Diagnostics;
+using System.Linq;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Random;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.EvolutionTracking.Tests {
+  [TestClass]
+  public class QueryMatchPerformanceTest {
+    private const int MaxDepth = 12;
+    private const int MaxLength = 50;
+    private const int N = 50000;
+    private const int Repetitions = 5;
+
+    [TestMethod]
+    public void TestQueryMatchPerformance() {
+      var grammar = new TypeCoherentExpressionGrammar();
+      grammar.ConfigureAsDefaultRegressionGrammar();
+      var creator = new ProbabilisticTreeCreator();
+      var random = new MersenneTwister();
+
+      var trees = Enumerable.Range(0, N).Select(x => creator.CreateTree(random, grammar, MaxLength, MaxDepth)).ToList();
+      var comparer = new SymbolicExpressionTreeNodeEqualityComparer {
+        MatchConstantValues = false,
+        MatchVariableWeights = false,
+        MatchVariableNames = true
+      };
+      var qm = new QueryMatch(comparer) { MatchParents = true };
+      // warmup
+      int count = trees.Skip(1).Count(x => qm.Match(x, trees[0]));
+
+      var sw = new Stopwatch();
+      sw.Start();
+      for (int i = 0; i < Repetitions; ++i)
+        count = trees.Skip(1).Count(x => x.Length >= trees[0].Length && qm.Match(x, trees[0]));
+      sw.Stop();
+
+      Console.WriteLine("Count: " + count);
+      Console.WriteLine("Query matches per second: " + (N - 1) / (sw.ElapsedMilliseconds / 1000.0) * Repetitions);
+      Console.WriteLine("Total time: " + sw.ElapsedMilliseconds / 1000.0 + "s");
+
+      sw.Restart();
+      for (int i = 0; i < Repetitions; ++i)
+        count = qm.GetMatchingTrees(trees.Skip(1), trees[0]).Count();
+      sw.Stop();
+
+      Console.WriteLine("Count: " + count);
+      Console.WriteLine("Optimized query matches per second: " + (N - 1) / (sw.ElapsedMilliseconds / 1000.0) * Repetitions);
+      Console.WriteLine("Total time: " + sw.ElapsedMilliseconds / 1000.0 + "s");
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.Designer.cs	(revision 16132)
@@ -0,0 +1,32 @@
+﻿namespace HeuristicLab.EvolutionTracking.Views {
+  partial class GenealogyGraphChart {
+    /// <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() {
+      components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+    }
+
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs	(revision 16132)
@@ -0,0 +1,347 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Drawing.Drawing2D;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Visualization;
+
+namespace HeuristicLab.EvolutionTracking.Views {
+  public partial class GenealogyGraphChart : ChartControl {
+    private IGenealogyGraph genealogyGraph;
+    private const double XIncrement = 25;
+    private const double YIncrement = 25;
+    private const double Diameter = 20;
+    private readonly Brush defaultBrush;
+    private readonly Pen defaultPen;
+
+    private Dictionary<IGenealogyGraphNode, VisualGenealogyGraphNode> nodeMap;
+    private Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc> arcMap;
+
+    #region chart options
+    public bool SimpleLineages { get; set; }
+    public bool LockGenealogy { get; set; }
+    public Func<IGenealogyGraphNode, Color> ColorSelector { get; set; }
+    #endregion
+
+    private bool DrawInProgress { get; set; } // do not try to update the chart while the drawing is not finished
+
+    public IGenealogyGraph GenealogyGraph {
+      get { return genealogyGraph; }
+      set {
+        if (value == null) return;
+        genealogyGraph = value;
+        Clear();
+        DrawGraph(XIncrement, YIncrement, Diameter);
+      }
+    }
+
+    public IGenealogyGraphNode SelectedGraphNode {
+      get {
+        return SelectedVisualNode == null ? null : SelectedVisualNode.Data;
+      }
+      set {
+        if (value == null || value == SelectedGraphNode)
+          return;
+        SelectedVisualNode = GetMappedNode(value);
+        RedrawLineages();
+      }
+    }
+    private void Clear() {
+      nodeMap = new Dictionary<IGenealogyGraphNode, VisualGenealogyGraphNode>();
+      arcMap = new Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc>();
+
+      Chart.Group.Clear();
+    }
+
+    private Visualization.Rectangle TargetRectangle { get; set; }
+    protected VisualGenealogyGraphNode SelectedVisualNode { get; set; }
+
+    public VisualGenealogyGraphNode GetMappedNode(IGenealogyGraphNode node) {
+      VisualGenealogyGraphNode v;
+      nodeMap.TryGetValue(node, out v);
+      return v;
+    }
+
+    public VisualGenealogyGraphArc GetMappedArc(IGenealogyGraphNode source, IGenealogyGraphNode target) {
+      VisualGenealogyGraphNode visualSource, visualTarget;
+      nodeMap.TryGetValue(source, out visualSource);
+      nodeMap.TryGetValue(target, out visualTarget);
+
+      if (visualSource == null || visualTarget == null) return null;
+
+      VisualGenealogyGraphArc arc;
+      arcMap.TryGetValue(new Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>(visualSource, visualTarget), out arc);
+      return arc;
+    }
+
+    public GenealogyGraphChart() : base(new GridlessChart(0, 0, 800, 600)) {
+      InitializeComponent();
+      AddChartModes(new PanChartMode(this), new ZoomInChartMode(this), new ZoomOutChartMode(this), new SelectChartMode(this));
+      defaultBrush = new SolidBrush(Color.Transparent);
+      defaultPen = new Pen(Color.DarkGray);
+
+      ColorSelector = node => ColorGradient.Colors[(int)Math.Round(node.Quality * 255)];
+    }
+
+    protected virtual void DrawGraph(double xIncrement, double yIncrement, double diameter) {
+      this.SuspendRendering();
+      DrawInProgress = true;
+
+      var ranks = GenealogyGraph.Ranks.Select(t => new { Rank = t.Key, Nodes = t.Value }).OrderBy(p => p.Rank).ToList();
+      double x = 0;
+      double y = PreferredSize.Height + yIncrement + 2 * diameter;
+
+      foreach (var rank in ranks) {
+        var rect = new Visualization.Rectangle(Chart, new PointD(x, y), new PointD(x + diameter, y + diameter));
+        var font = new Font(FontFamily.GenericSansSerif, 12);
+        var genLabel = new LabeledPrimitive(rect, rank.Rank.ToString(), font);
+        Chart.Group.Add(genLabel);
+
+        x += xIncrement;
+
+        var nodes = rank.Nodes.ToList();
+        nodes.Sort((a, b) => b.CompareTo(a)); // sort descending by quality
+        var nl = Environment.NewLine;
+
+        foreach (var node in nodes) {
+          var brush = new SolidBrush(ColorSelector(node));
+          var visualNode = new VisualGenealogyGraphNode(Chart, x, y, x + diameter, y + diameter, defaultPen, brush) {
+            Data = node,
+            ToolTipText = "Rank: " + node.Rank + nl +
+                          "Quality: " + string.Format("{0:N4}", node.Quality) + nl +
+                          "IsElite: " + node.IsElite + nl +
+                          "In/Out Degree: " + node.InDegree + " " + node.OutDegree
+          };
+          Chart.Group.Add(visualNode);
+          nodeMap.Add(node, visualNode);
+
+          x += xIncrement;
+        }
+        y -= yIncrement;
+        x = 0;
+      }
+
+      // add arcs
+      foreach (var node in GenealogyGraph.Vertices) {
+        if (!node.InArcs.Any()) continue;
+        var visualNode = GetMappedNode(node);
+
+        if (visualNode == null) continue;
+        foreach (var arc in node.InArcs) {
+          var parent = arc.Source;
+          var visualParent = GetMappedNode(parent);
+          if (visualParent == null) continue;
+          var pen = Pens.Transparent;
+          var visualArc = AddArc(Chart, visualParent, visualNode, pen);
+          Chart.OneLayerDown(visualArc); // send it behind the visual nodes
+          if (!arcMap.ContainsKey(Tuple.Create(visualParent, visualNode))) {
+            arcMap.Add(Tuple.Create(visualParent, visualNode), visualArc);
+          }
+        }
+      }
+
+      ResumeRendering();
+      DrawInProgress = false;
+    }
+
+    public event MouseEventHandler GenealogyGraphNodeClicked;
+    protected void OnGenealogyGraphNodeClicked(object sender, MouseEventArgs e) {
+      var clicked = GenealogyGraphNodeClicked;
+      if (clicked != null) clicked(sender, e);
+    }
+
+    public event MouseEventHandler GenealogyGraphNodeDoubleClicked;
+    protected void OnGenealogyGraphNodeDoubleClicked(object sender, MouseEventArgs e) {
+      var doubleClicked = GenealogyGraphNodeDoubleClicked;
+      if (doubleClicked != null)
+        doubleClicked(sender, e);
+    }
+    #region event handlers
+
+    protected override void PictureBoxOnMouseUp(object sender, MouseEventArgs e) {
+      if (Mode is SelectChartMode) {
+        var primitive = Chart.GetAllPrimitives(e.Location).FirstOrDefault(p => p is VisualGenealogyGraphNode);
+        if (primitive != null && primitive != SelectedVisualNode) {
+          SelectedVisualNode = (VisualGenealogyGraphNode)primitive;
+          RedrawLineages(); // redraw ancestries, mark node etc.
+
+          if (SelectedVisualNode != null)
+            OnGenealogyGraphNodeClicked(SelectedVisualNode, null); // emit clicked event
+        }
+      }
+      base.PictureBoxOnMouseUp(sender, e);
+    }
+
+    private void RedrawLineages() {
+      if (!LockGenealogy) {
+        // new node has been selected, clean up
+        SuspendRendering();
+        if (ModifierKeys != Keys.Shift) {
+          // clear colors
+          ClearPrimitives();
+        }
+        // use a rectangle to highlight the currently selected genealogy graph node
+        var graphNode = SelectedVisualNode.Data;
+        var visualNode = GetMappedNode(graphNode);
+
+        DrawLineage(visualNode, n => SimpleLineages ? n.IncomingArcs.Take(1) : n.IncomingArcs, a => a.Source, ColorSelector);
+        ((SolidBrush)visualNode.Brush).Color = Color.Transparent;
+        DrawLineage(visualNode, n => n.OutgoingArcs, a => a.Target, ColorSelector);
+      }
+
+      MarkSelectedNode();
+
+      // update
+      ResumeRendering();
+    }
+    #endregion
+
+    #region drawing routines
+    private static void DrawLineage(VisualGenealogyGraphNode node, Func<VisualGenealogyGraphNode, IEnumerable<VisualGenealogyGraphArc>> arcSelector, Func<VisualGenealogyGraphArc, VisualGenealogyGraphNode> nodeSelector, Func<IGenealogyGraphNode, Color> getNodeColor) {
+      var brush = (SolidBrush)node.Brush;
+      if (brush.Color != Color.Transparent) return; // this lineage was already drawn (avoid redrawing common ancestors)
+      brush.Color = getNodeColor(node.Data);
+      var arcs = arcSelector(node);
+      var pen = new Pen(Color.Transparent);
+      foreach (var arc in arcs) {
+        var source = arc.Source.Data;
+        var target = arc.Target.Data;
+        var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
+        var end = new Point((int)arc.End.X, (int)arc.End.Y);
+        arc.Pen = pen;
+        arc.Pen.Brush = new LinearGradientBrush(start, end, getNodeColor(source), getNodeColor(target));
+        DrawLineage(nodeSelector(arc), arcSelector, nodeSelector, getNodeColor);
+      }
+    }
+
+    void MarkSelectedNode() {
+      var center = SelectedVisualNode.Center;
+      var size = SelectedVisualNode.Size;
+      double x1 = center.X - size.Width / 2;
+      double x2 = x1 + size.Width;
+      double y1 = center.Y - size.Height / 2;
+      double y2 = y1 + size.Height;
+      if (TargetRectangle == null) {
+        var lowerLeft = new PointD(x1, y1);
+        var upperRight = new PointD(x2, y2);
+        TargetRectangle = new Visualization.Rectangle(Chart, lowerLeft, upperRight, new Pen(Color.Black), null);
+        Chart.Group.Add(TargetRectangle);
+      } else {
+        var lowerLeft = new PointD(x1, y1);
+        var upperRight = new PointD(x2, y2);
+        TargetRectangle.SetPosition(lowerLeft, upperRight);
+      }
+    }
+
+    private static VisualGenealogyGraphArc AddArc(IChart chart, VisualGenealogyGraphNode source, VisualGenealogyGraphNode target, Pen pen, Brush brush = null) {
+      var arc = new VisualGenealogyGraphArc(chart, source, target, pen) { Brush = brush };
+      arc.UpdatePosition();
+      source.OutgoingArcs.Add(arc);
+      target.IncomingArcs.Add(arc);
+      chart.Group.Add(arc);
+      return arc;
+    }
+
+    public void ClearArcs() {
+      foreach (var primitive in Chart.Group.Primitives.OfType<VisualGenealogyGraphArc>()) {
+        primitive.Pen = Pens.Transparent;
+      }
+    }
+
+    public void ClearNodes() {
+      foreach (var primitive in Chart.Group.Primitives.OfType<VisualGenealogyGraphNode>()) {
+        primitive.Brush = new SolidBrush(Color.Transparent);
+        primitive.Pen = new Pen(Color.LightGray);
+      }
+    }
+
+    public virtual void ClearPrimitives() {
+      foreach (var primitive in Chart.Group.Primitives) {
+        if (primitive is VisualGenealogyGraphArc) {
+          primitive.Pen = Pens.Transparent;
+        } else if (primitive is VisualGenealogyGraphNode) {
+          primitive.Brush = new SolidBrush(Color.Transparent);
+          primitive.Pen = new Pen(Color.DarkGray);
+        }
+      }
+    }
+
+    public void HighlightNodes(IEnumerable<IGenealogyGraphNode> nodes, bool clearPrimitives = true) {
+      if (clearPrimitives)
+        ClearPrimitives();
+
+      foreach (var node in nodes) {
+        var graphNode = GetMappedNode(node);
+        graphNode.Brush = new SolidBrush(ColorSelector(node));
+      }
+    }
+
+    public void HighlightNodes(IEnumerable<IGenealogyGraphNode> nodes, Color color, bool clearPrimitives = true) {
+      if (clearPrimitives)
+        ClearPrimitives();
+
+      foreach (var node in nodes.Select(GetMappedNode)) {
+        node.Brush = new SolidBrush(color);
+      }
+    }
+
+    public void HighlightAll() {
+      foreach (var visualNode in nodeMap.Values) {
+        visualNode.Brush = new SolidBrush(ColorSelector(visualNode.Data));
+        Chart.IntoForeground(visualNode);
+      }
+      // draw arcs first and then nodes
+      foreach (var arc in arcMap.Values) {
+        var source = arc.Source.Data;
+        var target = arc.Target.Data;
+        var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
+        var end = new Point((int)arc.End.X, (int)arc.End.Y);
+        arc.Pen = new Pen(new LinearGradientBrush(start, end, ColorSelector(source), ColorSelector(target)));
+        Chart.IntoBackground(arc);
+      }
+    }
+
+    public void HighlightArc(IGenealogyGraphNode source, IGenealogyGraphNode target) {
+      var arc = GetMappedArc(source, target) ??
+                AddArc(Chart, GetMappedNode(source), GetMappedNode(target), new Pen(Color.Transparent));
+      var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
+      var end = new Point((int)arc.End.X, (int)arc.End.Y);
+      arc.Pen = new Pen(Color.Transparent);
+      arc.Pen = new Pen(new LinearGradientBrush(start, end, ColorSelector(source), ColorSelector(target)));
+      Chart.IntoBackground(arc);
+    }
+    #endregion
+
+    // workaround to disable the chart grid
+    private class GridlessChart : Chart {
+      public GridlessChart(PointD lowerLeft, PointD upperRight) : base(lowerLeft, upperRight) {
+        Grid = null;
+      }
+
+      public GridlessChart(double x1, double y1, double x2, double y2) : this(new PointD(x1, y1), new PointD(x2, y2)) { }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.Designer.cs	(revision 16132)
@@ -0,0 +1,113 @@
+﻿
+namespace HeuristicLab.EvolutionTracking.Views {
+  partial class GenealogyGraphView<T> {
+    /// <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.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.genealogyGraphChart = new HeuristicLab.EvolutionTracking.Views.GenealogyGraphChart();
+      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // splitContainer
+      // 
+      this.splitContainer.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.splitContainer.Location = new System.Drawing.Point(3, 3);
+      this.splitContainer.Name = "splitContainer";
+      // 
+      // splitContainer.Panel1
+      // 
+      this.splitContainer.Panel1.Controls.Add(this.genealogyGraphChart);
+      // 
+      // splitContainer.Panel2
+      // 
+      this.splitContainer.Panel2.Controls.Add(this.viewHost);
+      this.splitContainer.Size = new System.Drawing.Size(1404, 794);
+      this.splitContainer.SplitterDistance = 698;
+      this.splitContainer.TabIndex = 0;
+      // 
+      // genealogyGraphChart
+      // 
+      this.genealogyGraphChart.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.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control;
+      this.genealogyGraphChart.GenealogyGraph = null;
+      this.genealogyGraphChart.Location = new System.Drawing.Point(0, 0);
+      this.genealogyGraphChart.LockGenealogy = false;
+      this.genealogyGraphChart.Mode = null;
+      this.genealogyGraphChart.Name = "genealogyGraphChart";
+      this.genealogyGraphChart.ScaleOnResize = true;
+      this.genealogyGraphChart.SelectedGraphNode = null;
+      this.genealogyGraphChart.ShowToolBar = true;
+      this.genealogyGraphChart.SimpleLineages = false;
+      this.genealogyGraphChart.Size = new System.Drawing.Size(693, 790);
+      this.genealogyGraphChart.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
+      this.genealogyGraphChart.TabIndex = 0;
+      // 
+      // 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.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+      this.viewHost.Caption = "View";
+      this.viewHost.Content = null;
+      this.viewHost.Enabled = false;
+      this.viewHost.Location = new System.Drawing.Point(0, 0);
+      this.viewHost.Name = "viewHost";
+      this.viewHost.ReadOnly = false;
+      this.viewHost.Size = new System.Drawing.Size(703, 795);
+      this.viewHost.TabIndex = 0;
+      this.viewHost.ViewsLabelVisible = true;
+      this.viewHost.ViewType = null;
+      // 
+      // GenealogyGraphView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.splitContainer);
+      this.Name = "GenealogyGraphView";
+      this.Size = new System.Drawing.Size(1410, 800);
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+      this.splitContainer.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.SplitContainer splitContainer;
+    protected MainForm.WindowsForms.ViewHost viewHost;
+    protected GenealogyGraphChart genealogyGraphChart;
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.cs	(revision 16132)
@@ -0,0 +1,72 @@
+﻿using System.Windows.Forms;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.EvolutionTracking.Views {
+  [View("GenealogyGraphView")]
+  [Content(typeof(IGenealogyGraph<>), IsDefaultView = false)]
+  public partial class GenealogyGraphView<T> : ItemView where T : class, IItem {
+    public new IGenealogyGraph<T> Content {
+      get { return (IGenealogyGraph<T>)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public GenealogyGraphView() {
+      InitializeComponent();
+    }
+
+    protected override void DeregisterContentEvents() {
+      // TODO: Deregister your event handlers here
+      genealogyGraphChart.GenealogyGraphNodeClicked -= graphChart_GenealogyGraphNodeClicked;
+      genealogyGraphChart.GenealogyGraphNodeDoubleClicked -= graphChart_GenealogyGraphNodeDoubleClicked;
+      base.DeregisterContentEvents();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      // TODO: Register your event handlers here
+      genealogyGraphChart.GenealogyGraphNodeClicked += graphChart_GenealogyGraphNodeClicked;
+      genealogyGraphChart.GenealogyGraphNodeDoubleClicked += graphChart_GenealogyGraphNodeDoubleClicked;
+    }
+
+    #region Event Handlers (Content)
+    // TODO: Put event handlers of the content here
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null && Content != genealogyGraphChart.GenealogyGraph) { genealogyGraphChart.GenealogyGraph = Content; }
+    }
+    #endregion
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      // TODO: Enable or disable controls based on whether the content is null or the view is set readonly
+    }
+
+    #region Event Handlers (child controls)
+    // TODO: Put event handlers of child controls here.
+    public virtual void graphChart_GenealogyGraphNodeClicked(object sender, MouseEventArgs args) {
+      var visualNode = (VisualGenealogyGraphNode)sender;
+      var graphNode = (IGenealogyGraphNode<T>)visualNode.Data;
+      if (graphNode == null || graphNode.Data == null) return;
+      viewHost.Content = graphNode.Data;
+    }
+    public virtual void graphChart_GenealogyGraphNodeDoubleClicked(object sender, MouseEventArgs arcs) {
+    }
+    #endregion
+
+    #region events for configuring the behavior of the genealogy chart (trace/match, simple lineages, etc)
+    private void trace_checkBox_CheckedChanged(object sender, System.EventArgs e) {
+      //genealogyGraphChart.TraceFragments = trace_checkBox.Checked;
+    }
+
+    private void simpleLineages_checkBox_CheckedChanged(object sender, System.EventArgs e) {
+      //genealogyGraphChart.SimpleLineages = simpleLineages_checkBox.Checked;
+    }
+
+    private void lockGraph_checkBox_CheckedChanged(object sender, System.EventArgs e) {
+      //genealogyGraphChart.LockGenealogy = lockGraph_checkBox.Checked;
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.resx
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.resx	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.resx	(revision 16132)
@@ -0,0 +1,120 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/HeuristicLab.EvolutionTracking.Views-3.4.csproj
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/HeuristicLab.EvolutionTracking.Views-3.4.csproj	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/HeuristicLab.EvolutionTracking.Views-3.4.csproj	(revision 16132)
@@ -0,0 +1,148 @@
+﻿<?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>{318DFE8C-CA23-4F1B-A4AC-62B425060241}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.EvolutionTracking.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.EvolutionTracking.Views-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization-3.3, Version=3.3.0.5170, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="GenealogyGraphChart.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="GenealogyGraphChart.Designer.cs">
+      <DependentUpon>GenealogyGraphChart.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="GenealogyGraphView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="GenealogyGraphView.Designer.cs">
+      <DependentUpon>GenealogyGraphView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="VisualGenealogyGraphArc.cs" />
+    <Compile Include="VisualGenealogyGraphNode.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.EvolutionTracking\3.4\HeuristicLab.EvolutionTracking-3.4.csproj">
+      <Project>{1f75cea3-464f-4a6f-b2f0-04b9841ebc16}</Project>
+      <Name>HeuristicLab.EvolutionTracking-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="GenealogyGraphView.resx">
+      <DependentUpon>GenealogyGraphView.cs</DependentUpon>
+    </EmbeddedResource>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+  </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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/Plugin.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/Plugin.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/Plugin.cs.frame	(revision 16132)
@@ -0,0 +1,37 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.PluginInfrastructure;
+
+namespace HeuristicLab.EvolutionTracking.Views {
+  [Plugin("HeuristicLab.EvolutionTracking.Views", "Provides controls and views for the evolution graph and related structures.", "3.4.2.$WCREV$")]
+  [PluginFile("HeuristicLab.EvolutionTracking.Views-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.Visualization", "3.3")]
+  [PluginDependency("HeuristicLab.EvolutionTracking", "3.4")]
+
+  public class HeuristicLabEvolutionTrackingPlugin : PluginBase {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
@@ -0,0 +1,47 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.EvolutionTracking.Views")]
+[assembly: AssemblyDescription("Provides views for evolution tracking objects.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2014 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("1E69A973-89E0-45C9-AB3F-E48C1AFEDD34")]
+
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.5.$WCREV$")]
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/VisualGenealogyGraphArc.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/VisualGenealogyGraphArc.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/VisualGenealogyGraphArc.cs	(revision 16132)
@@ -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 System.Drawing;
+using HeuristicLab.Visualization;
+
+namespace HeuristicLab.EvolutionTracking.Views {
+  public class VisualGenealogyGraphArc : Line {
+    public VisualGenealogyGraphNode Source;
+    public VisualGenealogyGraphNode Target;
+
+    public VisualGenealogyGraphArc(IChart chart, PointD start, PointD end)
+      : base(chart, start, end) {
+    }
+    public VisualGenealogyGraphArc(IChart chart, double x1, double y1, double x2, double y2)
+      : this(chart, new PointD(x1, y1), new PointD(x2, y2)) {
+    }
+    public VisualGenealogyGraphArc(IChart chart, PointD start, PointD end, Pen pen)
+      : base(chart, start, end, pen) {
+    }
+    public VisualGenealogyGraphArc(IChart chart, VisualGenealogyGraphNode source, VisualGenealogyGraphNode target, Pen pen)
+      : base(chart, source.Center, target.Center, pen) {
+      Source = source;
+      Target = target;
+      UpdatePosition();
+    }
+    public VisualGenealogyGraphArc(IChart chart, double x1, double y1, double x2, double y2, Pen pen)
+      : this(chart, new PointD(x1, y1), new PointD(x2, y2), pen) {
+    }
+
+    internal void UpdatePosition() {
+      if (Source.Equals(Target)) return;
+      // calculate the positions of the arc ends so that virtually the line will go through the centers of the two elliptical node shapes
+      PointD c1 = Source.Center;
+      PointD c2 = Target.Center;
+      double x = Math.Abs(c1.X - c2.X);
+      double y = Math.Abs(c1.Y - c2.Y);
+      double theta = Math.Atan(y / x); // returns angle in radians
+      // compute the intersection point between an ellipse-shaped node and a line passing through its center with the angular coordinate theta
+      PointD p1 = Source.CalculateIntersection(theta);
+      PointD p2 = Target.CalculateIntersection(theta);
+      // translate coordinates to real-world values
+      double p1X, p1Y, p2X, p2Y;
+      if (c1.X > c2.X) {
+        p1X = c1.X - p1.X;
+        p2X = c2.X + p2.X;
+      } else {
+        p1X = c1.X + p1.X;
+        p2X = c2.X - p2.X;
+      }
+      if (c1.Y > c2.Y) {
+        p1Y = c1.Y - p1.Y;
+        p2Y = c2.Y + p2.Y;
+      } else {
+        p1Y = c1.Y + p1.Y;
+        p2Y = c2.Y - p1.Y;
+      }
+      if (double.IsNaN(p1X) || double.IsNaN(p1Y) || double.IsNaN(p2X) || double.IsNaN(p2Y))
+        throw new Exception("Error calculating arc position.");
+      p1.X = p1X;
+      p1.Y = p1Y;
+      p2.X = p2X;
+      p2.Y = p2Y;
+      SetPosition(p1, p2);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/VisualGenealogyGraphNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/VisualGenealogyGraphNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/VisualGenealogyGraphNode.cs	(revision 16132)
@@ -0,0 +1,94 @@
+﻿#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.Visualization;
+
+namespace HeuristicLab.EvolutionTracking.Views {
+  public class VisualGenealogyGraphNode : Ellipse {
+    public IGenealogyGraphNode Data { get; internal set; }
+    private List<VisualGenealogyGraphArc> incomingArcs = new List<VisualGenealogyGraphArc>();
+    private List<VisualGenealogyGraphArc> outgoingArcs = new List<VisualGenealogyGraphArc>();
+
+    public List<VisualGenealogyGraphArc> IncomingArcs {
+      get { return incomingArcs; }
+      set { incomingArcs = value; }
+    }
+    public List<VisualGenealogyGraphArc> OutgoingArcs {
+      get { return outgoingArcs; }
+      set { outgoingArcs = value; }
+    }
+
+    public float LineWidth {
+      get { return Pen.Width; }
+      set { Pen.Width = value; }
+    }
+
+    public VisualGenealogyGraphNode(IChart chart, PointD lowerLeft, PointD upperRight)
+      : base(chart, lowerLeft, upperRight) {
+    }
+    public VisualGenealogyGraphNode(IChart chart, double x1, double y1, double x2, double y2)
+      : this(chart, new PointD(x1, y1), new PointD(x2, y2)) {
+    }
+    public VisualGenealogyGraphNode(IChart chart, PointD lowerLeft, PointD upperRight, Pen pen, Brush brush)
+      : base(chart, lowerLeft, upperRight, pen, brush) {
+    }
+    public VisualGenealogyGraphNode(IChart chart, double x1, double y1, double x2, double y2, Pen pen, Brush brush)
+      : this(chart, new PointD(x1, y1), new PointD(x2, y2), pen, brush) {
+    }
+
+    // compute the intersection point of an ellipse and a line passing through its center with the angular coordinate theta
+    public PointD CalculateIntersection(double theta) {
+      double sin = Math.Sin(theta);
+      double cos = Math.Cos(theta);
+      double a = Size.Width / 2;
+      double b = Size.Height / 2;
+      double r = a * b / Math.Sqrt(Math.Pow(a * sin, 2) + Math.Pow(b * cos, 2)); // radius at intersection point
+      double rx = r * cos; // X-component (relative to the origin/center of the ellipse)
+      double ry = r * sin; // Y-component (relative to the origin/center of the ellipse)
+      return new PointD(rx, ry);
+    }
+
+    public override void SetPosition(PointD lowerLeft, PointD upperRight) {
+      base.SetPosition(lowerLeft, upperRight);
+      foreach (var a in IncomingArcs) a.UpdatePosition();
+      foreach (var a in OutgoingArcs) a.UpdatePosition();
+    }
+
+    public PointD Center {
+      get { return new PointD((LowerLeft.X + UpperRight.X) / 2, (LowerLeft.Y + UpperRight.Y) / 2); }
+    }
+
+    public override void Draw(Graphics graphics) {
+      Point p = Chart.TransformWorldToPixel(new PointD(LowerLeft.X, LowerLeft.Y + Size.Height));
+      Size s = Chart.TransformWorldToPixel(Size);
+      if (Brush != null) {
+        graphics.FillEllipse(Brush, p.X, p.Y, s.Width, s.Height);
+        graphics.DrawEllipse(Pen, p.X, p.Y, s.Width, s.Height);
+        if (Data.IsElite) {
+          graphics.DrawEllipse(Pen, p.X + 2, p.Y + 2, s.Width - 4, s.Height - 4);
+        }
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/EvolutionTrackingAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/EvolutionTrackingAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/EvolutionTrackingAnalyzer.cs	(revision 16132)
@@ -0,0 +1,119 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [Item("EvolutionTrackingAnalyzer", "Base class for analyzers that use the genealogy graph")]
+  [StorableClass]
+  public abstract class EvolutionTrackingAnalyzer : SingleSuccessorOperator, IAnalyzer {
+    #region parameter names
+    private const string GenerationsParameterName = "Generations";
+    private const string ResultsParameterName = "Results";
+    private const string PopulationSizeParameterName = "PopulationSize";
+    protected const string PopulationGraphResultName = "PopulationGraph";
+    #endregion
+
+    #region parameters
+    public ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    public IValueParameter<IntValue> UpdateIntervalParameter {
+      get { return (IValueParameter<IntValue>)Parameters["UpdateInterval"]; }
+    }
+    public ILookupParameter<IntValue> UpdateCounterParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["UpdateCounter"]; }
+    }
+    public ILookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[PopulationSizeParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public IntValue Generations { get { return GenerationsParameter.ActualValue; } }
+    public ResultCollection Results { get { return ResultsParameter.ActualValue; } }
+    public IntValue UpdateCounter { get { return UpdateCounterParameter.ActualValue; } }
+    public IntValue UpdateInterval { get { return UpdateIntervalParameter.Value; } }
+    public IntValue Generation { get { return GenerationsParameter.ActualValue; } }
+    public IntValue PopulationSize { get { return PopulationSizeParameter.ActualValue; } }
+    public IGenealogyGraph PopulationGraph {
+      get {
+        if (Results.ContainsKey(PopulationGraphResultName))
+          return (IGenealogyGraph)Results[PopulationGraphResultName].Value;
+        return null;
+      }
+    }
+
+    #endregion
+
+    public bool EnabledByDefault {
+      get { return false; }
+    }
+
+    protected EvolutionTrackingAnalyzer() {
+      Parameters.Add(new LookupParameter<IGenealogyGraph>(PopulationGraphResultName, "The genealogy graph."));
+      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The results collection."));
+      Parameters.Add(new ValueParameter<IntValue>("UpdateInterval", new IntValue(1)));
+      Parameters.Add(new LookupParameter<IntValue>("UpdateCounter"));
+      Parameters.Add(new LookupParameter<IntValue>(PopulationSizeParameterName, "The population size"));
+    }
+
+    protected EvolutionTrackingAnalyzer(EvolutionTrackingAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    [StorableConstructor]
+    protected EvolutionTrackingAnalyzer(bool deserializing) : base(deserializing) { }
+  }
+
+  [Item("EvolutionTrackingAnalyzer", "Base class for analyzers that use the genealogy graph")]
+  [StorableClass]
+  public class EvolutionTrackingAnalyzer<T> : EvolutionTrackingAnalyzer where T : class, IItem {
+    public EvolutionTrackingAnalyzer() { }
+
+    protected EvolutionTrackingAnalyzer(EvolutionTrackingAnalyzer original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new EvolutionTrackingAnalyzer<T>(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected EvolutionTrackingAnalyzer(bool deserializing) : base(deserializing) { }
+
+    public new IGenealogyGraph<T> PopulationGraph {
+      get {
+        if (Results.ContainsKey(PopulationGraphResultName))
+          return (IGenealogyGraph<T>)Results[PopulationGraphResultName].Value;
+        return null;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs	(revision 16132)
@@ -0,0 +1,342 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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 License Information
+
+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;
+
+namespace HeuristicLab.EvolutionTracking {
+  [StorableClass]
+  [Item("GenealogyAnalyzer", "An analyzer which performs the necessary instrumentation to record the evolution of a genetic algorithm.")]
+  public abstract class GenealogyAnalyzer<T> : SingleSuccessorOperator, IAnalyzer
+  where T : class, IItem {
+    #region parameter names
+    private const string GenerationsParameterName = "Generations";
+    private const string ResultsParameterName = "Results";
+    private const string PopulationGraphParameterName = "PopulationGraph";
+    public const string QualityParameterName = "Quality";
+    public const string PopulationParameterName = "SymbolicExpressionTree";
+
+    private const string CrossoverParameterName = "Crossover";
+    private const string ManipulatorParameterName = "Mutator";
+    private const string SolutionCreatorParameterName = "SolutionCreator";
+
+    private const string BeforeCrossoverOperatorParameterName = "BeforeCrossoverOperator";
+    private const string AfterCrossoverOperatorParameterName = "AfterCrossoverOperator";
+
+    private const string BeforeManipulatorOperatorParameterName = "BeforeManipulatorOperator";
+    private const string AfterManipulatorOperatorParameterName = "AfterManipulatorOperator";
+
+    private const string EnableCrossoverTrackingParameterName = "EnableCrossoverTracking";
+    private const string EnableManipulatorTrackingParameterName = "EnableManipulatorTracking";
+    private const string EnableSolutionCreatorTrackingParameterName = "EnableSolutionCreatorTracking"; // should always be enabled. maybe superfluous
+    private const string TrimOlderGenerationsParameterName = "TrimOlderGenerations";
+    #endregion parameter names
+
+    #region parameter properties
+
+    public IFixedValueParameter<BoolValue> TrimOlderGenerationsParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[TrimOlderGenerationsParameterName]; }
+    }
+
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+
+    public IScopeTreeLookupParameter<T> PopulationParameter {
+      get { return (IScopeTreeLookupParameter<T>)Parameters[PopulationParameterName]; }
+    }
+
+    public IValueParameter<ICrossoverOperator<T>> BeforeCrossoverOperatorParameter {
+      get { return (IValueParameter<ICrossoverOperator<T>>)Parameters[BeforeCrossoverOperatorParameterName]; }
+    }
+
+    public IValueParameter<ICrossoverOperator<T>> AfterCrossoverOperatorParameter {
+      get { return (IValueParameter<ICrossoverOperator<T>>)Parameters[AfterCrossoverOperatorParameterName]; }
+    }
+
+    public IValueParameter<IManipulatorOperator<T>> BeforeManipulatorOperatorParameter {
+      get { return (IValueParameter<IManipulatorOperator<T>>)Parameters[BeforeManipulatorOperatorParameterName]; }
+    }
+
+    public IValueParameter<IManipulatorOperator<T>> AfterManipulatorOperatorParameter {
+      get { return (IValueParameter<IManipulatorOperator<T>>)Parameters[AfterManipulatorOperatorParameterName]; }
+    }
+
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+
+    public ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
+    }
+
+    public IValueParameter<BoolValue> EnableCrossoverTrackingParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[EnableCrossoverTrackingParameterName]; }
+    }
+
+    public IValueParameter<BoolValue> EnableManipulatorTrackingParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[EnableManipulatorTrackingParameterName]; }
+    }
+
+    public IValueParameter<BoolValue> EnableSolutionCreatorTrackingParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[EnableSolutionCreatorTrackingParameterName]; }
+    }
+
+    public ILookupParameter<ICrossover> CrossoverParameter {
+      get { return (ILookupParameter<ICrossover>)Parameters[CrossoverParameterName]; }
+    }
+
+    public ILookupParameter<IManipulator> ManipulatorParameter {
+      get { return (ILookupParameter<IManipulator>)Parameters[ManipulatorParameterName]; }
+    }
+
+    public ILookupParameter<ISolutionCreator> SolutionCreatorParameter {
+      get { return (ILookupParameter<ISolutionCreator>)Parameters[SolutionCreatorParameterName]; }
+    }
+    #endregion parameter properties
+
+    #region properties
+    public ICrossoverOperator<T> BeforeCrossoverOperator {
+      get { return BeforeCrossoverOperatorParameter.Value; }
+    }
+
+    public ICrossoverOperator<T> AfterCrossoverOperator {
+      get { return AfterCrossoverOperatorParameter.Value; }
+    }
+
+    public IManipulatorOperator<T> BeforeManipulatorOperator {
+      get { return BeforeManipulatorOperatorParameter.Value; }
+    }
+
+    public IManipulatorOperator<T> AfterManipulatorOperator {
+      get { return AfterManipulatorOperatorParameter.Value; }
+    }
+
+    public BoolValue EnableCrossoverTracking {
+      get { return EnableCrossoverTrackingParameter.Value; }
+    }
+
+    public BoolValue EnableManipulatorTracking {
+      get { return EnableManipulatorTrackingParameter.Value; }
+    }
+
+    public BoolValue EnableSolutionCreatorTracking {
+      get { return EnableSolutionCreatorTrackingParameter.Value; }
+    }
+
+    public bool TrimOlderGenerations {
+      get { return TrimOlderGenerationsParameter.Value.Value; }
+    }
+    #endregion properties
+
+    protected GenealogyAnalyzer() {
+      #region add parameters
+      // the instrumented operators
+      Parameters.Add(new LookupParameter<ICrossover>(CrossoverParameterName, "The crossover operator."));
+      Parameters.Add(new LookupParameter<IManipulator>(ManipulatorParameterName, "The manipulator operator."));
+      Parameters.Add(new LookupParameter<ISolutionCreator>(SolutionCreatorParameterName, "The solution creator operator."));
+      // the analyzer parameters
+      Parameters.Add(new ValueParameter<BoolValue>(EnableCrossoverTrackingParameterName, new BoolValue(true)));
+      Parameters.Add(new ValueParameter<BoolValue>(EnableManipulatorTrackingParameterName, new BoolValue(true)));
+      Parameters.Add(new ValueParameter<BoolValue>(EnableSolutionCreatorTrackingParameterName, new BoolValue(true)));
+      // parameters required by the analyzer to do its work
+      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations so far."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName));
+      Parameters.Add(new ScopeTreeLookupParameter<T>(PopulationParameterName, "The population of individuals."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The individual qualities."));
+      Parameters.Add(new ValueParameter<ICrossoverOperator<T>>(BeforeCrossoverOperatorParameterName));
+      Parameters.Add(new ValueParameter<ICrossoverOperator<T>>(AfterCrossoverOperatorParameterName));
+      Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(BeforeManipulatorOperatorParameterName));
+      Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(AfterManipulatorOperatorParameterName));
+      Parameters.Add(new FixedValueParameter<BoolValue>(TrimOlderGenerationsParameterName, "Remove all the generations older than the last generation from the genealoy graph to save memory."));
+      #endregion add parameters
+    }
+
+    protected GenealogyAnalyzer(GenealogyAnalyzer<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    [StorableConstructor]
+    protected GenealogyAnalyzer(bool deserializing) : base(deserializing) { }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // the instrumented operators
+      if (!Parameters.ContainsKey(CrossoverParameterName))
+        Parameters.Add(new LookupParameter<ICrossover>(CrossoverParameterName, "The crossover operator."));
+      if (!Parameters.ContainsKey(ManipulatorParameterName))
+        Parameters.Add(new LookupParameter<IManipulator>(ManipulatorParameterName, "The manipulator operator."));
+      if (!Parameters.ContainsKey(SolutionCreatorParameterName))
+        Parameters.Add(new LookupParameter<ISolutionCreator>(SolutionCreatorParameterName, "The solution creator operator."));
+      // the analyzer parameters
+      if (!Parameters.ContainsKey(EnableCrossoverTrackingParameterName))
+        Parameters.Add(new ValueParameter<BoolValue>(EnableCrossoverTrackingParameterName, new BoolValue(true)));
+      if (!Parameters.ContainsKey(EnableManipulatorTrackingParameterName))
+        Parameters.Add(new ValueParameter<BoolValue>(EnableManipulatorTrackingParameterName, new BoolValue(true)));
+      if (!Parameters.ContainsKey(EnableSolutionCreatorTrackingParameterName))
+        Parameters.Add(new ValueParameter<BoolValue>(EnableSolutionCreatorTrackingParameterName, new BoolValue(true)));
+      // parameters required by the analyzer to do its work
+      if (!Parameters.ContainsKey(GenerationsParameterName))
+        Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations so far."));
+      if (!Parameters.ContainsKey(ResultsParameterName))
+        Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName));
+      if (!Parameters.ContainsKey(PopulationParameterName)) {
+        Parameters.Add(new ScopeTreeLookupParameter<T>(PopulationParameterName, "The population of individuals."));
+      }
+      if (!Parameters.ContainsKey(QualityParameterName)) {
+        Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The individual qualities."));
+      }
+      if (!Parameters.ContainsKey(TrimOlderGenerationsParameterName))
+        Parameters.Add(new FixedValueParameter<BoolValue>(TrimOlderGenerationsParameterName, "Remove all the generations older than the last generation from the genealoy graph to save memory."));
+    }
+
+    public bool EnabledByDefault {
+      get { return false; }
+    }
+
+    private void ConfigureTrackingOperators() {
+      // at the beginning we add the before/after operators to the instrumented operators
+      var crossover = CrossoverParameter.ActualValue;
+      if (crossover != null) {
+        var instrumentedCrossover = (InstrumentedOperator)crossover;
+        instrumentedCrossover.AfterExecutionOperators.Clear();
+        instrumentedCrossover.BeforeExecutionOperators.Clear();
+
+        if (EnableCrossoverTracking.Value) {
+          if (BeforeCrossoverOperator != null) {
+            instrumentedCrossover.BeforeExecutionOperators.Add(BeforeCrossoverOperator);
+          }
+          if (AfterCrossoverOperator != null) {
+            instrumentedCrossover.AfterExecutionOperators.Add(AfterCrossoverOperator);
+          }
+        }
+      }
+      var manipulator = ManipulatorParameter.ActualValue;
+      if (manipulator != null) {
+        var instrumentedManipulator = (InstrumentedOperator)manipulator;
+        instrumentedManipulator.AfterExecutionOperators.Clear();
+        instrumentedManipulator.BeforeExecutionOperators.Clear();
+
+        if (EnableManipulatorTracking.Value) {
+          if (BeforeManipulatorOperator != null) {
+            instrumentedManipulator.BeforeExecutionOperators.Add(BeforeManipulatorOperator);
+          }
+          if (AfterManipulatorOperator != null) {
+            instrumentedManipulator.AfterExecutionOperators.Add(AfterManipulatorOperator);
+          }
+        }
+      }
+    }
+
+    protected abstract void EvaluateIntermediateChildren();
+
+    public override IOperation Apply() {
+      IGenealogyGraph<T> genealogyGraph;
+      var results = ResultsParameter.ActualValue;
+      if (!results.ContainsKey(PopulationGraphParameterName)) {
+        genealogyGraph = new GenealogyGraph<T>();
+        results.Add(new Result(PopulationGraphParameterName, genealogyGraph));
+      } else {
+        genealogyGraph = (IGenealogyGraph<T>)results[PopulationGraphParameterName].Value;
+      }
+
+      var population = PopulationParameter.ActualValue;
+      var qualities = QualityParameter.ActualValue;
+
+      int generation = GenerationsParameter.ActualValue.Value;
+      if (generation == 0) {
+        ConfigureTrackingOperators();
+
+        for (int i = 0; i < population.Length; ++i) {
+          var individual = population[i];
+          var vertex = new GenealogyGraphNode<T>(individual) { Rank = generation };
+          genealogyGraph.AddVertex(vertex);
+          // save the vertex id in the individual scope (so that we can identify graph indices)
+          ExecutionContext.Scope.SubScopes[i].Variables.Add(new Variable("Id", new StringValue(vertex.Id)));
+        }
+      } else {
+        int index = 0;
+        T elite = null;
+        // identify previous elite individual
+        for (int i = 0; i < population.Length; ++i) {
+          if (genealogyGraph.GetByContent(population[i]).Rank.Equals(generation - 1)) {
+            elite = population[i];
+            index = i;
+            break;
+          }
+        }
+        // add current elite and connect with previous
+        #region add elite in the graph and connect it with the previous elite
+        if (elite != null) {
+          var prevVertex = genealogyGraph.GetByContent(elite);
+          prevVertex.IsElite = true; // mark elites in the graph retroactively
+          var v = (IGenealogyGraphNode<T>)prevVertex.Clone();
+          v.Rank = generation;
+          v.IsElite = false;
+          population[index] = v.Data;
+          genealogyGraph.AddVertex(v);
+          genealogyGraph.AddArc(prevVertex, v);
+          // inject the graph node unique id to the scope
+          ExecutionContext.Scope.SubScopes[index].Variables[BeforeManipulatorOperator.ChildParameter.ActualName].Value = v.Data;
+          ExecutionContext.Scope.SubScopes[index].Variables["Id"].Value = new StringValue(v.Id);
+        }
+        #endregion add elite in the graph and connect it with the previous elite
+      }
+      // update qualities
+      for (int i = 0; i < population.Length; ++i) {
+        var vertex = genealogyGraph.GetByContent(population[i]);
+        vertex.Quality = qualities[i].Value;
+      }
+      // update qualities for intermediate vertices
+      EvaluateIntermediateChildren();
+
+      // remove extra graph nodes (added by the instrumented operators in the case of offspring selection)
+      var pop = new HashSet<T>(population);
+      var discarded = genealogyGraph.GetByRank(generation).Where(x => !pop.Contains(x.Data)).ToList();
+      for (int i = 0; i < discarded.Count; ++i) {
+        var v = discarded[i];
+        if (v.InDegree == 1) {
+          var p = v.Parents.First();
+          if (p.Rank.Equals(generation - 0.5))
+            // the individual was a product of mutation. since it wasn't selected, we must remove both it and its parent
+            // ("intermediate" vertex result of crossover)
+            discarded.Add(v.Parents.First());
+        }
+      }
+      genealogyGraph.RemoveVertices(discarded);
+
+      //trim
+      if (TrimOlderGenerations) {
+        var vertices = genealogyGraph.Vertices.Where(x => x.Rank < generation - 1).ToList(); // select all ranks older than the previous generation
+        genealogyGraph.RemoveVertices(vertices);
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/SelectionSchemeAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/SelectionSchemeAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/SelectionSchemeAnalyzer.cs	(revision 16132)
@@ -0,0 +1,122 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [Item("SelectionSchemeAnalyzer", "An analyzer which gives information about the relative amount of individuals that get selected each generation")]
+  [StorableClass]
+  public class SelectionSchemeAnalyzer : EvolutionTrackingAnalyzer {
+    private const string StoreHistoryParameterName = "StoreHistory";
+
+    public IFixedValueParameter<BoolValue> StoreHistoryParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[StoreHistoryParameterName]; }
+    }
+
+    public SelectionSchemeAnalyzer() {
+      UpdateCounterParameter.ActualName = "SelectionSchemeAnalyzerUpdateCounter";
+      Parameters.Add(new FixedValueParameter<BoolValue>(StoreHistoryParameterName, new BoolValue(false)));
+    }
+
+    public bool StoreHistory { get { return StoreHistoryParameter.Value.Value; } }
+
+    [StorableConstructor]
+    protected SelectionSchemeAnalyzer(bool deserializing) : base(deserializing) { }
+
+    protected SelectionSchemeAnalyzer(SelectionSchemeAnalyzer original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SelectionSchemeAnalyzer(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      int updateInterval = UpdateIntervalParameter.Value.Value;
+      IntValue updateCounter = UpdateCounterParameter.ActualValue;
+      // if counter does not yet exist then initialize it with update interval
+      // to make sure the solutions are analyzed on the first application of this operator
+      if (updateCounter == null) {
+        updateCounter = new IntValue(0);
+        UpdateCounterParameter.ActualValue = updateCounter;
+      }
+      updateCounter.Value++;
+      //analyze solutions only every 'updateInterval' times
+      if (updateCounter.Value != updateInterval) return base.Apply();
+      updateCounter.Value = 0;
+
+      if (PopulationGraph == null)
+        return base.Apply();
+      double selectionRatio = 1;
+
+      if (Generations.Value > 0) {
+        var previousRank = PopulationGraph.GetByRank(Generation.Value - 1);
+        selectionRatio = (double)previousRank.Count(x => x.OutDegree > 0) / PopulationSize.Value;
+      }
+
+      // the selection ratio represents the percentage of the old population that survived to reproduce
+      DataTable table;
+      if (!Results.ContainsKey("SelectionRatio")) {
+        table = new DataTable("Selection ratio");
+        Results.Add(new Result("SelectionRatio", table));
+        var row = new DataRow("Selection ratio") { VisualProperties = { StartIndexZero = true } };
+        row.Values.Add(selectionRatio);
+        table.Rows.Add(row);
+      } else {
+        table = (DataTable)Results["SelectionRatio"].Value;
+        table.Rows["Selection ratio"].Values.Add(selectionRatio);
+      }
+      DataTable contributionCountTable;
+      var contributions = PopulationGraph.GetByRank(Generation.Value - 1).OrderByDescending(x => x.Quality).Select(x => (double)x.OutDegree);
+      if (Results.ContainsKey("ContributionCount")) {
+        contributionCountTable = (DataTable)Results["ContributionCount"].Value;
+
+        var row = contributionCountTable.Rows["Contribution count"];
+        row.Values.Replace(contributions);
+      } else {
+        contributionCountTable = new DataTable("Contribution count");
+        Results.Add(new Result("ContributionCount", contributionCountTable));
+        var row = new DataRow("Contribution count") {
+          VisualProperties = { StartIndexZero = true, ChartType = DataRowVisualProperties.DataRowChartType.Columns }
+        };
+        row.Values.AddRange(contributions);
+        contributionCountTable.Rows.Add(row);
+      }
+
+      if (StoreHistory) {
+        DataTableHistory history;
+        if (Results.ContainsKey("ContributionCountHistory")) {
+          history = (DataTableHistory)Results["ContributionCountHistory"].Value;
+        } else {
+          history = new DataTableHistory();
+          Results.Add(new Result("ContributionCountHistory", history));
+        }
+        history.Add((DataTable)contributionCountTable.Clone());
+      }
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Collections/CloneableCollection.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Collections/CloneableCollection.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Collections/CloneableCollection.cs	(revision 16132)
@@ -0,0 +1,45 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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;
+
+namespace HeuristicLab.EvolutionTracking {
+  public class CloneableCollection<T> : List<T>, IDeepCloneable {
+    public CloneableCollection() { }
+
+    public CloneableCollection(IEnumerable<T> elements) : base(elements) { }
+
+    public CloneableCollection(CloneableCollection<T> original, Cloner cloner) : base(original) {
+      cloner.RegisterClonedObject(original, this);
+    }
+
+    public object Clone() { return Clone(new Cloner()); }
+
+    public IDeepCloneable Clone(Cloner cloner) { return new CloneableCollection<T>(this, cloner); }
+  }
+
+  public static class CloneableCollectionExtensions {
+    public static CloneableCollection<T> ToCloneableCollection<T>(this IEnumerable<T> elements) {
+      return new CloneableCollection<T>(elements);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/FPGraph.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/FPGraph.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/FPGraph.cs	(revision 16132)
@@ -0,0 +1,62 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [Item("Symbol graph", "A graph used to store the relationship between symbols in a population of individuals")]
+  [StorableClass]
+  public class FPGraph : DirectedGraph {
+    [Storable]
+    public Dictionary<int, List<SymbolNode>> Levels { get { return levels; } }
+    private Dictionary<int, List<SymbolNode>> levels = new Dictionary<int, List<SymbolNode>>();
+
+    public void AddNode(SymbolNode node, int level) {
+      if (levels.ContainsKey(level)) {
+        SymbolNode match = levels[level].Find(n => n.Label.Equals(node.Label));
+        if (match == null) {
+          levels[level].Add(node);
+        }
+      } else {
+        levels[level] = new List<SymbolNode> { node };
+      }
+      base.AddVertex(node);
+    }
+
+    public bool ContainsKey(string key, int level) {
+      return levels.ContainsKey(level) && levels[level].Select(n => n.Label).Contains(key);
+    }
+
+    public SymbolNode GetNode(string key, int level) {
+      SymbolNode node = null;
+      if (levels.ContainsKey(level))
+        node = levels[level].Find(n => n.Label.Equals(key));
+      return node;
+    }
+
+    void AddArc(SymbolNode source, SymbolNode target, double weight, object data = null) {
+      source.AddForwardArc(target, weight, data);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Fragment.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Fragment.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Fragment.cs	(revision 16132)
@@ -0,0 +1,59 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [StorableClass]
+  [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")]
+  public class Fragment : Item, IFragment {
+    [Storable]
+    public int Index1 { get; set; }
+
+    [Storable]
+    public int Index2 { get; set; }
+
+    [Storable]
+    private object root;
+    public object Root {
+      get { return root; }
+      set { root = value; }
+    }
+    [StorableConstructor]
+    protected Fragment(bool deserializable) : base(deserializable) { }
+
+    protected Fragment(Fragment original, Cloner cloner)
+      : base(original, cloner) {
+      Root = original.Root;
+      Index1 = original.Index1;
+      Index2 = original.Index2;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Fragment(this, cloner);
+    }
+
+    public Fragment() { }
+  }
+
+  [StorableClass]
+  [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")]
+  public class Fragment<T> : Fragment, IFragment<T> where T : class {
+    public new T Root {
+      get { return (T)base.Root; }
+      set { base.Root = value; }
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Fragment<T>(this, cloner);
+    }
+
+    protected Fragment(Fragment<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    [StorableConstructor]
+    protected Fragment(bool deserializable) : base(deserializable) { }
+
+    public Fragment() { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs	(revision 16132)
@@ -0,0 +1,218 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.IO;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [StorableClass]
+  [Item("GenealogyGraph", "A class representing a genealogy graph")]
+  public class GenealogyGraph : DirectedGraph, IGenealogyGraph {
+    private Dictionary<object, IGenealogyGraphNode> contentMap;
+    private Dictionary<string, IGenealogyGraphNode> idMap;
+
+    private readonly Comparison<IArc<IDeepCloneable>> compareArcs = (a, b) => {
+      var da = a.Data;
+      var db = b.Data;
+
+      if ((da == null && db == null) || (da != null && db != null))
+        return 0;
+
+      if (da == null)
+        return -1;
+
+      return 1;
+    };
+
+    protected Dictionary<double, List<IGenealogyGraphNode>> ranks;
+    public IEnumerable<KeyValuePair<double, IEnumerable<IGenealogyGraphNode>>> Ranks {
+      get { return ranks.Select(x => new KeyValuePair<double, IEnumerable<IGenealogyGraphNode>>(x.Key, x.Value)); }
+    }
+    public IEnumerable<IGenealogyGraphNode> GetByRank(double rank) {
+      return ranks.ContainsKey(rank) ? ranks[rank] : Enumerable.Empty<IGenealogyGraphNode>();
+    }
+    protected GenealogyGraph(GenealogyGraph original, Cloner cloner)
+      : base(original, cloner) {
+      RebuildDictionaries();
+      // sort arcs so that in the case of crossover (child vertex with two parents)
+      // the arc which holds the fragment information is always last
+      foreach (var arcList in base.Vertices.Select(v => (List<IArc>)v.InArcs)) {
+        arcList.Sort((a, b) => compareArcs((IGenealogyGraphArc)a, (IGenealogyGraphArc)b));
+      }
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GenealogyGraph(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected GenealogyGraph(bool deserializing)
+      : base(deserializing) {
+    }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RebuildDictionaries();
+      foreach (var arcList in base.Vertices.Select(v => (List<IArc>)v.InArcs)) {
+        arcList.Sort((a, b) => compareArcs((IGenealogyGraphArc)a, (IGenealogyGraphArc)b));
+      }
+    }
+    public GenealogyGraph() {
+      ranks = new Dictionary<double, List<IGenealogyGraphNode>>();
+      contentMap = new Dictionary<object, IGenealogyGraphNode>();
+      idMap = new Dictionary<string, IGenealogyGraphNode>();
+    }
+    new public IEnumerable<IGenealogyGraphNode> Vertices {
+      get { return base.Vertices.Select(x => (IGenealogyGraphNode)x); }
+    }
+    new public IEnumerable<IGenealogyGraphArc> Arcs {
+      get { return base.Arcs.Select(x => (IGenealogyGraphArc)x); }
+    }
+    public override IArc AddArc(IVertex source, IVertex target) {
+      var arc = new GenealogyGraphArc((IGenealogyGraphNode)source, (IGenealogyGraphNode)target);
+      base.AddArc(arc);
+      return arc;
+    }
+    public override void AddVertex(IVertex vertex) {
+      base.AddVertex(vertex);
+      var genealogyGraphNode = (IGenealogyGraphNode)vertex;
+
+      if (contentMap.ContainsKey(genealogyGraphNode.Data))
+        throw new InvalidOperationException("Duplicate content is not allowed in the genealogy graph.");
+      contentMap[genealogyGraphNode.Data] = genealogyGraphNode;
+
+      if (idMap.ContainsKey(genealogyGraphNode.Id))
+        throw new InvalidOperationException("Duplicate ids are not allowed in the genealogy graph.");
+      idMap[genealogyGraphNode.Id] = genealogyGraphNode;
+
+      if (!ranks.ContainsKey(genealogyGraphNode.Rank))
+        ranks[genealogyGraphNode.Rank] = new List<IGenealogyGraphNode>();
+      ranks[genealogyGraphNode.Rank].Add(genealogyGraphNode);
+    }
+    public override void RemoveVertex(IVertex vertex) {
+      var node = (IGenealogyGraphNode)vertex;
+      contentMap.Remove(node.Data);
+      idMap.Remove(node.Id);
+      if (ranks.ContainsKey(node.Rank)) {
+        ranks[node.Rank].Remove(node); // this call will be slow, use with caution
+        if (!ranks[node.Rank].Any())
+          ranks.Remove(node.Rank);
+      }
+      base.RemoveVertex(vertex);
+    }
+
+    public override void RemoveVertices(IEnumerable<IVertex> vertices) {
+      foreach (var v in vertices)
+        this.RemoveVertex(v);
+    }
+
+    public IGenealogyGraphNode GetByContent(object content) {
+      IGenealogyGraphNode result;
+      contentMap.TryGetValue(content, out result);
+      return result;
+    }
+    public IGenealogyGraphNode GetById(string id) {
+      IGenealogyGraphNode result;
+      idMap.TryGetValue(id, out result);
+      return result;
+    }
+    public bool Contains(object content) {
+      return contentMap.ContainsKey(content);
+    }
+    public event EventHandler GraphUpdated;
+    private void OnGraphUpdated(object sender, EventArgs args) {
+      var updated = GraphUpdated;
+      if (updated != null) updated(sender, args);
+    }
+    public override void Clear() {
+      base.Clear();
+      ranks.Clear();
+      contentMap.Clear();
+      idMap.Clear();
+    }
+    private void RebuildDictionaries() {
+      contentMap = new Dictionary<object, IGenealogyGraphNode>();
+      idMap = new Dictionary<string, IGenealogyGraphNode>();
+      ranks = new Dictionary<double, List<IGenealogyGraphNode>>();
+
+      foreach (var v in Vertices) {
+        contentMap[v.Data] = v;
+        idMap[v.Id] = v;
+        if (ranks.ContainsKey(v.Rank)) {
+          ranks[v.Rank].Add(v);
+        } else {
+          ranks[v.Rank] = new List<IGenealogyGraphNode> { v };
+        }
+      }
+    }
+    public void ExportDot(string path) {
+      var sb = new StringBuilder();
+      sb.AppendLine("graph fragmentgraph {");
+      foreach (var v in Vertices) {
+        double width = Math.Max(0.5, v.Degree);
+        sb.AppendLine("\"" + v.Id + "\"[shape=circle, style = filled, width = " + width + ", label = " + v.Rank + "\n" + String.Format("{0:00}", v.Quality) + ", fillcolor = \"" + ColorTranslator.ToHtml(GetColor(v)) + "\"]");
+      }
+      foreach (var a in Arcs) {
+        sb.AppendLine("\"" + a.Source.Id + "\" -- \"" + a.Target.Id + "\"");
+      }
+
+      sb.AppendLine("}");
+      File.WriteAllText(path, sb.ToString());
+    }
+    private Color GetColor(IGenealogyGraphNode node) {
+      var colorIndex = (int)Math.Round(node.Quality * ColorGradient.Colors.Count);
+      if (colorIndex >= ColorGradient.Colors.Count) return ColorGradient.Colors.Last();
+      return ColorGradient.Colors[colorIndex];
+    }
+  }
+
+  [Item("GenealogyGraph", "A genealogy graph in which the vertex data is of type T")]
+  [StorableClass]
+  public class GenealogyGraph<T> : GenealogyGraph, IGenealogyGraph<T> where T : class, IItem {
+    public GenealogyGraph() { }
+    private GenealogyGraph(GenealogyGraph original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GenealogyGraph<T>(this, cloner);
+    }
+    new public IEnumerable<IGenealogyGraphNode<T>> Vertices {
+      get { return base.Vertices.Select(x => (IGenealogyGraphNode<T>)x); }
+    }
+    new public IGenealogyGraphNode<T> GetByContent(object content) {
+      return (IGenealogyGraphNode<T>)base.GetByContent(content);
+    }
+    new public IGenealogyGraphNode<T> GetById(string id) {
+      return (IGenealogyGraphNode<T>)base.GetById(id);
+    }
+    new public IEnumerable<IGenealogyGraphNode<T>> GetByRank(double rank) {
+      return base.GetByRank(rank).Select(x => (IGenealogyGraphNode<T>)x);
+    }
+    public new IEnumerable<KeyValuePair<double, IEnumerable<IGenealogyGraphNode<T>>>> Ranks {
+      get { return base.Ranks.Select(x => new KeyValuePair<double, IEnumerable<IGenealogyGraphNode<T>>>(x.Key, x.Value.Select(n => (IGenealogyGraphNode<T>)n))); }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphArc.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphArc.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphArc.cs	(revision 16132)
@@ -0,0 +1,71 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.EvolutionTracking {
+  [StorableClass]
+  [Item("GenealogyGraphArc", "A graph arc connecting two GenealogyGraphNodes and holding some data.")]
+  public class GenealogyGraphArc : Arc<IDeepCloneable>, IGenealogyGraphArc {
+    [StorableConstructor]
+    protected GenealogyGraphArc(bool deserializing) : base(deserializing) { }
+    protected GenealogyGraphArc(GenealogyGraphArc original, Cloner cloner)
+      : base(original, cloner) { }
+
+    public GenealogyGraphArc(IGenealogyGraphNode source, IGenealogyGraphNode target)
+      : base(source, target) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GenealogyGraphArc(this, cloner);
+    }
+
+    public new IGenealogyGraphNode Source {
+      get { return (IGenealogyGraphNode)base.Source; }
+    }
+
+    public new IGenealogyGraphNode Target {
+      get { return (IGenealogyGraphNode)base.Target; }
+    }
+  }
+
+  [StorableClass]
+  [Item("GenealogyGraphArc", "")]
+  public class GenealogyGraphArc<T> : GenealogyGraphArc where T : class,IItem {
+    [StorableConstructor]
+    protected GenealogyGraphArc(bool deserializing) : base(deserializing) { }
+
+    protected GenealogyGraphArc(GenealogyGraphArc original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GenealogyGraphArc<T>(this, cloner);
+    }
+
+    public new T Data {
+      get { return (T)base.Data; }
+      set { base.Data = value; }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs	(revision 16132)
@@ -0,0 +1,166 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.EvolutionTracking {
+  [StorableClass]
+  [Item("GenealogGraphNode", "A class representing a node in the GenealogyGraph")]
+  public class GenealogyGraphNode : Vertex<IDeepCloneable>, IGenealogyGraphNode {
+    [StorableConstructor]
+    protected GenealogyGraphNode(bool deserializing) : base(deserializing) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GenealogyGraphNode(this, cloner);
+    }
+
+    protected GenealogyGraphNode(GenealogyGraphNode original, Cloner cloner)
+      : base(original, cloner) {
+      Quality = original.Quality;
+      Rank = original.Rank;
+      IsElite = original.IsElite;
+      Id = Guid.NewGuid().ToString();
+    }
+
+    public GenealogyGraphNode() {
+      Id = Guid.NewGuid().ToString();
+    }
+
+    public GenealogyGraphNode(IDeepCloneable data)
+      : this() {
+      Data = data;
+    }
+
+    public new IEnumerable<IGenealogyGraphArc> InArcs {
+      get { return base.InArcs.Select(x => (IGenealogyGraphArc)x); }
+    }
+
+    public new IEnumerable<IGenealogyGraphArc> OutArcs {
+      get { return base.OutArcs.Select(x => (IGenealogyGraphArc)x); }
+    }
+
+    public IEnumerable<IGenealogyGraphNode> Parents {
+      get { return base.InArcs.Select(x => (IGenealogyGraphNode)x.Source); }
+    }
+
+    public IEnumerable<IGenealogyGraphNode> Children {
+      get { return base.OutArcs.Select(x => (IGenealogyGraphNode)x.Target); }
+    }
+
+    public IEnumerable<IGenealogyGraphNode> Ancestors {
+      get {
+        if (!Parents.Any())
+          return Enumerable.Empty<IGenealogyGraphNode>();
+        // for performance, we use a hashset for lookup and a list for iteration
+        var nodes = new HashSet<IGenealogyGraphNode>(Parents);
+        var list = new List<IGenealogyGraphNode>(nodes);
+        int i = 0;
+        while (i != list.Count) {
+          foreach (var arc in list[i].InArcs) {
+            if (nodes.Add(arc.Source))
+              list.Add(arc.Source);
+          }
+          ++i;
+        }
+        return list;
+      }
+    }
+
+    public IEnumerable<IGenealogyGraphNode> Descendants {
+      get {
+        var nodes = new HashSet<IGenealogyGraphNode>(Children);
+        var list = new List<IGenealogyGraphNode>(nodes);
+        int i = 0;
+        while (i != list.Count) {
+          foreach (var e in list[i].OutArcs) {
+            if (nodes.Add(e.Target))
+              list.Add(e.Target);
+          }
+          ++i;
+        }
+        return list;
+      }
+    }
+
+    [Storable]
+    public string Id { get; private set; }
+
+    [Storable]
+    private double rank;
+    public double Rank {
+      get { return rank; }
+      set { rank = value; }
+    }
+    [Storable]
+    private double quality;
+    public double Quality {
+      get { return quality; }
+      set { quality = value; }
+    }
+    [Storable]
+    private bool isElite;
+    public bool IsElite {
+      get { return isElite; }
+      set { isElite = value; }
+    }
+    public int CompareTo(IGenealogyGraphNode other) {
+      return Quality.CompareTo(other.Quality);
+    }
+  }
+
+  [StorableClass]
+  [Item("GenealogyGraphNode", "A genealogy graph node which also has a Content")]
+  public class GenealogyGraphNode<T> : GenealogyGraphNode, IGenealogyGraphNode<T> where T : class, IItem {
+    public new T Data {
+      get { return (T)base.Data; }
+      set { base.Data = value; }
+    }
+
+    [StorableConstructor]
+    protected GenealogyGraphNode(bool deserializing) : base(deserializing) { }
+
+    public GenealogyGraphNode(IDeepCloneable content) : base(content) { }
+
+    protected GenealogyGraphNode(GenealogyGraphNode<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GenealogyGraphNode<T>(this, cloner);
+    }
+    public new IEnumerable<IGenealogyGraphNode<T>> Parents {
+      get { return base.Parents.Select(x => (IGenealogyGraphNode<T>)x); }
+    }
+    public new IEnumerable<IGenealogyGraphNode<T>> Children {
+      get { return base.Children.Select(x => (IGenealogyGraphNode<T>)x); }
+    }
+    public new IEnumerable<IGenealogyGraphNode<T>> Ancestors {
+      get { return base.Ancestors.Select(x => (IGenealogyGraphNode<T>)x); }
+    }
+    public new IEnumerable<IGenealogyGraphNode<T>> Descendants {
+      get { return base.Descendants.Select(x => (IGenealogyGraphNode<T>)x); }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraph.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraph.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraph.cs	(revision 16132)
@@ -0,0 +1,40 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.EvolutionTracking {
+  public interface IGenealogyGraph : IDirectedGraph {
+    IEnumerable<IGenealogyGraphNode> GetByRank(double rank);
+    IEnumerable<KeyValuePair<double, IEnumerable<IGenealogyGraphNode>>> Ranks { get; }
+    IGenealogyGraphNode GetByContent(object content);
+    IGenealogyGraphNode GetById(string id);
+    bool Contains(object content);
+    new IEnumerable<IGenealogyGraphNode> Vertices { get; }
+  }
+
+  public interface IGenealogyGraph<T> : IGenealogyGraph where T : class, IItem {
+    new IEnumerable<IGenealogyGraphNode<T>> Vertices { get; }
+    new IGenealogyGraphNode<T> GetByContent(object content);
+    new IGenealogyGraphNode<T> GetById(string id);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphArc.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphArc.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphArc.cs	(revision 16132)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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;
+
+namespace HeuristicLab.EvolutionTracking {
+  public interface IGenealogyGraphArc : IArc<IDeepCloneable> {
+    new IGenealogyGraphNode Source { get; }
+    new IGenealogyGraphNode Target { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphNode.cs	(revision 16132)
@@ -0,0 +1,50 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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;
+
+namespace HeuristicLab.EvolutionTracking {
+  public interface IGenealogyGraphNode : IVertex<IDeepCloneable>, IComparable<IGenealogyGraphNode> {
+    double Rank { get; set; }
+    double Quality { get; set; }
+    bool IsElite { get; set; }
+    string Id { get; }
+
+    IEnumerable<IGenealogyGraphNode> Parents { get; }
+    IEnumerable<IGenealogyGraphNode> Children { get; }
+    IEnumerable<IGenealogyGraphNode> Ancestors { get; }
+    IEnumerable<IGenealogyGraphNode> Descendants { get; }
+    new IEnumerable<IGenealogyGraphArc> InArcs { get; }
+    new IEnumerable<IGenealogyGraphArc> OutArcs { get; }
+  }
+
+  public interface IGenealogyGraphNode<T> : IGenealogyGraphNode where T : class {
+    new IEnumerable<IGenealogyGraphNode<T>> Parents { get; }
+    new IEnumerable<IGenealogyGraphNode<T>> Children { get; }
+    new IEnumerable<IGenealogyGraphNode<T>> Ancestors { get; }
+    new IEnumerable<IGenealogyGraphNode<T>> Descendants { get; }
+
+    new T Data { get; set; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/HeuristicLab.EvolutionTracking-3.4.csproj
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/HeuristicLab.EvolutionTracking-3.4.csproj	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/HeuristicLab.EvolutionTracking-3.4.csproj	(revision 16132)
@@ -0,0 +1,158 @@
+﻿<?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>{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.EvolutionTracking</RootNamespace>
+    <AssemblyName>HeuristicLab.EvolutionTracking-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Analyzers\EvolutionTrackingAnalyzer.cs" />
+    <Compile Include="Analyzers\GenealogyAnalyzer.cs" />
+    <Compile Include="Analyzers\SelectionSchemeAnalyzer.cs" />
+    <Compile Include="Collections\CloneableCollection.cs" />
+    <Compile Include="Fragment.cs" />
+    <Compile Include="Interfaces\IFragment.cs" />
+    <Compile Include="Operators\BeforeCrossoverOperator.cs" />
+    <Compile Include="Operators\AfterCrossoverOperator.cs" />
+    <Compile Include="Operators\AfterManipulatorOperator.cs" />
+    <Compile Include="Operators\AfterSolutionCreatorOperator.cs" />
+    <Compile Include="Operators\BeforeManipulatorOperator.cs" />
+    <Compile Include="Operators\EvolutionTrackingOperator.cs" />
+    <Compile Include="GenealogyGraph\GenealogyGraph.cs" />
+    <Compile Include="GenealogyGraph\GenealogyGraphArc.cs" />
+    <Compile Include="GenealogyGraph\GenealogyGraphNode.cs" />
+    <Compile Include="GenealogyGraph\Interfaces\IGenealogyGraph.cs" />
+    <Compile Include="GenealogyGraph\Interfaces\IGenealogyGraphArc.cs" />
+    <Compile Include="GenealogyGraph\Interfaces\IGenealogyGraphNode.cs" />
+    <Compile Include="Operators\Interfaces\IManipulatorOperator.cs" />
+    <Compile Include="Operators\Interfaces\ICrossoverOperator.cs" />
+    <Compile Include="Operators\RemovePopulationGraphFromResults.cs" />
+    <Compile Include="Plugin.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+  </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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Interfaces/IFragment.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Interfaces/IFragment.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Interfaces/IFragment.cs	(revision 16132)
@@ -0,0 +1,34 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+
+namespace HeuristicLab.EvolutionTracking {
+
+  public interface IFragment : IItem {
+    object Root { get; set; }
+    int Index1 { get; set; }
+    int Index2 { get; set; }
+  }
+
+  public interface IFragment<T> : IFragment where T : class {
+    new T Root { get; set; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterCrossoverOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterCrossoverOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterCrossoverOperator.cs	(revision 16132)
@@ -0,0 +1,59 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [StorableClass]
+  [Item("AfterCrossoverOperator", "A generic operator that can record genealogical relationships between crossover parents and children.")]
+  public class AfterCrossoverOperator<T> : EvolutionTrackingOperator<T>, ICrossoverOperator<T> where T : class, IItem {
+    private const string ParentsParameterName = "Parents";
+    private const string ChildParameterName = "Child";
+
+    public IScopeTreeLookupParameter<T> ParentsParameter {
+      get { return (IScopeTreeLookupParameter<T>)Parameters[ParentsParameterName]; }
+    }
+    public ILookupParameter<T> ChildParameter {
+      get { return (ILookupParameter<T>)Parameters[ChildParameterName]; }
+    }
+
+    protected AfterCrossoverOperator(AfterCrossoverOperator<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AfterCrossoverOperator<T>(this, cloner);
+    }
+    [StorableConstructor]
+    protected AfterCrossoverOperator(bool deserializing) : base(deserializing) { }
+
+    public AfterCrossoverOperator() {
+      Parameters.Add(new ScopeTreeLookupParameter<T>(ParentsParameterName));
+      Parameters.Add(new LookupParameter<T>(ChildParameterName));
+    }
+
+    public override IOperation Apply() {
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterManipulatorOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterManipulatorOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterManipulatorOperator.cs	(revision 16132)
@@ -0,0 +1,54 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [StorableClass]
+  [Item("AfterCrossoverOperator", "Performs an action after the crossover operator is applied.")]
+  public class AfterManipulatorOperator<T> : EvolutionTrackingOperator<T>, IManipulatorOperator<T> where T : class,IItem {
+    private const string ChildParameterName = "Child";
+
+    public ILookupParameter<T> ChildParameter {
+      get { return (ILookupParameter<T>)Parameters[ChildParameterName]; }
+    }
+
+    protected AfterManipulatorOperator(AfterManipulatorOperator<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AfterManipulatorOperator<T>(this, cloner);
+    }
+    [StorableConstructor]
+    protected AfterManipulatorOperator(bool deserializing) : base(deserializing) { }
+
+    public AfterManipulatorOperator() {
+      Parameters.Add(new LookupParameter<T>(ChildParameterName));
+    }
+
+    public override IOperation Apply() {
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterSolutionCreatorOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterSolutionCreatorOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterSolutionCreatorOperator.cs	(revision 16132)
@@ -0,0 +1,43 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking.Operators {
+  [StorableClass]
+  [Item("AfterSolutionCreatorOperator", "An operator that runs after the solution creator and performs additional actions.")]
+  public class AfterSolutionCreatorOperator<T> : EvolutionTrackingOperator<T>
+    where T : class,IItem {
+
+    private const string CurrentScopeParameterName = "CurrentScope";
+
+    public ScopeParameter CurrentScopeParameter {
+      get { return (ScopeParameter)Parameters[CurrentScopeParameterName]; }
+    }
+    public IScope CurrentScope { get { return CurrentScopeParameter.ActualValue; } }
+
+    public override IOperation Apply() {
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeCrossoverOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeCrossoverOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeCrossoverOperator.cs	(revision 16132)
@@ -0,0 +1,87 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [StorableClass]
+  [Item("BeforeCrossoverOperator", "A generic operator that can record genealogical relationships between crossover parents and children.")]
+  public class BeforeCrossoverOperator<T> : EvolutionTrackingOperator<T>, ICrossoverOperator<T> where T : class,IItem {
+    private const string ParentsParameterName = "Parents";
+    private const string ChildParameterName = "Child";
+
+    public IScopeTreeLookupParameter<T> ParentsParameter {
+      get { return (IScopeTreeLookupParameter<T>)Parameters[ParentsParameterName]; }
+    }
+    public ILookupParameter<T> ChildParameter {
+      get { return (ILookupParameter<T>)Parameters[ChildParameterName]; }
+    }
+
+    public IValueParameter<IntValue> ExecutionCountParameter {
+      get { return (IValueParameter<IntValue>)Parameters["ExecutionCount"]; }
+    }
+
+    protected BeforeCrossoverOperator(BeforeCrossoverOperator<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BeforeCrossoverOperator<T>(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected BeforeCrossoverOperator(bool deserializing) : base(deserializing) { }
+
+    public BeforeCrossoverOperator() {
+      Parameters.Add(new ScopeTreeLookupParameter<T>(ParentsParameterName));
+      Parameters.Add(new LookupParameter<T>(ChildParameterName));
+      Parameters.Add(new ValueParameter<IntValue>("ExecutionCount", new IntValue(0)));
+    }
+
+    private readonly Func<IScope, string> getScopeId = s => ((StringValue)s.Variables["Id"].Value).Value;
+    public override IOperation Apply() {
+      ExecutionCountParameter.Value.Value++;
+
+      var subScopes = ExecutionContext.Scope.SubScopes;
+      var parentVertices = subScopes.Select(x => (GenealogyGraphNode<T>)GenealogyGraph.GetById(getScopeId(x))).ToList();
+      if (!parentVertices.Any())
+        throw new InvalidOperationException("Could not retrieve parent vertices.");
+
+      var parents = ParentsParameter.ActualValue.ToList();
+
+      var childVertex = new GenealogyGraphNode<T>(parents[0]) { Rank = parentVertices[0].Rank + 1 };
+
+      GenealogyGraph.AddVertex(childVertex);
+
+      foreach (var parentVertex in parentVertices)
+        GenealogyGraph.AddArc(parentVertex, childVertex);
+
+      ExecutionContext.Scope.Variables.Add(new Variable("Id", new StringValue(childVertex.Id)));
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs	(revision 16132)
@@ -0,0 +1,75 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [StorableClass]
+  [Item("AfterCrossoverOperator", "Performs an action after the crossover operator is applied.")]
+  public class BeforeManipulatorOperator<T> : EvolutionTrackingOperator<T>, IManipulatorOperator<T> where T : class, IItem {
+    private const string ChildParameterName = "Child";
+
+    public ILookupParameter<T> ChildParameter {
+      get { return (ILookupParameter<T>)Parameters[ChildParameterName]; }
+    }
+
+    protected BeforeManipulatorOperator(BeforeManipulatorOperator<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BeforeManipulatorOperator<T>(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected BeforeManipulatorOperator(bool deserializing) : base(deserializing) { }
+
+    public BeforeManipulatorOperator() {
+      Parameters.Add(new LookupParameter<T>(ChildParameterName));
+    }
+
+    public override IOperation Apply() {
+      // since mutation always takes place after crossover, the vertex for the current child is already in the graph
+      var vChild = GenealogyGraph.GetByContent(ChildParameter.ActualValue);
+      var vClone = (IGenealogyGraphNode<T>)vChild.Clone();
+      vClone.Rank = vChild.Rank - 0.5;
+      GenealogyGraph.AddVertex(vClone);
+
+      var arcs = vChild.InArcs.ToList();
+      foreach (var arc in arcs) {
+        var p = arc.Source;
+        GenealogyGraph.RemoveArc(arc);
+        GenealogyGraph.AddArc(new GenealogyGraphArc(p, vClone));
+      }
+      // by convention, the arc connecting child with parent (non-root parent in case of crossover)
+      // holds fragment data when applicable. the following line of code preserves this data 
+      // the graph arcs are now connecting parent (rank n) --> clone (rank n+0.5) --> child (rank n+1)
+      vClone.InArcs.Last().Data = arcs.Last().Data;
+      GenealogyGraph.AddArc(new GenealogyGraphArc(vClone, vChild));
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/EvolutionTrackingOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/EvolutionTrackingOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/EvolutionTrackingOperator.cs	(revision 16132)
@@ -0,0 +1,77 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [Item("EvolutionTrackingOperator", "A base operator which facilitates access to the genealogy graph.")]
+  [StorableClass]
+  public class EvolutionTrackingOperator<T> : SingleSuccessorOperator where T : class, IItem {
+    // evolution tracking-related parameters
+    private const string ResultsParameterName = "Results";
+    private const string PopulationGraphParameterName = "PopulationGraph";
+    private const string GenerationsParameterName = "Generations";
+
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+    public ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
+    }
+    public ResultCollection Results {
+      get { return ResultsParameter.ActualValue; }
+    }
+    public IntValue Generations {
+      get { return GenerationsParameter.ActualValue; }
+    }
+    public IGenealogyGraph<T> GenealogyGraph {
+      get {
+        IResult result;
+        if (!Results.ContainsKey(PopulationGraphParameterName)) {
+          result = new Result(PopulationGraphParameterName, new GenealogyGraph<T>());
+          Results.Add(result);
+        } else {
+          result = Results[PopulationGraphParameterName];
+        }
+        var graph = (GenealogyGraph<T>)result.Value;
+        return graph;
+      }
+    }
+    public EvolutionTrackingOperator() {
+      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName));
+    }
+    protected EvolutionTrackingOperator(EvolutionTrackingOperator<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new EvolutionTrackingOperator<T>(this, cloner);
+    }
+    [StorableConstructor]
+    protected EvolutionTrackingOperator(bool deserializing) : base(deserializing) { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/Interfaces/ICrossoverOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/Interfaces/ICrossoverOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/Interfaces/ICrossoverOperator.cs	(revision 16132)
@@ -0,0 +1,8 @@
+﻿using HeuristicLab.Core;
+
+namespace HeuristicLab.EvolutionTracking {
+  public interface ICrossoverOperator<T> : IOperator where T : class,IItem {
+    IScopeTreeLookupParameter<T> ParentsParameter { get; }
+    ILookupParameter<T> ChildParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/Interfaces/IManipulatorOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/Interfaces/IManipulatorOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/Interfaces/IManipulatorOperator.cs	(revision 16132)
@@ -0,0 +1,7 @@
+﻿using HeuristicLab.Core;
+
+namespace HeuristicLab.EvolutionTracking {
+  public interface IManipulatorOperator<T> : IOperator where T : class,IItem {
+    ILookupParameter<T> ChildParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/RemovePopulationGraphFromResults.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/RemovePopulationGraphFromResults.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/RemovePopulationGraphFromResults.cs	(revision 16132)
@@ -0,0 +1,55 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.EvolutionTracking.Operators {
+  [StorableClass]
+  [Item("RemovePopulationGraphFromResultsOperator", "In some cases the genealogy graph is necessary during the run but to save memory it should be removed from the results at the end of the run.")]
+  public class RemovePopulationGraphFromResultsOperator : SingleSuccessorOperator {
+
+    public const string ResultCollectionParameterName = "Results";
+
+    public ILookupParameter<ResultCollection> ResultCollectionParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultCollectionParameterName]; }
+    }
+
+    [StorableConstructor]
+    protected RemovePopulationGraphFromResultsOperator(bool deserializing) : base(deserializing) { }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(ResultCollectionParameterName))
+        Parameters.Add(new LookupParameter<ResultCollection>(ResultCollectionParameterName));
+    }
+
+    public RemovePopulationGraphFromResultsOperator() {
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultCollectionParameterName));
+    }
+
+    public RemovePopulationGraphFromResultsOperator(RemovePopulationGraphFromResultsOperator original, Cloner cloner) : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RemovePopulationGraphFromResultsOperator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      if (Parameters.ContainsKey(ResultCollectionParameterName)) {
+        var results = ResultCollectionParameter.ActualValue;
+
+        if (results.ContainsKey("PopulationGraph"))
+          results.Remove("PopulationGraph");
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Plugin.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Plugin.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Plugin.cs.frame	(revision 16132)
@@ -0,0 +1,42 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.PluginInfrastructure;
+
+namespace HeuristicLab.EvolutionTracking {
+  [Plugin("HeuristicLab.EvolutionTracking", "Provides operators and related classes for tracking the evolution within a GA.", "3.4.5.$WCREV$")]
+  [PluginFile("HeuristicLab.EvolutionTracking-3.4.dll", PluginFileType.Assembly)]
+  [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.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  [PluginDependency("HeuristicLab.Selection", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+
+  public class HeuristicLabEvolutionTrackingPlugin : PluginBase {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
@@ -0,0 +1,47 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.EvolutionTracking")]
+[assembly: AssemblyDescription("Provides operators and related classes for the tracking of genetic inheritance.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2014 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("3539BCEC-1C7D-4828-898C-850B2DFE1526")]
+
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.5.$WCREV$")]
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/SymbolGraph.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/SymbolGraph.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/SymbolGraph.cs	(revision 16132)
@@ -0,0 +1,81 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.EvolutionTracking {
+  [Item("Symbol graph", "A graph used to store the relationship between symbols in a population of individuals")]
+  [StorableClass]
+  public class SymbolGraph : DirectedGraph {
+    [Storable]
+    private readonly Dictionary<string, SymbolNode> nodeMap = new Dictionary<string, SymbolNode>();
+
+    public void AddVertex(SymbolNode node) {
+      if (nodeMap.ContainsKey(node.Label)) return; // node already present? do nothing
+      nodeMap[node.Label] = node;
+      base.AddVertex(node);
+    }
+
+    public bool ContainsKey(string key) {
+      return nodeMap.ContainsKey(key);
+    }
+
+    public SymbolNode GetNode(string key) {
+      SymbolNode node;
+      nodeMap.TryGetValue(key, out node);
+      return node;
+    }
+
+    void AddArc(SymbolNode source, SymbolNode target, double weight, object data = null) {
+      source.AddForwardArc(target, weight, data);
+    }
+  }
+
+  [StorableClass]
+  public class SymbolNode : Vertex {
+    public ISymbol Symbol { get; set; }
+    public Dictionary<int, int> Positions { get; set; }
+    public double AverageArity { get; set; }
+
+    public new List<SymbolArc> InArcs {
+      get { return base.InArcs == null ? null : base.InArcs.Cast<SymbolArc>().ToList(); }
+    }
+
+    public new List<SymbolArc> OutArcs {
+      get { return base.OutArcs == null ? null : base.OutArcs.Cast<SymbolArc>().ToList(); }
+    }
+
+    public SymbolNode() {
+    }
+  }
+
+  public class SymbolArc : IArc {
+    public IVertex Source { get; set; }
+    public IVertex Target { get; set; }
+    public double Weight { get; set; }
+
+    public object Data { get; set; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Exporters/SymbolicSolutionExcelExporter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Exporters/SymbolicSolutionExcelExporter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Exporters/SymbolicSolutionExcelExporter.cs	(revision 16132)
@@ -0,0 +1,360 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding.Views;
+using OfficeOpenXml;
+using OfficeOpenXml.Drawing.Chart;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  public class SymbolicSolutionExcelExporter : IDataAnalysisSolutionExporter {
+    protected const string TRAININGSTART = "TrainingStart";
+    protected const string TRAININGEND = "TrainingEnd";
+    protected const string TESTSTART = "TestStart";
+    protected const string TESTEND = "TestEnd";
+
+
+    public string FileTypeFilter {
+      get { return "Excel 2007 file (*.xlsx)|*.xlsx"; }
+    }
+    public bool Supports(IDataAnalysisSolution solution) {
+      return solution is ISymbolicDataAnalysisSolution &&
+        solution is IRegressionSolution;
+    }
+
+    public virtual void Export(IDataAnalysisSolution solution, string fileName) {
+      var symbSolution = solution as ISymbolicDataAnalysisSolution;
+      if (symbSolution == null) throw new NotSupportedException("This solution cannot be exported to Excel");
+      var formatter = new SymbolicDataAnalysisExpressionExcelFormatter();
+      var formula = formatter.Format(symbSolution.Model.SymbolicExpressionTree, solution.ProblemData.Dataset);
+      ExportChart(fileName, symbSolution, formula);
+    }
+
+    private void ExportChart(string fileName, ISymbolicDataAnalysisSolution solution, string formula) {
+      FileInfo newFile = new FileInfo(fileName);
+      if (newFile.Exists) {
+        newFile.Delete();
+        newFile = new FileInfo(fileName);
+      }
+      var formulaParts = formula.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
+
+      using (ExcelPackage package = new ExcelPackage(newFile)) {
+        ExcelWorksheet modelWorksheet = package.Workbook.Worksheets.Add("Model");
+        FormatModelSheet(modelWorksheet, solution, formulaParts);
+
+        ExcelWorksheet datasetWorksheet = package.Workbook.Worksheets.Add("Dataset");
+        WriteDatasetToExcel(datasetWorksheet, solution.ProblemData);
+
+        ExcelWorksheet inputsWorksheet = package.Workbook.Worksheets.Add("Inputs");
+        WriteInputSheet(inputsWorksheet, datasetWorksheet, formulaParts.Skip(2), solution.ProblemData.Dataset);
+
+        if (solution is IRegressionSolution) {
+          ExcelWorksheet estimatedWorksheet = package.Workbook.Worksheets.Add("Estimated Values");
+          WriteEstimatedWorksheet(estimatedWorksheet, datasetWorksheet, formulaParts, solution as IRegressionSolution);
+
+          ExcelWorksheet chartsWorksheet = package.Workbook.Worksheets.Add("Charts");
+          AddCharts(chartsWorksheet);
+        }
+        package.Workbook.Properties.Title = "Excel Export";
+        package.Workbook.Properties.Author = "HEAL";
+        package.Workbook.Properties.Comments = "Excel export of a symbolic data analysis solution from HeuristicLab";
+
+        package.Save();
+      }
+    }
+
+    private void FormatModelSheet(ExcelWorksheet modelWorksheet, ISymbolicDataAnalysisSolution solution, IEnumerable<string> formulaParts) {
+      int row = 1;
+      modelWorksheet.Cells[row, 1].Value = "Model";
+      modelWorksheet.Cells[row, 2].Value = solution.Name;
+
+      foreach (var part in formulaParts) {
+        modelWorksheet.Cells[row, 4].Value = part;
+        row++;
+      }
+
+      row = 2;
+      modelWorksheet.Cells[row, 1].Value = "Model Depth";
+      modelWorksheet.Cells[row, 2].Value = solution.Model.SymbolicExpressionTree.Depth;
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Model Length";
+      modelWorksheet.Cells[row, 2].Value = solution.Model.SymbolicExpressionTree.Length;
+      row += 2;
+
+      modelWorksheet.Cells[row, 1].Value = "Estimation Limits Lower";
+      modelWorksheet.Cells[row, 2].Value = Math.Max(solution.Model.LowerEstimationLimit, -9.99999999999999E+307); // minimal value supported by excel
+      modelWorksheet.Names.Add("EstimationLimitLower", modelWorksheet.Cells[row, 2]);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Estimation Limits Upper";
+      modelWorksheet.Cells[row, 2].Value = Math.Min(solution.Model.UpperEstimationLimit, 9.99999999999999E+307);  // maximal value supported by excel
+      modelWorksheet.Names.Add("EstimationLimitUpper", modelWorksheet.Cells[row, 2]);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+      row += 2;
+
+      modelWorksheet.Cells[row, 1].Value = "Trainings Partition Start";
+      modelWorksheet.Cells[row, 2].Value = solution.ProblemData.TrainingPartition.Start;
+      modelWorksheet.Names.Add(TRAININGSTART, modelWorksheet.Cells[row, 2]);
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Trainings Partition End";
+      modelWorksheet.Cells[row, 2].Value = solution.ProblemData.TrainingPartition.End;
+      modelWorksheet.Names.Add(TRAININGEND, modelWorksheet.Cells[row, 2]);
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Test Partition Start";
+      modelWorksheet.Cells[row, 2].Value = solution.ProblemData.TestPartition.Start;
+      modelWorksheet.Names.Add(TESTSTART, modelWorksheet.Cells[row, 2]);
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Test Partition End";
+      modelWorksheet.Cells[row, 2].Value = solution.ProblemData.TestPartition.End;
+      modelWorksheet.Names.Add(TESTEND, modelWorksheet.Cells[row, 2]);
+      row += 2;
+
+      string excelTrainingTarget = Indirect("B", true);
+      string excelTrainingEstimated = Indirect("C", true);
+      string excelTrainingAbsoluteError = Indirect("D", true);
+      string excelTrainingRelativeError = Indirect("E", true);
+      string excelTrainingMeanError = Indirect("F", true);
+      string excelTrainingMSE = Indirect("G", true);
+
+      string excelTestTarget = Indirect("B", false);
+      string excelTestEstimated = Indirect("C", false);
+      string excelTestAbsoluteError = Indirect("D", false);
+      string excelTestRelativeError = Indirect("E", false);
+      string excelTestMeanError = Indirect("F", false);
+      string excelTestMSE = Indirect("G", false);
+
+      modelWorksheet.Cells[row, 1].Value = "Pearson's R² (training)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("POWER(PEARSON({0},{1}),2)", excelTrainingTarget, excelTrainingEstimated);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Pearson's R² (test)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("POWER(PEARSON({0},{1}),2)", excelTestTarget, excelTestEstimated);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Mean Squared Error (training)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingMSE);
+      modelWorksheet.Names.Add("TrainingMSE", modelWorksheet.Cells[row, 2]);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Mean Squared Error (test)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestMSE);
+      modelWorksheet.Names.Add("TestMSE", modelWorksheet.Cells[row, 2]);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Mean absolute error (training)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingAbsoluteError);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Mean absolute error (test)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestAbsoluteError);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Mean error (training)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingMeanError);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Mean error (test)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestMeanError);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Average relative error (training)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingRelativeError);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.00%";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Average relative error (test)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestRelativeError);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.00%";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Normalized Mean Squared error (training)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("TrainingMSE / VAR({0})", excelTrainingTarget);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+      row++;
+
+      modelWorksheet.Cells[row, 1].Value = "Normalized Mean Squared error  (test)";
+      modelWorksheet.Cells[row, 2].Formula = string.Format("TestMSE / VAR({0})", excelTestTarget);
+      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000E+00";
+
+      modelWorksheet.Cells["A1:B" + row].AutoFitColumns();
+
+      AddModelTreePicture(modelWorksheet, solution.Model);
+    }
+
+    protected string Indirect(string column, bool training) {
+      if (training) {
+        return string.Format("INDIRECT(\"'Estimated Values'!{0}\"&{1}+2&\":{0}\"&{2}+1)", column, TRAININGSTART, TRAININGEND);
+      } else {
+        return string.Format("INDIRECT(\"'Estimated Values'!{0}\"&{1}+2&\":{0}\"&{2}+1)", column, TESTSTART, TESTEND);
+      }
+    }
+
+    private void AddCharts(ExcelWorksheet chartsWorksheet) {
+      chartsWorksheet.Names.AddFormula("AllId", "OFFSET('Estimated Values'!$A$1,1,0, COUNTA('Estimated Values'!$A:$A)-1)");
+      chartsWorksheet.Names.AddFormula("AllTarget", "OFFSET('Estimated Values'!$B$1,1,0, COUNTA('Estimated Values'!$B:$B)-1)");
+      chartsWorksheet.Names.AddFormula("AllEstimated", "OFFSET('Estimated Values'!$C$1,1,0, COUNTA('Estimated Values'!$C:$C)-1)");
+      chartsWorksheet.Names.AddFormula("TrainingId", "OFFSET('Estimated Values'!$A$1,Model!TrainingStart + 1,0, Model!TrainingEnd - Model!TrainingStart)");
+      chartsWorksheet.Names.AddFormula("TrainingTarget", "OFFSET('Estimated Values'!$B$1,Model!TrainingStart + 1,0, Model!TrainingEnd - Model!TrainingStart)");
+      chartsWorksheet.Names.AddFormula("TrainingEstimated", "OFFSET('Estimated Values'!$C$1,Model!TrainingStart + 1,0, Model!TrainingEnd - Model!TrainingStart)");
+      chartsWorksheet.Names.AddFormula("TestId", "OFFSET('Estimated Values'!$A$1,Model!TestStart + 1,0, Model!TestEnd - Model!TestStart)");
+      chartsWorksheet.Names.AddFormula("TestTarget", "OFFSET('Estimated Values'!$B$1,Model!TestStart + 1,0, Model!TestEnd - Model!TestStart)");
+      chartsWorksheet.Names.AddFormula("TestEstimated", "OFFSET('Estimated Values'!$C$1,Model!TestStart + 1,0, Model!TestEnd - Model!TestStart)");
+
+      var scatterPlot = chartsWorksheet.Drawings.AddChart("scatterPlot", eChartType.XYScatter);
+      scatterPlot.SetSize(800, 400);
+      scatterPlot.SetPosition(0, 0);
+      scatterPlot.Title.Text = "Scatter Plot";
+      var seriesAll = scatterPlot.Series.Add("AllTarget", "AllEstimated");
+      seriesAll.Header = "All";
+      var seriesTraining = scatterPlot.Series.Add("TrainingTarget", "TrainingEstimated");
+      seriesTraining.Header = "Training";
+      var seriesTest = scatterPlot.Series.Add("TestTarget", "TestEstimated");
+      seriesTest.Header = "Test";
+
+      var lineChart = chartsWorksheet.Drawings.AddChart("lineChart", eChartType.XYScatterLinesNoMarkers);
+      lineChart.SetSize(800, 400);
+      lineChart.SetPosition(400, 0);
+      lineChart.Title.Text = "LineChart";
+      var lineTarget = lineChart.Series.Add("AllTarget", "AllId");
+      lineTarget.Header = "Target";
+      var lineAll = lineChart.Series.Add("AllEstimated", "AllId");
+      lineAll.Header = "All";
+      var lineTraining = lineChart.Series.Add("TrainingEstimated", "TrainingId");
+      lineTraining.Header = "Training";
+      var lineTest = lineChart.Series.Add("TestEstimated", "TestId");
+      lineTest.Header = "Test";
+    }
+
+    protected void AddModelTreePicture(ExcelWorksheet modelWorksheet, ISymbolicDataAnalysisModel model) {
+      SymbolicExpressionTreeChart modelTreePicture = new SymbolicExpressionTreeChart();
+      modelTreePicture.Tree = model.SymbolicExpressionTree;
+      string tmpFilename = Path.GetTempFileName();
+      modelTreePicture.Width = 1000;
+      modelTreePicture.Height = 500;
+      modelTreePicture.SaveImageAsEmf(tmpFilename);
+
+      FileInfo fi = new FileInfo(tmpFilename);
+      var excelModelTreePic = modelWorksheet.Drawings.AddPicture("ModelTree", fi);
+      excelModelTreePic.SetSize(50);
+      excelModelTreePic.SetPosition(2, 0, 6, 0);
+    }
+
+    private void WriteEstimatedWorksheet(ExcelWorksheet estimatedWorksheet, ExcelWorksheet datasetWorksheet, string[] formulaParts, IRegressionSolution solution) {
+      string preparedFormula = PrepareFormula(formulaParts);
+      int rows = solution.ProblemData.Dataset.Rows;
+      estimatedWorksheet.Cells[1, 1].Value = "Id";
+      estimatedWorksheet.Cells[1, 2].Value = "Target Variable";
+      estimatedWorksheet.Cells[1, 3].Value = "Estimated Values";
+      estimatedWorksheet.Cells[1, 4].Value = "Absolute Error";
+      estimatedWorksheet.Cells[1, 5].Value = "Relative Error";
+      estimatedWorksheet.Cells[1, 6].Value = "Error";
+      estimatedWorksheet.Cells[1, 7].Value = "Squared Error";
+      estimatedWorksheet.Cells[1, 9].Value = "Unbounded Estimated Values";
+      estimatedWorksheet.Cells[1, 10].Value = "Bounded Estimated Values";
+
+      estimatedWorksheet.Cells[1, 1, 1, 10].AutoFitColumns();
+
+      // fill in id, target variable and unbounded estimated values
+      int targetIndex = solution.ProblemData.Dataset.VariableNames.ToList().FindIndex(x => x.Equals(solution.ProblemData.TargetVariable)) + 1;
+      for (int i = 0; i < rows; i++) {
+        estimatedWorksheet.Cells[i + 2, 1].Value = i; // id
+        estimatedWorksheet.Cells[i + 2, 2].Formula = datasetWorksheet.Cells[i + 2, targetIndex].FullAddress; // target variable
+        estimatedWorksheet.Cells[i + 2, 9].Formula = string.Format(preparedFormula, i + 2); // unbounded estimated values
+      }
+      estimatedWorksheet.Cells["B2:B" + (rows + 1)].Style.Numberformat.Format = "0.000";
+
+      estimatedWorksheet.Cells["C2:C" + (rows + 1)].Formula = "J2";
+      estimatedWorksheet.Cells["C2:C" + (rows + 1)].Style.Numberformat.Format = "0.000";
+      estimatedWorksheet.Cells["D2:D" + (rows + 1)].Formula = "ABS(B2 - C2)";
+      estimatedWorksheet.Cells["D2:D" + (rows + 1)].Style.Numberformat.Format = "0.000";
+      estimatedWorksheet.Cells["E2:E" + (rows + 1)].Formula = "ABS(D2 / B2)";
+      estimatedWorksheet.Cells["E2:E" + (rows + 1)].Style.Numberformat.Format = "0.000";
+      estimatedWorksheet.Cells["F2:F" + (rows + 1)].Formula = "C2 - B2";
+      estimatedWorksheet.Cells["F2:F" + (rows + 1)].Style.Numberformat.Format = "0.000";
+      estimatedWorksheet.Cells["G2:G" + (rows + 1)].Formula = "POWER(F2, 2)";
+      estimatedWorksheet.Cells["G2:G" + (rows + 1)].Style.Numberformat.Format = "0.000";
+
+      estimatedWorksheet.Cells["I2:I" + (rows + 1)].Style.Numberformat.Format = "0.000";
+      estimatedWorksheet.Cells["J2:J" + (rows + 1)].Formula = "IFERROR(IF(I2 > Model!EstimationLimitUpper, Model!EstimationLimitUpper, IF(I2 < Model!EstimationLimitLower, Model!EstimationLimitLower, I2)), AVERAGE(Model!EstimationLimitLower, Model!EstimationLimitUpper))";
+      estimatedWorksheet.Cells["J2:J" + (rows + 1)].Style.Numberformat.Format = "0.000";
+    }
+
+    protected string PrepareFormula(string[] formulaParts) {
+      string preparedFormula = formulaParts[0];
+      foreach (var part in formulaParts.Skip(2)) {
+        var varMap = part.Split(new string[] { " = " }, StringSplitOptions.None);
+        var columnName = "$" + varMap[1] + "1";
+        preparedFormula = preparedFormula.Replace(columnName, "Inputs!$" + varMap[1] + "{0}");   //{0} will be replaced later with the row number 
+      }
+      return preparedFormula;
+    }
+
+    protected void WriteInputSheet(ExcelWorksheet inputsWorksheet, ExcelWorksheet datasetWorksheet, IEnumerable<string> list, IDataset dataset) {
+      //remark the performance of EPPlus drops dramatically 
+      //if the data is not written row wise (from left to right) due the internal indices used.
+      var variableNames = dataset.VariableNames.Select((v, i) => new { variable = v, index = i + 1 }).ToDictionary(v => v.variable, v => v.index);
+      var nameMapping = list.Select(x => x.Split('=')[0].Trim()).ToArray();
+
+      for (int row = 1; row <= dataset.Rows + 1; row++) {
+        for (int column = 1; column < nameMapping.Length + 1; column++) {
+          int variableIndex = variableNames[nameMapping[column - 1]];
+          inputsWorksheet.Cells[row, column].Formula = datasetWorksheet.Cells[row, variableIndex].FullAddress;
+        }
+      }
+    }
+
+    protected void WriteDatasetToExcel(ExcelWorksheet datasetWorksheet, IDataAnalysisProblemData problemData) {
+      //remark the performance of EPPlus drops dramatically 
+      //if the data is not written row wise (from left to right) due the internal indices used.
+      IDataset dataset = problemData.Dataset;
+      var variableNames = dataset.VariableNames.ToList();
+      var doubleVariables = new HashSet<string>(dataset.DoubleVariables);
+
+      for (int col = 1; col <= variableNames.Count; col++)
+        datasetWorksheet.Cells[1, col].Value = variableNames[col - 1];
+
+      for (int row = 0; row < dataset.Rows; row++) {
+        for (int col = 0; col < variableNames.Count; col++) {
+          if (doubleVariables.Contains(variableNames[col]))
+            datasetWorksheet.Cells[row + 2, col + 1].Value = dataset.GetDoubleValue(variableNames[col], row);
+          else
+            datasetWorksheet.Cells[row + 2, col + 1].Value = dataset.GetValue(row, col);
+        }
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.cs	(revision 16132)
@@ -0,0 +1,47 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [View("Graphical Representation")]
+  [Content(typeof(ISymbolicDataAnalysisModel), true)]
+  public partial class GraphicalSymbolicDataAnalysisModelView : AsynchronousContentView {
+    public GraphicalSymbolicDataAnalysisModelView()
+      : base() {
+      InitializeComponent();
+    }
+
+    public new ISymbolicDataAnalysisModel Content {
+      get { return (ISymbolicDataAnalysisModel)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      symbolicExpressionTreeView.Content = null;
+      if (Content != null)
+        symbolicExpressionTreeView.Content = Content.SymbolicExpressionTree;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.designer.cs	(revision 16132)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  partial class GraphicalSymbolicDataAnalysisModelView {
+    /// <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.symbolicExpressionTreeView = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.GraphicalSymbolicExpressionTreeView();
+      this.SuspendLayout();
+      // 
+      // expressionTreeView
+      // 
+      this.symbolicExpressionTreeView.AllowDrop = true;
+      this.symbolicExpressionTreeView.Caption = "Graphical SymbolicExpressionTree View";
+      this.symbolicExpressionTreeView.Content = null;
+      this.symbolicExpressionTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolicExpressionTreeView.Location = new System.Drawing.Point(0, 0);
+      this.symbolicExpressionTreeView.Name = "expressionTreeView";
+      this.symbolicExpressionTreeView.ReadOnly = false;
+      this.symbolicExpressionTreeView.Size = new System.Drawing.Size(352, 413);
+      this.symbolicExpressionTreeView.TabIndex = 0;
+      // 
+      // SymbolicExpressionModelView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.symbolicExpressionTreeView);
+      this.Name = "SymbolicExpressionModelView";
+      this.Size = new System.Drawing.Size(352, 413);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+    private HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.GraphicalSymbolicExpressionTreeView symbolicExpressionTreeView;
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 16132)
@@ -0,0 +1,397 @@
+﻿<?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>{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <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>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-3.7.0">
+      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="EPPlus-4.0.3, Version=4.0.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\EPPlus-4.0.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data.Views-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Views-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimizer-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimizer-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters.Views-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization-3.3, Version=3.3.0.9491, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
+      <Private>False</Private>
+    </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" />
+    <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="Exporters\SymbolicSolutionExcelExporter.cs" />
+    <Compile Include="InteractiveSymbolicExpressionTreeChart.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="InteractiveSymbolicExpressionTreeChart.Designer.cs">
+      <DependentUpon>InteractiveSymbolicExpressionTreeChart.cs</DependentUpon>
+    </Compile>
+    <Compile Include="LatexSymbolicDataAnalysisModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="LatexSymbolicDataAnalysisModelView.designer.cs">
+      <DependentUpon>LatexSymbolicDataAnalysisModelView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="MenuItems\OptimizeDataAnalysisRunsMenuItem.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicDataAnalysisModelMathView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicDataAnalysisModelMathView.designer.cs">
+      <DependentUpon>SymbolicDataAnalysisModelMathView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="TextualSymbolicDataAnalysisModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="TextualSymbolicDataAnalysisModelView.designer.cs">
+      <DependentUpon>TextualSymbolicDataAnalysisModelView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs">
+      <DependentUpon>InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="GraphicalSymbolicDataAnalysisModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="GraphicalSymbolicDataAnalysisModelView.designer.cs">
+      <DependentUpon>GraphicalSymbolicDataAnalysisModelView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbols\ConstantView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbols\ConstantView.Designer.cs">
+      <DependentUpon>ConstantView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbols\LaggedVariableView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbols\LaggedVariableView.Designer.cs">
+      <DependentUpon>LaggedVariableView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbols\TimeLagView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbols\TimeLagView.Designer.cs">
+      <DependentUpon>TimeLagView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbols\VariableConditionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbols\VariableConditionView.Designer.cs">
+      <DependentUpon>VariableConditionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Symbols\VariableView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Symbols\VariableView.Designer.cs">
+      <DependentUpon>VariableView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Tracking\SymbolicDataAnalysisGenealogyGraphView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Tracking\SymbolicDataAnalysisGenealogyGraphView.Designer.cs">
+      <DependentUpon>SymbolicDataAnalysisGenealogyGraphView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeConstantNodeEditDialog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeConstantNodeEditDialog.Designer.cs">
+      <DependentUpon>SymbolicExpressionTreeConstantNodeEditDialog.cs</DependentUpon>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeVariableNodeEditDialog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeVariableNodeEditDialog.Designer.cs">
+      <DependentUpon>SymbolicExpressionTreeVariableNodeEditDialog.cs</DependentUpon>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeNodeInsertDialog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeNodeInsertDialog.Designer.cs">
+      <DependentUpon>SymbolicExpressionTreeNodeInsertDialog.cs</DependentUpon>
+    </Compile>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+    <Compile Include="RunCollectionVariableImpactView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectionVariableImpactView.Designer.cs">
+      <DependentUpon>RunCollectionVariableImpactView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj">
+      <Project>{423bd94f-963a-438e-ba45-3bb3d61cd03b}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
+      <Project>{06d4a186-9319-48a0-bade-a2058d462eea}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.EvolutionTracking.Views\3.4\HeuristicLab.EvolutionTracking.Views-3.4.csproj">
+      <Project>{318dfe8c-ca23-4f1b-a4ac-62b425060241}</Project>
+      <Name>HeuristicLab.EvolutionTracking.Views-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.EvolutionTracking\3.4\HeuristicLab.EvolutionTracking-3.4.csproj">
+      <Project>{1f75cea3-464f-4a6f-b2f0-04b9841ebc16}</Project>
+      <Name>HeuristicLab.EvolutionTracking-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
+      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
+      <Private>False</Private>
+    </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>
+    <Content Include="displayModelFrame.html">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <None Include="Resources\LargeLeftDiagonal_235.png" />
+    <None Include="Resources\LargeRightDiagonal_238.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+  </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 Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs	(revision 16132)
@@ -0,0 +1,229 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  partial class InteractiveSymbolicDataAnalysisSolutionSimplifierView {
+    /// <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.components = new System.ComponentModel.Container();
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InteractiveSymbolicDataAnalysisSolutionSimplifierView));
+      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.grpSimplify = new System.Windows.Forms.GroupBox();
+      this.treeStatusValue = new System.Windows.Forms.Label();
+      this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
+      this.btnSimplify = new System.Windows.Forms.Button();
+      this.btnOptimizeConstants = new System.Windows.Forms.Button();
+      this.grpViewHost = new System.Windows.Forms.GroupBox();
+      this.treeChart = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.InteractiveSymbolicExpressionTreeChart();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.grpSimplify.SuspendLayout();
+      this.flowLayoutPanel.SuspendLayout();
+      this.grpViewHost.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // 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.Enabled = false;
+      this.viewHost.Location = new System.Drawing.Point(6, 16);
+      this.viewHost.Name = "viewHost";
+      this.viewHost.ReadOnly = false;
+      this.viewHost.Size = new System.Drawing.Size(336, 383);
+      this.viewHost.TabIndex = 0;
+      this.viewHost.ViewsLabelVisible = true;
+      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(565, 405);
+      this.splitContainer.SplitterDistance = 213;
+      this.splitContainer.TabIndex = 1;
+      // 
+      // grpSimplify
+      // 
+      this.grpSimplify.AutoSize = true;
+      this.grpSimplify.Controls.Add(this.treeStatusValue);
+      this.grpSimplify.Controls.Add(this.flowLayoutPanel);
+      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, 405);
+      this.grpSimplify.TabIndex = 1;
+      this.grpSimplify.TabStop = false;
+      this.grpSimplify.Text = "Simplify";
+      // 
+      // treeStatusValue
+      // 
+      this.treeStatusValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+      this.treeStatusValue.AutoSize = true;
+      this.treeStatusValue.BackColor = System.Drawing.Color.White;
+      this.treeStatusValue.ForeColor = System.Drawing.Color.Red;
+      this.treeStatusValue.Location = new System.Drawing.Point(6, 351);
+      this.treeStatusValue.Name = "treeStatusValue";
+      this.treeStatusValue.Size = new System.Drawing.Size(63, 13);
+      this.treeStatusValue.TabIndex = 3;
+      this.treeStatusValue.Text = "Invalid Tree";
+      this.treeStatusValue.Visible = false;
+      // 
+      // flowLayoutPanel
+      // 
+      this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.flowLayoutPanel.Controls.Add(this.btnSimplify);
+      this.flowLayoutPanel.Controls.Add(this.btnOptimizeConstants);
+      this.flowLayoutPanel.Location = new System.Drawing.Point(6, 370);
+      this.flowLayoutPanel.Name = "flowLayoutPanel";
+      this.flowLayoutPanel.Size = new System.Drawing.Size(204, 29);
+      this.flowLayoutPanel.TabIndex = 2;
+      this.flowLayoutPanel.WrapContents = false;
+      // 
+      // btnSimplify
+      // 
+      this.btnSimplify.AutoSize = true;
+      this.btnSimplify.Image = HeuristicLab.Common.Resources.VSImageLibrary.FormulaEvaluator;
+      this.btnSimplify.Location = new System.Drawing.Point(3, 3);
+      this.btnSimplify.Name = "btnSimplify";
+      this.btnSimplify.Size = new System.Drawing.Size(80, 24);
+      this.btnSimplify.TabIndex = 1;
+      this.btnSimplify.Text = "Simplify";
+      this.btnSimplify.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+      this.btnSimplify.UseVisualStyleBackColor = true;
+      this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click);
+      // 
+      // btnOptimizeConstants
+      // 
+      this.btnOptimizeConstants.AutoSize = true;
+      this.btnOptimizeConstants.Enabled = false;
+      this.btnOptimizeConstants.Image = HeuristicLab.Common.Resources.VSImageLibrary.Performance;
+      this.btnOptimizeConstants.Location = new System.Drawing.Point(89, 3);
+      this.btnOptimizeConstants.Name = "btnOptimizeConstants";
+      this.btnOptimizeConstants.Size = new System.Drawing.Size(80, 24);
+      this.btnOptimizeConstants.TabIndex = 2;
+      this.btnOptimizeConstants.Text = "Optimize";
+      this.btnOptimizeConstants.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+      this.btnOptimizeConstants.UseVisualStyleBackColor = true;
+      this.btnOptimizeConstants.Click += new System.EventHandler(this.btnOptimizeConstants_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(348, 405);
+      this.grpViewHost.TabIndex = 1;
+      this.grpViewHost.TabStop = false;
+      this.grpViewHost.Text = "Details";
+      // 
+      // 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.ModifyTree = null;
+      this.treeChart.Name = "treeChart";
+      this.treeChart.Size = new System.Drawing.Size(201, 348);
+      this.treeChart.SuspendRepaint = false;
+      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);
+      // 
+      // InteractiveSymbolicDataAnalysisSolutionSimplifierView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.splitContainer);
+      this.DoubleBuffered = true;
+      this.Name = "InteractiveSymbolicDataAnalysisSolutionSimplifierView";
+      this.Size = new System.Drawing.Size(565, 405);
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel1.PerformLayout();
+      this.splitContainer.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+      this.splitContainer.ResumeLayout(false);
+      this.grpSimplify.ResumeLayout(false);
+      this.grpSimplify.PerformLayout();
+      this.flowLayoutPanel.ResumeLayout(false);
+      this.flowLayoutPanel.PerformLayout();
+      this.grpViewHost.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private HeuristicLab.Problems.DataAnalysis.Symbolic.Views.InteractiveSymbolicExpressionTreeChart 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;
+    private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
+    protected System.Windows.Forms.Button btnOptimizeConstants;
+    private System.Windows.Forms.Label treeStatusValue;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 16132)
@@ -0,0 +1,307 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Threading.Tasks;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  public abstract partial class InteractiveSymbolicDataAnalysisSolutionSimplifierView : AsynchronousContentView {
+    private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> foldedNodes;
+    private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> changedNodes;
+    private Dictionary<ISymbolicExpressionTreeNode, double> nodeImpacts;
+
+    private readonly ISymbolicDataAnalysisSolutionImpactValuesCalculator impactCalculator;
+
+    private readonly IProgress progress = new Progress();
+
+    private enum TreeState { Valid, Invalid }
+    private TreeState treeState;
+
+    protected InteractiveSymbolicDataAnalysisSolutionSimplifierView(ISymbolicDataAnalysisSolutionImpactValuesCalculator impactCalculator) {
+      InitializeComponent();
+      foldedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
+      changedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
+      nodeImpacts = new Dictionary<ISymbolicExpressionTreeNode, double>();
+      this.Caption = "Interactive Solution Simplifier";
+      this.impactCalculator = impactCalculator;
+
+      // initialize the tree modifier that will be used to perform edit operations over the tree
+      treeChart.ModifyTree = Modify;
+    }
+
+    /// <summary>
+    /// Remove, Replace or Insert subtrees
+    /// </summary>
+    /// <param name="tree">The symbolic expression tree</param>
+    /// <param name="parent">The insertion point (ie, the parent node who will receive a new child)</param>
+    /// <param name="oldChild">The subtree to be replaced</param>
+    /// <param name="newChild">The replacement subtree</param>
+    /// <param name="removeSubtree">Flag used to indicate if whole subtrees should be removed (default behavior), or just the subtree root</param>
+    private void Modify(ISymbolicExpressionTree tree, ISymbolicExpressionTreeNode parent,
+      ISymbolicExpressionTreeNode oldChild, ISymbolicExpressionTreeNode newChild, bool removeSubtree = true) {
+      if (oldChild == null && newChild == null)
+        throw new ArgumentNullException("Cannot deduce operation type from the arguments. Please provide non null operands.");
+      if (oldChild == null) {
+        // insertion operation
+        parent.AddSubtree(newChild);
+        newChild.Parent = parent;
+      } else if (newChild == null) {
+        // removal operation
+        parent.RemoveSubtree(parent.IndexOfSubtree(oldChild));
+        if (!removeSubtree) {
+          for (int i = oldChild.SubtreeCount - 1; i >= 0; --i) {
+            var subtree = oldChild.GetSubtree(i);
+            oldChild.RemoveSubtree(i);
+            parent.AddSubtree(subtree);
+          }
+        }
+      } else {
+        // replacement operation
+        var replacementIndex = parent.IndexOfSubtree(oldChild);
+        parent.RemoveSubtree(replacementIndex);
+        parent.InsertSubtree(replacementIndex, newChild);
+        newChild.Parent = parent;
+        if (changedNodes.ContainsKey(oldChild)) {
+          changedNodes.Add(newChild, changedNodes[oldChild]); // so that on double click the original node is restored
+          changedNodes.Remove(oldChild);
+        } else {
+          changedNodes.Add(newChild, oldChild);
+        }
+      }
+      treeState = IsValid(tree) ? TreeState.Valid : TreeState.Invalid;
+      switch (treeState) {
+        case TreeState.Valid:
+          this.grpViewHost.Enabled = true;
+          UpdateModel(Content.Model.SymbolicExpressionTree);
+          break;
+        case TreeState.Invalid:
+          this.grpViewHost.Enabled = false;
+          break;
+      }
+    }
+
+    // the optimizer always assumes 2 children for multiplication and addition nodes
+    // thus, we enforce that the tree stays valid so that the constant optimization won't throw an exception
+    // by returning 2 as the minimum allowed arity for addition and multiplication symbols
+    private readonly Func<ISymbol, int> GetMinArity = symbol => {
+      var min = symbol.MinimumArity;
+      if (symbol is Multiplication || symbol is Division) return Math.Max(2, min);
+      return min;
+    };
+    private bool IsValid(ISymbolicExpressionTree tree) {
+      treeChart.Tree = tree;
+      treeChart.Repaint();
+      // check if all nodes have a legal arity
+      var nodes = tree.IterateNodesPostfix().ToList();
+      bool valid = !nodes.Any(node => node.SubtreeCount < GetMinArity(node.Symbol) || node.SubtreeCount > node.Symbol.MaximumArity);
+
+      if (valid) {
+        // check if all variables are contained in the dataset
+        var variables = new HashSet<string>(Content.ProblemData.Dataset.DoubleVariables);
+        valid = nodes.OfType<VariableTreeNode>().All(x => variables.Contains(x.VariableName));
+      }
+
+      if (valid) {
+        btnOptimizeConstants.Enabled = true;
+        btnSimplify.Enabled = true;
+        treeStatusValue.Visible = false;
+      } else {
+        btnOptimizeConstants.Enabled = false;
+        btnSimplify.Enabled = false;
+        treeStatusValue.Visible = true;
+      }
+      this.Refresh();
+      return valid;
+    }
+
+    public new ISymbolicDataAnalysisSolution Content {
+      get { return (ISymbolicDataAnalysisSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ModelChanged += Content_Changed;
+      Content.ProblemDataChanged += Content_Changed;
+      treeChart.Repainted += treeChart_Repainted;
+      MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(grpSimplify, progress);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ModelChanged -= Content_Changed;
+      Content.ProblemDataChanged -= Content_Changed;
+      treeChart.Repainted -= treeChart_Repainted;
+      MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(grpSimplify, false);
+    }
+
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateView();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      foldedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
+      UpdateView();
+      viewHost.Content = this.Content;
+    }
+
+    private void treeChart_Repainted(object sender, EventArgs e) {
+      if (nodeImpacts != null && nodeImpacts.Count > 0)
+        PaintNodeImpacts();
+    }
+
+    private async void UpdateView() {
+      if (Content == null || Content.Model == null || Content.ProblemData == null) return;
+      var tree = Content.Model.SymbolicExpressionTree;
+      treeChart.Tree = tree.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(tree.Root) : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0));
+
+      progress.Start("Calculate Impact and Replacement Values ...");
+      var impactAndReplacementValues = await Task.Run(() => CalculateImpactAndReplacementValues(tree));
+      await Task.Delay(500); // wait for progressbar to finish animation
+      var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2);
+      foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) {
+        foldedNodes[pair.Key] = MakeConstantTreeNode(pair.Value);
+      }
+      nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1);
+      progress.Finish();
+      PaintNodeImpacts();
+    }
+
+    protected virtual Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>> CalculateImpactAndReplacementValues(ISymbolicExpressionTree tree) {
+      var impactAndReplacementValues = new Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>>();
+      foreach (var node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
+        double impactValue, replacementValue, newQualityForImpactsCalculation;
+        impactCalculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue, out newQualityForImpactsCalculation);
+        double newProgressValue = progress.ProgressValue + 1.0 / (tree.Length - 2);
+        progress.ProgressValue = Math.Min(newProgressValue, 1);
+        impactAndReplacementValues.Add(node, new Tuple<double, double>(impactValue, replacementValue));
+      }
+      return impactAndReplacementValues;
+    }
+
+    protected abstract void UpdateModel(ISymbolicExpressionTree tree);
+
+    protected virtual ISymbolicExpressionTree OptimizeConstants(ISymbolicExpressionTree tree, IProgress progress) {
+      return tree;
+    }
+
+    private static ConstantTreeNode MakeConstantTreeNode(double value) {
+      var constant = new Constant { MinValue = value - 1, MaxValue = value + 1 };
+      var constantTreeNode = (ConstantTreeNode)constant.CreateTreeNode();
+      constantTreeNode.Value = value;
+      return constantTreeNode;
+    }
+
+    private void treeChart_SymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) {
+      if (treeState == TreeState.Invalid) return;
+      var visualNode = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender;
+      if (visualNode.Content == null) { throw new Exception("VisualNode content cannot be null."); }
+      var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode.Content;
+      var tree = Content.Model.SymbolicExpressionTree;
+      var parent = symbExprTreeNode.Parent;
+      int indexOfSubtree = parent.IndexOfSubtree(symbExprTreeNode);
+      if (changedNodes.ContainsKey(symbExprTreeNode)) {
+        // undo node change
+        parent.RemoveSubtree(indexOfSubtree);
+        var originalNode = changedNodes[symbExprTreeNode];
+        parent.InsertSubtree(indexOfSubtree, originalNode);
+        changedNodes.Remove(symbExprTreeNode);
+      } else if (foldedNodes.ContainsKey(symbExprTreeNode)) {
+        // undo node folding
+        SwitchNodeWithReplacementNode(parent, indexOfSubtree);
+      }
+      UpdateModel(tree);
+    }
+
+    private void SwitchNodeWithReplacementNode(ISymbolicExpressionTreeNode parent, int subTreeIndex) {
+      ISymbolicExpressionTreeNode subTree = parent.GetSubtree(subTreeIndex);
+      if (foldedNodes.ContainsKey(subTree)) {
+        parent.RemoveSubtree(subTreeIndex);
+        var replacementNode = foldedNodes[subTree];
+        parent.InsertSubtree(subTreeIndex, replacementNode);
+        // exchange key and value 
+        foldedNodes.Remove(subTree);
+        foldedNodes.Add(replacementNode, subTree);
+      }
+    }
+
+    private void PaintNodeImpacts() {
+      var impacts = nodeImpacts.Values;
+      double max = impacts.Max();
+      double min = impacts.Min();
+      foreach (ISymbolicExpressionTreeNode treeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) {
+        VisualTreeNode<ISymbolicExpressionTreeNode> visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
+
+        if (!(treeNode is ConstantTreeNode) && nodeImpacts.ContainsKey(treeNode)) {
+          visualTree.ToolTip = visualTree.Content.ToString();
+          double impact = nodeImpacts[treeNode];
+
+          // impact = 0 if no change
+          // impact < 0 if new solution is better
+          // impact > 0 if new solution is worse
+          if (impact < 0.0) {
+            // min is guaranteed to be < 0
+            visualTree.FillColor = Color.FromArgb((int)(impact / min * 255), Color.Red);
+          } else if (impact.IsAlmost(0.0)) {
+            visualTree.FillColor = Color.White;
+          } else {
+            // max is guaranteed to be > 0
+            visualTree.FillColor = Color.FromArgb((int)(impact / max * 255), Color.Green);
+          }
+          visualTree.ToolTip += Environment.NewLine + "Node impact: " + impact;
+          var constantReplacementNode = foldedNodes[treeNode] as ConstantTreeNode;
+          if (constantReplacementNode != null) {
+            visualTree.ToolTip += Environment.NewLine + "Replacement value: " + constantReplacementNode.Value;
+          }
+        }
+        if (visualTree != null)
+          if (changedNodes.ContainsKey(treeNode)) {
+            visualTree.LineColor = Color.DodgerBlue;
+          } else if (treeNode is ConstantTreeNode && foldedNodes.ContainsKey(treeNode)) {
+            visualTree.LineColor = Color.DarkOrange;
+          }
+      }
+      treeChart.RepaintNodes();
+    }
+
+    private void btnSimplify_Click(object sender, EventArgs e) {
+      var simplifiedExpressionTree = TreeSimplifier.Simplify(Content.Model.SymbolicExpressionTree);
+      UpdateModel(simplifiedExpressionTree);
+    }
+
+    private async void btnOptimizeConstants_Click(object sender, EventArgs e) {
+      progress.Start("Optimizing Constants ...");
+      var tree = (ISymbolicExpressionTree)Content.Model.SymbolicExpressionTree.Clone();
+      var newTree = await Task.Run(() => OptimizeConstants(tree, progress));
+      await Task.Delay(500); // wait for progressbar to finish animation
+      UpdateModel(newTree); // UpdateModel calls Progress.Finish (via Content_Changed)
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs	(revision 16132)
@@ -0,0 +1,172 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  partial class InteractiveSymbolicExpressionTreeChart {
+    /// <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.insertNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.changeNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.removeNodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.removeSubtreeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
+      this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+      this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+      this.SuspendLayout();
+      // 
+      // insertNodeToolStripMenuItem
+      // 
+      this.insertNodeToolStripMenuItem.Name = "insertNodeToolStripMenuItem";
+      this.insertNodeToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+      this.insertNodeToolStripMenuItem.Text = "Insert Node";
+      this.insertNodeToolStripMenuItem.Click += new System.EventHandler(this.insertNodeToolStripMenuItem_Click);
+      // 
+      // changeNodeToolStripMenuItem
+      // 
+      this.changeNodeToolStripMenuItem.Name = "changeNodeToolStripMenuItem";
+      this.changeNodeToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+      this.changeNodeToolStripMenuItem.Text = "Change Node";
+      this.changeNodeToolStripMenuItem.Click += new System.EventHandler(this.changeNodeToolStripMenuItem_Click);
+      // 
+      // cutToolStripMenuItem
+      // 
+      this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
+      this.cutToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+      this.cutToolStripMenuItem.Text = "Cut Subtree";
+      this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click);
+      // 
+      // removeToolStripMenuItem
+      // 
+      this.removeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.removeNodeToolStripMenuItem,
+            this.removeSubtreeToolStripMenuItem});
+      this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
+      this.removeToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+      this.removeToolStripMenuItem.Text = "Remove";
+      this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeSubtreeToolStripMenuItem_Click);
+      // 
+      // removeNodeToolStripMenuItem
+      // 
+      this.removeNodeToolStripMenuItem.Name = "removeNodeToolStripMenuItem";
+      this.removeNodeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
+      this.removeNodeToolStripMenuItem.Text = "Node";
+      this.removeNodeToolStripMenuItem.Click += new System.EventHandler(this.removeNodeToolStripMenuItem_Click);
+      // 
+      // removeSubtreeToolStripMenuItem
+      // 
+      this.removeSubtreeToolStripMenuItem.Name = "removeSubtreeToolStripMenuItem";
+      this.removeSubtreeToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
+      this.removeSubtreeToolStripMenuItem.Text = "Subtree";
+      this.removeSubtreeToolStripMenuItem.Click += new System.EventHandler(this.removeSubtreeToolStripMenuItem_Click);
+      // 
+      // pasteToolStripMenuItem
+      // 
+      this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
+      this.pasteToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+      this.pasteToolStripMenuItem.Text = "Paste Subtree";
+      this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Clicked);
+      // 
+      // toolStripSeparator
+      // 
+      this.toolStripSeparator.Name = "toolStripSeparator";
+      this.toolStripSeparator.Size = new System.Drawing.Size(149, 6);
+      // 
+      // copyToolStripMenuItem
+      // 
+      this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
+      this.copyToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
+      this.copyToolStripMenuItem.Text = "Copy Subtree";
+      this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
+      // 
+      // toolStripSeparator1
+      // 
+      this.toolStripSeparator1.Name = "toolStripSeparator1";
+      this.toolStripSeparator1.Size = new System.Drawing.Size(162, 6);
+      // 
+      // toolStripSeparator2
+      // 
+      this.toolStripSeparator2.Name = "toolStripSeparator2";
+      this.toolStripSeparator2.Size = new System.Drawing.Size(162, 6);
+      //
+      // contextMenuStrip
+      //
+      this.contextMenuStrip.Opened += this.contextMenuStrip_Opened;
+      this.contextMenuStrip.Items.AddRange(new ToolStripItem[] { toolStripSeparator1,
+                                                                 insertNodeToolStripMenuItem, 
+                                                                 removeToolStripMenuItem, 
+                                                                 changeNodeToolStripMenuItem, 
+                                                                 toolStripSeparator2,
+                                                                 copyToolStripMenuItem, 
+                                                                 cutToolStripMenuItem, 
+                                                                 pasteToolStripMenuItem });
+      // 
+      // InteractiveSymbolicExpressionTreeChart
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.DoubleBuffered = true;
+      this.Name = "InteractiveSymbolicExpressionTreeChart";
+      this.ResumeLayout(false);
+    }
+
+    private ToolStripMenuItem insertNodeToolStripMenuItem;
+    private ToolStripMenuItem changeNodeToolStripMenuItem;
+    private ToolStripMenuItem cutToolStripMenuItem;
+    private ToolStripMenuItem pasteToolStripMenuItem;
+    private ToolStripMenuItem removeToolStripMenuItem;
+    private ToolStripMenuItem removeNodeToolStripMenuItem;
+    private ToolStripMenuItem removeSubtreeToolStripMenuItem;
+
+    #endregion
+
+    private ToolStripSeparator toolStripSeparator;
+    private ToolStripMenuItem copyToolStripMenuItem;
+    private ToolStripSeparator toolStripSeparator1;
+    private ToolStripSeparator toolStripSeparator2;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs	(revision 16132)
@@ -0,0 +1,224 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  internal delegate void
+  ModifyTree(ISymbolicExpressionTree tree, ISymbolicExpressionTreeNode node, ISymbolicExpressionTreeNode oldChild, ISymbolicExpressionTreeNode newChild, bool removeSubtree = true);
+
+  internal sealed partial class InteractiveSymbolicExpressionTreeChart : SymbolicExpressionTreeChart {
+    private ISymbolicExpressionTreeNode tempNode; //node in clipboard (to be cut/copy/pasted etc)
+    private VisualTreeNode<ISymbolicExpressionTreeNode> currSelected; //currently selected node
+    private enum EditOp { NoOp, CopySubtree, CutSubtree }
+    private EditOp lastOp = EditOp.NoOp;
+
+    // delegate to notify the parent container (the view) about the tree edit operations that it needs to perform
+    public ModifyTree ModifyTree { get; set; }
+
+    public InteractiveSymbolicExpressionTreeChart() {
+      InitializeComponent();
+      currSelected = null;
+      tempNode = null;
+    }
+
+    private void contextMenuStrip_Opened(object sender, EventArgs e) {
+      var menuStrip = (ContextMenuStrip)sender;
+      var point = menuStrip.SourceControl.PointToClient(Cursor.Position);
+      var ea = new MouseEventArgs(MouseButtons.Left, 1, point.X, point.Y, 0);
+      var visualNode = FindVisualSymbolicExpressionTreeNodeAt(ea.X, ea.Y);
+      if (visualNode != null) {
+        OnSymbolicExpressionTreeNodeClicked(visualNode, ea);
+      } else {
+        currSelected = null;
+      }
+
+      if (currSelected == null) {
+        insertNodeToolStripMenuItem.Visible = false;
+        changeNodeToolStripMenuItem.Visible = false;
+        copyToolStripMenuItem.Visible = false;
+        cutToolStripMenuItem.Visible = false;
+        removeToolStripMenuItem.Visible = false;
+        pasteToolStripMenuItem.Visible = false;
+      } else {
+        var node = currSelected.Content;
+        insertNodeToolStripMenuItem.Visible = true;
+        changeNodeToolStripMenuItem.Visible = true;
+        changeNodeToolStripMenuItem.Enabled = (node is SymbolicExpressionTreeTerminalNode);
+        insertNodeToolStripMenuItem.Enabled = !changeNodeToolStripMenuItem.Enabled;
+        copyToolStripMenuItem.Visible = true;
+        cutToolStripMenuItem.Visible = true;
+        removeToolStripMenuItem.Visible = true;
+
+        pasteToolStripMenuItem.Visible = true;
+        pasteToolStripMenuItem.Enabled = tempNode != null && insertNodeToolStripMenuItem.Enabled
+                                                          && !(lastOp == EditOp.CutSubtree && tempNode.IterateNodesBreadth().Contains(node))
+                                                          && node.SubtreeCount < node.Symbol.MaximumArity;
+      }
+    }
+
+    protected override void OnSymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
+      currSelected = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender; ;
+      base.OnSymbolicExpressionTreeNodeClicked(sender, e);
+    }
+
+    protected override void OnSymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) {
+      currSelected = null;
+      base.OnSymbolicExpressionTreeNodeDoubleClicked(sender, e);
+    }
+
+
+    private static readonly ISymbolicExpressionGrammar grammar = new TypeCoherentExpressionGrammar();
+    private void insertNodeToolStripMenuItem_Click(object sender, EventArgs e) {
+      if (currSelected == null || currSelected.Content is SymbolicExpressionTreeTerminalNode) return;
+      var parent = currSelected.Content;
+
+      using (var dialog = new InsertNodeDialog()) {
+        dialog.SetAllowedSymbols(grammar.Symbols.Where(s => !(s is ProgramRootSymbol || s is StartSymbol || s is Defun || s is GroupSymbol))); // allow everything
+        dialog.ShowDialog(this);
+        if (dialog.DialogResult != DialogResult.OK) return;
+
+        var symbol = dialog.SelectedSymbol;
+        var node = symbol.CreateTreeNode();
+        if (node is ConstantTreeNode) {
+          var constant = node as ConstantTreeNode;
+          constant.Value = double.Parse(dialog.constantValueTextBox.Text);
+        } else if (node is VariableTreeNode) {
+          var variable = node as VariableTreeNode;
+          variable.Weight = double.Parse(dialog.variableWeightTextBox.Text);
+          variable.VariableName = dialog.SelectedVariableName;
+        } else if (node.Symbol.MinimumArity <= parent.SubtreeCount && node.Symbol.MaximumArity >= parent.SubtreeCount) {
+          for (int i = parent.SubtreeCount - 1; i >= 0; --i) {
+            var child = parent.GetSubtree(i);
+            parent.RemoveSubtree(i);
+            node.AddSubtree(child);
+          }
+        }
+        // the if condition will always be true for the final else clause above
+        if (parent.Symbol.MaximumArity > parent.SubtreeCount) {
+          ModifyTree(Tree, parent, null, node);
+        }
+      }
+      currSelected = null;
+    }
+    private void changeNodeToolStripMenuItem_Click(object sender, EventArgs e) {
+      if (currSelected == null) return;
+
+      var node = (ISymbolicExpressionTreeNode)currSelected.Content.Clone();
+      var originalNode = currSelected.Content;
+
+      ISymbolicExpressionTreeNode newNode = null;
+      var result = DialogResult.Cancel;
+      if (node is ConstantTreeNode) {
+        using (var dialog = new ConstantNodeEditDialog(node)) {
+          dialog.ShowDialog(this);
+          newNode = dialog.NewNode;
+          result = dialog.DialogResult;
+        }
+      } else if (node is VariableTreeNode) {
+        using (var dialog = new VariableNodeEditDialog(node)) {
+          dialog.ShowDialog(this);
+          newNode = dialog.NewNode;
+          result = dialog.DialogResult;
+        }
+      }
+      if (result != DialogResult.OK) return;
+      ModifyTree(Tree, originalNode.Parent, originalNode, newNode); // this will replace the original node with the new node
+      currSelected = null;
+    }
+    private void cutToolStripMenuItem_Click(object sender, EventArgs e) {
+      lastOp = EditOp.CutSubtree;
+      copySubtree();
+    }
+    private void copyToolStripMenuItem_Click(object sender, EventArgs e) {
+      lastOp = EditOp.CopySubtree;
+      copySubtree();
+    }
+    private void copySubtree() {
+      if (tempNode != null) {
+        foreach (var subtree in tempNode.IterateNodesPostfix()) {
+          var visualNode = GetVisualSymbolicExpressionTreeNode(subtree);
+          visualNode.LineColor = Color.Black;
+          visualNode.TextColor = Color.Black;
+          if (subtree.Parent != null) {
+            var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(subtree.Parent, subtree);
+            visualLine.LineColor = Color.Black;
+          }
+        }
+      }
+      tempNode = currSelected.Content;
+      foreach (var node in tempNode.IterateNodesPostfix()) {
+        var visualNode = GetVisualSymbolicExpressionTreeNode(node);
+        visualNode.LineColor = Color.LightGray;
+        visualNode.TextColor = Color.LightGray;
+        foreach (var subtree in node.Subtrees) {
+          var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node, subtree);
+          visualLine.LineColor = Color.LightGray;
+        }
+      }
+      currSelected = null;
+      RepaintNodes(); // no need to redo the layout and repaint everything since this operation does not change the tree
+    }
+    private void removeNodeToolStripMenuItem_Click(object sender, EventArgs e) {
+      var node = currSelected.Content;
+      if (node == tempNode) tempNode = null;
+      ModifyTree(Tree, node.Parent, node, null, removeSubtree: false);
+      currSelected = null; // because the currently selected node was just deleted
+    }
+    private void removeSubtreeToolStripMenuItem_Click(object sender, EventArgs e) {
+      var node = currSelected.Content;
+      if (node.IterateNodesPostfix().Contains(tempNode)) tempNode = null;
+      ModifyTree(Tree, node.Parent, node, null, removeSubtree: true);
+      currSelected = null; // because the currently selected node was just deleted
+      contextMenuStrip.Close(); // avoid display of submenus since the action has already been performed
+    }
+    private void pasteToolStripMenuItem_Clicked(object sender, EventArgs e) {
+      if (!(lastOp == EditOp.CopySubtree || lastOp == EditOp.CutSubtree)) return;
+      // check if the copied/cut node (stored in the tempNode) can be inserted as a child of the current selected node
+      var node = currSelected.Content;
+      if (node is ConstantTreeNode || node is VariableTreeNode) return;
+      // check if the currently selected node can accept the copied node as a child 
+      // no need to check the grammar, an arity check will do just fine here
+      if (node.Symbol.MaximumArity <= node.SubtreeCount) return;
+      switch (lastOp) {
+        case EditOp.CutSubtree: {
+            if (tempNode.IterateNodesBreadth().Contains(node))
+              throw new ArgumentException();// cannot cut/paste a node into itself
+            ModifyTree(Tree, tempNode.Parent, tempNode, null); //remove node from its original parent
+            ModifyTree(Tree, node, null, tempNode); //insert it as a child to the new parent 
+            break;
+          }
+        case EditOp.CopySubtree: {
+            var clone = (SymbolicExpressionTreeNode)tempNode.Clone();
+            ModifyTree(Tree, node, null, clone);
+            break;
+          }
+      }
+      currSelected = null; // because the tree will have changed
+      tempNode = null; // clear the clipboard after one paste
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/LatexSymbolicDataAnalysisModelView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/LatexSymbolicDataAnalysisModelView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/LatexSymbolicDataAnalysisModelView.cs	(revision 16132)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [View("Latex Representation")]
+  [Content(typeof(ISymbolicDataAnalysisModel))]
+  public partial class LatexSymbolicDataAnalysisModelView : AsynchronousContentView {
+    private SymbolicDataAnalysisExpressionLatexFormatter formatter = new SymbolicDataAnalysisExpressionLatexFormatter();
+    public LatexSymbolicDataAnalysisModelView()
+      : base() {
+      InitializeComponent();
+      webBrowser.ScrollBarsEnabled = true;
+      webBrowser.ScriptErrorsSuppressed = false;
+
+      // update for the first time after page has loaded
+      webBrowser.DocumentCompleted += (sender, args) => RefreshHtmlPage();
+
+      string hlDir = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory);
+      webBrowser.Navigate("file://" + Path.Combine(hlDir, "displayModelFrame.html"));
+    }
+
+    public new ISymbolicDataAnalysisModel Content {
+      get { return (ISymbolicDataAnalysisModel)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      RefreshHtmlPage();
+    }
+
+    private void RefreshHtmlPage() {
+      // only update if the page has loaded already
+      if (webBrowser.Document == null || webBrowser.Document.Body == null) return;
+
+      if (Content != null) {
+        HtmlElement newElement = webBrowser.Document.GetElementById("model");
+        newElement.InnerText = formatter.Format(Content.SymbolicExpressionTree);
+      } else {
+        HtmlElement newElement = webBrowser.Document.GetElementById("model");
+        newElement.InnerText = string.Empty;
+      }
+      webBrowser.Document.InvokeScript("refreshModel");
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/LatexSymbolicDataAnalysisModelView.designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/LatexSymbolicDataAnalysisModelView.designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/LatexSymbolicDataAnalysisModelView.designer.cs	(revision 16132)
@@ -0,0 +1,81 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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.Symbolic.Views {
+  partial class LatexSymbolicDataAnalysisModelView {
+    /// <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)) {
+        webBrowser.Dispose();
+        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.webBrowser = new System.Windows.Forms.WebBrowser();
+      this.SuspendLayout();
+      // 
+      // webBrowser
+      // 
+      this.webBrowser.AllowNavigation = false;
+      this.webBrowser.AllowWebBrowserDrop = false;
+      this.webBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.webBrowser.IsWebBrowserContextMenuEnabled = false;
+      this.webBrowser.Location = new System.Drawing.Point(0, 0);
+      this.webBrowser.MinimumSize = new System.Drawing.Size(20, 20);
+      this.webBrowser.Name = "webBrowser";
+      this.webBrowser.Size = new System.Drawing.Size(352, 413);
+      this.webBrowser.TabIndex = 0;
+      this.webBrowser.WebBrowserShortcutsEnabled = false;
+      // 
+      // MathSymbolicDataAnalysisModelView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.webBrowser);
+      this.Name = "MathSymbolicDataAnalysisModelView";
+      this.Size = new System.Drawing.Size(352, 413);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.WebBrowser webBrowser;
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/MenuItems/OptimizeDataAnalysisRunsMenuItem.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/MenuItems/OptimizeDataAnalysisRunsMenuItem.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/MenuItems/OptimizeDataAnalysisRunsMenuItem.cs	(revision 16132)
@@ -0,0 +1,74 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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.MainForm;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimizer;
+
+using MenuItem = HeuristicLab.MainForm.WindowsForms.MenuItem;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  public abstract class OptimizeDataAnalysisRunsMenuItem : MenuItem, IOptimizerUserInterfaceItemProvider {
+    public override string Name {
+      get { return "Optimize Runs"; }
+    }
+    public override IEnumerable<string> Structure {
+      get { return new string[] { "&Data Analysis" }; }
+    }
+    public override int Position {
+      get { return 5400; }
+    }
+    public override string ToolTipText {
+      get {
+        return "This command tries to optimize each run by performing a pruning and a constant optimization step on the solution models.";
+      }
+    }
+    protected override void OnToolStripItemSet(EventArgs e) {
+      ToolStripItem.Enabled = false;
+    }
+    protected RunCollection runCollection;
+
+    protected override void OnActiveViewChanged(object sender, EventArgs e) {
+      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
+      if (activeView == null) {
+        ToolStripItem.Enabled = false;
+        return;
+      }
+
+      var content = activeView.Content;
+      runCollection = content as RunCollection;
+      if (runCollection == null && content is IOptimizer)
+        runCollection = ((IOptimizer)content).Runs;
+
+      if (runCollection == null) {
+        ToolStripItem.Enabled = false;
+        return;
+      }
+
+      ToolStripItem.Enabled = runCollection.Any(run => run.Results.ContainsKey("Best training solution"));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame	(revision 16132)
@@ -0,0 +1,52 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Views","Provides views for symbolic data analysis problem classes.", "3.4.11.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.dll", PluginFileType.Assembly)]
+  [PluginFile("displayModelFrame.html", PluginFileType.Data)]
+  [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Data.Views", "3.3")]
+  [PluginDependency("HeuristicLab.EPPlus", "4.0.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views", "3.4")]
+  [PluginDependency("HeuristicLab.MainForm", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.MathJax", "1.1")]
+  [PluginDependency("HeuristicLab.Optimization","3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
+  [PluginDependency("HeuristicLab.EvolutionTracking", "3.4")]
+  [PluginDependency("HeuristicLab.EvolutionTracking.Views", "3.4")]
+  public class HeuristicLabProblemsDataAnalysisSymbolicViewsPlugin : PluginBase {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views")]
+[assembly: AssemblyDescription("Provides views for symbolic data analysis problem classes.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 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("B2F2EF94-C278-4DCB-B8AB-E0C22A95F747")]
+
+// 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.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.11.$WCREV$")]
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/Resources.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/Resources.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/Resources.Designer.cs	(revision 16132)
@@ -0,0 +1,83 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.34209
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HeuristicLab.Problems.DataAnalysis.Symbolic.Views.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized resource of type System.Drawing.Bitmap.
+        /// </summary>
+        internal static System.Drawing.Bitmap LargeLeftDiagonal_235 {
+            get {
+                object obj = ResourceManager.GetObject("LargeLeftDiagonal_235", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized resource of type System.Drawing.Bitmap.
+        /// </summary>
+        internal static System.Drawing.Bitmap LargeRightDiagonal_238 {
+            get {
+                object obj = ResourceManager.GetObject("LargeRightDiagonal_238", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+    }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/Resources.resx
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/Resources.resx	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/Resources.resx	(revision 16132)
@@ -0,0 +1,127 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="LargeRightDiagonal_238" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\LargeRightDiagonal_238.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="LargeLeftDiagonal_235" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\LargeLeftDiagonal_235.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+</root>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.Designer.cs	(revision 16132)
@@ -0,0 +1,122 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.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.comboBox = new System.Windows.Forms.ComboBox();
+      this.foldsLabel = new System.Windows.Forms.Label();
+      this.variableImpactsGroupBox = new System.Windows.Forms.GroupBox();
+      this.variableImpactsGroupBox.SuspendLayout();
+      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(6, 19);
+      this.matrixView.Name = "matrixView";
+      this.matrixView.ReadOnly = true;
+      this.matrixView.ShowRowsAndColumnsTextBox = true;
+      this.matrixView.ShowStatisticalInformation = true;
+      this.matrixView.Size = new System.Drawing.Size(294, 174);
+      this.matrixView.TabIndex = 0;
+      // 
+      // comboBox
+      // 
+      this.comboBox.FormattingEnabled = true;
+      this.comboBox.Location = new System.Drawing.Point(39, 6);
+      this.comboBox.Name = "comboBox";
+      this.comboBox.Size = new System.Drawing.Size(68, 21);
+      this.comboBox.TabIndex = 1;
+      this.comboBox.SelectedValueChanged += new System.EventHandler(this.comboBox_SelectedValueChanged);
+      // 
+      // label1
+      // 
+      this.foldsLabel.AutoSize = true;
+      this.foldsLabel.Location = new System.Drawing.Point(3, 9);
+      this.foldsLabel.Name = "foldsLabel";
+      this.foldsLabel.Size = new System.Drawing.Size(30, 13);
+      this.foldsLabel.TabIndex = 2;
+      this.foldsLabel.Text = "Fold:";
+      // 
+      // variableImpactsGroupBox
+      // 
+      this.variableImpactsGroupBox.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.variableImpactsGroupBox.Controls.Add(this.matrixView);
+      this.variableImpactsGroupBox.Location = new System.Drawing.Point(0, 33);
+      this.variableImpactsGroupBox.Name = "variableImpactsGroupBox";
+      this.variableImpactsGroupBox.Size = new System.Drawing.Size(306, 199);
+      this.variableImpactsGroupBox.TabIndex = 3;
+      this.variableImpactsGroupBox.TabStop = false;
+      this.variableImpactsGroupBox.Text = "Variable impacts:";
+      // 
+      // RunCollectionVariableImpactView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.variableImpactsGroupBox);
+      this.Controls.Add(this.foldsLabel);
+      this.Controls.Add(this.comboBox);
+      this.Name = "RunCollectionVariableImpactView";
+      this.Size = new System.Drawing.Size(309, 235);
+      this.variableImpactsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private HeuristicLab.Data.Views.StringConvertibleMatrixView matrixView;
+    private System.Windows.Forms.ComboBox comboBox;
+    private System.Windows.Forms.Label foldsLabel;
+    private System.Windows.Forms.GroupBox variableImpactsGroupBox;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.cs	(revision 16132)
@@ -0,0 +1,358 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.ComponentModel;
+using System.Drawing;
+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.Symbolic.Views {
+  [Content(typeof(RunCollection), false)]
+  [View("Variable Impacts")]
+  public sealed partial class RunCollectionVariableImpactView : AsynchronousContentView {
+    private const string variableImpactResultName = "Variable impacts";
+    private const string crossValidationFoldsResultName = "CrossValidation Folds";
+    private const string numberOfFoldsParameterName = "Folds";
+    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 += Content_UpdateOfRunsInProgressChanged;
+      Content.ItemsAdded += Content_ItemsAdded;
+      Content.ItemsRemoved += Content_ItemsRemoved;
+      Content.CollectionReset += Content_CollectionReset;
+      RegisterRunEvents(Content);
+    }
+    protected override void DeregisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.UpdateOfRunsInProgressChanged -= Content_UpdateOfRunsInProgressChanged;
+      Content.ItemsAdded -= Content_ItemsAdded;
+      Content.ItemsRemoved -= Content_ItemsRemoved;
+      Content.CollectionReset -= Content_CollectionReset;
+      DeregisterRunEvents(Content);
+    }
+    private void RegisterRunEvents(IEnumerable<IRun> runs) {
+      foreach (IRun run in runs)
+        run.PropertyChanged += Run_PropertyChanged;
+    }
+    private void DeregisterRunEvents(IEnumerable<IRun> runs) {
+      foreach (IRun run in runs)
+        run.PropertyChanged -= Run_PropertyChanged;
+    }
+    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_PropertyChanged(object sender, PropertyChangedEventArgs e) {
+      if (!Content.UpdateOfRunsInProgress && e.PropertyName == "Visible")
+        UpdateData();
+    }
+    #endregion
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      this.UpdateData();
+    }
+
+    private void comboBox_SelectedValueChanged(object sender, EventArgs e) {
+      if (comboBox.SelectedItem != null) {
+        var visibleRuns = from run in Content where run.Visible select run;
+        if (comboBox.SelectedIndex == 0) {
+          var selectedFolds = from r in visibleRuns
+                              let foldCollection = (RunCollection)r.Results[crossValidationFoldsResultName]
+                              from run in foldCollection
+                              let name = (r.Name + " " + run.Name)
+                              select new { run, name };
+          matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.Select(x => x.run).ToArray(), selectedFolds.Select(x => x.name).ToArray());
+        } else {
+          var selectedFolds = from r in visibleRuns
+                              let foldCollection = (RunCollection)r.Results[crossValidationFoldsResultName]
+                              let run = foldCollection.ElementAt(comboBox.SelectedIndex - 1)
+                              let name = (r.Name + " " + run.Name)
+                              select new { run, name };
+          matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.Select(x => x.run).ToArray(), selectedFolds.Select(x => x.name).ToArray());
+        }
+      }
+    }
+
+
+    private void UpdateData() {
+      if (InvokeRequired) {
+        Invoke((Action)UpdateData);
+      } else {
+        if (Content != null) {
+          comboBox.Items.Clear();
+          comboBox.Enabled = false;
+          comboBox.Visible = false;
+          foldsLabel.Visible = false;
+          variableImpactsGroupBox.Dock = DockStyle.Fill;
+          var visibleRuns = Content.Where(r => r.Visible).ToArray();
+          if (visibleRuns.Length == 0) {
+            DisplayMessage("Run collection is empty.");
+          } else if (visibleRuns.All(r => r.Parameters.ContainsKey(numberOfFoldsParameterName))) {
+            // check if all runs are comparable (CV or normal runs)
+            CheckAndUpdateCvRuns();
+          } else if (visibleRuns.All(r => !r.Parameters.ContainsKey(numberOfFoldsParameterName))) {
+            CheckAndUpdateNormalRuns();
+          } else {
+            // there is a mix of CV and normal runs => show an error message
+            DisplayMessage("The run collection contains a mixture of normal runs and cross-validation runs. Variable impact calculation does not work in this case.");
+          }
+        }
+      }
+    }
+
+    private void CheckAndUpdateCvRuns() {
+      var visibleRuns = from run in Content where run.Visible select run;
+      var representativeRun = visibleRuns.First();
+      // make sure all runs have the same number of folds
+      int nFolds = ((IntValue)representativeRun.Parameters[numberOfFoldsParameterName]).Value;
+      if (visibleRuns.All(r => ((IntValue)r.Parameters[numberOfFoldsParameterName]).Value == nFolds)) {
+        var allFoldResults = visibleRuns.SelectMany(run => (RunCollection)run.Results[crossValidationFoldsResultName]);
+
+        // make sure each fold contains variable impacts 
+        if (!allFoldResults.All(r => r.Results.ContainsKey(variableImpactResultName))) {
+          DisplayMessage("At least one of the runs does not contain a variable impact result.");
+        } else {
+          // make sure each of the runs has the same input variables
+          var allVariableNames = from run in allFoldResults
+                                 let varImpacts = (DoubleMatrix)run.Results[variableImpactResultName]
+                                 select varImpacts.RowNames;
+          var groupedVariableNames = allVariableNames
+            .SelectMany(x => x)
+            .GroupBy(x => x);
+
+          if (groupedVariableNames.Any(g => g.Count() != allFoldResults.Count())) {
+            DisplayMessage("At least one of the runs has a different input variable set than the rest.");
+          } else {
+            // populate combobox
+            comboBox.Items.Add("Overall");
+            for (int foldIndex = 0; foldIndex < nFolds; foldIndex++) {
+              comboBox.Items.Add("Fold " + foldIndex);
+            }
+            comboBox.SelectedIndex = 0;
+            comboBox.Enabled = true;
+            comboBox.Visible = true;
+            foldsLabel.Visible = true;
+            variableImpactsGroupBox.Controls.Clear();
+            variableImpactsGroupBox.Dock = DockStyle.None;
+            variableImpactsGroupBox.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right |
+                                             AnchorStyles.Bottom;
+            variableImpactsGroupBox.Height = this.Height - comboBox.Height - 12;
+            variableImpactsGroupBox.Width = this.Width;
+            matrixView.Dock = DockStyle.Fill;
+            variableImpactsGroupBox.Controls.Add(matrixView);
+          }
+        }
+      } else {
+        DisplayMessage("At least on of the cross-validation runs has a different number of folds than the rest.");
+      }
+    }
+
+    private void CheckAndUpdateNormalRuns() {
+      // make sure all runs contain variable impact results
+      var visibleRuns = from run in Content where run.Visible select run;
+
+      if (!visibleRuns.All(r => r.Results.ContainsKey(variableImpactResultName))) {
+        DisplayMessage("At least one of the runs does not contain a variable impact result.");
+      } else {
+        // make sure each of the runs has the same input variables
+        var allVariableNames = from run in visibleRuns
+                               let varImpacts = (DoubleMatrix)run.Results[variableImpactResultName]
+                               select varImpacts.RowNames;
+        var groupedVariableNames = allVariableNames
+          .SelectMany(x => x)
+          .GroupBy(x => x);
+
+        if (groupedVariableNames.Any(g => g.Count() != visibleRuns.Count())) {
+          DisplayMessage("At least one of the runs has a different input variable set than the rest.");
+        } else {
+          if (!variableImpactsGroupBox.Controls.Contains(matrixView)) {
+            variableImpactsGroupBox.Controls.Clear();
+            matrixView.Dock = DockStyle.Fill;
+            variableImpactsGroupBox.Controls.Add(matrixView);
+          }
+          matrixView.Content = CalculateVariableImpactMatrix(visibleRuns.ToArray(), visibleRuns.Select(r => r.Name).ToArray());
+        }
+      }
+    }
+
+    private DoubleMatrix CalculateVariableImpactMatrix(IRun[] runs, string[] runNames) {
+      DoubleMatrix matrix = null;
+      IEnumerable<DoubleMatrix> allVariableImpacts = (from run in runs
+                                                      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 = new List<string>(runNames);
+      columnNames.AddRange(statictics);
+      int numberOfRuns = runs.Length;
+
+      matrix = new DoubleMatrix(variableNamesList.Count, numberOfRuns + statictics.Count);
+      matrix.SortableView = true;
+      matrix.ColumnNames = columnNames;
+
+      // calculate statistics
+      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, numberOfRuns] = variableRanks[row].Median();
+          // also show mean and std.dev. of relative variable impacts to indicate the relative difference in impacts of variables
+          matrix[row, numberOfRuns + 1] = Math.Round(variableImpactsOverRuns[row].Average(), 3);
+          matrix[row, numberOfRuns + 2] = Math.Round(variableImpactsOverRuns[row].StandardDeviation(), 3);
+
+          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, numberOfRuns + 3] = Math.Round(bothTails, 4);
+        }
+      }
+
+      // fill matrix with impacts from runs
+      for (int i = 0; i < runs.Length; i++) {
+        IRun run = runs[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] = Math.Round(runVariableImpacts[j, 0], 3);
+          }
+        }
+      }
+      // sort by median
+      var sortedMatrix = (DoubleMatrix)matrix.Clone();
+      var sortedIndexes = from i in Enumerable.Range(0, sortedMatrix.Rows)
+                          orderby matrix[i, numberOfRuns]
+                          select i;
+
+      int targetIndex = 0;
+      foreach (var sourceIndex in sortedIndexes) {
+        for (int c = 0; c < matrix.Columns; c++)
+          sortedMatrix[targetIndex, c] = matrix[sourceIndex, c];
+        targetIndex++;
+      }
+      sortedMatrix.RowNames = sortedIndexes.Select(i => variableNamesList[i]);
+
+      return sortedMatrix;
+    }
+
+    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++;
+        }
+      }
+    }
+
+    private void DisplayMessage(string message) {
+      variableImpactsGroupBox.Controls.Remove(matrixView);
+      var label = new Label { TextAlign = ContentAlignment.MiddleCenter, Text = message, Dock = DockStyle.Fill };
+      variableImpactsGroupBox.Controls.Add(label);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisModelMathView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisModelMathView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisModelMathView.cs	(revision 16132)
@@ -0,0 +1,74 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [View("Mathematical Representation")]
+  [Content(typeof(ISymbolicDataAnalysisModel))]
+  public partial class SymbolicDataAnalysisModelMathView : AsynchronousContentView {
+    protected readonly SymbolicDataAnalysisExpressionLatexFormatter Formatter = new SymbolicDataAnalysisExpressionLatexFormatter();
+    public SymbolicDataAnalysisModelMathView()
+      : base() {
+      InitializeComponent();
+      webBrowser.ScrollBarsEnabled = true;
+      webBrowser.ScriptErrorsSuppressed = false;
+
+      // update for the first time after page has loaded
+      webBrowser.DocumentCompleted += (sender, args) => RefreshHtmlPage();
+
+      string hlDir = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory);
+      webBrowser.Navigate("file://" + Path.Combine(hlDir, "displayModelFrame.html"));
+    }
+
+    public new ISymbolicDataAnalysisModel Content {
+      get { return (ISymbolicDataAnalysisModel)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      RefreshHtmlPage();
+    }
+
+    private void RefreshHtmlPage() {
+      // only update if the page has loaded already
+      if (webBrowser.Document == null || webBrowser.Document.Body == null) return;
+
+      if (Content != null) {
+        HtmlElement newElement = webBrowser.Document.GetElementById("model");
+        newElement.InnerText = GetFormattedTree();
+        webBrowser.Document.InvokeScript("refreshModel");
+      } else {
+        HtmlElement newElement = webBrowser.Document.GetElementById("model");
+        newElement.InnerText = string.Empty;
+      }
+    }
+
+    protected virtual string GetFormattedTree() {
+      return Formatter.Format(Content.SymbolicExpressionTree);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisModelMathView.designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisModelMathView.designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisModelMathView.designer.cs	(revision 16132)
@@ -0,0 +1,81 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  partial class SymbolicDataAnalysisModelMathView {
+    /// <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)) {
+        webBrowser.Dispose();
+        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.webBrowser = new System.Windows.Forms.WebBrowser();
+      this.SuspendLayout();
+      // 
+      // webBrowser
+      // 
+      this.webBrowser.AllowNavigation = false;
+      this.webBrowser.AllowWebBrowserDrop = false;
+      this.webBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.webBrowser.IsWebBrowserContextMenuEnabled = false;
+      this.webBrowser.Location = new System.Drawing.Point(0, 0);
+      this.webBrowser.MinimumSize = new System.Drawing.Size(20, 20);
+      this.webBrowser.Name = "webBrowser";
+      this.webBrowser.Size = new System.Drawing.Size(352, 413);
+      this.webBrowser.TabIndex = 0;
+      this.webBrowser.WebBrowserShortcutsEnabled = false;
+      // 
+      // MathSymbolicDataAnalysisModelView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.webBrowser);
+      this.Name = "MathSymbolicDataAnalysisModelView";
+      this.Size = new System.Drawing.Size(352, 413);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.WebBrowser webBrowser;
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.Designer.cs	(revision 16132)
@@ -0,0 +1,256 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  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.multiplicativeChangeLabel = new System.Windows.Forms.Label();
+      this.multiplicativeChangeSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.additiveChangeLabel = new System.Windows.Forms.Label();
+      this.additiveChangeSigmaTextBox = 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(280, 20);
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Size = new System.Drawing.Size(280, 20);
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Size = new System.Drawing.Size(280, 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(280, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(379, 3);
+      // 
+      // 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 = 0;
+      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(300, 20);
+      this.minValueTextBox.TabIndex = 1;
+      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(0, 127);
+      this.initializationGroupBox.Name = "initializationGroupBox";
+      this.initializationGroupBox.Size = new System.Drawing.Size(398, 73);
+      this.initializationGroupBox.TabIndex = 5;
+      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 = 2;
+      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(300, 20);
+      this.maxValueTextBox.TabIndex = 3;
+      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.multiplicativeChangeLabel);
+      this.mutationGroupBox.Controls.Add(this.multiplicativeChangeSigmaTextBox);
+      this.mutationGroupBox.Controls.Add(this.additiveChangeLabel);
+      this.mutationGroupBox.Controls.Add(this.additiveChangeSigmaTextBox);
+      this.mutationGroupBox.Location = new System.Drawing.Point(0, 206);
+      this.mutationGroupBox.Name = "mutationGroupBox";
+      this.mutationGroupBox.Size = new System.Drawing.Size(398, 73);
+      this.mutationGroupBox.TabIndex = 6;
+      this.mutationGroupBox.TabStop = false;
+      this.mutationGroupBox.Text = "Mutation";
+      // 
+      // multiplicativeChangeLabel
+      // 
+      this.multiplicativeChangeLabel.AutoSize = true;
+      this.multiplicativeChangeLabel.Location = new System.Drawing.Point(6, 48);
+      this.multiplicativeChangeLabel.Name = "multiplicativeChangeLabel";
+      this.multiplicativeChangeLabel.Size = new System.Drawing.Size(146, 13);
+      this.multiplicativeChangeLabel.TabIndex = 2;
+      this.multiplicativeChangeLabel.Text = "Multiplicative change (sigma):";
+      this.toolTip.SetToolTip(this.multiplicativeChangeLabel, "The sigma (std. dev.) parameter for the normal distribution to use to sample the " +
+        "multiplicative change.");
+      // 
+      // multiplicativeChangeSigmaTextBox
+      // 
+      this.multiplicativeChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.multiplicativeChangeSigmaTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.multiplicativeChangeSigmaTextBox.Location = new System.Drawing.Point(168, 45);
+      this.multiplicativeChangeSigmaTextBox.Name = "multiplicativeChangeSigmaTextBox";
+      this.multiplicativeChangeSigmaTextBox.Size = new System.Drawing.Size(224, 20);
+      this.multiplicativeChangeSigmaTextBox.TabIndex = 3;
+      this.toolTip.SetToolTip(this.multiplicativeChangeSigmaTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample a mu" +
+        "ltiplicative change.");
+      this.multiplicativeChangeSigmaTextBox.TextChanged += new System.EventHandler(this.multiplicativeChangeSigmaTextBox_TextChanged);
+      // 
+      // additiveChangeLabel
+      // 
+      this.additiveChangeLabel.AutoSize = true;
+      this.additiveChangeLabel.Location = new System.Drawing.Point(6, 22);
+      this.additiveChangeLabel.Name = "additiveChangeLabel";
+      this.additiveChangeLabel.Size = new System.Drawing.Size(123, 13);
+      this.additiveChangeLabel.TabIndex = 0;
+      this.additiveChangeLabel.Text = "Additive change (sigma):";
+      this.toolTip.SetToolTip(this.additiveChangeLabel, "The sigma (std. dev.) parameter for the normal distribution to sample the additiv" +
+        "e change.");
+      // 
+      // additiveChangeSigmaTextBox
+      // 
+      this.additiveChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.additiveChangeSigmaTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.additiveChangeSigmaTextBox.Location = new System.Drawing.Point(168, 19);
+      this.additiveChangeSigmaTextBox.Name = "additiveChangeSigmaTextBox";
+      this.additiveChangeSigmaTextBox.Size = new System.Drawing.Size(224, 20);
+      this.additiveChangeSigmaTextBox.TabIndex = 1;
+      this.toolTip.SetToolTip(this.additiveChangeSigmaTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample an a" +
+        "dditive change.");
+      this.additiveChangeSigmaTextBox.TextChanged += new System.EventHandler(this.additiveChangeSigmaTextBox_TextChanged);
+      // 
+      // ConstantView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.mutationGroupBox);
+      this.Controls.Add(this.initializationGroupBox);
+      this.Name = "ConstantView";
+      this.Size = new System.Drawing.Size(398, 284);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      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.nameTextBox, 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 multiplicativeChangeLabel;
+    private System.Windows.Forms.TextBox multiplicativeChangeSigmaTextBox;
+    private System.Windows.Forms.Label additiveChangeLabel;
+    private System.Windows.Forms.TextBox additiveChangeSigmaTextBox;
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.cs	(revision 16132)
@@ -0,0 +1,133 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [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;
+      additiveChangeSigmaTextBox.Enabled = Content != null;
+      additiveChangeSigmaTextBox.ReadOnly = ReadOnly;
+      multiplicativeChangeSigmaTextBox.Enabled = Content != null;
+      multiplicativeChangeSigmaTextBox.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 additiveChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double sigma;
+      if (double.TryParse(additiveChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
+        Content.ManipulatorSigma = sigma;
+        errorProvider.SetError(additiveChangeSigmaTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(additiveChangeSigmaTextBox, "Invalid value");
+      }
+    }
+
+    private void multiplicativeChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double sigma;
+      if (double.TryParse(multiplicativeChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
+        Content.MultiplicativeManipulatorSigma = sigma;
+        errorProvider.SetError(multiplicativeChangeSigmaTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(multiplicativeChangeSigmaTextBox, "Invalid value");
+      }
+    }
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        minValueTextBox.Text = string.Empty;
+        maxValueTextBox.Text = string.Empty;
+        minValueTextBox.Text = string.Empty;
+        multiplicativeChangeSigmaTextBox.Text = string.Empty;
+        additiveChangeSigmaTextBox.Text = string.Empty;
+      } else {
+        minValueTextBox.Text = Content.MinValue.ToString();
+        maxValueTextBox.Text = Content.MaxValue.ToString();
+        additiveChangeSigmaTextBox.Text = Content.ManipulatorSigma.ToString();
+        multiplicativeChangeSigmaTextBox.Text = Content.MultiplicativeManipulatorSigma.ToString();
+      }
+      SetEnabledStateOfControls();
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs	(revision 16132)
@@ -0,0 +1,266 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  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();
+      this.initializationGroupBox.SuspendLayout();
+      this.mutationGroupBox.SuspendLayout();
+      this.parametersTabPage.SuspendLayout();
+      this.tabControl.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // weightMuLabel
+      // 
+      this.toolTip.SetToolTip(this.weightMuLabel, "The mu (mean) parameter of the normal distribution to use for initial weights.");
+      // 
+      // weightInitializationMuTextBox
+      // 
+      this.weightInitializationMuTextBox.Size = new System.Drawing.Size(293, 20);
+      this.toolTip.SetToolTip(this.weightInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
+        "al weights.");
+      // 
+      // initializationGroupBox
+      // 
+      this.initializationGroupBox.Location = new System.Drawing.Point(6, 7);
+      this.initializationGroupBox.Size = new System.Drawing.Size(391, 73);
+      // 
+      // weightSigmaLabel
+      // 
+      this.toolTip.SetToolTip(this.weightSigmaLabel, "The sigma parameter for the normal distribution to use for the initial weights.");
+      // 
+      // weightInitializationSigmaTextBox
+      // 
+      this.weightInitializationSigmaTextBox.Size = new System.Drawing.Size(293, 20);
+      this.toolTip.SetToolTip(this.weightInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
+        "weights.");
+      // 
+      // mutationGroupBox
+      // 
+      this.mutationGroupBox.Location = new System.Drawing.Point(6, 86);
+      this.mutationGroupBox.Size = new System.Drawing.Size(391, 95);
+      // 
+      // multiplicativeWeightChangeLabel
+      // 
+      this.multiplicativeWeightChangeLabel.TabIndex = 4;
+      this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" +
+        " change in weight.");
+      // 
+      // multiplicativeWeightChangeSigmaTextBox
+      // 
+      this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 5;
+      this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" +
+        "tive change in weight.");
+      // 
+      // additiveWeightChangeLabel
+      // 
+      this.additiveWeightChangeLabel.TabIndex = 2;
+      this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
+        "change in weight.");
+      // 
+      // additiveWeightChangeSigmaTextBox
+      // 
+      this.additiveWeightChangeSigmaTextBox.TabIndex = 3;
+      this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
+        "change in weight.");
+      // 
+      // variableNamesTabPage
+      // 
+      this.variableNamesTabPage.Size = new System.Drawing.Size(400, 149);
+      // 
+      // parametersTabPage
+      // 
+      this.parametersTabPage.Size = new System.Drawing.Size(412, 208);
+      // 
+      // tabControl
+      // 
+      this.tabControl.Location = new System.Drawing.Point(0, 179);
+      this.tabControl.Size = new System.Drawing.Size(420, 234);
+      this.tabControl.TabIndex = 13;
+      // 
+      // varChangeProbTextBox
+      // 
+      this.varChangeProbTextBox.TabIndex = 1;
+      this.toolTip.SetToolTip(this.varChangeProbTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
+        "change in weight.");
+      // 
+      // varChangeProbLabel
+      // 
+      this.varChangeProbLabel.TabIndex = 0;
+      this.toolTip.SetToolTip(this.varChangeProbLabel, "The probability of changing the referenced variable in [0..1]. Variable reference" +
+        "s are sampled uniformly.");
+      // 
+      // initialFrequencyLabel
+      // 
+      this.initialFrequencyLabel.TabIndex = 2;
+      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(323, 20);
+      this.initialFrequencyTextBox.TabIndex = 3;
+      // 
+      // enabledCheckBox
+      // 
+      this.enabledCheckBox.TabIndex = 8;
+      // 
+      // minimumArityLabel
+      // 
+      this.minimumArityLabel.TabIndex = 4;
+      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
+      // 
+      // maximumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol");
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Size = new System.Drawing.Size(327, 20);
+      this.minimumArityTextBox.TabIndex = 5;
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Size = new System.Drawing.Size(327, 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(302, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(401, 3);
+      // 
+      // minTimeOffsetLabel
+      // 
+      this.minTimeOffsetLabel.AutoSize = true;
+      this.minTimeOffsetLabel.Location = new System.Drawing.Point(3, 130);
+      this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
+      this.minTimeOffsetLabel.Size = new System.Drawing.Size(81, 13);
+      this.minTimeOffsetLabel.TabIndex = 9;
+      this.minTimeOffsetLabel.Text = "Min. time offset:";
+      // 
+      // maxTimeOffsetLabel
+      // 
+      this.maxTimeOffsetLabel.AutoSize = true;
+      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(3, 156);
+      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.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(93, 127);
+      this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
+      this.minTimeOffsetTextBox.Size = new System.Drawing.Size(327, 20);
+      this.minTimeOffsetTextBox.TabIndex = 10;
+      this.minTimeOffsetTextBox.TextChanged += new System.EventHandler(this.minTimeOffsetTextBox_TextChanged);
+      // 
+      // maxTimeOffsetTextBox
+      // 
+      this.maxTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(93, 153);
+      this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
+      this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(327, 20);
+      this.maxTimeOffsetTextBox.TabIndex = 12;
+      this.maxTimeOffsetTextBox.TextChanged += new System.EventHandler(this.maxTimeOffsetTextBox_TextChanged);
+      // 
+      // LaggedVariableView
+      // 
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.minTimeOffsetTextBox);
+      this.Controls.Add(this.maxTimeOffsetLabel);
+      this.Controls.Add(this.minTimeOffsetLabel);
+      this.Controls.Add(this.maxTimeOffsetTextBox);
+      this.Name = "LaggedVariableView";
+      this.Size = new System.Drawing.Size(420, 411);
+      this.Controls.SetChildIndex(this.enabledCheckBox, 0);
+      this.Controls.SetChildIndex(this.maxTimeOffsetTextBox, 0);
+      this.Controls.SetChildIndex(this.minTimeOffsetLabel, 0);
+      this.Controls.SetChildIndex(this.maxTimeOffsetLabel, 0);
+      this.Controls.SetChildIndex(this.minTimeOffsetTextBox, 0);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.tabControl, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.initializationGroupBox.ResumeLayout(false);
+      this.initializationGroupBox.PerformLayout();
+      this.mutationGroupBox.ResumeLayout(false);
+      this.mutationGroupBox.PerformLayout();
+      this.parametersTabPage.ResumeLayout(false);
+      this.tabControl.ResumeLayout(false);
+      ((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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.cs	(revision 16132)
@@ -0,0 +1,107 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  [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 negative or zero.");
+      }
+    }
+
+    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 negative or zero.");
+      }
+    }
+
+    #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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.Designer.cs	(revision 16132)
@@ -0,0 +1,159 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  partial class LaggedSymbolView {
+    /// <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.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(315, 20);
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Size = new System.Drawing.Size(315, 20);
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Size = new System.Drawing.Size(315, 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(290, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(389, 3);
+      // 
+      // minTimeOffsetLabel
+      // 
+      this.minTimeOffsetLabel.AutoSize = true;
+      this.minTimeOffsetLabel.Location = new System.Drawing.Point(3, 130);
+      this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
+      this.minTimeOffsetLabel.Size = new System.Drawing.Size(81, 13);
+      this.minTimeOffsetLabel.TabIndex = 5;
+      this.minTimeOffsetLabel.Text = "Min. time offset:";
+      // 
+      // maxTimeOffsetLabel
+      // 
+      this.maxTimeOffsetLabel.AutoSize = true;
+      this.maxTimeOffsetLabel.Location = new System.Drawing.Point(3, 156);
+      this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
+      this.maxTimeOffsetLabel.Size = new System.Drawing.Size(84, 13);
+      this.maxTimeOffsetLabel.TabIndex = 7;
+      this.maxTimeOffsetLabel.Text = "Max. time offset:";
+      // 
+      // minTimeOffsetTextBox
+      // 
+      this.minTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(93, 127);
+      this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
+      this.minTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
+      this.minTimeOffsetTextBox.TabIndex = 6;
+      this.minTimeOffsetTextBox.TextChanged += new System.EventHandler(this.minTimeOffsetTextBox_TextChanged);
+      // 
+      // maxTimeOffsetTextBox
+      // 
+      this.maxTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(93, 153);
+      this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
+      this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
+      this.maxTimeOffsetTextBox.TabIndex = 8;
+      this.maxTimeOffsetTextBox.TextChanged += new System.EventHandler(this.maxTimeOffsetTextBox_TextChanged);
+      // 
+      // LaggedSymbolView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.maxTimeOffsetTextBox);
+      this.Controls.Add(this.minTimeOffsetTextBox);
+      this.Controls.Add(this.maxTimeOffsetLabel);
+      this.Controls.Add(this.minTimeOffsetLabel);
+      this.Name = "LaggedSymbolView";
+      this.Size = new System.Drawing.Size(408, 179);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.cs	(revision 16132)
@@ -0,0 +1,108 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [View("LaggedSymbol View")]
+  [Content(typeof(LaggedSymbol), true)]
+  public partial class LaggedSymbolView : SymbolView {
+    public new LaggedSymbol Content {
+      get { return (LaggedSymbol)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public LaggedSymbolView() {
+      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 negative or zero.");
+      }
+    }
+
+    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 negative or zero.");
+      }
+    }
+
+    #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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs	(revision 16132)
@@ -0,0 +1,419 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  partial class VariableConditionView {
+    /// <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.mutationGroupBox = new System.Windows.Forms.GroupBox();
+      this.slopeChangeSigmaLabel = new System.Windows.Forms.Label();
+      this.slopeChangeSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.slopeChangeMuLabel = new System.Windows.Forms.Label();
+      this.slopeChangeMuTextBox = new System.Windows.Forms.TextBox();
+      this.thresholdChangeSigmaLabel = new System.Windows.Forms.Label();
+      this.thresholdChangeSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.ThresholdChangeMuLabel = new System.Windows.Forms.Label();
+      this.thresholdChangeMuTextBox = new System.Windows.Forms.TextBox();
+      this.tabControl = new System.Windows.Forms.TabControl();
+      this.variableNamesTabPage = new System.Windows.Forms.TabPage();
+      this.parametersTabPage = new System.Windows.Forms.TabPage();
+      this.initializationGroupBox = new System.Windows.Forms.GroupBox();
+      this.slopeInitializationSigmaLabel = new System.Windows.Forms.Label();
+      this.slopeInitializationSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.slopeInitializationMuLabel = new System.Windows.Forms.Label();
+      this.slopeInitializationMuTextBox = new System.Windows.Forms.TextBox();
+      this.thresholdInitializationSigmaLabel = new System.Windows.Forms.Label();
+      this.thresholdInitializationSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.thresholdInitializationMuLabel = new System.Windows.Forms.Label();
+      this.thresholdInitializationMuTextBox = new System.Windows.Forms.TextBox();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.mutationGroupBox.SuspendLayout();
+      this.tabControl.SuspendLayout();
+      this.parametersTabPage.SuspendLayout();
+      this.initializationGroupBox.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(427, 20);
+      // 
+      // minimumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
+      // 
+      // maximumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol");
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Size = new System.Drawing.Size(421, 20);
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Size = new System.Drawing.Size(421, 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(397, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(495, 3);
+      // 
+      // 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.slopeChangeSigmaLabel);
+      this.mutationGroupBox.Controls.Add(this.slopeChangeSigmaTextBox);
+      this.mutationGroupBox.Controls.Add(this.slopeChangeMuLabel);
+      this.mutationGroupBox.Controls.Add(this.slopeChangeMuTextBox);
+      this.mutationGroupBox.Controls.Add(this.thresholdChangeSigmaLabel);
+      this.mutationGroupBox.Controls.Add(this.thresholdChangeSigmaTextBox);
+      this.mutationGroupBox.Controls.Add(this.ThresholdChangeMuLabel);
+      this.mutationGroupBox.Controls.Add(this.thresholdChangeMuTextBox);
+      this.mutationGroupBox.Location = new System.Drawing.Point(6, 142);
+      this.mutationGroupBox.Name = "mutationGroupBox";
+      this.mutationGroupBox.Size = new System.Drawing.Size(503, 126);
+      this.mutationGroupBox.TabIndex = 6;
+      this.mutationGroupBox.TabStop = false;
+      this.mutationGroupBox.Text = "Mutation";
+      // 
+      // slopeChangeSigmaLabel
+      // 
+      this.slopeChangeSigmaLabel.AutoSize = true;
+      this.slopeChangeSigmaLabel.Location = new System.Drawing.Point(6, 102);
+      this.slopeChangeSigmaLabel.Name = "slopeChangeSigmaLabel";
+      this.slopeChangeSigmaLabel.Size = new System.Drawing.Size(112, 13);
+      this.slopeChangeSigmaLabel.TabIndex = 6;
+      this.slopeChangeSigmaLabel.Text = "Slope change (sigma):";
+      this.toolTip.SetToolTip(this.slopeChangeSigmaLabel, "The sigma parameter for the normal distribution to use to sample the change in sl" +
+              "ope.");
+      // 
+      // slopeChangeSigmaTextBox
+      // 
+      this.slopeChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.slopeChangeSigmaTextBox.Location = new System.Drawing.Point(149, 99);
+      this.slopeChangeSigmaTextBox.Name = "slopeChangeSigmaTextBox";
+      this.slopeChangeSigmaTextBox.Size = new System.Drawing.Size(345, 20);
+      this.slopeChangeSigmaTextBox.TabIndex = 7;
+      this.toolTip.SetToolTip(this.slopeChangeSigmaTextBox, "The sigma parameter for the normal distribution to use to sample the change in sl" +
+              "ope.");
+      this.slopeChangeSigmaTextBox.TextChanged += new System.EventHandler(this.SlopeChangeSigmaTextBox_TextChanged);
+      // 
+      // slopeChangeMuLabel
+      // 
+      this.slopeChangeMuLabel.AutoSize = true;
+      this.slopeChangeMuLabel.Location = new System.Drawing.Point(6, 76);
+      this.slopeChangeMuLabel.Name = "slopeChangeMuLabel";
+      this.slopeChangeMuLabel.Size = new System.Drawing.Size(99, 13);
+      this.slopeChangeMuLabel.TabIndex = 4;
+      this.slopeChangeMuLabel.Text = "Slope change (mu):";
+      this.toolTip.SetToolTip(this.slopeChangeMuLabel, "The nu (mean) parameter for the normal distribution to sample the change in slope" +
+              ".");
+      // 
+      // slopeChangeMuTextBox
+      // 
+      this.slopeChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.slopeChangeMuTextBox.Location = new System.Drawing.Point(149, 73);
+      this.slopeChangeMuTextBox.Name = "slopeChangeMuTextBox";
+      this.slopeChangeMuTextBox.Size = new System.Drawing.Size(345, 20);
+      this.slopeChangeMuTextBox.TabIndex = 5;
+      this.toolTip.SetToolTip(this.slopeChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the change in slope" +
+              ".");
+      this.slopeChangeMuTextBox.TextChanged += new System.EventHandler(this.SlopeChangeMuTextBox_TextChanged);
+      // 
+      // thresholdChangeSigmaLabel
+      // 
+      this.thresholdChangeSigmaLabel.AutoSize = true;
+      this.thresholdChangeSigmaLabel.Location = new System.Drawing.Point(6, 44);
+      this.thresholdChangeSigmaLabel.Name = "thresholdChangeSigmaLabel";
+      this.thresholdChangeSigmaLabel.Size = new System.Drawing.Size(132, 13);
+      this.thresholdChangeSigmaLabel.TabIndex = 2;
+      this.thresholdChangeSigmaLabel.Text = "Threshold change (sigma):";
+      this.toolTip.SetToolTip(this.thresholdChangeSigmaLabel, "The sigma parameter for the normal distribution to use to sample the change in th" +
+              "reshold.");
+      // 
+      // thresholdChangeSigmaTextBox
+      // 
+      this.thresholdChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.thresholdChangeSigmaTextBox.Location = new System.Drawing.Point(149, 41);
+      this.thresholdChangeSigmaTextBox.Name = "thresholdChangeSigmaTextBox";
+      this.thresholdChangeSigmaTextBox.Size = new System.Drawing.Size(345, 20);
+      this.thresholdChangeSigmaTextBox.TabIndex = 3;
+      this.toolTip.SetToolTip(this.thresholdChangeSigmaTextBox, "The sigma parameter for the normal distribution to use to sample the change in th" +
+              "reshold.");
+      this.thresholdChangeSigmaTextBox.TextChanged += new System.EventHandler(this.ThresholdChangeSigmaTextBox_TextChanged);
+      // 
+      // ThresholdChangeMuLabel
+      // 
+      this.ThresholdChangeMuLabel.AutoSize = true;
+      this.ThresholdChangeMuLabel.Location = new System.Drawing.Point(6, 18);
+      this.ThresholdChangeMuLabel.Name = "ThresholdChangeMuLabel";
+      this.ThresholdChangeMuLabel.Size = new System.Drawing.Size(119, 13);
+      this.ThresholdChangeMuLabel.TabIndex = 0;
+      this.ThresholdChangeMuLabel.Text = "Threshold change (mu):";
+      this.toolTip.SetToolTip(this.ThresholdChangeMuLabel, "The nu (mean) parameter for the normal distribution to sample the change in thres" +
+              "hold.");
+      // 
+      // thresholdChangeMuTextBox
+      // 
+      this.thresholdChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.thresholdChangeMuTextBox.Location = new System.Drawing.Point(149, 15);
+      this.thresholdChangeMuTextBox.Name = "thresholdChangeMuTextBox";
+      this.thresholdChangeMuTextBox.Size = new System.Drawing.Size(345, 20);
+      this.thresholdChangeMuTextBox.TabIndex = 1;
+      this.toolTip.SetToolTip(this.thresholdChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the change in thres" +
+              "hold.");
+      this.thresholdChangeMuTextBox.TextChanged += new System.EventHandler(this.ThresholdChangeMuTextBox_TextChanged);
+      // 
+      // 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.variableNamesTabPage);
+      this.tabControl.Controls.Add(this.parametersTabPage);
+      this.tabControl.Location = new System.Drawing.Point(0, 127);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(520, 299);
+      this.tabControl.TabIndex = 10;
+      // 
+      // variableNamesTabPage
+      // 
+      this.variableNamesTabPage.Location = new System.Drawing.Point(4, 22);
+      this.variableNamesTabPage.Name = "variableNamesTabPage";
+      this.variableNamesTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.variableNamesTabPage.Size = new System.Drawing.Size(512, 273);
+      this.variableNamesTabPage.TabIndex = 0;
+      this.variableNamesTabPage.Text = "Variable Names";
+      this.variableNamesTabPage.UseVisualStyleBackColor = true;
+      // 
+      // parametersTabPage
+      // 
+      this.parametersTabPage.Controls.Add(this.initializationGroupBox);
+      this.parametersTabPage.Controls.Add(this.mutationGroupBox);
+      this.parametersTabPage.Location = new System.Drawing.Point(4, 22);
+      this.parametersTabPage.Name = "parametersTabPage";
+      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.parametersTabPage.Size = new System.Drawing.Size(512, 273);
+      this.parametersTabPage.TabIndex = 1;
+      this.parametersTabPage.Text = "Parameters";
+      this.parametersTabPage.UseVisualStyleBackColor = true;
+      // 
+      // 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.slopeInitializationSigmaLabel);
+      this.initializationGroupBox.Controls.Add(this.slopeInitializationSigmaTextBox);
+      this.initializationGroupBox.Controls.Add(this.slopeInitializationMuLabel);
+      this.initializationGroupBox.Controls.Add(this.slopeInitializationMuTextBox);
+      this.initializationGroupBox.Controls.Add(this.thresholdInitializationSigmaLabel);
+      this.initializationGroupBox.Controls.Add(this.thresholdInitializationSigmaTextBox);
+      this.initializationGroupBox.Controls.Add(this.thresholdInitializationMuLabel);
+      this.initializationGroupBox.Controls.Add(this.thresholdInitializationMuTextBox);
+      this.initializationGroupBox.Location = new System.Drawing.Point(6, 6);
+      this.initializationGroupBox.Name = "initializationGroupBox";
+      this.initializationGroupBox.Size = new System.Drawing.Size(503, 130);
+      this.initializationGroupBox.TabIndex = 6;
+      this.initializationGroupBox.TabStop = false;
+      this.initializationGroupBox.Text = "Initialization";
+      // 
+      // slopeInitializationSigmaLabel
+      // 
+      this.slopeInitializationSigmaLabel.AutoSize = true;
+      this.slopeInitializationSigmaLabel.Location = new System.Drawing.Point(6, 105);
+      this.slopeInitializationSigmaLabel.Name = "slopeInitializationSigmaLabel";
+      this.slopeInitializationSigmaLabel.Size = new System.Drawing.Size(73, 13);
+      this.slopeInitializationSigmaLabel.TabIndex = 6;
+      this.slopeInitializationSigmaLabel.Text = "Slope (sigma):";
+      this.toolTip.SetToolTip(this.slopeInitializationSigmaLabel, "The sigma parameter for the normal distribution to use for the initial slopes.");
+      // 
+      // slopeInitializationSigmaTextBox
+      // 
+      this.slopeInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.slopeInitializationSigmaTextBox.Location = new System.Drawing.Point(114, 102);
+      this.slopeInitializationSigmaTextBox.Name = "slopeInitializationSigmaTextBox";
+      this.slopeInitializationSigmaTextBox.Size = new System.Drawing.Size(380, 20);
+      this.slopeInitializationSigmaTextBox.TabIndex = 7;
+      this.toolTip.SetToolTip(this.slopeInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
+              "slopes.");
+      this.slopeInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.SlopeInitializationSigmaTextBox_TextChanged);
+      // 
+      // slopeInitializationMuLabel
+      // 
+      this.slopeInitializationMuLabel.AutoSize = true;
+      this.slopeInitializationMuLabel.Location = new System.Drawing.Point(6, 79);
+      this.slopeInitializationMuLabel.Name = "slopeInitializationMuLabel";
+      this.slopeInitializationMuLabel.Size = new System.Drawing.Size(60, 13);
+      this.slopeInitializationMuLabel.TabIndex = 4;
+      this.slopeInitializationMuLabel.Text = "Slope (mu):";
+      this.toolTip.SetToolTip(this.slopeInitializationMuLabel, "The mu (mean) parameter of the normal distribution to use for initial slopes.");
+      // 
+      // slopeInitializationMuTextBox
+      // 
+      this.slopeInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.slopeInitializationMuTextBox.Location = new System.Drawing.Point(114, 76);
+      this.slopeInitializationMuTextBox.Name = "slopeInitializationMuTextBox";
+      this.slopeInitializationMuTextBox.Size = new System.Drawing.Size(380, 20);
+      this.slopeInitializationMuTextBox.TabIndex = 5;
+      this.toolTip.SetToolTip(this.slopeInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
+              "al slopes.");
+      this.slopeInitializationMuTextBox.TextChanged += new System.EventHandler(this.SlopeInitializationMuTextBox_TextChanged);
+      // 
+      // thresholdInitializationSigmaLabel
+      // 
+      this.thresholdInitializationSigmaLabel.AutoSize = true;
+      this.thresholdInitializationSigmaLabel.Location = new System.Drawing.Point(6, 44);
+      this.thresholdInitializationSigmaLabel.Name = "thresholdInitializationSigmaLabel";
+      this.thresholdInitializationSigmaLabel.Size = new System.Drawing.Size(93, 13);
+      this.thresholdInitializationSigmaLabel.TabIndex = 2;
+      this.thresholdInitializationSigmaLabel.Text = "Threshold (sigma):";
+      this.toolTip.SetToolTip(this.thresholdInitializationSigmaLabel, "The sigma parameter for the normal distribution to use for the initial weights.");
+      // 
+      // thresholdInitializationSigmaTextBox
+      // 
+      this.thresholdInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.thresholdInitializationSigmaTextBox.Location = new System.Drawing.Point(114, 41);
+      this.thresholdInitializationSigmaTextBox.Name = "thresholdInitializationSigmaTextBox";
+      this.thresholdInitializationSigmaTextBox.Size = new System.Drawing.Size(380, 20);
+      this.thresholdInitializationSigmaTextBox.TabIndex = 3;
+      this.toolTip.SetToolTip(this.thresholdInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
+              "thresholds.");
+      this.thresholdInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.ThresholdInitializationSigmaTextBox_TextChanged);
+      // 
+      // thresholdInitializationMuLabel
+      // 
+      this.thresholdInitializationMuLabel.AutoSize = true;
+      this.thresholdInitializationMuLabel.Location = new System.Drawing.Point(6, 18);
+      this.thresholdInitializationMuLabel.Name = "thresholdInitializationMuLabel";
+      this.thresholdInitializationMuLabel.Size = new System.Drawing.Size(80, 13);
+      this.thresholdInitializationMuLabel.TabIndex = 0;
+      this.thresholdInitializationMuLabel.Text = "Threshold (mu):";
+      this.toolTip.SetToolTip(this.thresholdInitializationMuLabel, "The mu (mean) parameter of the normal distribution to use for initial weights.");
+      // 
+      // thresholdInitializationMuTextBox
+      // 
+      this.thresholdInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.thresholdInitializationMuTextBox.Location = new System.Drawing.Point(114, 15);
+      this.thresholdInitializationMuTextBox.Name = "thresholdInitializationMuTextBox";
+      this.thresholdInitializationMuTextBox.Size = new System.Drawing.Size(380, 20);
+      this.thresholdInitializationMuTextBox.TabIndex = 1;
+      this.toolTip.SetToolTip(this.thresholdInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
+              "al thresholds.");
+      this.thresholdInitializationMuTextBox.TextChanged += new System.EventHandler(this.ThresholdInitializationMuTextBox_TextChanged);
+      // 
+      // VariableConditionView
+      // 
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.tabControl);
+      this.Name = "VariableConditionView";
+      this.Size = new System.Drawing.Size(520, 426);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.tabControl, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.mutationGroupBox.ResumeLayout(false);
+      this.mutationGroupBox.PerformLayout();
+      this.tabControl.ResumeLayout(false);
+      this.parametersTabPage.ResumeLayout(false);
+      this.initializationGroupBox.ResumeLayout(false);
+      this.initializationGroupBox.PerformLayout();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.GroupBox mutationGroupBox;
+    private System.Windows.Forms.Label thresholdChangeSigmaLabel;
+    private System.Windows.Forms.TextBox thresholdChangeSigmaTextBox;
+    private System.Windows.Forms.Label ThresholdChangeMuLabel;
+    private System.Windows.Forms.TextBox thresholdChangeMuTextBox;
+    private System.Windows.Forms.Label slopeChangeSigmaLabel;
+    private System.Windows.Forms.TextBox slopeChangeSigmaTextBox;
+    private System.Windows.Forms.Label slopeChangeMuLabel;
+    private System.Windows.Forms.TextBox slopeChangeMuTextBox;
+    protected System.Windows.Forms.TabControl tabControl;
+    protected System.Windows.Forms.TabPage variableNamesTabPage;
+    protected System.Windows.Forms.TabPage parametersTabPage;
+    protected System.Windows.Forms.GroupBox initializationGroupBox;
+    private System.Windows.Forms.Label slopeInitializationSigmaLabel;
+    private System.Windows.Forms.TextBox slopeInitializationSigmaTextBox;
+    private System.Windows.Forms.Label slopeInitializationMuLabel;
+    private System.Windows.Forms.TextBox slopeInitializationMuTextBox;
+    private System.Windows.Forms.Label thresholdInitializationSigmaLabel;
+    private System.Windows.Forms.TextBox thresholdInitializationSigmaTextBox;
+    private System.Windows.Forms.Label thresholdInitializationMuLabel;
+    private System.Windows.Forms.TextBox thresholdInitializationMuTextBox;
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.cs	(revision 16132)
@@ -0,0 +1,234 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [View("Variable View")]
+  [Content(typeof(VariableCondition), true)]
+  public partial class VariableConditionView : SymbolView {
+    private readonly CheckedItemCollectionView<StringValue> variableNamesView;
+
+    public new VariableCondition Content {
+      get { return (VariableCondition)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public VariableConditionView() {
+      InitializeComponent();
+      variableNamesView = new CheckedItemCollectionView<StringValue>();
+      variableNamesView.Dock = DockStyle.Fill;
+      variableNamesTabPage.Controls.Add(variableNamesView);
+      variableNamesView.Content = new CheckedItemCollection<StringValue>();
+
+      RegisterVariableNamesViewContentEvents();
+    }
+
+    private void RegisterVariableNamesViewContentEvents() {
+      variableNamesView.Content.ItemsAdded += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      variableNamesView.Content.ItemsRemoved += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Removed);
+      variableNamesView.Content.CheckedItemsChanged += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      variableNamesView.Content.CollectionReset += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      foreach (var variable in variableNamesView.Content) {
+        variable.ValueChanged += new EventHandler(Variable_ValueChanged);
+      }
+    }
+
+    private void DeregisterVariableNamesViewContentEvents() {
+      variableNamesView.Content.ItemsAdded -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      variableNamesView.Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Removed);
+      variableNamesView.Content.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      variableNamesView.Content.CollectionReset -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      foreach (var variable in variableNamesView.Content) {
+        variable.ValueChanged -= new EventHandler(Variable_ValueChanged);
+      }
+    }
+
+    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();
+    }
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      thresholdInitializationMuTextBox.Enabled = Content != null;
+      thresholdInitializationMuTextBox.ReadOnly = ReadOnly;
+      thresholdInitializationSigmaTextBox.Enabled = Content != null;
+      thresholdInitializationSigmaTextBox.ReadOnly = ReadOnly;
+      slopeInitializationMuTextBox.Enabled = Content != null;
+      slopeInitializationMuTextBox.ReadOnly = ReadOnly;
+      slopeInitializationSigmaTextBox.Enabled = Content != null;
+      slopeInitializationSigmaTextBox.ReadOnly = ReadOnly;
+
+      thresholdChangeMuTextBox.Enabled = Content != null;
+      thresholdChangeMuTextBox.ReadOnly = ReadOnly;
+      thresholdChangeSigmaTextBox.Enabled = Content != null;
+      thresholdChangeSigmaTextBox.ReadOnly = ReadOnly;
+      slopeChangeMuTextBox.Enabled = Content != null;
+      slopeChangeMuTextBox.ReadOnly = ReadOnly;
+      slopeChangeSigmaTextBox.Enabled = Content != null;
+      slopeChangeSigmaTextBox.ReadOnly = ReadOnly;
+    }
+
+    private void UpdateControl() {
+      if (Content == null) {
+        thresholdInitializationMuTextBox.Text = string.Empty;
+        thresholdInitializationSigmaTextBox.Text = string.Empty;
+        slopeInitializationMuTextBox.Text = string.Empty;
+        slopeInitializationSigmaTextBox.Text = string.Empty;
+        thresholdChangeMuTextBox.Text = string.Empty;
+        thresholdChangeSigmaTextBox.Text = string.Empty;
+        slopeChangeMuTextBox.Text = string.Empty;
+        slopeChangeSigmaTextBox.Text = string.Empty;
+        // temporarily deregister to prevent circular calling of events
+        DeregisterVariableNamesViewContentEvents();
+        variableNamesView.Content.Clear();
+        RegisterVariableNamesViewContentEvents();
+      } else {
+        // temporarily deregister to prevent circular calling of events
+        DeregisterVariableNamesViewContentEvents();
+        variableNamesView.Content.Clear();
+        foreach (var variableName in Content.AllVariableNames) {
+          variableNamesView.Content.Add(new StringValue(variableName), Content.VariableNames.Contains(variableName));
+        }
+        RegisterVariableNamesViewContentEvents();
+
+        thresholdInitializationMuTextBox.Text = Content.ThresholdInitializerMu.ToString();
+        thresholdInitializationSigmaTextBox.Text = Content.ThresholdInitializerSigma.ToString();
+        slopeInitializationMuTextBox.Text = Content.SlopeInitializerMu.ToString();
+        slopeInitializationSigmaTextBox.Text = Content.SlopeInitializerSigma.ToString();
+        thresholdChangeMuTextBox.Text = Content.ThresholdManipulatorMu.ToString();
+        thresholdChangeSigmaTextBox.Text = Content.ThresholdManipulatorSigma.ToString();
+        slopeChangeMuTextBox.Text = Content.SlopeManipulatorMu.ToString();
+        slopeChangeSigmaTextBox.Text = Content.SlopeManipulatorSigma.ToString();
+      }
+      SetEnabledStateOfControls();
+    }
+
+    #region control events
+    private void VariableNames_Changed(object sender, CollectionItemsChangedEventArgs<StringValue> e) {
+      foreach (var newVar in e.Items)
+        newVar.ValueChanged += new EventHandler(Variable_ValueChanged);
+      foreach (var oldVar in e.OldItems)
+        oldVar.ValueChanged -= new EventHandler(Variable_ValueChanged);
+      UpdateContent();
+    }
+
+    private void VariableNames_Removed(object sender, CollectionItemsChangedEventArgs<StringValue> e) {
+      foreach (var newVar in e.Items)
+        newVar.ValueChanged -= new EventHandler(Variable_ValueChanged);
+      UpdateContent();
+    }
+
+    private void Variable_ValueChanged(object sender, EventArgs e) {
+      UpdateContent();
+    }
+
+    private void UpdateContent() {
+      if (Content != null) {
+        DeregisterContentEvents();
+        Content.VariableNames = variableNamesView.Content.CheckedItems.Select(x => x.Value).ToList();
+        RegisterContentEvents();
+      }
+    }
+
+    private void ThresholdInitializationMuTextBox_TextChanged(object sender, EventArgs e) {
+      double value;
+      if (double.TryParse(thresholdInitializationMuTextBox.Text, out value)) {
+        Content.ThresholdInitializerMu = value;
+        errorProvider.SetError(thresholdInitializationMuTextBox, string.Empty);
+      } else errorProvider.SetError(thresholdInitializationMuTextBox, "Invalid value");
+    }
+    private void ThresholdInitializationSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double value;
+      if (double.TryParse(thresholdInitializationSigmaTextBox.Text, out value)) {
+        Content.ThresholdInitializerSigma = value;
+        errorProvider.SetError(thresholdInitializationSigmaTextBox, string.Empty);
+      } else errorProvider.SetError(thresholdInitializationSigmaTextBox, "Invalid value");
+    }
+    private void SlopeInitializationMuTextBox_TextChanged(object sender, EventArgs e) {
+      double value;
+      if (double.TryParse(slopeInitializationMuTextBox.Text, out value)) {
+        Content.SlopeInitializerMu = value;
+        errorProvider.SetError(slopeInitializationMuTextBox, string.Empty);
+      } else errorProvider.SetError(slopeInitializationMuTextBox, "Invalid value");
+    }
+    private void SlopeInitializationSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double value;
+      if (double.TryParse(slopeInitializationSigmaTextBox.Text, out value)) {
+        Content.SlopeInitializerSigma = value;
+        errorProvider.SetError(slopeInitializationSigmaTextBox, string.Empty);
+      } else errorProvider.SetError(slopeInitializationSigmaTextBox, "Invalid value");
+    }
+
+    private void ThresholdChangeMuTextBox_TextChanged(object sender, EventArgs e) {
+      double value;
+      if (double.TryParse(thresholdChangeMuTextBox.Text, out value)) {
+        Content.ThresholdManipulatorMu = value;
+        errorProvider.SetError(thresholdChangeMuTextBox, string.Empty);
+      } else errorProvider.SetError(thresholdChangeMuTextBox, "Invalid value");
+    }
+
+    private void ThresholdChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double value;
+      if (double.TryParse(thresholdChangeSigmaTextBox.Text, out value)) {
+        Content.ThresholdManipulatorSigma = value;
+        errorProvider.SetError(thresholdChangeSigmaTextBox, string.Empty);
+      } else errorProvider.SetError(thresholdChangeSigmaTextBox, "Invalid value");
+    }
+    private void SlopeChangeMuTextBox_TextChanged(object sender, EventArgs e) {
+      double value;
+      if (double.TryParse(slopeChangeMuTextBox.Text, out value)) {
+        Content.SlopeManipulatorMu = value;
+        errorProvider.SetError(slopeChangeMuTextBox, string.Empty);
+      } else errorProvider.SetError(slopeChangeMuTextBox, "Invalid value");
+    }
+
+    private void SlopeChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double value;
+      if (double.TryParse(slopeChangeSigmaTextBox.Text, out value)) {
+        Content.SlopeManipulatorSigma = value;
+        errorProvider.SetError(slopeChangeSigmaTextBox, string.Empty);
+      } else errorProvider.SetError(slopeChangeSigmaTextBox, "Invalid value");
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs	(revision 16132)
@@ -0,0 +1,341 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  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.weightInitializationMuTextBox = new System.Windows.Forms.TextBox();
+      this.initializationGroupBox = new System.Windows.Forms.GroupBox();
+      this.weightSigmaLabel = new System.Windows.Forms.Label();
+      this.weightInitializationSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.mutationGroupBox = new System.Windows.Forms.GroupBox();
+      this.varChangeProbTextBox = new System.Windows.Forms.TextBox();
+      this.varChangeProbLabel = new System.Windows.Forms.Label();
+      this.multiplicativeWeightChangeLabel = new System.Windows.Forms.Label();
+      this.multiplicativeWeightChangeSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.additiveWeightChangeLabel = new System.Windows.Forms.Label();
+      this.additiveWeightChangeSigmaTextBox = new System.Windows.Forms.TextBox();
+      this.tabControl = new System.Windows.Forms.TabControl();
+      this.variableNamesTabPage = new System.Windows.Forms.TabPage();
+      this.parametersTabPage = new System.Windows.Forms.TabPage();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.initializationGroupBox.SuspendLayout();
+      this.mutationGroupBox.SuspendLayout();
+      this.tabControl.SuspendLayout();
+      this.parametersTabPage.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // initialFrequencyLabel
+      // 
+      this.initialFrequencyLabel.TabIndex = 2;
+      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(311, 20);
+      this.initialFrequencyTextBox.TabIndex = 3;
+      // 
+      // enabledCheckBox
+      // 
+      this.enabledCheckBox.TabIndex = 8;
+      // 
+      // minimumArityLabel
+      // 
+      this.minimumArityLabel.TabIndex = 4;
+      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
+      // 
+      // maximumArityLabel
+      // 
+      this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol");
+      // 
+      // minimumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Size = new System.Drawing.Size(311, 20);
+      this.minimumArityTextBox.TabIndex = 5;
+      // 
+      // maximumArityTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Size = new System.Drawing.Size(311, 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(290, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(389, 3);
+      // 
+      // 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 = 0;
+      this.weightMuLabel.Text = "Weight (mu):";
+      this.toolTip.SetToolTip(this.weightMuLabel, "The mu (mean) parameter of the normal distribution to use for initial weights.");
+      // 
+      // weightInitializationMuTextBox
+      // 
+      this.weightInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.weightInitializationMuTextBox.Location = new System.Drawing.Point(92, 19);
+      this.weightInitializationMuTextBox.Name = "weightInitializationMuTextBox";
+      this.weightInitializationMuTextBox.Size = new System.Drawing.Size(290, 20);
+      this.weightInitializationMuTextBox.TabIndex = 1;
+      this.toolTip.SetToolTip(this.weightInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
+        "al weights.");
+      this.weightInitializationMuTextBox.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.weightInitializationSigmaTextBox);
+      this.initializationGroupBox.Controls.Add(this.weightMuLabel);
+      this.initializationGroupBox.Controls.Add(this.weightInitializationMuTextBox);
+      this.initializationGroupBox.Location = new System.Drawing.Point(6, 6);
+      this.initializationGroupBox.Name = "initializationGroupBox";
+      this.initializationGroupBox.Size = new System.Drawing.Size(388, 73);
+      this.initializationGroupBox.TabIndex = 0;
+      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 = 2;
+      this.weightSigmaLabel.Text = "Weight (sigma):";
+      this.toolTip.SetToolTip(this.weightSigmaLabel, "The sigma parameter for the normal distribution to use for the initial weights.");
+      // 
+      // weightInitializationSigmaTextBox
+      // 
+      this.weightInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.weightInitializationSigmaTextBox.Location = new System.Drawing.Point(92, 45);
+      this.weightInitializationSigmaTextBox.Name = "weightInitializationSigmaTextBox";
+      this.weightInitializationSigmaTextBox.Size = new System.Drawing.Size(290, 20);
+      this.weightInitializationSigmaTextBox.TabIndex = 3;
+      this.toolTip.SetToolTip(this.weightInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
+        "weights.");
+      this.weightInitializationSigmaTextBox.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.varChangeProbTextBox);
+      this.mutationGroupBox.Controls.Add(this.varChangeProbLabel);
+      this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeLabel);
+      this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeSigmaTextBox);
+      this.mutationGroupBox.Controls.Add(this.additiveWeightChangeLabel);
+      this.mutationGroupBox.Controls.Add(this.additiveWeightChangeSigmaTextBox);
+      this.mutationGroupBox.Location = new System.Drawing.Point(6, 85);
+      this.mutationGroupBox.Name = "mutationGroupBox";
+      this.mutationGroupBox.Size = new System.Drawing.Size(391, 97);
+      this.mutationGroupBox.TabIndex = 1;
+      this.mutationGroupBox.TabStop = false;
+      this.mutationGroupBox.Text = "Mutation";
+      // 
+      // varChangeProbTextBox
+      // 
+      this.varChangeProbTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.varChangeProbTextBox.Location = new System.Drawing.Point(201, 13);
+      this.varChangeProbTextBox.Name = "varChangeProbTextBox";
+      this.varChangeProbTextBox.Size = new System.Drawing.Size(184, 20);
+      this.varChangeProbTextBox.TabIndex = 1;
+      this.toolTip.SetToolTip(this.varChangeProbTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
+        "change in weight.");
+      this.varChangeProbTextBox.TextChanged += new System.EventHandler(this.VarProbTextBox_TextChanged);
+      // 
+      // varChangeProbLabel
+      // 
+      this.varChangeProbLabel.AutoSize = true;
+      this.varChangeProbLabel.Location = new System.Drawing.Point(6, 16);
+      this.varChangeProbLabel.Name = "varChangeProbLabel";
+      this.varChangeProbLabel.Size = new System.Drawing.Size(134, 13);
+      this.varChangeProbLabel.TabIndex = 0;
+      this.varChangeProbLabel.Text = "Variable change probability";
+      this.toolTip.SetToolTip(this.varChangeProbLabel, "The probability of changing the referenced variable in [0..1]. Variable reference" +
+        "s are sampled uniformly.");
+      // 
+      // multiplicativeWeightChangeLabel
+      // 
+      this.multiplicativeWeightChangeLabel.AutoSize = true;
+      this.multiplicativeWeightChangeLabel.Location = new System.Drawing.Point(6, 68);
+      this.multiplicativeWeightChangeLabel.Name = "multiplicativeWeightChangeLabel";
+      this.multiplicativeWeightChangeLabel.Size = new System.Drawing.Size(180, 13);
+      this.multiplicativeWeightChangeLabel.TabIndex = 4;
+      this.multiplicativeWeightChangeLabel.Text = "Multiplicative weight change (sigma):";
+      this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" +
+        " change in weight.");
+      // 
+      // multiplicativeWeightChangeSigmaTextBox
+      // 
+      this.multiplicativeWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 65);
+      this.multiplicativeWeightChangeSigmaTextBox.Name = "multiplicativeWeightChangeSigmaTextBox";
+      this.multiplicativeWeightChangeSigmaTextBox.Size = new System.Drawing.Size(184, 20);
+      this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 5;
+      this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" +
+        "tive change in weight.");
+      this.multiplicativeWeightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.MultiplicativeWeightChangeSigmaTextBox_TextChanged);
+      // 
+      // additiveWeightChangeLabel
+      // 
+      this.additiveWeightChangeLabel.AutoSize = true;
+      this.additiveWeightChangeLabel.Location = new System.Drawing.Point(6, 42);
+      this.additiveWeightChangeLabel.Name = "additiveWeightChangeLabel";
+      this.additiveWeightChangeLabel.Size = new System.Drawing.Size(157, 13);
+      this.additiveWeightChangeLabel.TabIndex = 2;
+      this.additiveWeightChangeLabel.Text = "Additive weight change (sigma):";
+      this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
+        "change in weight.");
+      // 
+      // additiveWeightChangeSigmaTextBox
+      // 
+      this.additiveWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 39);
+      this.additiveWeightChangeSigmaTextBox.Name = "additiveWeightChangeSigmaTextBox";
+      this.additiveWeightChangeSigmaTextBox.Size = new System.Drawing.Size(184, 20);
+      this.additiveWeightChangeSigmaTextBox.TabIndex = 3;
+      this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
+        "change in weight.");
+      this.additiveWeightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.AdditiveWeightChangeSigmaTextBox_TextChanged);
+      // 
+      // 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.variableNamesTabPage);
+      this.tabControl.Controls.Add(this.parametersTabPage);
+      this.tabControl.Location = new System.Drawing.Point(0, 127);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(408, 216);
+      this.tabControl.TabIndex = 9;
+      // 
+      // variableNamesTabPage
+      // 
+      this.variableNamesTabPage.Location = new System.Drawing.Point(4, 22);
+      this.variableNamesTabPage.Name = "variableNamesTabPage";
+      this.variableNamesTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.variableNamesTabPage.Size = new System.Drawing.Size(400, 190);
+      this.variableNamesTabPage.TabIndex = 0;
+      this.variableNamesTabPage.Text = "Variable Names";
+      this.variableNamesTabPage.UseVisualStyleBackColor = true;
+      // 
+      // parametersTabPage
+      // 
+      this.parametersTabPage.Controls.Add(this.mutationGroupBox);
+      this.parametersTabPage.Controls.Add(this.initializationGroupBox);
+      this.parametersTabPage.Location = new System.Drawing.Point(4, 22);
+      this.parametersTabPage.Name = "parametersTabPage";
+      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.parametersTabPage.Size = new System.Drawing.Size(400, 190);
+      this.parametersTabPage.TabIndex = 1;
+      this.parametersTabPage.Text = "Parameters";
+      this.parametersTabPage.UseVisualStyleBackColor = true;
+      // 
+      // VariableView
+      // 
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.tabControl);
+      this.Name = "VariableView";
+      this.Size = new System.Drawing.Size(408, 346);
+      this.Controls.SetChildIndex(this.enabledCheckBox, 0);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.tabControl, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.initializationGroupBox.ResumeLayout(false);
+      this.initializationGroupBox.PerformLayout();
+      this.mutationGroupBox.ResumeLayout(false);
+      this.mutationGroupBox.PerformLayout();
+      this.tabControl.ResumeLayout(false);
+      this.parametersTabPage.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.Label weightMuLabel;
+    protected System.Windows.Forms.TextBox weightInitializationMuTextBox;
+    protected System.Windows.Forms.GroupBox initializationGroupBox;
+    protected System.Windows.Forms.Label weightSigmaLabel;
+    protected System.Windows.Forms.TextBox weightInitializationSigmaTextBox;
+    protected System.Windows.Forms.GroupBox mutationGroupBox;
+    protected System.Windows.Forms.Label multiplicativeWeightChangeLabel;
+    protected System.Windows.Forms.TextBox multiplicativeWeightChangeSigmaTextBox;
+    protected System.Windows.Forms.Label additiveWeightChangeLabel;
+    protected System.Windows.Forms.TextBox additiveWeightChangeSigmaTextBox;
+    protected System.Windows.Forms.TabPage variableNamesTabPage;
+    protected System.Windows.Forms.TabPage parametersTabPage;
+    protected System.Windows.Forms.TabControl tabControl;
+    protected System.Windows.Forms.TextBox varChangeProbTextBox;
+    protected System.Windows.Forms.Label varChangeProbLabel;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs	(revision 16132)
@@ -0,0 +1,222 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm;
+
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [View("Variable View")]
+  [Content(typeof(VariableBase), true)]
+  public partial class VariableView : SymbolView {
+    private CheckedItemCollectionView<StringValue> variableNamesView;
+
+    public new VariableBase Content {
+      get { return (VariableBase)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public VariableView() {
+      InitializeComponent();
+      variableNamesView = new CheckedItemCollectionView<StringValue>();
+      variableNamesView.Dock = DockStyle.Fill;
+      variableNamesTabPage.Controls.Add(variableNamesView);
+      variableNamesView.Content = new CheckedItemCollection<StringValue>();
+
+      RegisterVariableNamesViewContentEvents();
+    }
+
+    private void RegisterVariableNamesViewContentEvents() {
+      variableNamesView.Content.ItemsAdded += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      variableNamesView.Content.ItemsRemoved += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Removed);
+      variableNamesView.Content.CheckedItemsChanged += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      variableNamesView.Content.CollectionReset += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      foreach (var variable in variableNamesView.Content) {
+        variable.ValueChanged += new EventHandler(Variable_ValueChanged);
+      }
+    }
+
+
+    private void DeregisterVariableNamesViewContentEvents() {
+      variableNamesView.Content.ItemsAdded -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      variableNamesView.Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Removed);
+      variableNamesView.Content.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      variableNamesView.Content.CollectionReset -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
+      foreach (var variable in variableNamesView.Content) {
+        variable.ValueChanged -= new EventHandler(Variable_ValueChanged);
+      }
+    }
+
+
+    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();
+      enabledCheckBox.Enabled = Content != null && Content.VariableNames.Any() && !Locked && !ReadOnly;
+      weightInitializationMuTextBox.Enabled = Content != null;
+      weightInitializationMuTextBox.ReadOnly = ReadOnly;
+      weightInitializationSigmaTextBox.Enabled = Content != null;
+      weightInitializationSigmaTextBox.ReadOnly = ReadOnly;
+      additiveWeightChangeSigmaTextBox.Enabled = Content != null;
+      additiveWeightChangeSigmaTextBox.ReadOnly = ReadOnly;
+      multiplicativeWeightChangeSigmaTextBox.Enabled = Content != null;
+      multiplicativeWeightChangeSigmaTextBox.ReadOnly = ReadOnly;
+      varChangeProbTextBox.Enabled = Content != null;
+      varChangeProbTextBox.ReadOnly = ReadOnly;
+    }
+
+    #region content event handlers
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+    #endregion
+
+    #region control event handlers
+    private void VariableNames_Changed(object sender, CollectionItemsChangedEventArgs<StringValue> e) {
+      foreach (var newVar in e.Items)
+        newVar.ValueChanged += new EventHandler(Variable_ValueChanged);
+      foreach (var oldVar in e.OldItems)
+        oldVar.ValueChanged -= new EventHandler(Variable_ValueChanged);
+      UpdateContent();
+    }
+
+    private void VariableNames_Removed(object sender, CollectionItemsChangedEventArgs<StringValue> e) {
+      foreach (var newVar in e.Items)
+        newVar.ValueChanged -= new EventHandler(Variable_ValueChanged);
+      UpdateContent();
+    }
+
+    private void Variable_ValueChanged(object sender, EventArgs e) {
+      UpdateContent();
+    }
+
+    private void UpdateContent() {
+      if (Content != null) {
+        Content.Fixed = true;
+        DeregisterContentEvents();
+        Content.VariableNames = variableNamesView.Content.CheckedItems.Select(x => x.Value);
+        Content.AllVariableNames = variableNamesView.Content.Select(x => x.Value);
+        RegisterContentEvents();
+      }
+    }
+
+    private void WeightMuTextBox_TextChanged(object sender, EventArgs e) {
+      double nu;
+      if (double.TryParse(weightInitializationMuTextBox.Text, out nu)) {
+        Content.WeightMu = nu;
+        errorProvider.SetError(weightInitializationMuTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(weightInitializationMuTextBox, "Invalid value");
+      }
+    }
+    private void WeightSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double sigma;
+      if (double.TryParse(weightInitializationSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
+        Content.WeightSigma = sigma;
+        errorProvider.SetError(weightInitializationSigmaTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(weightInitializationSigmaTextBox, "Invalid value");
+      }
+    }
+
+    private void AdditiveWeightChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double sigma;
+      if (double.TryParse(additiveWeightChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
+        Content.WeightManipulatorSigma = sigma;
+        errorProvider.SetError(additiveWeightChangeSigmaTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(additiveWeightChangeSigmaTextBox, "Invalid value");
+      }
+    }
+    private void MultiplicativeWeightChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
+      double sigma;
+      if (double.TryParse(multiplicativeWeightChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
+        Content.MultiplicativeWeightManipulatorSigma = sigma;
+        errorProvider.SetError(multiplicativeWeightChangeSigmaTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(multiplicativeWeightChangeSigmaTextBox, "Invalid value");
+      }
+    }
+
+    private void VarProbTextBox_TextChanged(object sender, EventArgs e) {
+      double prob;
+      if (double.TryParse(varChangeProbTextBox.Text, out prob) && prob >= 0.0 && prob <= 1.0) {
+        Content.VariableChangeProbability = prob;
+        errorProvider.SetError(varChangeProbTextBox, string.Empty);
+      } else {
+        errorProvider.SetError(varChangeProbTextBox, "Invalid value");
+      }
+    }
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        weightInitializationMuTextBox.Text = string.Empty;
+        weightInitializationSigmaTextBox.Text = string.Empty;
+        additiveWeightChangeSigmaTextBox.Text = string.Empty;
+        multiplicativeWeightChangeSigmaTextBox.Text = string.Empty;
+        varChangeProbTextBox.Text = string.Empty;
+        // temporarily deregister to prevent circular calling of events
+        DeregisterVariableNamesViewContentEvents();
+        variableNamesView.Content.Clear();
+        RegisterVariableNamesViewContentEvents();
+      } else {
+        // temporarily deregister to prevent circular calling of events
+        DeregisterVariableNamesViewContentEvents();
+        variableNamesView.Content.Clear();
+        foreach (var variableName in Content.AllVariableNames) {
+          variableNamesView.Content.Add(new StringValue(variableName), Content.VariableNames.Contains(variableName));
+        }
+        RegisterVariableNamesViewContentEvents();
+
+        weightInitializationMuTextBox.Text = Content.WeightMu.ToString();
+        weightInitializationSigmaTextBox.Text = Content.WeightSigma.ToString();
+        additiveWeightChangeSigmaTextBox.Text = Content.WeightManipulatorSigma.ToString();
+        multiplicativeWeightChangeSigmaTextBox.Text = Content.MultiplicativeWeightManipulatorSigma.ToString();
+        varChangeProbTextBox.Text = Content.VariableChangeProbability.ToString();
+      }
+      SetEnabledStateOfControls();
+    }
+    #endregion
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.cs	(revision 16132)
@@ -0,0 +1,48 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [View("Textual Representation")]
+  [Content(typeof(ISymbolicDataAnalysisModel), false)]
+  public partial class TextualSymbolicDataAnalysisModelView : AsynchronousContentView {
+    public TextualSymbolicDataAnalysisModelView()
+      : base() {
+      InitializeComponent();
+    }
+
+    public new ISymbolicDataAnalysisModel Content {
+      get { return (ISymbolicDataAnalysisModel)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null)
+        symbolicExpressionTreeView.Content = Content.SymbolicExpressionTree;
+      else
+        symbolicExpressionTreeView.Content = null;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.designer.cs	(revision 16132)
@@ -0,0 +1,77 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  partial class TextualSymbolicDataAnalysisModelView {
+    /// <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.symbolicExpressionTreeView = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionView();
+      this.SuspendLayout();
+      // 
+      // symbolicExpressionTreeView
+      // 
+      this.symbolicExpressionTreeView.AllowDrop = true;
+      this.symbolicExpressionTreeView.Caption = "Graphical SymbolicExpressionTree View";
+      this.symbolicExpressionTreeView.Content = null;
+      this.symbolicExpressionTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolicExpressionTreeView.Location = new System.Drawing.Point(0, 0);
+      this.symbolicExpressionTreeView.Name = "symbolicExpressionTreeView";
+      this.symbolicExpressionTreeView.ReadOnly = false;
+      this.symbolicExpressionTreeView.Size = new System.Drawing.Size(352, 413);
+      this.symbolicExpressionTreeView.TabIndex = 0;
+      // 
+      // TextualSymbolicDataAnalysisModelView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.symbolicExpressionTreeView);
+      this.Name = "TextualSymbolicDataAnalysisModelView";
+      this.Size = new System.Drawing.Size(352, 413);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+    private HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionView symbolicExpressionTreeView;
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.Designer.cs	(revision 16132)
@@ -0,0 +1,207 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.Symbolic.Views {
+  partial class SymbolicDataAnalysisGenealogyGraphView {
+    /// <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.selectedNodeStatusStrip = new System.Windows.Forms.StatusStrip();
+      this.colorModeLabel = new System.Windows.Forms.Label();
+      this.nodeColorsComboBox = new System.Windows.Forms.ComboBox();
+      this.traceCheckBox = new System.Windows.Forms.CheckBox();
+      this.createNewViewCheckBox = new System.Windows.Forms.CheckBox();
+      this.navigateRightButton = new System.Windows.Forms.Button();
+      this.navigateLeftButton = new System.Windows.Forms.Button();
+      this.lockCheckBox = new System.Windows.Forms.CheckBox();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // splitContainer
+      // 
+      this.splitContainer.Location = new System.Drawing.Point(3, 31);
+      // 
+      // splitContainer.Panel1
+      // 
+      this.splitContainer.Panel1.Controls.Add(this.selectedNodeStatusStrip);
+      this.splitContainer.Size = new System.Drawing.Size(1241, 721);
+      this.splitContainer.SplitterDistance = 617;
+      // 
+      // viewHost
+      // 
+      this.viewHost.Size = new System.Drawing.Size(617, 770);
+      // 
+      // genealogyGraphChart
+      // 
+      this.genealogyGraphChart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
+      this.genealogyGraphChart.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.genealogyGraphChart.Size = new System.Drawing.Size(617, 699);
+      // 
+      // selectedNodeStatusStrip
+      // 
+      this.selectedNodeStatusStrip.Location = new System.Drawing.Point(0, 699);
+      this.selectedNodeStatusStrip.Name = "selectedNodeStatusStrip";
+      this.selectedNodeStatusStrip.Size = new System.Drawing.Size(617, 22);
+      this.selectedNodeStatusStrip.TabIndex = 1;
+      this.selectedNodeStatusStrip.Text = "statusStrip1";
+      // 
+      // colorModeLabel
+      // 
+      this.colorModeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.colorModeLabel.AutoSize = true;
+      this.colorModeLabel.Location = new System.Drawing.Point(453, 9);
+      this.colorModeLabel.Name = "colorModeLabel";
+      this.colorModeLabel.Size = new System.Drawing.Size(39, 13);
+      this.colorModeLabel.TabIndex = 1;
+      this.colorModeLabel.Text = "Colors:";
+      // 
+      // nodeColorsComboBox
+      // 
+      this.nodeColorsComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.nodeColorsComboBox.FormattingEnabled = true;
+      this.nodeColorsComboBox.Items.AddRange(new object[] {
+            "Quality",
+            "Weight"});
+      this.nodeColorsComboBox.Location = new System.Drawing.Point(498, 6);
+      this.nodeColorsComboBox.Name = "nodeColorsComboBox";
+      this.nodeColorsComboBox.Size = new System.Drawing.Size(62, 21);
+      this.nodeColorsComboBox.TabIndex = 2;
+      this.nodeColorsComboBox.Text = "Quality";
+      this.nodeColorsComboBox.SelectedIndexChanged += new System.EventHandler(this.nodeColorsComboBox_SelectedIndexChanged);
+      // 
+      // traceCheckBox
+      // 
+      this.traceCheckBox.AutoSize = true;
+      this.traceCheckBox.Location = new System.Drawing.Point(3, 8);
+      this.traceCheckBox.Name = "traceCheckBox";
+      this.traceCheckBox.Size = new System.Drawing.Size(54, 17);
+      this.traceCheckBox.TabIndex = 3;
+      this.traceCheckBox.Text = "Trace";
+      this.traceCheckBox.UseVisualStyleBackColor = true;
+      // 
+      // createNewViewCheckBox
+      // 
+      this.createNewViewCheckBox.AutoSize = true;
+      this.createNewViewCheckBox.Location = new System.Drawing.Point(63, 8);
+      this.createNewViewCheckBox.Name = "createNewViewCheckBox";
+      this.createNewViewCheckBox.Size = new System.Drawing.Size(105, 17);
+      this.createNewViewCheckBox.TabIndex = 4;
+      this.createNewViewCheckBox.Text = "Create new view";
+      this.createNewViewCheckBox.UseVisualStyleBackColor = true;
+      // 
+      // navigateRightButton
+      // 
+      this.navigateRightButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.navigateRightButton.Image = global::HeuristicLab.Problems.DataAnalysis.Symbolic.Views.Properties.Resources.LargeLeftDiagonal_235;
+      this.navigateRightButton.Location = new System.Drawing.Point(595, 4);
+      this.navigateRightButton.Name = "navigateRightButton";
+      this.navigateRightButton.Size = new System.Drawing.Size(23, 23);
+      this.navigateRightButton.TabIndex = 5;
+      this.navigateRightButton.UseVisualStyleBackColor = true;
+      this.navigateRightButton.Click += new System.EventHandler(this.navigateRightButton_Click);
+      // 
+      // navigateLeftButton
+      // 
+      this.navigateLeftButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.navigateLeftButton.Image = global::HeuristicLab.Problems.DataAnalysis.Symbolic.Views.Properties.Resources.LargeRightDiagonal_238;
+      this.navigateLeftButton.Location = new System.Drawing.Point(566, 4);
+      this.navigateLeftButton.Name = "navigateLeftButton";
+      this.navigateLeftButton.Size = new System.Drawing.Size(23, 23);
+      this.navigateLeftButton.TabIndex = 6;
+      this.navigateLeftButton.UseVisualStyleBackColor = true;
+      this.navigateLeftButton.Click += new System.EventHandler(this.navigateLeftButton_Click);
+      // 
+      // lockCheckBox
+      // 
+      this.lockCheckBox.AutoSize = true;
+      this.lockCheckBox.Location = new System.Drawing.Point(174, 8);
+      this.lockCheckBox.Name = "lockCheckBox";
+      this.lockCheckBox.Size = new System.Drawing.Size(50, 17);
+      this.lockCheckBox.TabIndex = 7;
+      this.lockCheckBox.Text = "Lock";
+      this.lockCheckBox.UseVisualStyleBackColor = true;
+      this.lockCheckBox.CheckedChanged += new System.EventHandler(this.lockCheckBox_CheckedChanged);
+      // 
+      // SymbolicDataAnalysisGenealogyGraphView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.lockCheckBox);
+      this.Controls.Add(this.navigateLeftButton);
+      this.Controls.Add(this.navigateRightButton);
+      this.Controls.Add(this.createNewViewCheckBox);
+      this.Controls.Add(this.traceCheckBox);
+      this.Controls.Add(this.nodeColorsComboBox);
+      this.Controls.Add(this.colorModeLabel);
+      this.Name = "SymbolicDataAnalysisGenealogyGraphView";
+      this.Size = new System.Drawing.Size(1247, 755);
+      this.Controls.SetChildIndex(this.splitContainer, 0);
+      this.Controls.SetChildIndex(this.colorModeLabel, 0);
+      this.Controls.SetChildIndex(this.nodeColorsComboBox, 0);
+      this.Controls.SetChildIndex(this.traceCheckBox, 0);
+      this.Controls.SetChildIndex(this.createNewViewCheckBox, 0);
+      this.Controls.SetChildIndex(this.navigateRightButton, 0);
+      this.Controls.SetChildIndex(this.navigateLeftButton, 0);
+      this.Controls.SetChildIndex(this.lockCheckBox, 0);
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel1.PerformLayout();
+      this.splitContainer.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+      this.splitContainer.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+    private System.Windows.Forms.StatusStrip selectedNodeStatusStrip;
+    private System.Windows.Forms.Label colorModeLabel;
+    private System.Windows.Forms.ComboBox nodeColorsComboBox;
+    private System.Windows.Forms.CheckBox traceCheckBox;
+    private System.Windows.Forms.CheckBox createNewViewCheckBox;
+    private System.Windows.Forms.Button navigateRightButton;
+    private System.Windows.Forms.Button navigateLeftButton;
+    private System.Windows.Forms.CheckBox lockCheckBox;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs	(revision 16132)
@@ -0,0 +1,465 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Views;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.EvolutionTracking.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [View("SymbolicDataAnalysisGenealogyGraphView")]
+  [Content(typeof(IGenealogyGraph<ISymbolicExpressionTree>), IsDefaultView = true)]
+  public partial class SymbolicDataAnalysisGenealogyGraphView : SymbolicDataAnalysisGenealogyGraphViewDesignable {
+    private readonly ISymbolicExpressionTreeNodeEqualityComparer comparer;
+
+    private TraceData lastTd;
+
+    private ISymbolicExpressionTreeNode clonedSubtree;
+    private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> clonedMap;
+
+    private ISymbolicExpressionTreeNode selectedSubtree;
+    private ISymbolicExpressionTreeNode SelectedSubtree {
+      get { return selectedSubtree; }
+      set {
+        if (value == null) return;
+        selectedSubtree = value;
+        // the code below enables a "shadow" copy of the selected subtree which is used for matching against the graph 
+        clonedSubtree = (ISymbolicExpressionTreeNode)selectedSubtree.Clone();
+        clonedMap = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
+        var e1 = selectedSubtree.IterateNodesPrefix().GetEnumerator();
+        var e2 = clonedSubtree.IterateNodesPrefix().GetEnumerator();
+
+        while (e1.MoveNext() && e2.MoveNext()) {
+          clonedMap.Add(e1.Current, e2.Current);
+        }
+      }
+    }
+
+    // we use the symbolic expression tree chart to call the drawing routines
+    // and highlight relevant tree parts
+    public SymbolicExpressionTreeChart SymbolicExpressionTreeChart {
+      get {
+        var view = (GraphicalSymbolicExpressionTreeView)base.viewHost.ActiveView;
+        return view == null ? null : view.SymbolicExpressionTreeChart;
+      }
+    }
+
+    public SymbolicDataAnalysisGenealogyGraphView() {
+      InitializeComponent();
+      comparer = new SymbolicExpressionTreeNodeEqualityComparer();
+      viewHost.ViewType = typeof(GraphicalSymbolicExpressionTreeView);
+    }
+    #region event handlers
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null && Content != genealogyGraphChart.GenealogyGraph) {
+        genealogyGraphChart.GenealogyGraph = Content;
+      }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      if (SymbolicExpressionTreeChart != null)
+        SymbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked += treeChart_SymbolicExpressionTreeNodeClicked;
+    }
+
+    protected override void DeregisterContentEvents() {
+      if (SymbolicExpressionTreeChart != null)
+        SymbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked -= treeChart_SymbolicExpressionTreeNodeClicked;
+      base.DeregisterContentEvents();
+    }
+
+    public override void graphChart_GenealogyGraphNodeClicked(object sender, MouseEventArgs args) {
+      base.graphChart_GenealogyGraphNodeClicked(sender, args);
+      var visualNode = (VisualGenealogyGraphNode)sender;
+      var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)visualNode.Data;
+
+      lastTd = null;
+
+      selectedNodeStatusStrip.Text = string.Format("Quality: {0:0.00}, Rank: {1:0.0}, Degree: {2}/{3}, Weight: {4:0.00}",
+        graphNode.Quality, graphNode.Rank, graphNode.InDegree, graphNode.OutDegree, graphNode.Weight);
+
+      // update the righthand side tree view when another genealogy graph node is selected
+      UpdateTreeChart(graphNode);
+
+      if (!graphNode.InArcs.Any()) return; // node has no ancestors, nothing to do
+
+      if (createNewViewCheckBox.Checked) {
+        // get the ancestors into a new view
+        var cloner = new Cloner();
+        // clone arcs and vertices and use them to create a new graph 
+        // that will include just the individual and its ancestors
+        var graph = new GenealogyGraph<ISymbolicExpressionTree>();
+        var ancestors = new[] { graphNode }.Concat(graphNode.Ancestors).ToList();
+        graph.AddVertices(ancestors.Select(cloner.Clone));
+        graph.AddArcs(ancestors.SelectMany(x => x.InArcs).Select(cloner.Clone));
+        MainFormManager.MainForm.ShowContent(graph);
+      }
+    }
+
+    private void UpdateTreeChart(IGenealogyGraphNode<ISymbolicExpressionTree> graphNode) {
+      SymbolicExpressionTreeChart.Tree = graphNode.Data;
+      var nodes = graphNode.Data.IterateNodesPrefix().ToList();
+      // calculate max only in the current generation
+      var max = Content.Vertices.Max(x => x.Data.IterateNodesPrefix().Max(n => n.NodeWeight));
+      if (max.IsAlmost(0)) max = 1;
+      // we skip the program root node because it's useless for display and it just takes space in the chart 
+      foreach (var n in nodes.Skip(1)) {
+        var visualSymbolicExpressionTreeNode = SymbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(n);
+        visualSymbolicExpressionTreeNode.ToolTip += Environment.NewLine + string.Format("Weight: {0:0}", n.NodeWeight);
+        var i = (int)Math.Round(n.NodeWeight / max * 255);
+        var fillColor = Color.FromArgb(i, Color.Red);
+        treeChart_HighlightSubtree(n, null, fillColor);
+      }
+
+      if (!graphNode.InArcs.Any())
+        return;
+      var data = graphNode.InArcs.Last().Data;
+      var fragment = data as IFragment<ISymbolicExpressionTreeNode>;
+      var td = lastTd;
+
+      if (fragment != null) {
+        // highlight the fragment with a blue line color
+        foreach (var n in graphNode.Data.NodeAt(fragment.Index1).IterateNodesPrefix()) {
+          treeChart_HighlightSubtree(n, Color.CornflowerBlue);
+        }
+      } else if (td != null) {
+        // highlight traced subtree and fragment
+        if (td.SubtreeIndex == td.FragmentIndex) {
+          treeChart_HighlightSubtree(nodes[td.SubtreeIndex], Color.Purple);
+        } else if (td.SubtreeIndex < td.FragmentIndex) {
+          treeChart_HighlightSubtree(nodes[td.SubtreeIndex], Color.Orange);
+          treeChart_HighlightSubtree(nodes[td.FragmentIndex], Color.CornflowerBlue);
+        } else {
+          treeChart_HighlightSubtree(nodes[td.FragmentIndex], Color.CornflowerBlue);
+          treeChart_HighlightSubtree(nodes[td.SubtreeIndex], Color.Orange);
+        }
+      }
+    }
+
+    #region specific symbolic expression tree node click actions
+    private void OnTreeNodeLeftClicked(ISymbolicExpressionTreeNode node) {
+      SelectedSubtree = node;
+      bool trace = traceCheckBox.Checked;
+
+      // check whether we are in 'trace' or 'match' mode
+      if (trace) {
+        // perform fragment tracing
+        var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)genealogyGraphChart.SelectedGraphNode;
+        var subtreeIndex = graphNode.Data.IterateNodesPrefix().ToList().IndexOf(node);
+        var traceGraph = TraceCalculator.TraceSubtree(graphNode, subtreeIndex, updateVertexWeights: false, updateSubtreeWeights: false, cacheTraceNodes: true);
+
+        if (!traceGraph.Vertices.Any())
+          return;
+
+        genealogyGraphChart.SuspendRendering();
+        genealogyGraphChart.ClearPrimitives(); // clear everything
+        bool newView = createNewViewCheckBox.Checked;
+        if (newView) {
+          MainFormManager.MainForm.ShowContent(traceGraph);
+        } else {
+          genealogyGraphChart.SuspendRendering();
+          genealogyGraphChart.HighlightNodes(traceGraph.Vertices);
+          genealogyGraphChart.ResumeRendering();
+        }
+      } else {
+        // perform matching like it was done before
+        // currently there is no possibility to specify the subtree matching criteria
+        var trees = Content.Vertices.Select(x => x.Data);
+        //comparer.MatchVariableWeights = matchingModeButton.Checked;
+        //comparer.MatchConstantValues = matchingModeButton.Checked;
+        var matchingTrees = trees.Where(x => x.Root.ContainsSubtree(node, comparer));
+
+        var matchingVertices = matchingTrees.Select(x => Content.GetByContent(x));
+        graphChart_HighlightMatchingVertices(matchingVertices);
+      }
+    }
+
+    private void OnTreeNodeMiddleClicked(ISymbolicExpressionTreeNode node) {
+      ISymbolicExpressionTreeNode clone;
+      if (!clonedMap.TryGetValue(node, out clone)) return;
+      if (clone.Parent == null) return;
+      var cloneParent = clone.Parent;
+      var cloneIndex = cloneParent.IndexOfSubtree(clone);
+      cloneParent.RemoveSubtree(cloneIndex);
+      cloneParent.InsertSubtree(cloneIndex, new AnySubtreeSymbol().CreateTreeNode());
+
+      var trees = Content.Vertices.Select(x => x.Data);
+      //comparer.MatchVariableWeights = comparer.MatchConstantValues = matchingModeButton.Checked;
+      var matchingTrees = trees.Where(x => x.Root.ContainsSubtree(clonedSubtree, comparer));
+
+      var matchingVertices = matchingTrees.Select(x => Content.GetByContent(x));
+      treeChart_HighlightSubtree(node, Color.Black, Color.White);
+      graphChart_HighlightMatchingVertices(matchingVertices);
+    }
+    #endregion
+
+    public void treeChart_SymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs args) {
+      var visualNode = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender;
+      var subtree = visualNode.Content;
+
+      switch (args.Button) {
+        case MouseButtons.Left: {
+            // highlight the selected subtree inside the displayed tree on the right hand side
+            treeChart_ClearColors();
+            treeChart_HighlightSubtree(subtree, Color.Black, Color.RoyalBlue);
+
+            OnTreeNodeLeftClicked(subtree);
+            break;
+          }
+        case MouseButtons.Middle: {
+            OnTreeNodeMiddleClicked(subtree);
+            break;
+          }
+      }
+    }
+    #endregion
+
+    private void graphChart_HighlightMatchingVertices(IEnumerable<IGenealogyGraphNode> vertices) {
+      genealogyGraphChart.SuspendRendering();
+      genealogyGraphChart.ClearPrimitives();
+      genealogyGraphChart.HighlightNodes(vertices);
+      genealogyGraphChart.ResumeRendering();
+    }
+
+    #region treechart methods
+    private void treeChart_ClearColors() {
+      foreach (var node in SymbolicExpressionTreeChart.Tree.IterateNodesPrefix()) {
+        var visualNode = SymbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node);
+        if (visualNode != null) {
+          visualNode.LineColor = Color.Black;
+          visualNode.FillColor = Color.Transparent;
+        }
+      }
+      SymbolicExpressionTreeChart.RepaintNodes();
+    }
+
+    private void treeChart_HighlightSubtree(ISymbolicExpressionTreeNode subtree, Color? lineColor = null, Color? fillColor = null) {
+      if (lineColor == null && fillColor == null)
+        return;
+
+      foreach (var s in subtree.IterateNodesPrefix()) {
+        var visualNode = SymbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(s);
+        if (lineColor != null) {
+          visualNode.LineColor = (Color)lineColor;
+          foreach (var c in s.Subtrees) {
+            var visualArc = SymbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(s, c);
+            visualArc.LineColor = (Color)lineColor;
+          }
+        }
+        if (fillColor != null)
+          visualNode.FillColor = (Color)fillColor;
+      }
+      SymbolicExpressionTreeChart.RepaintNodes();
+    }
+    #endregion
+
+    #region navigate the genealogy / trace graph
+    private void navigateLeftButton_Click(object sender, EventArgs e) {
+      var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)genealogyGraphChart.SelectedGraphNode;
+      if (!graphNode.InArcs.Any()) return;
+
+      // check if the arc contains fragment data
+      var arc = graphNode.InArcs.First();
+      var fragment = arc.Data as IFragment<ISymbolicExpressionTreeNode>;
+
+      if (fragment != null) {
+        genealogyGraphChart.SelectedGraphNode = arc.Source;
+        UpdateTreeChart((IGenealogyGraphNode<ISymbolicExpressionTree>)arc.Source);
+        return;
+      }
+
+      var comp = new SymbolicExpressionTreeNodeEqualityComparer();
+
+      if (lastTd != null && graphNode.InDegree > 1) {
+        var descendant = graphNode.Data;
+        // going left (in the direction of the traced subtree): 
+        // the ancestor shares the same structure with the descendant, with the exception of the fragment
+        // thus we identify the right ancestor by comparing the remaining nodes
+        //var descendantNodes = descendant.Root.IterateNodesPrefix(lastTd.FragmentIndex);
+        // calculate the relative fragment preorder index. it will always be > 0 due to the way the trace graph is constructed
+        var relativeFragmentIndex = lastTd.FragmentIndex - lastTd.SubtreeIndex;
+        var descendantNodes = descendant.NodeAt(lastTd.SubtreeIndex).IterateNodesPrefix(relativeFragmentIndex);
+
+        var filteredArcs = graphNode.InArcs.Where(a => {
+          var td = a.Data as TraceData;
+          if (td == null)
+            return false;
+          if (!(td.LastSubtreeIndex == lastTd.SubtreeIndex && td.LastFragmentIndex == lastTd.FragmentIndex))
+            return false;
+          return true;
+        }).ToList();
+
+        if (filteredArcs.Count == 0)
+          return;
+
+        if (filteredArcs.Count == 1) {
+          arc = filteredArcs[0];
+        } else {
+          arc = filteredArcs.FirstOrDefault(
+         a => {
+           var ancestor = (ISymbolicExpressionTree)a.Source.Data;
+           var td = a.Data as TraceData;
+           if (td == null)
+             return false;
+           var ancestorNodes = ancestor.NodeAt(td.SubtreeIndex).IterateNodesPrefix(skipIndex: relativeFragmentIndex);
+           return descendantNodes.SequenceEqual(ancestorNodes, comp);
+         });
+        }
+      }
+      if (arc == null) return;
+      lastTd = arc.Data as TraceData;
+      genealogyGraphChart.SelectedGraphNode = arc.Source;
+      graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)arc.Source;
+      UpdateTreeChart(graphNode);
+
+      var inDegreeDistinct = graphNode.InArcs.Select(x => x.Source).Distinct().Count();
+      var outDegreeDistinct = graphNode.OutArcs.Select(x => x.Target).Distinct().Count();
+
+      selectedNodeStatusStrip.Text = string.Format("Quality: {0:0.00}, Rank: {1:0.0}, Degree: {2}/{3}, Weight: {4:0.00}",
+        graphNode.Quality, graphNode.Rank, inDegreeDistinct, outDegreeDistinct, graphNode.Weight);
+    }
+
+    private void navigateRightButton_Click(object sender, EventArgs e) {
+      var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)genealogyGraphChart.SelectedGraphNode;
+      if (!graphNode.InArcs.Any()) return;
+
+      // check if the arc contains fragment data
+      var arc = graphNode.InArcs.Last();
+      var fragment = arc.Data as IFragment<ISymbolicExpressionTreeNode>;
+      if (fragment != null) {
+        genealogyGraphChart.SelectedGraphNode = arc.Source;
+        UpdateTreeChart((IGenealogyGraphNode<ISymbolicExpressionTree>)arc.Source);
+        return;
+      }
+
+      if (lastTd != null && graphNode.InDegree > 1) {
+        var descendant = graphNode.Data;
+        // going right (in the direction of the fragment): 
+        // 1) fragment was swapped by crossover
+        // 2) fragment was introduced by mutation 
+        // in some cases mutation changes things completely so we do not know which way to go
+
+        var f = descendant.NodeAt(lastTd.FragmentIndex);
+        arc = graphNode.InArcs.FirstOrDefault(a => {
+          var td = a.Data as TraceData;
+          if (td == null) return false;
+          var ancestor = (ISymbolicExpressionTree)a.Source.Data;
+          return f.Difference(ancestor.NodeAt(td.SubtreeIndex)) == null;
+        });
+      }
+      if (arc == null) return;
+      lastTd = arc.Data as TraceData;
+      genealogyGraphChart.SelectedGraphNode = arc.Source;
+      graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)arc.Source;
+      UpdateTreeChart(graphNode);
+
+      var inDegreeDistinct = graphNode.InArcs.Select(x => x.Source).Distinct().Count();
+      var outDegreeDistinct = graphNode.OutArcs.Select(x => x.Target).Distinct().Count();
+
+      selectedNodeStatusStrip.Text = string.Format("Quality: {0:0.00}, Rank: {1:0.0}, Degree: {2}/{3}, Weight: {4:0.00}",
+        graphNode.Quality, graphNode.Rank, inDegreeDistinct, outDegreeDistinct, graphNode.Weight);
+    }
+
+    private void nodeColorsComboBox_SelectedIndexChanged(object sender, EventArgs e) {
+      switch (nodeColorsComboBox.SelectedIndex) {
+        case 0: // color by quality
+          genealogyGraphChart.ColorSelector = node => ColorGradient.Colors[(int)Math.Round(node.Quality * 255)];
+          genealogyGraphChart.SuspendRendering();
+          genealogyGraphChart.HighlightAll();
+          genealogyGraphChart.ResumeRendering();
+          break;
+        case 1: // color by weight
+          var weights = Content.Vertices.ToDictionary(v => (IGenealogyGraphNode)v, v => v.Data.IterateNodesPrefix().Average(x => x.NodeWeight));
+          var max = weights.Values.Max();
+          genealogyGraphChart.ColorSelector = node => ColorGradient.GrayscaledColors[(int)Math.Round(weights[node] / max * 255)];
+          genealogyGraphChart.SuspendRendering();
+          genealogyGraphChart.HighlightAll();
+          genealogyGraphChart.ResumeRendering();
+          break;
+        default:
+          break;
+      }
+    }
+
+    private void lockCheckBox_CheckedChanged(object sender, EventArgs e) {
+      genealogyGraphChart.LockGenealogy = lockCheckBox.Checked;
+    }
+  }
+  #endregion
+}
+
+// bogus class needed in order to be able to "design" the view
+public class SymbolicDataAnalysisGenealogyGraphViewDesignable : GenealogyGraphView<ISymbolicExpressionTree> { }
+
+#region helper methods
+internal static class Util {
+  internal static ISymbolicExpressionTreeNode NodeAt(this ISymbolicExpressionTree tree, int position) {
+    return NodeAt(tree.Root, position);
+  }
+
+  internal static ISymbolicExpressionTreeNode NodeAt(this ISymbolicExpressionTreeNode root, int position) {
+    return root.IterateNodesPrefix().ElementAt(position);
+  }
+
+  internal static bool IsIsomorphicWith(this ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+    return a.Difference(b) == null;
+  }
+
+  internal static IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix(this ISymbolicExpressionTreeNode node, int skipIndex) {
+    var e = node.IterateNodesPrefix().GetEnumerator();
+    var i = 0;
+    while (e.MoveNext()) {
+      var n = e.Current;
+      if (i == skipIndex) {
+        var len = n.GetLength();
+        while (--len >= 0 && e.MoveNext()) ;
+        n = e.Current;
+      }
+      if (n != null)
+        yield return n;
+      ++i;
+    }
+  }
+
+  internal static IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix(this ISymbolicExpressionTreeNode node, ISymbolicExpressionTreeNode skipNode) {
+    var e = node.IterateNodesPrefix().GetEnumerator();
+    while (e.MoveNext()) {
+      var n = e.Current;
+      if (n == skipNode) {
+        int len = n.GetLength();
+        while (--len >= 0 && e.MoveNext()) ;
+        n = e.Current;
+      }
+      if (n != null)
+        yield return n;
+    }
+  }
+}
+#endregion
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.Designer.cs	(revision 16132)
@@ -0,0 +1,162 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  partial class ConstantNodeEditDialog {
+    /// <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) {
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form 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.components = new System.ComponentModel.Container();
+      this.originalValueLabel = new System.Windows.Forms.Label();
+      this.oldValueTextBox = new System.Windows.Forms.TextBox();
+      this.newValueTextBox = new System.Windows.Forms.TextBox();
+      this.newValueLabel = new System.Windows.Forms.Label();
+      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
+      this.okButton = new System.Windows.Forms.Button();
+      this.cancelButton = new System.Windows.Forms.Button();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // originalValueLabel
+      // 
+      this.originalValueLabel.AutoSize = true;
+      this.originalValueLabel.Location = new System.Drawing.Point(12, 9);
+      this.originalValueLabel.Name = "originalValueLabel";
+      this.originalValueLabel.Size = new System.Drawing.Size(72, 13);
+      this.originalValueLabel.TabIndex = 2;
+      this.originalValueLabel.Text = "Original Value";
+      // 
+      // oldValueTextBox
+      // 
+      this.oldValueTextBox.Location = new System.Drawing.Point(106, 6);
+      this.oldValueTextBox.Name = "oldValueTextBox";
+      this.oldValueTextBox.ReadOnly = true;
+      this.oldValueTextBox.Size = new System.Drawing.Size(131, 20);
+      this.oldValueTextBox.TabIndex = 3;
+      // 
+      // newValueTextBox
+      // 
+      this.newValueTextBox.Location = new System.Drawing.Point(106, 32);
+      this.newValueTextBox.Name = "newValueTextBox";
+      this.newValueTextBox.Size = new System.Drawing.Size(131, 20);
+      this.newValueTextBox.TabIndex = 0;
+      this.newValueTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
+      this.newValueTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.newValueTextBox_Validating);
+      this.newValueTextBox.Validated += new System.EventHandler(this.newValueTextBox_Validated);
+      // 
+      // newValueLabel
+      // 
+      this.newValueLabel.AutoSize = true;
+      this.newValueLabel.Location = new System.Drawing.Point(12, 35);
+      this.newValueLabel.Name = "newValueLabel";
+      this.newValueLabel.Size = new System.Drawing.Size(59, 13);
+      this.newValueLabel.TabIndex = 5;
+      this.newValueLabel.Text = "New Value";
+      // 
+      // errorProvider
+      // 
+      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
+      this.errorProvider.ContainerControl = this;
+      this.errorProvider.RightToLeft = true;
+      // 
+      // okButton
+      // 
+      this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
+      this.okButton.Location = new System.Drawing.Point(81, 66);
+      this.okButton.Name = "okButton";
+      this.okButton.Size = new System.Drawing.Size(75, 23);
+      this.okButton.TabIndex = 8;
+      this.okButton.Text = "OK";
+      this.okButton.UseVisualStyleBackColor = true;
+      this.okButton.Click += new System.EventHandler(this.okButton_Click);
+      // 
+      // cancelButton
+      // 
+      this.cancelButton.CausesValidation = false;
+      this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+      this.cancelButton.Location = new System.Drawing.Point(162, 66);
+      this.cancelButton.Name = "cancelButton";
+      this.cancelButton.Size = new System.Drawing.Size(75, 23);
+      this.cancelButton.TabIndex = 9;
+      this.cancelButton.Text = "Cancel";
+      this.cancelButton.UseVisualStyleBackColor = true;
+      this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
+      // 
+      // ConstantNodeEditDialog
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.AutoSize = true;
+      this.CancelButton = this.cancelButton;
+      this.ClientSize = new System.Drawing.Size(248, 101);
+      this.ControlBox = false;
+      this.Controls.Add(this.cancelButton);
+      this.Controls.Add(this.okButton);
+      this.Controls.Add(this.newValueLabel);
+      this.Controls.Add(this.newValueTextBox);
+      this.Controls.Add(this.oldValueTextBox);
+      this.Controls.Add(this.originalValueLabel);
+      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+      this.MaximizeBox = false;
+      this.MinimizeBox = false;
+      this.Name = "ConstantNodeEditDialog";
+      this.ShowIcon = false;
+      this.ShowInTaskbar = false;
+      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+      this.Text = "Edit constant value";
+      this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ConstantNodeEditDialog_KeyDown);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label originalValueLabel;
+    private System.Windows.Forms.TextBox oldValueTextBox;
+    private System.Windows.Forms.Label newValueLabel;
+    private System.Windows.Forms.ErrorProvider errorProvider;
+    private System.Windows.Forms.Button cancelButton;
+    private System.Windows.Forms.Button okButton;
+    public System.Windows.Forms.TextBox newValueTextBox;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.cs	(revision 16132)
@@ -0,0 +1,125 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.ComponentModel;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  public partial class ConstantNodeEditDialog : Form {
+    private ConstantTreeNode constantTreeNode;
+    public ConstantTreeNode NewNode {
+      get { return constantTreeNode; }
+      set {
+        if (InvokeRequired)
+          Invoke(new Action<SymbolicExpressionTreeNode>(x => constantTreeNode = (ConstantTreeNode)x), value);
+        else
+          constantTreeNode = value;
+      }
+    }
+
+    public ConstantNodeEditDialog(ISymbolicExpressionTreeNode node) {
+      InitializeComponent();
+      oldValueTextBox.TabStop = false; // cannot receive focus using tab key
+      NewNode = (ConstantTreeNode)node;
+      InitializeFields();
+    }
+
+    private void InitializeFields() {
+      if (NewNode == null)
+        throw new ArgumentException("Node is not a constant.");
+      else {
+        this.Text = "Edit constant";
+        newValueTextBox.Text = oldValueTextBox.Text = Math.Round(constantTreeNode.Value, 4).ToString();
+      }
+    }
+
+    #region text box validation and events
+    private void newValueTextBox_Validating(object sender, CancelEventArgs e) {
+      string errorMessage;
+      if (!ValidateNewValue(newValueTextBox.Text, out errorMessage)) {
+        e.Cancel = true;
+        errorProvider.SetError(newValueTextBox, errorMessage);
+        newValueTextBox.SelectAll();
+      }
+    }
+
+    private void newValueTextBox_Validated(object sender, EventArgs e) {
+      errorProvider.SetError(newValueTextBox, string.Empty);
+    }
+
+    private static bool ValidateNewValue(string value, out string errorMessage) {
+      double val;
+      bool valid = double.TryParse(value, out val);
+      errorMessage = string.Empty;
+      if (!valid) {
+        var sb = new StringBuilder();
+        sb.Append("Invalid Value (Valid Value Format: \"");
+        sb.Append(FormatPatterns.GetDoubleFormatPattern());
+        sb.Append("\")");
+        errorMessage = sb.ToString();
+      }
+      return valid;
+    }
+    #endregion
+
+    // proxy handler passing key strokes to the parent control
+    private void childControl_KeyDown(object sender, KeyEventArgs e) {
+      ConstantNodeEditDialog_KeyDown(sender, e);
+    }
+
+    private void ConstantNodeEditDialog_KeyDown(object sender, KeyEventArgs e) {
+      if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return)) {
+        if (!ValidateChildren()) return;
+        OnDialogValidated(this, e); // emit validated effect
+        Close();
+      }
+    }
+
+    public event EventHandler DialogValidated;
+    private void OnDialogValidated(object sender, EventArgs e) {
+      if (constantTreeNode == null) return;
+      var value = double.Parse(newValueTextBox.Text);
+      // we impose an extra validation condition: that the new value is different from the original value
+      if (constantTreeNode.Value.Equals(value)) return;
+
+      constantTreeNode.Value = value;
+      DialogResult = DialogResult.OK;
+      var dialogValidated = DialogValidated;
+      if (dialogValidated != null)
+        dialogValidated(sender, e);
+    }
+
+    private void cancelButton_Click(object sender, EventArgs e) {
+      Close();
+    }
+
+    private void okButton_Click(object sender, EventArgs e) {
+      if (ValidateChildren()) {
+        OnDialogValidated(this, e);
+        Close();
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.Designer.cs	(revision 16132)
@@ -0,0 +1,222 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  partial class InsertNodeDialog {
+    /// <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 Windows Form 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.components = new System.ComponentModel.Container();
+      this.nodeSymbolLabel = new System.Windows.Forms.Label();
+      this.allowedSymbolsCombo = new System.Windows.Forms.ComboBox();
+      this.variableWeightLabel = new System.Windows.Forms.Label();
+      this.variableNameLabel = new System.Windows.Forms.Label();
+      this.variableNamesCombo = new System.Windows.Forms.ComboBox();
+      this.variableWeightTextBox = new System.Windows.Forms.TextBox();
+      this.constantValueTextBox = new System.Windows.Forms.TextBox();
+      this.constantValueLabel = new System.Windows.Forms.Label();
+      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
+      this.okButton = new System.Windows.Forms.Button();
+      this.cancelButton = new System.Windows.Forms.Button();
+      this.variableNameTextBox = new System.Windows.Forms.TextBox();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // nodeSymbolLabel
+      // 
+      this.nodeSymbolLabel.AutoSize = true;
+      this.nodeSymbolLabel.Location = new System.Drawing.Point(19, 13);
+      this.nodeSymbolLabel.Name = "nodeSymbolLabel";
+      this.nodeSymbolLabel.Size = new System.Drawing.Size(41, 13);
+      this.nodeSymbolLabel.TabIndex = 0;
+      this.nodeSymbolLabel.Text = "Symbol";
+      // 
+      // allowedSymbolsCombo
+      // 
+      this.allowedSymbolsCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.allowedSymbolsCombo.FormattingEnabled = true;
+      this.allowedSymbolsCombo.Location = new System.Drawing.Point(101, 10);
+      this.allowedSymbolsCombo.Name = "allowedSymbolsCombo";
+      this.allowedSymbolsCombo.Size = new System.Drawing.Size(127, 21);
+      this.allowedSymbolsCombo.TabIndex = 1;
+      this.allowedSymbolsCombo.SelectedIndexChanged += new System.EventHandler(this.allowedSymbolsCombo_SelectedIndexChanged);
+      this.allowedSymbolsCombo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
+      // 
+      // variableWeightLabel
+      // 
+      this.variableWeightLabel.AutoSize = true;
+      this.variableWeightLabel.Location = new System.Drawing.Point(19, 40);
+      this.variableWeightLabel.Name = "variableWeightLabel";
+      this.variableWeightLabel.Size = new System.Drawing.Size(41, 13);
+      this.variableWeightLabel.TabIndex = 2;
+      this.variableWeightLabel.Text = "Weight";
+      this.variableWeightLabel.Visible = false;
+      // 
+      // variableNameLabel
+      // 
+      this.variableNameLabel.AutoSize = true;
+      this.variableNameLabel.Location = new System.Drawing.Point(19, 66);
+      this.variableNameLabel.Name = "variableNameLabel";
+      this.variableNameLabel.Size = new System.Drawing.Size(35, 13);
+      this.variableNameLabel.TabIndex = 3;
+      this.variableNameLabel.Text = "Name";
+      this.variableNameLabel.Visible = false;
+      // 
+      // variableNamesCombo
+      // 
+      this.variableNamesCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.variableNamesCombo.FormattingEnabled = true;
+      this.variableNamesCombo.Location = new System.Drawing.Point(101, 63);
+      this.variableNamesCombo.Name = "variableNamesCombo";
+      this.variableNamesCombo.Size = new System.Drawing.Size(127, 21);
+      this.variableNamesCombo.TabIndex = 5;
+      this.variableNamesCombo.Visible = false;
+      // 
+      // variableWeightTextBox
+      // 
+      this.variableWeightTextBox.Location = new System.Drawing.Point(101, 37);
+      this.variableWeightTextBox.Name = "variableWeightTextBox";
+      this.variableWeightTextBox.Size = new System.Drawing.Size(127, 20);
+      this.variableWeightTextBox.TabIndex = 6;
+      this.variableWeightTextBox.Text = "0.0";
+      this.variableWeightTextBox.Visible = false;
+      this.variableWeightTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.variableWeightTextBox_Validating);
+      // 
+      // constantValueTextBox
+      // 
+      this.constantValueTextBox.Location = new System.Drawing.Point(101, 37);
+      this.constantValueTextBox.Name = "constantValueTextBox";
+      this.constantValueTextBox.Size = new System.Drawing.Size(127, 20);
+      this.constantValueTextBox.TabIndex = 7;
+      this.constantValueTextBox.Text = "0.0";
+      this.constantValueTextBox.Visible = false;
+      this.constantValueTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.constantValueTextBox_Validating);
+      // 
+      // constantValueLabel
+      // 
+      this.constantValueLabel.AutoSize = true;
+      this.constantValueLabel.Location = new System.Drawing.Point(19, 40);
+      this.constantValueLabel.Name = "constantValueLabel";
+      this.constantValueLabel.Size = new System.Drawing.Size(34, 13);
+      this.constantValueLabel.TabIndex = 8;
+      this.constantValueLabel.Text = "Value";
+      this.constantValueLabel.Visible = false;
+      // 
+      // errorProvider
+      // 
+      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
+      this.errorProvider.ContainerControl = this;
+      this.errorProvider.RightToLeft = true;
+      // 
+      // okButton
+      // 
+      this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
+      this.okButton.Location = new System.Drawing.Point(72, 98);
+      this.okButton.Name = "okButton";
+      this.okButton.Size = new System.Drawing.Size(75, 23);
+      this.okButton.TabIndex = 9;
+      this.okButton.Text = "OK";
+      this.okButton.UseVisualStyleBackColor = true;
+      this.okButton.Click += new System.EventHandler(this.okButton_Click);
+      // 
+      // cancelButton
+      // 
+      this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+      this.cancelButton.Location = new System.Drawing.Point(153, 98);
+      this.cancelButton.Name = "cancelButton";
+      this.cancelButton.Size = new System.Drawing.Size(75, 23);
+      this.cancelButton.TabIndex = 10;
+      this.cancelButton.Text = "Cancel";
+      this.cancelButton.UseVisualStyleBackColor = true;
+      this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
+      // 
+      // variableNameTextBox
+      // 
+      this.variableNameTextBox.Location = new System.Drawing.Point(101, 63);
+      this.variableNameTextBox.Name = "variableNameTextBox";
+      this.variableNameTextBox.Size = new System.Drawing.Size(127, 20);
+      this.variableNameTextBox.TabIndex = 11;
+      this.variableNameTextBox.Visible = false;
+      // 
+      // InsertNodeDialog
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.CancelButton = this.cancelButton;
+      this.ClientSize = new System.Drawing.Size(241, 133);
+      this.ControlBox = false;
+      this.Controls.Add(this.variableNameTextBox);
+      this.Controls.Add(this.cancelButton);
+      this.Controls.Add(this.okButton);
+      this.Controls.Add(this.constantValueLabel);
+      this.Controls.Add(this.constantValueTextBox);
+      this.Controls.Add(this.variableWeightTextBox);
+      this.Controls.Add(this.variableNamesCombo);
+      this.Controls.Add(this.variableNameLabel);
+      this.Controls.Add(this.variableWeightLabel);
+      this.Controls.Add(this.allowedSymbolsCombo);
+      this.Controls.Add(this.nodeSymbolLabel);
+      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+      this.Name = "InsertNodeDialog";
+      this.Text = "SymbolicExpressionTreeNodeInsertDialog";
+      this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.insertNodeDialog_KeyDown);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label nodeSymbolLabel;
+    private System.Windows.Forms.ComboBox allowedSymbolsCombo;
+    private System.Windows.Forms.Label variableWeightLabel;
+    private System.Windows.Forms.Label variableNameLabel;
+    private System.Windows.Forms.Label constantValueLabel;
+    private System.Windows.Forms.ErrorProvider errorProvider;
+    internal System.Windows.Forms.TextBox constantValueTextBox;
+    internal System.Windows.Forms.TextBox variableWeightTextBox;
+    internal System.Windows.Forms.ComboBox variableNamesCombo;
+    private System.Windows.Forms.Button cancelButton;
+    private System.Windows.Forms.Button okButton;
+    private System.Windows.Forms.TextBox variableNameTextBox;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs	(revision 16132)
@@ -0,0 +1,158 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  public partial class InsertNodeDialog : Form {
+    public string SelectedVariableName {
+      get {
+        var variable = SelectedSymbol as Variable;
+        if (variable == null)
+          return string.Empty;
+        return variable.VariableNames.Any() ? variableNamesCombo.Text : variableNameTextBox.Text;
+      }
+    }
+
+    public InsertNodeDialog() {
+      InitializeComponent();
+    }
+
+    public void SetAllowedSymbols(IEnumerable<ISymbol> symbols) {
+      allowedSymbolsCombo.Items.Clear();
+      foreach (var s in symbols) allowedSymbolsCombo.Items.Add(s);
+      allowedSymbolsCombo.SelectedIndex = 0;
+    }
+
+    public ISymbol SelectedSymbol {
+      get { return (ISymbol)allowedSymbolsCombo.SelectedItem; }
+    }
+
+    private void allowedSymbolsCombo_SelectedIndexChanged(object sender, EventArgs e) {
+      var combo = (ComboBox)sender;
+      var symbol = combo.Items[combo.SelectedIndex];
+      if (symbol is Constant) {
+        // add controls to the dialog for changing the constant value
+        variableNameLabel.Visible = false;
+        variableNamesCombo.Visible = false;
+        variableWeightLabel.Visible = false;
+        variableWeightTextBox.Visible = false;
+        constantValueLabel.Visible = true;
+        constantValueTextBox.Visible = true;
+      } else if (symbol is VariableBase) {
+        var variableSymbol = (VariableBase)symbol;
+        if (variableSymbol.VariableNames.Any()) {
+          foreach (var name in variableSymbol.VariableNames)
+            variableNamesCombo.Items.Add(name);
+          variableNamesCombo.SelectedIndex = 0;
+          variableNamesCombo.Visible = true;
+          variableNameTextBox.Visible = false;
+        } else {
+          variableNamesCombo.Visible = false;
+          variableNameTextBox.Visible = true;
+        }
+        variableNameLabel.Visible = true;
+        variableWeightLabel.Visible = true;
+        variableWeightTextBox.Visible = true;
+        constantValueLabel.Visible = false;
+        constantValueTextBox.Visible = false;
+        // add controls to the dialog for changing the variable name or weight
+      } else {
+        variableNameLabel.Visible = false;
+        variableNamesCombo.Visible = false;
+        variableWeightLabel.Visible = false;
+        variableWeightTextBox.Visible = false;
+        constantValueLabel.Visible = false;
+        constantValueTextBox.Visible = false;
+      }
+    }
+
+    // validation
+    private void variableWeightTextBox_Validating(object sender, CancelEventArgs e) {
+      string errorMessage;
+      if (ValidateDoubleValue(variableWeightTextBox.Text, out errorMessage)) return;
+      e.Cancel = true;
+      errorProvider.SetError(variableWeightTextBox, errorMessage);
+      variableWeightTextBox.SelectAll();
+    }
+
+    private void constantValueTextBox_Validating(object sender, CancelEventArgs e) {
+      string errorMessage;
+      if (ValidateDoubleValue(constantValueTextBox.Text, out errorMessage)) return;
+      e.Cancel = true;
+      errorProvider.SetError(constantValueTextBox, errorMessage);
+      constantValueTextBox.SelectAll();
+    }
+
+    private static bool ValidateDoubleValue(string value, out string errorMessage) {
+      double val;
+      bool valid = double.TryParse(value, out val);
+      errorMessage = string.Empty;
+      if (!valid) {
+        var sb = new StringBuilder();
+        sb.Append("Invalid Value (Valid Value Format: \"");
+        sb.Append(FormatPatterns.GetDoubleFormatPattern());
+        sb.Append("\")");
+        errorMessage = sb.ToString();
+      }
+      return valid;
+    }
+
+    public event EventHandler DialogValidated;
+    private void OnDialogValidated(object sender, EventArgs e) {
+      DialogResult = DialogResult.OK;
+      var dialogValidated = DialogValidated;
+      if (dialogValidated != null)
+        dialogValidated(sender, e);
+    }
+
+    private void childControl_KeyDown(object sender, KeyEventArgs e) {
+      insertNodeDialog_KeyDown(sender, e);
+    }
+
+    private void insertNodeDialog_KeyDown(object sender, KeyEventArgs e) {
+      if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) {
+        if (ValidateChildren()) {
+          OnDialogValidated(this, e);
+          Close();
+        }
+      }
+    }
+
+    private void okButton_Click(object sender, EventArgs e) {
+      if (ValidateChildren()) {
+        OnDialogValidated(this, e);
+        Close();
+      }
+    }
+
+    private void cancelButton_Click(object sender, EventArgs e) {
+      Close();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.Designer.cs	(revision 16132)
@@ -0,0 +1,202 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic.Views {
+  partial class VariableNodeEditDialog {
+    /// <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) {
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form 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.components = new System.ComponentModel.Container();
+      this.originalValueLabel = new System.Windows.Forms.Label();
+      this.oldValueTextBox = new System.Windows.Forms.TextBox();
+      this.newValueTextBox = new System.Windows.Forms.TextBox();
+      this.newValueLabel = new System.Windows.Forms.Label();
+      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
+      this.variableNameLabel = new System.Windows.Forms.Label();
+      this.variableNamesCombo = new System.Windows.Forms.ComboBox();
+      this.okButton = new System.Windows.Forms.Button();
+      this.cancelButton = new System.Windows.Forms.Button();
+      this.variableNameTextBox = new System.Windows.Forms.TextBox();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // originalValueLabel
+      // 
+      this.originalValueLabel.AutoSize = true;
+      this.originalValueLabel.Location = new System.Drawing.Point(6, 42);
+      this.originalValueLabel.Name = "originalValueLabel";
+      this.originalValueLabel.Size = new System.Drawing.Size(72, 13);
+      this.originalValueLabel.TabIndex = 2;
+      this.originalValueLabel.Text = "Original Value";
+      // 
+      // oldValueTextBox
+      // 
+      this.oldValueTextBox.Location = new System.Drawing.Point(101, 39);
+      this.oldValueTextBox.Name = "oldValueTextBox";
+      this.oldValueTextBox.ReadOnly = true;
+      this.oldValueTextBox.Size = new System.Drawing.Size(131, 20);
+      this.oldValueTextBox.TabIndex = 3;
+      // 
+      // newValueTextBox
+      // 
+      this.newValueTextBox.Location = new System.Drawing.Point(101, 65);
+      this.newValueTextBox.Name = "newValueTextBox";
+      this.newValueTextBox.Size = new System.Drawing.Size(131, 20);
+      this.newValueTextBox.TabIndex = 0;
+      this.newValueTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
+      this.newValueTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.newValueTextBox_Validating);
+      this.newValueTextBox.Validated += new System.EventHandler(this.newValueTextBox_Validated);
+      // 
+      // newValueLabel
+      // 
+      this.newValueLabel.AutoSize = true;
+      this.newValueLabel.Location = new System.Drawing.Point(6, 68);
+      this.newValueLabel.Name = "newValueLabel";
+      this.newValueLabel.Size = new System.Drawing.Size(59, 13);
+      this.newValueLabel.TabIndex = 5;
+      this.newValueLabel.Text = "New Value";
+      // 
+      // errorProvider
+      // 
+      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
+      this.errorProvider.ContainerControl = this;
+      this.errorProvider.RightToLeft = true;
+      // 
+      // variableNameLabel
+      // 
+      this.variableNameLabel.AutoSize = true;
+      this.variableNameLabel.Location = new System.Drawing.Point(6, 15);
+      this.variableNameLabel.Name = "variableNameLabel";
+      this.variableNameLabel.Size = new System.Drawing.Size(76, 13);
+      this.variableNameLabel.TabIndex = 6;
+      this.variableNameLabel.Text = "Variable Name";
+      this.variableNameLabel.Visible = false;
+      // 
+      // variableNamesCombo
+      // 
+      this.variableNamesCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.variableNamesCombo.FormattingEnabled = true;
+      this.variableNamesCombo.Location = new System.Drawing.Point(101, 12);
+      this.variableNamesCombo.Name = "variableNamesCombo";
+      this.variableNamesCombo.Size = new System.Drawing.Size(131, 21);
+      this.variableNamesCombo.TabIndex = 7;
+      this.variableNamesCombo.Visible = false;
+      this.variableNamesCombo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.childControl_KeyDown);
+      this.variableNamesCombo.Validating += new System.ComponentModel.CancelEventHandler(this.variableNamesCombo_Validating);
+      this.variableNamesCombo.Validated += new System.EventHandler(this.variableNamesCombo_Validated);
+      // 
+      // okButton
+      // 
+      this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
+      this.okButton.Location = new System.Drawing.Point(75, 98);
+      this.okButton.Name = "okButton";
+      this.okButton.Size = new System.Drawing.Size(75, 23);
+      this.okButton.TabIndex = 8;
+      this.okButton.Text = "OK";
+      this.okButton.UseVisualStyleBackColor = true;
+      this.okButton.Click += new System.EventHandler(this.okButton_Click);
+      // 
+      // cancelButton
+      // 
+      this.cancelButton.CausesValidation = false;
+      this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+      this.cancelButton.Location = new System.Drawing.Point(156, 98);
+      this.cancelButton.Name = "cancelButton";
+      this.cancelButton.Size = new System.Drawing.Size(75, 23);
+      this.cancelButton.TabIndex = 9;
+      this.cancelButton.Text = "Cancel";
+      this.cancelButton.UseVisualStyleBackColor = true;
+      this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
+      // 
+      // variableNameTextBox
+      // 
+      this.variableNameTextBox.Location = new System.Drawing.Point(101, 12);
+      this.variableNameTextBox.Name = "variableNameTextBox";
+      this.variableNameTextBox.Size = new System.Drawing.Size(131, 20);
+      this.variableNameTextBox.TabIndex = 12;
+      this.variableNameTextBox.Visible = false;
+      // 
+      // VariableNodeEditDialog
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.AutoSize = true;
+      this.CancelButton = this.cancelButton;
+      this.ClientSize = new System.Drawing.Size(244, 134);
+      this.ControlBox = false;
+      this.Controls.Add(this.variableNameTextBox);
+      this.Controls.Add(this.cancelButton);
+      this.Controls.Add(this.okButton);
+      this.Controls.Add(this.variableNamesCombo);
+      this.Controls.Add(this.variableNameLabel);
+      this.Controls.Add(this.newValueLabel);
+      this.Controls.Add(this.newValueTextBox);
+      this.Controls.Add(this.oldValueTextBox);
+      this.Controls.Add(this.originalValueLabel);
+      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+      this.MaximizeBox = false;
+      this.MinimizeBox = false;
+      this.Name = "VariableNodeEditDialog";
+      this.ShowIcon = false;
+      this.ShowInTaskbar = false;
+      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+      this.Text = "Change Value or Weight";
+      this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ValueChangeDialog_KeyDown);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label originalValueLabel;
+    private System.Windows.Forms.TextBox oldValueTextBox;
+    private System.Windows.Forms.Label newValueLabel;
+    private System.Windows.Forms.ErrorProvider errorProvider;
+    private System.Windows.Forms.Label variableNameLabel;
+    private System.Windows.Forms.Button cancelButton;
+    private System.Windows.Forms.Button okButton;
+    public System.Windows.Forms.TextBox newValueTextBox;
+    public System.Windows.Forms.ComboBox variableNamesCombo;
+    private System.Windows.Forms.TextBox variableNameTextBox;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.cs	(revision 16132)
@@ -0,0 +1,162 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  public partial class VariableNodeEditDialog : Form {
+    private VariableTreeNode variableTreeNode;
+    public VariableTreeNode NewNode {
+      get { return variableTreeNode; }
+      set {
+        if (InvokeRequired) {
+          Invoke(new Action<SymbolicExpressionTreeNode>(x =>
+          {
+            variableTreeNode = (VariableTreeNode) x;
+            variableNameTextBox.Text = variableTreeNode.VariableName;
+          }), value);
+        } else {
+          variableTreeNode = value;
+          variableNameTextBox.Text = variableTreeNode.VariableName;
+        }
+      }
+    }
+
+    public string SelectedVariableName {
+      get { return variableNamesCombo.Visible ? variableNamesCombo.Text : variableNameTextBox.Text; }
+    }
+
+    public VariableNodeEditDialog(ISymbolicExpressionTreeNode node) {
+      InitializeComponent();
+      oldValueTextBox.TabStop = false; // cannot receive focus using tab key
+      NewNode = (VariableTreeNode)node; // will throw an invalid cast exception if node is not of the correct type
+      InitializeFields();
+    }
+
+    private void InitializeFields() {
+      if (NewNode == null)
+        throw new ArgumentException("Node is not a constant.");
+      else {
+        this.Text = "Edit variable";
+        newValueTextBox.Text = oldValueTextBox.Text = Math.Round(variableTreeNode.Weight, 4).ToString();
+        // add a dropbox containing all the available variable names
+        variableNameLabel.Visible = true;
+        variableNamesCombo.Visible = true;
+        if (variableTreeNode.Symbol.VariableNames.Any()) {
+          foreach (var name in variableTreeNode.Symbol.VariableNames)
+            variableNamesCombo.Items.Add(name);
+          variableNamesCombo.SelectedIndex = variableNamesCombo.Items.IndexOf(variableTreeNode.VariableName);
+          variableNamesCombo.Visible = true;
+          variableNameTextBox.Visible = false;
+        } else {
+          variableNamesCombo.Visible = false;
+          variableNameTextBox.Visible = true;
+        }
+      }
+    }
+
+    #region text box validation and events
+    private void newValueTextBox_Validating(object sender, CancelEventArgs e) {
+      string errorMessage;
+      if (!ValidateNewValue(newValueTextBox.Text, out errorMessage)) {
+        e.Cancel = true;
+        errorProvider.SetError(newValueTextBox, errorMessage);
+        newValueTextBox.SelectAll();
+      }
+    }
+
+    private void newValueTextBox_Validated(object sender, EventArgs e) {
+      errorProvider.SetError(newValueTextBox, string.Empty);
+    }
+
+    private static bool ValidateNewValue(string value, out string errorMessage) {
+      double val;
+      bool valid = double.TryParse(value, out val);
+      errorMessage = string.Empty;
+      if (!valid) {
+        var sb = new StringBuilder();
+        sb.Append("Invalid Value (Valid Value Format: \"");
+        sb.Append(FormatPatterns.GetDoubleFormatPattern());
+        sb.Append("\")");
+        errorMessage = sb.ToString();
+      }
+      return valid;
+    }
+    #endregion
+
+    #region combo box validation and events
+    private void variableNamesCombo_Validating(object sender, CancelEventArgs e) {
+      if (variableNamesCombo.Items.Count == 0) return;
+      if (variableNamesCombo.Items.Contains(variableNamesCombo.SelectedItem)) return;
+      e.Cancel = true;
+      errorProvider.SetError(variableNamesCombo, "Invalid variable name");
+      variableNamesCombo.SelectAll();
+    }
+
+    private void variableNamesCombo_Validated(object sender, EventArgs e) {
+      errorProvider.SetError(variableNamesCombo, String.Empty);
+    }
+    #endregion
+    // proxy handler passing key strokes to the parent control
+    private void childControl_KeyDown(object sender, KeyEventArgs e) {
+      ValueChangeDialog_KeyDown(sender, e);
+    }
+
+    private void ValueChangeDialog_KeyDown(object sender, KeyEventArgs e) {
+      if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return)) {
+        if (!ValidateChildren()) return;
+        OnDialogValidated(this, e); // emit validated effect
+        Close();
+      }
+    }
+
+    public event EventHandler DialogValidated;
+    private void OnDialogValidated(object sender, EventArgs e) {
+      double weight = double.Parse(newValueTextBox.Text);
+      // we impose an extra validation condition: that the weight/value be different than the original ones
+      var variableName = SelectedVariableName;
+      if (variableTreeNode.Weight.Equals(weight) && variableTreeNode.VariableName.Equals(variableName)) return;
+      variableTreeNode.Weight = weight;
+      variableTreeNode.VariableName = variableName;
+      DialogResult = DialogResult.OK;
+      var dialogValidated = DialogValidated;
+      if (dialogValidated != null)
+        dialogValidated(sender, e);
+    }
+
+    private void cancelButton_Click(object sender, EventArgs e) {
+      Close();
+    }
+
+    private void okButton_Click(object sender, EventArgs e) {
+      if (ValidateChildren()) {
+        OnDialogValidated(this, e);
+        Close();
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/displayModelFrame.html
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/displayModelFrame.html	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/displayModelFrame.html	(revision 16132)
@@ -0,0 +1,51 @@
+﻿<!-- this file is derived from sample_tex.html from the MathJax distribution -->
+<!-- Copyright (c) 2010-2015 The MathJax Consortium -->
+<!-- adapted by HEAL for HeuristicLab-->
+<!DOCTYPE html>
+<html>
+<head>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+
+    <!-- title change by HEAL -->
+    <title>Symbolic Expression Tree</title>
+
+    <script type="text/x-mathjax-config">
+        MathJax.Hub.Config({
+        extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
+        jax: ["input/TeX","output/SVG"],
+        tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
+        "HTML-CSS": {preferredFont: "STIX-Web"},
+        MathMenu: { showLocale:false},
+        imageFont: null
+        });
+    </script>
+
+    <script type="text/javascript" async
+            src="./MathJax/MathJax.js?config=TeX-AMS_SVG&locale=en">
+    </script>
+    <script type="text/javascript">
+        <!-- necessary to re-typeset when the model is changed-->
+        function refreshModel() {
+            var model = document.getElementById("model");
+            <!-- see https://docs.mathjax.org/en/v1.1-latest/typeset.html -->
+            MathJax.Hub.Queue(["Typeset",MathJax.Hub,model]);
+        }
+    </script> 
+</head>
+<body id="body">
+    <noscript>
+        <div style="color: #CC0000; text-align: center">
+            <b>
+                Warning: <a href="http://www.mathjax.org/">MathJax</a> requires JavaScript to process
+                the mathematics on this page.<br />
+                If your browser supports JavaScript, be sure it is enabled.
+            </b>
+        </div>
+        <hr>
+    </noscript>
+    <p id="model">
+    </p>
+</body>
+</html>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/BuildingBlockAnalyzers/SymbolicDataAnalysisPoly10Analyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/BuildingBlockAnalyzers/SymbolicDataAnalysisPoly10Analyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/BuildingBlockAnalyzers/SymbolicDataAnalysisPoly10Analyzer.cs	(revision 16132)
@@ -0,0 +1,238 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using DataRow = HeuristicLab.Analysis.DataRow;
+using DataTable = HeuristicLab.Analysis.DataTable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers.BuidingBlocks {
+  [Item("Poly-10 building blocks analyzer", "An analyzer which attempts to identify parts of the Poly-10 formula")]
+  [StorableClass]
+  public class SymbolicDataAnalysisPoly10Analyzer : SymbolicDataAnalysisAnalyzer {
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string GenerationsParameterName = "Generations";
+    private const string PhenotypicSimilarityThresholdParameterName = "PhenotypicSimilarityThreshold";
+    private const string UpdateCounterParameterName = "UpdateCounter";
+    private const string UpdateIntervalParameterName = "UpdateInterval";
+    private const string BuildingBlocksFrequenciesTableName = "Building blocks frequencies";
+
+    // store evaluations of building blocks for phenotypic matching
+    private readonly Dictionary<string, List<double>> evaluationMap = new Dictionary<string, List<double>>();
+    private readonly Dictionary<string, ISymbolicExpressionTreeNode> fragmentMap = new Dictionary<string, ISymbolicExpressionTreeNode>();
+    private readonly Dictionary<string, string> prettyLabels = new Dictionary<string, string>();
+    private readonly SymbolicExpressionImporter importer = new SymbolicExpressionImporter();
+
+    #region Parameters
+    public IValueParameter<DoubleValue> PhenotypicSimilarityThresholdParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[PhenotypicSimilarityThresholdParameterName]; }
+    }
+
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+
+    public ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+
+    public ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
+    }
+
+    public ValueParameter<IntValue> UpdateCounterParameter {
+      get { return (ValueParameter<IntValue>)Parameters[UpdateCounterParameterName]; }
+    }
+
+    public ValueParameter<IntValue> UpdateIntervalParameter {
+      get { return (ValueParameter<IntValue>)Parameters[UpdateIntervalParameterName]; }
+    }
+    #endregion
+
+    #region Parameter properties
+    public double PhenotypicSimilarityThreshold {
+      get { return PhenotypicSimilarityThresholdParameter.Value.Value; }
+      set { PhenotypicSimilarityThresholdParameter.Value.Value = value; }
+    }
+
+    public int UpdateCounter {
+      get { return UpdateCounterParameter.Value.Value; }
+      set { UpdateCounterParameter.Value.Value = value; }
+    }
+
+    public int UpdateInterval {
+      get { return UpdateIntervalParameter.Value.Value; }
+      set { UpdateIntervalParameter.Value.Value = value; }
+    }
+    #endregion
+
+    public SymbolicDataAnalysisPoly10Analyzer() {
+      #region Add parameters
+      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName));
+      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName));
+      Parameters.Add(new ValueParameter<DoubleValue>(PhenotypicSimilarityThresholdParameterName, "The phenotypic similarity threshold", new DoubleValue(0.9)));
+      Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, new IntValue(0)));
+      Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, new IntValue(1)));
+      #endregion
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisPoly10Analyzer(bool deserializing)
+      : base(deserializing) {
+    }
+
+    protected SymbolicDataAnalysisPoly10Analyzer(SymbolicDataAnalysisPoly10Analyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisPoly10Analyzer(this, cloner);
+    }
+
+    new public bool EnabledByDefault {
+      get { return false; }
+    }
+
+    public override IOperation Apply() {
+      #region Update counter & update interval
+      UpdateCounter++;
+      if (UpdateCounter != UpdateInterval) {
+        return base.Apply();
+      }
+      UpdateCounter = 0;
+      #endregion
+
+      int generations = GenerationsParameter.ActualValue.Value;
+      if (generations == 0)
+        InitializeBuildingBlockCollection();
+
+      var results = ResultCollectionParameter.ActualValue;
+      var trees = SymbolicExpressionTreeParameter.ActualValue;
+      var interpreter = (SymbolicDataAnalysisExpressionTreeLinearInterpreter)SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
+      var dataset = ProblemDataParameter.ActualValue.Dataset;
+      var rows = ProblemDataParameter.ActualValue.TrainingIndices.ToList();
+      var bbFrequencies = evaluationMap.Keys.ToDictionary(x => x, x => 0);
+
+      foreach (var key in evaluationMap.Keys) {
+        var bb = fragmentMap[key];
+        int len = bb.GetLength();
+        foreach (var t in trees) {
+          var root = t.Root.GetSubtree(0).GetSubtree(0);
+          var nodes = root.IterateNodesPrefix().Where(x => x.GetLength() > len).ToList();
+
+          for (int i = 0; i < nodes.Count; ++i) {
+            var s = nodes[i];
+            var values = interpreter.GetValues(s, dataset, rows);
+            OnlineCalculatorError error;
+            var r = OnlinePearsonsRCalculator.Calculate(values, evaluationMap[key], out error);
+            var r2 = error == OnlineCalculatorError.None ? r * r : double.NaN;
+            if (!double.IsNaN(r2) && r2 >= PhenotypicSimilarityThreshold) {
+              bbFrequencies[key]++;
+              i += s.GetLength();
+            }
+          }
+        }
+      }
+      var table = (DataTable)results[BuildingBlocksFrequenciesTableName].Value;
+      foreach (var pair in bbFrequencies) {
+        var formatter = new SymbolicExpressionTreeStringFormatter();
+        //        var label = formatter.Format(fragmentMap[pair.Key]) + "(" + prettyLabels[pair.Key] + ")";
+        var label = prettyLabels[pair.Key];
+        if (table.Rows.ContainsKey(label)) {
+          var row = table.Rows[label];
+          row.Values.Add(pair.Value);
+        }
+      }
+
+      return base.Apply();
+    }
+
+    private void InitializeBuildingBlockCollection() {
+      #region Add building blocks
+      // building blocks
+      const string x1 = "(variable 1 X1)";
+      const string x2 = "(variable 1 X2)";
+      const string x3 = "(variable 1 X3)";
+      const string x4 = "(variable 1 X4)";
+      const string x5 = "(variable 1 X5)";
+      const string x6 = "(variable 1 X6)";
+      const string x7 = "(variable 1 X7)";
+      // x8 is never used in the formula
+      // const string x8 = "(variable 1 X8)"; 
+      const string x9 = "(variable 1 X9)";
+      const string x10 = "(variable 1 X10)";
+      string s1 = String.Format("(* {0} {1})", x1, x2);
+      string s2 = String.Format("(* {0} {1})", x3, x4);
+      string s3 = String.Format("(* {0} {1})", x5, x6);
+      string s4 = String.Format("(* (* {0} {1}) {2})", x1, x7, x9);
+      string s5 = String.Format("(* (* {0} {1}) {2})", x3, x6, x10);
+      string s6 = String.Format("(+ {0} {1})", s1, s2); // x1x2 + x3x4
+      string s7 = String.Format("(+ {0} {1})", s1, s3); // x1x2 + x5x6
+      string s8 = String.Format("(+ {0} {1})", s2, s3); // x3x4 + x5x6
+      string s9 = String.Format("(+ (+ {0} {1}) {2})", s1, s2, s3); // x1x2 + x3x4 + x5x6
+      string s10 = String.Format("(+ (+ {0} {1}) {2})", s4, s5, s9); // x1x2 + x3x4 + x5x6 + x1x7x9 + x3x6x10
+      prettyLabels[s1] = "X1*X2";
+      prettyLabels[s2] = "X3*X4";
+      prettyLabels[s3] = "X5*X6";
+      prettyLabels[s4] = "X1*X7*X9";
+      prettyLabels[s5] = "X3*X6*X10";
+      prettyLabels[s6] = prettyLabels[s1] + " + " + prettyLabels[s2];
+      prettyLabels[s7] = prettyLabels[s1] + " + " + prettyLabels[s3];
+      prettyLabels[s8] = prettyLabels[s2] + " + " + prettyLabels[s3];
+      prettyLabels[s9] = prettyLabels[s1] + " + " + prettyLabels[s2] + " + " + prettyLabels[s3];
+      prettyLabels[s10] = prettyLabels[s9] + " + " + prettyLabels[s4] + " + " + prettyLabels[s5];
+      #endregion
+      var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
+      var dataset = ProblemDataParameter.ActualValue.Dataset;
+      var rows = ProblemDataParameter.ActualValue.TrainingIndices.ToList();
+
+      foreach (var s in new[] { s1, s2, s3, s4, s5, s6, s7, s8, s9, s10 }) {
+        if (evaluationMap.ContainsKey(s)) continue;
+        var t = importer.Import(s);
+        evaluationMap.Add(s, interpreter.GetSymbolicExpressionTreeValues(t, dataset, rows).ToList());
+        fragmentMap.Add(s, t.Root.GetSubtree(0).GetSubtree(0));
+      }
+
+      var results = ResultCollectionParameter.ActualValue;
+      DataTable table;
+      if (!results.ContainsKey(BuildingBlocksFrequenciesTableName)) {
+        table = new DataTable(BuildingBlocksFrequenciesTableName);
+        results.Add(new Result(BuildingBlocksFrequenciesTableName, table));
+      } else {
+        table = (DataTable)results[BuildingBlocksFrequenciesTableName].Value;
+      }
+      table.Rows.Clear();
+      foreach (var key in evaluationMap.Keys) {
+        table.Rows.Add(new DataRow(prettyLabels[key]) { VisualProperties = { StartIndexZero = true } });
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs	(revision 16132)
@@ -0,0 +1,117 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 System.Text;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SymbolicDataAnalysisAlleleFrequencyAnalyzer", "")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisAlleleFrequencyAnalyzer : AlleleFrequencyAnalyzer<ISymbolicExpressionTree>, ISymbolicDataAnalysisAnalyzer {
+    private const string AlleleTreeDepthParameterName = "AlleleTreeDepth";
+
+    #region parameter properties
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return SolutionParameter; }
+    }
+
+    public ILookupParameter<Optimization.ResultCollection> ResultCollectionParameter {
+      get { return ResultsParameter; }
+    }
+
+    public IFixedValueParameter<IntValue> AlleleTreeDepthParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[AlleleTreeDepthParameterName]; }
+    }
+    #endregion
+    #region properties
+    public int AlleleTreeDepth {
+      get { return AlleleTreeDepthParameter.Value.Value; }
+      set { AlleleTreeDepthParameter.Value.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicDataAnalysisAlleleFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisAlleleFrequencyAnalyzer(SymbolicDataAnalysisAlleleFrequencyAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisAlleleFrequencyAnalyzer()
+      : base() {
+      Parameters.Add(new FixedValueParameter<IntValue>(AlleleTreeDepthParameterName, "The depth of subtrees that should be considered as allele", new IntValue(2)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisAlleleFrequencyAnalyzer(this, cloner);
+    }
+
+    protected override Allele[] CalculateAlleles(ISymbolicExpressionTree solution) {
+      return CalculateAlleles(solution, AlleleTreeDepth);
+    }
+
+    public static Allele[] CalculateAlleles(ISymbolicExpressionTree solution, int alleleTreedepth) {
+      return GetAllSubtreesOfDepth(solution, alleleTreedepth)
+        .Select(t => GetAlleleFromSubtreeOfDepth(t, alleleTreedepth))
+        .ToArray();
+    }
+
+    private static Allele GetAlleleFromSubtreeOfDepth(ISymbolicExpressionTreeNode tree, int d) {
+      string textualRepresentation = GetTextualRepresentationFromSubtreeOfDepth(tree, d);
+      return new Allele(textualRepresentation);
+    }
+
+    private static string GetTextualRepresentationFromSubtreeOfDepth(ISymbolicExpressionTreeNode tree, int d) {
+      if (d == 0) return "";
+      StringBuilder builder = new StringBuilder();
+      var varTreeNode = tree as VariableTreeNode;
+      var constTreeNode = tree as ConstantTreeNode;
+      var factorVarTreeNode = tree as FactorVariableTreeNode;
+      var binFactorVarTreeNode = tree as BinaryFactorVariableTreeNode;
+      if (varTreeNode != null) {
+        builder.Append("(var " + varTreeNode.VariableName);
+      } else if (factorVarTreeNode != null) {
+        builder.Append("(factor " + factorVarTreeNode.VariableName);
+      } else if (binFactorVarTreeNode != null) {
+        builder.Append("(factor " + binFactorVarTreeNode.VariableName + "=" + binFactorVarTreeNode.VariableValue);
+      } else if (constTreeNode != null) {
+        builder.Append("(const");
+      } else {
+        builder.Append("(" + tree.ToString());
+      }
+      for (int i = 0; i < tree.SubtreeCount; i++) {
+        builder.Append(" " + GetTextualRepresentationFromSubtreeOfDepth(tree.GetSubtree(i), d - 1));
+      }
+      builder.Append(")");
+      return builder.ToString();
+    }
+
+    private static IEnumerable<ISymbolicExpressionTreeNode> GetAllSubtreesOfDepth(ISymbolicExpressionTree solution, int d) {
+      return from node in solution.IterateNodesPostfix()
+             where node.GetDepth() >= d
+             select node;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisAnalyzer.cs	(revision 16132)
@@ -0,0 +1,69 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Abstract base class for symbolic data analysis analyzers.
+  /// </summary>
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisAnalyzer : SingleSuccessorOperator, ISymbolicDataAnalysisAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ResultCollectionParameterName = "Results";
+
+    #region parameter properties
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultCollectionParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultCollectionParameterName]; }
+    }
+    #endregion
+    #region properties
+    public virtual bool EnabledByDefault {
+      get { return true; }
+    }
+    public ItemArray<ISymbolicExpressionTree> SymbolicExpressionTree {
+      get { return SymbolicExpressionTreeParameter.ActualValue; }
+    }
+    public ResultCollection ResultCollection {
+      get { return ResultCollectionParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    protected SymbolicDataAnalysisAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisAnalyzer(SymbolicDataAnalysisAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDataAnalysisAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees that should be analyzed."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultCollectionParameterName, "The result collection to store the analysis results."));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs	(revision 16132)
@@ -0,0 +1,86 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SymbolicDataAnalysisBottomUpDiversityAnalyzer", "A diversity analyzer based on the bottom-up distance between trees.")]
+  [StorableClass]
+  public class SymbolicDataAnalysisBottomUpDiversityAnalyzer : PopulationSimilarityAnalyzer {
+    private const string MatchConstantValuesParameterName = "MatchConstantValues";
+    private const string MatchVariableWeightsParameterName = "MatchVariableWeights";
+
+    public IFixedValueParameter<BoolValue> MatchConstantValuesParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[MatchConstantValuesParameterName]; }
+    }
+
+    public IFixedValueParameter<BoolValue> MatchVariableWeightsParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[MatchVariableWeightsParameterName]; }
+    }
+
+    public bool MatchConstantValues {
+      get { return MatchConstantValuesParameter.Value.Value; }
+      set {
+        MatchConstantValuesParameter.Value.Value = value;
+
+      }
+    }
+
+    public bool MatchVariableWeights {
+      get { return MatchVariableWeightsParameter.Value.Value; }
+      set {
+        MatchVariableWeightsParameter.Value.Value = value;
+      }
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(bool deserializing) : base(deserializing) { }
+
+    protected SymbolicDataAnalysisBottomUpDiversityAnalyzer(SymbolicDataAnalysisBottomUpDiversityAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisBottomUpDiversityAnalyzer(this, cloner);
+    }
+
+    public SymbolicDataAnalysisBottomUpDiversityAnalyzer(SymbolicExpressionTreeBottomUpSimilarityCalculator similarityCalculator)
+      : base(new[] { similarityCalculator }) {
+      DiversityResultName = "Genotypic Diversity";
+      UpdateCounterParameter.ActualName = "GenotypicDiversityAnalyzerUpdateCounter";
+
+      Parameters.Add(new FixedValueParameter<BoolValue>(MatchConstantValuesParameterName, new BoolValue(true)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(MatchVariableWeightsParameterName, new BoolValue(true)));
+    }
+
+    public override IOperation Apply() {
+      var bus = (SymbolicExpressionTreeBottomUpSimilarityCalculator)SimilarityCalculatorParameter.Value;
+      bus.MatchConstantValues = MatchConstantValues;
+      bus.MatchVariableWeights = MatchVariableWeights;
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGenealogyAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGenealogyAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGenealogyAnalyzer.cs	(revision 16132)
@@ -0,0 +1,117 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SymbolicDataAnalysisGenealogyAnalyzer", "Genealogy analyzer for symbolic data analysis problems")]
+  [StorableClass]
+  public class SymbolicDataAnalysisGenealogyAnalyzer : GenealogyAnalyzer<ISymbolicExpressionTree> {
+    private const string EvaluatorParameterName = "Evaluator";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string EstimationLimitsParameterName = "EstimationLimits";
+    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
+
+    #region parameters
+    public ILookupParameter<ISingleObjectiveEvaluator> EvaluatorParameter {
+      get {
+        return (ILookupParameter<ISingleObjectiveEvaluator>)Parameters[EvaluatorParameterName];
+      }
+    }
+
+    public ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter {
+      get {
+        return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName];
+      }
+    }
+
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
+      get {
+        return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName];
+      }
+    }
+
+    public ILookupParameter<DoubleLimit> EstimationLimitsParameter {
+      get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+    }
+
+    public ILookupParameter<BoolValue> ApplyLinearScalingParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
+    }
+    #endregion
+
+    public SymbolicDataAnalysisGenealogyAnalyzer() {
+      Parameters.Add(new LookupParameter<ISingleObjectiveEvaluator>(EvaluatorParameterName));
+      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));
+      Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));
+      Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName));
+    }
+
+    public SymbolicDataAnalysisGenealogyAnalyzer(SymbolicDataAnalysisGenealogyAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisGenealogyAnalyzer(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisGenealogyAnalyzer(bool deserializing) : base(deserializing) {
+    }
+
+    protected override void EvaluateIntermediateChildren() {
+      var results = ResultsParameter.ActualValue;
+      var graph = (IGenealogyGraph<ISymbolicExpressionTree>)results["PopulationGraph"].Value;
+      var population = PopulationParameter.ActualValue;
+      var generation = GenerationsParameter.ActualValue.Value;
+      var problemData = ProblemDataParameter.ActualValue;
+
+      var vertices = population.Select(graph.GetByContent).Where(x => x.InDegree == 1).Select(x => x.Parents.First());
+      var intermediateVertices = vertices.Where(x => x.Rank.IsAlmost(generation - 0.5));
+
+      var classificationProblemData = problemData as IClassificationProblemData;
+      var regressionProblemData = problemData as IRegressionProblemData;
+      if (classificationProblemData != null) {
+        var evaluator = (ISymbolicDataAnalysisSingleObjectiveEvaluator<IClassificationProblemData>)EvaluatorParameter.ActualValue;
+        foreach (var v in intermediateVertices) {
+          var child = v.Data;
+          v.Quality = evaluator.Evaluate(this.ExecutionContext, child, classificationProblemData, classificationProblemData.TrainingIndices);
+        }
+      } else if (regressionProblemData != null) {
+        var evaluator = (ISymbolicDataAnalysisSingleObjectiveEvaluator<IRegressionProblemData>)EvaluatorParameter.ActualValue;
+        foreach (var v in intermediateVertices) {
+          var child = v.Data;
+          v.Quality = evaluator.Evaluate(this.ExecutionContext, child, regressionProblemData, problemData.TrainingIndices);
+        }
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer.cs	(revision 16132)
@@ -0,0 +1,179 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.EvolutionTracking;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer", "An analyzer which records the best and average genetic operator improvement")]
+  public class SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer : EvolutionTrackingAnalyzer<ISymbolicExpressionTree> {
+    public const string QualityParameterName = "Quality";
+    public const string PopulationParameterName = "SymbolicExpressionTree";
+    public const string CountIntermediateChildrenParameterName = "CountIntermediateChildren";
+
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> PopulationParameter {
+      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[PopulationParameterName]; }
+    }
+
+    public IFixedValueParameter<BoolValue> CountIntermediateChildrenParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[CountIntermediateChildrenParameterName]; }
+    }
+
+    public bool CountIntermediateChildren {
+      get { return CountIntermediateChildrenParameter.Value.Value; }
+      set { CountIntermediateChildrenParameter.Value.Value = value; }
+    }
+
+    public SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer() {
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(PopulationParameterName, "The population of individuals."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The individual qualities."));
+      Parameters.Add(new FixedValueParameter<BoolValue>(CountIntermediateChildrenParameterName, "Specifies whether to consider intermediate children (when crossover was followed by mutation). This should be set to false for offspring selection.", new BoolValue(true)));
+
+      CountIntermediateChildrenParameter.Hidden = true;
+    }
+
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer(bool deserializing) : base(deserializing) { }
+
+    public SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer(
+    SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer original, Cloner cloner) : base(original, cloner) {
+      CountIntermediateChildren = original.CountIntermediateChildren;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(CountIntermediateChildrenParameterName))
+        Parameters.Add(new FixedValueParameter<BoolValue>(CountIntermediateChildrenParameterName, "Specifies whether to consider intermediate children (when crossover was followed by mutation", new BoolValue(true)));
+      CountIntermediateChildrenParameter.Hidden = true;
+    }
+
+    public override IOperation Apply() {
+      IntValue updateCounter = UpdateCounterParameter.ActualValue;
+      if (updateCounter == null) {
+        updateCounter = new IntValue(0);
+        UpdateCounterParameter.ActualValue = updateCounter;
+      }
+      updateCounter.Value++;
+      if (updateCounter.Value != UpdateInterval.Value) return base.Apply();
+      updateCounter.Value = 0;
+
+      var graph = PopulationGraph;
+      if (graph == null || Generation.Value == 0)
+        return base.Apply();
+
+      var generation = Generation.Value;
+      var averageQuality = QualityParameter.ActualValue.Average(x => x.Value);
+      var population = PopulationParameter.ActualValue;
+      var populationSize = population.Length;
+
+      //      var vertices = population.Select(graph.GetByContent).ToList();
+      var crossoverChildren = new List<IGenealogyGraphNode<ISymbolicExpressionTree>>();
+      var mutationChildren = new List<IGenealogyGraphNode<ISymbolicExpressionTree>>();
+      var vertices = graph.Vertices.Where(x => x.Rank > generation - 1);
+      foreach (var v in vertices) {
+        if (v.InDegree == 2) {
+          crossoverChildren.Add(v);
+        } else {
+          var parent = v.Parents.First();
+          // mutation is always preceded by crossover
+          // so the parent vertex should have an intermediate rank
+          // otherwise, it is the previos generation elite
+          if (parent.Rank.IsAlmost(generation - 1) && parent.IsElite)
+            continue;
+          mutationChildren.Add(v);
+        }
+      }
+      DataTable table;
+      #region crossover improvement
+      if (!Results.ContainsKey("Crossover improvement")) {
+        table = new DataTable("Crossover improvement");
+        Results.Add(new Result("Crossover improvement", table));
+        table.Rows.AddRange(new[] {
+          new DataRow("Average crossover child quality") { VisualProperties = { StartIndexZero = true } },
+          new DataRow("Average crossover parent quality") { VisualProperties = { StartIndexZero = true } },
+          new DataRow("Best crossover child quality") { VisualProperties = { StartIndexZero = true } },
+          new DataRow("Best crossover parent quality") { VisualProperties = { StartIndexZero = true } },
+        });
+      } else {
+        table = (DataTable)Results["Crossover improvement"].Value;
+      }
+
+      var avgCrossoverParentQuality = crossoverChildren.SelectMany(x => x.Parents).Average(x => x.Quality);
+      var avgCrossoverChildQuality = crossoverChildren.Average(x => x.Quality);
+
+      var bestCrossoverChildQuality = crossoverChildren.OrderBy(x => x.Quality).Last().Quality;
+      var bestCrossoverParentQuality = crossoverChildren.OrderBy(x => x.Quality).Last().Parents.First().Quality;
+
+      table.Rows["Average crossover child quality"].Values.Add(avgCrossoverChildQuality);
+      table.Rows["Average crossover parent quality"].Values.Add(avgCrossoverParentQuality);
+      table.Rows["Best crossover child quality"].Values.Add(bestCrossoverChildQuality);
+      table.Rows["Best crossover parent quality"].Values.Add(bestCrossoverParentQuality);
+      #endregion
+
+      #region mutation improvement
+      if (!Results.ContainsKey("Mutation improvement")) {
+        table = new DataTable("Mutation improvement");
+        Results.Add(new Result("Mutation improvement", table));
+        table.Rows.AddRange(new[] {
+          new DataRow("Average mutation child quality") { VisualProperties = { StartIndexZero = true } },
+          new DataRow("Average mutation parent quality") { VisualProperties = { StartIndexZero = true } },
+          new DataRow("Best mutation child quality") { VisualProperties = { StartIndexZero = true } },
+          new DataRow("Best mutation parent quality") { VisualProperties = { StartIndexZero = true } },
+        });
+      } else {
+        table = (DataTable)Results["Mutation improvement"].Value;
+      }
+
+      var avgMutationParentQuality = mutationChildren.SelectMany(x => x.Parents).Average(x => x.Quality);
+      var avgMutationChildQuality = mutationChildren.Average(x => x.Quality);
+
+      var bestMutationChildQuality = mutationChildren.OrderBy(x => x.Quality).Last().Quality;
+      var bestMutationParentQuality = mutationChildren.OrderBy(x => x.Quality).Last().Parents.First().Quality;
+
+      table.Rows["Average mutation child quality"].Values.Add(avgMutationChildQuality);
+      table.Rows["Average mutation parent quality"].Values.Add(avgMutationParentQuality);
+      table.Rows["Best mutation child quality"].Values.Add(bestMutationChildQuality);
+      table.Rows["Best mutation parent quality"].Values.Add(bestMutationParentQuality);
+
+      #endregion
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveAnalyzer.cs	(revision 16132)
@@ -0,0 +1,76 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Abstract base class for multi objective symbolic data analysis analyzers.
+  /// </summary>
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisMultiObjectiveAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicDataAnalysisMultiObjectiveAnalyzer {
+    private const string QualitiesParameterName = "Qualities";
+    private const string MaximizationParameterName = "Maximization";
+    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
+    #region parameter properties
+    public IScopeTreeLookupParameter<DoubleArray> QualitiesParameter {
+      get { return (IScopeTreeLookupParameter<DoubleArray>)Parameters[QualitiesParameterName]; }
+    }
+    public ILookupParameter<BoolArray> MaximizationParameter {
+      get { return (ILookupParameter<BoolArray>)Parameters[MaximizationParameterName]; }
+    }
+    public ILookupParameter<BoolValue> ApplyLinearScalingParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
+    }
+    #endregion
+    #region properties
+    public ItemArray<DoubleArray> Qualities {
+      get { return QualitiesParameter.ActualValue; }
+    }
+    public BoolArray Maximization {
+      get { return MaximizationParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    protected SymbolicDataAnalysisMultiObjectiveAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisMultiObjectiveAnalyzer(SymbolicDataAnalysisMultiObjectiveAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDataAnalysisMultiObjectiveAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>(QualitiesParameterName, "The qualities of the trees that should be analyzed."));
+      Parameters.Add(new LookupParameter<BoolArray>(MaximizationParameterName, "The directions of optimization for each dimension."));
+      Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating."));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (Parameters.ContainsKey(ApplyLinearScalingParameterName) && Parameters[ApplyLinearScalingParameterName] is LookupParameter<BoolValue>)
+        Parameters.Remove(ApplyLinearScalingParameterName);
+      if (!Parameters.ContainsKey(ApplyLinearScalingParameterName))
+        Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating."));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer.cs	(revision 16132)
@@ -0,0 +1,182 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// An operator that analyzes the training best symbolic data analysis solution for multi objective symbolic data analysis problems.
+  /// </summary>
+  [Item("SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic data analysis solution for multi objective symbolic data analysis problems.")]
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisMultiObjectiveAnalyzer
+    where T : class, ISymbolicDataAnalysisSolution {
+    private const string TrainingBestSolutionsParameterName = "Best training solutions";
+    private const string TrainingBestSolutionQualitiesParameterName = "Best training solution qualities";
+    private const string UpdateAlwaysParameterName = "Always update best solutions";
+    private const string TrainingBestSolutionParameterName = "Best training solution";
+
+    #region parameter properties
+    public ILookupParameter<ItemList<T>> TrainingBestSolutionsParameter {
+      get { return (ILookupParameter<ItemList<T>>)Parameters[TrainingBestSolutionsParameterName]; }
+    }
+    public ILookupParameter<ItemList<DoubleArray>> TrainingBestSolutionQualitiesParameter {
+      get { return (ILookupParameter<ItemList<DoubleArray>>)Parameters[TrainingBestSolutionQualitiesParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> UpdateAlwaysParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; }
+    }
+    #endregion
+    #region properties
+    private ItemList<T> TrainingBestSolutions {
+      get { return TrainingBestSolutionsParameter.ActualValue; }
+      set { TrainingBestSolutionsParameter.ActualValue = value; }
+    }
+    private ItemList<DoubleArray> TrainingBestSolutionQualities {
+      get { return TrainingBestSolutionQualitiesParameter.ActualValue; }
+      set { TrainingBestSolutionQualitiesParameter.ActualValue = value; }
+    }
+    public bool UpdateAlways {
+      get { return UpdateAlwaysParameter.Value.Value; }
+      set { UpdateAlwaysParameter.Value.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer(SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer<T> original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<ItemList<T>>(TrainingBestSolutionsParameterName, "The training best (Pareto-optimal) symbolic data analysis solutions."));
+      Parameters.Add(new LookupParameter<ItemList<DoubleArray>>(TrainingBestSolutionQualitiesParameterName, "The qualities of the training best (Pareto-optimal) solutions."));
+      Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best training solutions should always be updated regardless of its quality.", new BoolValue(false)));
+      UpdateAlwaysParameter.Hidden = true;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(UpdateAlwaysParameterName)) {
+        Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best training solutions should always be updated regardless of its quality.", new BoolValue(false)));
+        UpdateAlwaysParameter.Hidden = true;
+      }
+    }
+
+    public override IOperation Apply() {
+      var results = ResultCollection;
+      // create empty parameter and result values
+      if (TrainingBestSolutions == null) {
+        TrainingBestSolutions = new ItemList<T>();
+        TrainingBestSolutionQualities = new ItemList<DoubleArray>();
+        results.Add(new Result(TrainingBestSolutionQualitiesParameter.Name, TrainingBestSolutionQualitiesParameter.Description, TrainingBestSolutionQualities));
+        results.Add(new Result(TrainingBestSolutionsParameter.Name, TrainingBestSolutionsParameter.Description, TrainingBestSolutions));
+      }
+
+      if (!results.ContainsKey(TrainingBestSolutionParameterName)) {
+        results.Add(new Result(TrainingBestSolutionParameterName, "", typeof(ISymbolicDataAnalysisSolution)));
+      }
+
+      //if the pareto front of best solutions shall be updated regardless of the quality, the list initialized empty to discard old solutions
+      List<double[]> trainingBestQualities;
+      if (UpdateAlways) {
+        trainingBestQualities = new List<double[]>();
+      } else {
+        trainingBestQualities = TrainingBestSolutionQualities.Select(x => x.ToArray()).ToList();
+      }
+
+      ISymbolicExpressionTree[] trees = SymbolicExpressionTree.ToArray();
+      List<double[]> qualities = Qualities.Select(x => x.ToArray()).ToList();
+      bool[] maximization = Maximization.ToArray();
+
+      var nonDominatedIndividuals = new[] { new { Tree = default(ISymbolicExpressionTree), Qualities = default(double[]) } }.ToList();
+      nonDominatedIndividuals.Clear();
+
+      // build list of new non-dominated solutions
+      for (int i = 0; i < trees.Length; i++) {
+        if (IsNonDominated(qualities[i], nonDominatedIndividuals.Select(ind => ind.Qualities), maximization) &&
+            IsNonDominated(qualities[i], trainingBestQualities, maximization)) {
+          for (int j = nonDominatedIndividuals.Count - 1; j >= 0; j--) {
+            if (IsBetterOrEqual(qualities[i], nonDominatedIndividuals[j].Qualities, maximization)) {
+              nonDominatedIndividuals.RemoveAt(j);
+            }
+          }
+          nonDominatedIndividuals.Add(new { Tree = trees[i], Qualities = qualities[i] });
+        }
+      }
+
+      var nonDominatedSolutions = nonDominatedIndividuals.Select(x => new { Solution = CreateSolution(x.Tree, x.Qualities), Qualities = x.Qualities }).ToList();
+      nonDominatedSolutions.ForEach(s => s.Solution.Name = string.Join(",", s.Qualities.Select(q => q.ToString())));
+
+      #region update Pareto-optimal solution archive
+      if (nonDominatedSolutions.Count > 0) {
+        //add old non-dominated solutions only if they are not dominated by one of the new solutions
+        for (int i = 0; i < trainingBestQualities.Count; i++) {
+          if (IsNonDominated(trainingBestQualities[i], nonDominatedSolutions.Select(x => x.Qualities), maximization)) {
+            nonDominatedSolutions.Add(new { Solution = TrainingBestSolutions[i], Qualities = TrainingBestSolutionQualities[i].ToArray() });
+          }
+        }
+
+        //assumes the the first objective is always the accuracy
+        var sortedNonDominatedSolutions = maximization[0]
+          ? nonDominatedSolutions.OrderByDescending(x => x.Qualities[0])
+          : nonDominatedSolutions.OrderBy(x => x.Qualities[0]);
+        var trainingBestSolution = sortedNonDominatedSolutions.Select(s => s.Solution).First();
+        results[TrainingBestSolutionParameterName].Value = trainingBestSolution;
+        TrainingBestSolutions = new ItemList<T>(sortedNonDominatedSolutions.Select(x => x.Solution));
+        results[TrainingBestSolutionsParameter.Name].Value = TrainingBestSolutions;
+        TrainingBestSolutionQualities = new ItemList<DoubleArray>(sortedNonDominatedSolutions.Select(x => new DoubleArray(x.Qualities)));
+        results[TrainingBestSolutionQualitiesParameter.Name].Value = TrainingBestSolutionQualities;
+      }
+      #endregion
+      return base.Apply();
+    }
+
+    protected abstract T CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQuality);
+
+    private bool IsNonDominated(double[] point, IEnumerable<double[]> points, bool[] maximization) {
+      foreach (var refPoint in points) {
+        bool refPointDominatesPoint = IsBetterOrEqual(refPoint, point, maximization);
+        if (refPointDominatesPoint) return false;
+      }
+      return true;
+    }
+
+    private bool IsBetterOrEqual(double[] lhs, double[] rhs, bool[] maximization) {
+      for (int i = 0; i < lhs.Length; i++) {
+        var result = IsBetterOrEqual(lhs[i], rhs[i], maximization[i]);
+        if (!result) return false;
+      }
+      return true;
+    }
+
+    private bool IsBetterOrEqual(double lhs, double rhs, bool maximization) {
+      if (maximization) return lhs >= rhs;
+      else return lhs <= rhs;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationAnalyzer.cs	(revision 16132)
@@ -0,0 +1,98 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Abstract base class for symbolic data analysis analyzers that validate a solution on a separate data partition using the evaluator.
+  /// </summary>
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisMultiObjectiveValidationAnalyzer<T, U> : SymbolicDataAnalysisMultiObjectiveAnalyzer,
+    ISymbolicDataAnalysisValidationAnalyzer<T, U>
+    where T : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<U>
+    where U : class, IDataAnalysisProblemData {
+    private const string RandomParameterName = "Random";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string EvaluatorParameterName = "Evaluator";
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
+    private const string ValidationPartitionParameterName = "ValidationPartition";
+    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+
+    #region parameter properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public ILookupParameter<U> ProblemDataParameter {
+      get { return (ILookupParameter<U>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<T> EvaluatorParameter {
+      get { return (ILookupParameter<T>)Parameters[EvaluatorParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+    public IValueLookupParameter<IntRange> ValidationPartitionParameter {
+      get { return (IValueLookupParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
+    }
+    public IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisMultiObjectiveValidationAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisMultiObjectiveValidationAnalyzer(SymbolicDataAnalysisMultiObjectiveValidationAnalyzer<T, U> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDataAnalysisMultiObjectiveValidationAnalyzer()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
+      Parameters.Add(new LookupParameter<U>(ProblemDataParameterName, "The problem data of the symbolic data analysis problem."));
+      Parameters.Add(new LookupParameter<T>(EvaluatorParameterName, "The operator to use for fitness evaluation on the validation partition."));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter for symbolic data analysis expression trees."));
+      Parameters.Add(new ValueLookupParameter<IntRange>(ValidationPartitionParameterName, "The validation partition."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index."));
+    }
+
+    protected IEnumerable<int> GenerateRowsToEvaluate() {
+      int seed = RandomParameter.ActualValue.Next();
+      int samplesStart = ValidationPartitionParameter.ActualValue.Start;
+      int samplesEnd = ValidationPartitionParameter.ActualValue.End;
+      int testPartitionStart = ProblemDataParameter.ActualValue.TestPartition.Start;
+      int testPartitionEnd = ProblemDataParameter.ActualValue.TestPartition.End;
+
+      if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value.");
+      int count = (int)((samplesEnd - samplesStart) * RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value);
+      if (count == 0) count = 1;
+      return RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count)
+        .Where(i => i < testPartitionStart || testPartitionEnd <= i);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer.cs	(revision 16132)
@@ -0,0 +1,197 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// An operator that analyzes the validation best symbolic data analysis solution for multi objective symbolic data analysis problems.
+  /// </summary>
+  [Item("SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for multi objective symbolic data analysis problems.")]
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisMultiObjectiveValidationAnalyzer<T, U>,
+    ISymbolicDataAnalysisMultiObjectiveAnalyzer
+    where S : class, ISymbolicDataAnalysisSolution
+    where T : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<U>
+    where U : class, IDataAnalysisProblemData {
+    private const string ValidationBestSolutionsParameterName = "Best validation solutions";
+    private const string ValidationBestSolutionQualitiesParameterName = "Best validation solution qualities";
+    private const string UpdateAlwaysParameterName = "Always update best solutions";
+
+    #region parameter properties
+    public ILookupParameter<ItemList<S>> ValidationBestSolutionsParameter {
+      get { return (ILookupParameter<ItemList<S>>)Parameters[ValidationBestSolutionsParameterName]; }
+    }
+    public ILookupParameter<ItemList<DoubleArray>> ValidationBestSolutionQualitiesParameter {
+      get { return (ILookupParameter<ItemList<DoubleArray>>)Parameters[ValidationBestSolutionQualitiesParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> UpdateAlwaysParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; }
+    }
+    #endregion
+    #region properties
+    public ItemList<S> ValidationBestSolutions {
+      get { return ValidationBestSolutionsParameter.ActualValue; }
+      set { ValidationBestSolutionsParameter.ActualValue = value; }
+    }
+    public ItemList<DoubleArray> ValidationBestSolutionQualities {
+      get { return ValidationBestSolutionQualitiesParameter.ActualValue; }
+      set { ValidationBestSolutionQualitiesParameter.ActualValue = value; }
+    }
+    public BoolValue UpdateAlways {
+      get { return UpdateAlwaysParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer(SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<ItemList<S>>(ValidationBestSolutionsParameterName, "The validation best (Pareto-optimal) symbolic data analysis solutions."));
+      Parameters.Add(new LookupParameter<ItemList<DoubleArray>>(ValidationBestSolutionQualitiesParameterName, "The qualities of the validation best (Pareto-optimal) solutions."));
+      Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best validation solutions should always be updated regardless of its quality.", new BoolValue(false)));
+      UpdateAlwaysParameter.Hidden = true;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(UpdateAlwaysParameterName)) {
+        Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best training solutions should always be updated regardless of its quality.", new BoolValue(false)));
+        UpdateAlwaysParameter.Hidden = true;
+      }
+    }
+
+    public override IOperation Apply() {
+      IEnumerable<int> rows = GenerateRowsToEvaluate();
+      if (!rows.Any()) return base.Apply();
+
+      var results = ResultCollection;
+      // create empty parameter and result values
+      if (ValidationBestSolutions == null) {
+        ValidationBestSolutions = new ItemList<S>();
+        ValidationBestSolutionQualities = new ItemList<DoubleArray>();
+        results.Add(new Result(ValidationBestSolutionQualitiesParameter.Name, ValidationBestSolutionQualitiesParameter.Description, ValidationBestSolutionQualities));
+        results.Add(new Result(ValidationBestSolutionsParameter.Name, ValidationBestSolutionsParameter.Description, ValidationBestSolutions));
+      }
+
+      //if the pareto front of best solutions shall be updated regardless of the quality, the list initialized empty to discard old solutions
+      IList<double[]> trainingBestQualities;
+      if (UpdateAlways.Value) {
+        trainingBestQualities = new List<double[]>();
+      } else {
+        trainingBestQualities = ValidationBestSolutionQualities.Select(x => x.ToArray()).ToList();
+      }
+
+      #region find best trees
+      IList<int> nonDominatedIndexes = new List<int>();
+      ISymbolicExpressionTree[] tree = SymbolicExpressionTree.ToArray();
+      bool[] maximization = Maximization.ToArray();
+      List<double[]> newNonDominatedQualities = new List<double[]>();
+      var evaluator = EvaluatorParameter.ActualValue;
+      var problemData = ProblemDataParameter.ActualValue;
+      IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator);
+
+      var qualities = tree
+        .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
+        .ToArray();
+      for (int i = 0; i < tree.Length; i++) {
+        if (IsNonDominated(qualities[i], trainingBestQualities, maximization) &&
+          IsNonDominated(qualities[i], qualities, maximization)) {
+          if (!newNonDominatedQualities.Contains(qualities[i], new DoubleArrayComparer())) {
+            newNonDominatedQualities.Add(qualities[i]);
+            nonDominatedIndexes.Add(i);
+          }
+        }
+      }
+      #endregion
+      #region update Pareto-optimal solution archive
+      if (nonDominatedIndexes.Count > 0) {
+        ItemList<DoubleArray> nonDominatedQualities = new ItemList<DoubleArray>();
+        ItemList<S> nonDominatedSolutions = new ItemList<S>();
+        // add all new non-dominated solutions to the archive
+        foreach (var index in nonDominatedIndexes) {
+          S solution = CreateSolution(tree[index], qualities[index]);
+          nonDominatedSolutions.Add(solution);
+          nonDominatedQualities.Add(new DoubleArray(qualities[index]));
+        }
+        // add old non-dominated solutions only if they are not dominated by one of the new solutions
+        for (int i = 0; i < trainingBestQualities.Count; i++) {
+          if (IsNonDominated(trainingBestQualities[i], newNonDominatedQualities, maximization)) {
+            if (!newNonDominatedQualities.Contains(trainingBestQualities[i], new DoubleArrayComparer())) {
+              nonDominatedSolutions.Add(ValidationBestSolutions[i]);
+              nonDominatedQualities.Add(ValidationBestSolutionQualities[i]);
+            }
+          }
+        }
+
+        results[ValidationBestSolutionsParameter.Name].Value = nonDominatedSolutions;
+        results[ValidationBestSolutionQualitiesParameter.Name].Value = nonDominatedQualities;
+      }
+      #endregion
+      return base.Apply();
+    }
+
+    protected abstract S CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQuality);
+
+    private bool IsNonDominated(double[] point, IList<double[]> points, bool[] maximization) {
+      foreach (var refPoint in points) {
+        bool refPointDominatesPoint = true;
+        for (int i = 0; i < point.Length; i++) {
+          refPointDominatesPoint &= IsBetter(refPoint[i], point[i], maximization[i]);
+        }
+        if (refPointDominatesPoint) return false;
+      }
+      return true;
+    }
+    private bool IsBetter(double lhs, double rhs, bool maximization) {
+      if (maximization) return lhs > rhs;
+      else return lhs < rhs;
+    }
+
+    private class DoubleArrayComparer : IEqualityComparer<double[]> {
+      public bool Equals(double[] x, double[] y) {
+        if (y.Length != x.Length) throw new ArgumentException();
+        for (int i = 0; i < x.Length; i++) {
+          if (!x[i].IsAlmost(y[i])) return false;
+        }
+        return true;
+      }
+
+      public int GetHashCode(double[] obj) {
+        int c = obj.Length;
+        for (int i = 0; i < obj.Length; i++)
+          c ^= obj[i].GetHashCode();
+        return c;
+      }
+    }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveAnalyzer.cs	(revision 16132)
@@ -0,0 +1,77 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Abstract base class for single objective symbolic data analysis analyzers.
+  /// </summary>
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisSingleObjectiveAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicDataAnalysisSingleObjectiveAnalyzer {
+    private const string QualityParameterName = "Quality";
+    private const string MaximizationParameterName = "Maximization";
+    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
+
+    #region parameter properties
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    public ILookupParameter<BoolValue> MaximizationParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[MaximizationParameterName]; }
+    }
+    public ILookupParameter<BoolValue> ApplyLinearScalingParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
+    }
+    #endregion
+    #region properties
+    public ItemArray<DoubleValue> Quality {
+      get { return QualityParameter.ActualValue; }
+    }
+    public BoolValue Maximization {
+      get { return MaximizationParameter.ActualValue; }
+    }
+    #endregion
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSingleObjectiveAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisSingleObjectiveAnalyzer(SymbolicDataAnalysisSingleObjectiveAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDataAnalysisSingleObjectiveAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The qualities of the trees that should be analyzed."));
+      Parameters.Add(new LookupParameter<BoolValue>(MaximizationParameterName, "The direction of optimization."));
+      Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating."));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (Parameters.ContainsKey(ApplyLinearScalingParameterName) && !(Parameters[ApplyLinearScalingParameterName] is LookupParameter<BoolValue>))
+        Parameters.Remove(ApplyLinearScalingParameterName);
+      if (!Parameters.ContainsKey(ApplyLinearScalingParameterName))
+        Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating."));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs	(revision 16132)
@@ -0,0 +1,276 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisSingleObjectivePruningAnalyzer", "An analyzer that prunes introns from trees in single objective symbolic data analysis problems.")]
+  public abstract class SymbolicDataAnalysisSingleObjectivePruningAnalyzer : SymbolicDataAnalysisSingleObjectiveAnalyzer {
+    #region parameter names
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string UpdateIntervalParameterName = "UpdateInverval";
+    private const string UpdateCounterParameterName = "UpdateCounter";
+    private const string PopulationSliceParameterName = "PopulationSlice";
+    private const string PruningProbabilityParameterName = "PruningProbability";
+    private const string TotalNumberOfPrunedSubtreesParameterName = "Number of pruned subtrees";
+    private const string TotalNumberOfPrunedTreesParameterName = "Number of pruned trees";
+    private const string TotalNumberOfPrunedNodesParameterName = "Number of pruned nodes";
+    private const string RandomParameterName = "Random";
+    private const string ResultsParameterName = "Results";
+    private const string PopulationSizeParameterName = "PopulationSize";
+    #endregion
+
+    #region private members
+    private DataReducer prunedNodesReducer;
+    private DataReducer prunedSubtreesReducer;
+    private DataReducer prunedTreesReducer;
+    private DataTableValuesCollector valuesCollector;
+    private ResultsCollector resultsCollector;
+    #endregion
+
+    #region parameter properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> UpdateIntervalParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[UpdateIntervalParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> UpdateCounterParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[UpdateCounterParameterName]; }
+    }
+    public IFixedValueParameter<DoubleRange> PopulationSliceParameter {
+      get { return (IFixedValueParameter<DoubleRange>)Parameters[PopulationSliceParameterName]; }
+    }
+    public IFixedValueParameter<DoubleValue> PruningProbabilityParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters[PruningProbabilityParameterName]; }
+    }
+    public ILookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[PopulationSizeParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    protected abstract SymbolicDataAnalysisExpressionPruningOperator PruningOperator { get; }
+    protected int UpdateInterval { get { return UpdateIntervalParameter.Value.Value; } }
+
+    protected int UpdateCounter {
+      get { return UpdateCounterParameter.Value.Value; }
+      set { UpdateCounterParameter.Value.Value = value; }
+    }
+
+    protected double PopulationSliceStart {
+      get { return PopulationSliceParameter.Value.Start; }
+      set { PopulationSliceParameter.Value.Start = value; }
+    }
+
+    protected double PopulationSliceEnd {
+      get { return PopulationSliceParameter.Value.End; }
+      set { PopulationSliceParameter.Value.End = value; }
+    }
+
+    protected double PruningProbability {
+      get { return PruningProbabilityParameter.Value.Value; }
+      set { PruningProbabilityParameter.Value.Value = value; }
+    }
+    #endregion
+
+    #region IStatefulItem members
+    public override void InitializeState() {
+      base.InitializeState();
+      UpdateCounter = 0;
+    }
+    public override void ClearState() {
+      base.ClearState();
+      UpdateCounter = 0;
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(bool deserializing) : base(deserializing) { }
+
+    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(SymbolicDataAnalysisSingleObjectivePruningAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+      if (original.prunedNodesReducer != null)
+        this.prunedNodesReducer = (DataReducer)original.prunedNodesReducer.Clone();
+      if (original.prunedSubtreesReducer != null)
+        this.prunedSubtreesReducer = (DataReducer)original.prunedSubtreesReducer.Clone();
+      if (original.prunedTreesReducer != null)
+        this.prunedTreesReducer = (DataReducer)original.prunedTreesReducer.Clone();
+      if (original.valuesCollector != null)
+        this.valuesCollector = (DataTableValuesCollector)original.valuesCollector.Clone();
+      if (original.resultsCollector != null)
+        this.resultsCollector = (ResultsCollector)original.resultsCollector.Clone();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(PopulationSizeParameterName)) {
+        Parameters.Add(new LookupParameter<IntValue>(PopulationSizeParameterName, "The population of individuals."));
+      }
+      if (Parameters.ContainsKey(UpdateCounterParameterName)) {
+        var fixedValueParameter = Parameters[UpdateCounterParameterName] as FixedValueParameter<IntValue>;
+        if (fixedValueParameter == null) {
+          var valueParameter = (ValueParameter<IntValue>)Parameters[UpdateCounterParameterName];
+          Parameters.Remove(UpdateCounterParameterName);
+          Parameters.Add(new FixedValueParameter<IntValue>(UpdateCounterParameterName, valueParameter.Value));
+        }
+      }
+      if (Parameters.ContainsKey(UpdateIntervalParameterName)) {
+        var fixedValueParameter = Parameters[UpdateIntervalParameterName] as FixedValueParameter<IntValue>;
+        if (fixedValueParameter == null) {
+          var valueParameter = (ValueParameter<IntValue>)Parameters[UpdateIntervalParameterName];
+          Parameters.Remove(UpdateIntervalParameterName);
+          Parameters.Add(new FixedValueParameter<IntValue>(UpdateIntervalParameterName, valueParameter.Value));
+        }
+      }
+      if (Parameters.ContainsKey(PopulationSliceParameterName)) {
+        var fixedValueParameter = Parameters[PopulationSliceParameterName] as FixedValueParameter<DoubleRange>;
+        if (fixedValueParameter == null) {
+          var valueParameter = (ValueParameter<DoubleRange>)Parameters[PopulationSliceParameterName];
+          Parameters.Remove(PopulationSliceParameterName);
+          Parameters.Add(new FixedValueParameter<DoubleRange>(PopulationSliceParameterName, valueParameter.Value));
+        }
+      }
+      if (Parameters.ContainsKey(PruningProbabilityParameterName)) {
+        var fixedValueParameter = Parameters[PruningProbabilityParameterName] as FixedValueParameter<DoubleValue>;
+        if (fixedValueParameter == null) {
+          var valueParameter = (ValueParameter<DoubleValue>)Parameters[PruningProbabilityParameterName];
+          Parameters.Remove(PruningProbabilityParameterName);
+          Parameters.Add(new FixedValueParameter<DoubleValue>(PruningProbabilityParameterName, valueParameter.Value));
+        }
+      }
+    }
+
+    protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer() {
+      #region add parameters
+      Parameters.Add(new FixedValueParameter<DoubleRange>(PopulationSliceParameterName, "The slice of the population where pruning should be applied.", new DoubleRange(0.75, 1)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>(PruningProbabilityParameterName, "The probability for pruning an individual.", new DoubleValue(0.5)));
+      Parameters.Add(new FixedValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1)));
+      Parameters.Add(new FixedValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called", new IntValue(0)));
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random number generator."));
+      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName, "The problem data."));
+      Parameters.Add(new LookupParameter<IntValue>(PopulationSizeParameterName, "The population of individuals."));
+      #endregion
+    }
+
+    // 
+    /// <summary>
+    /// Computes the closed interval bounding the portion of the population that is to be pruned. 
+    /// </summary>
+    /// <returns>Returns an int range [start, end]</returns>
+    private IntRange GetSliceBounds() {
+      if (PopulationSliceStart < 0 || PopulationSliceEnd < 0) throw new ArgumentOutOfRangeException("The slice bounds cannot be negative.");
+      if (PopulationSliceStart > 1 || PopulationSliceEnd > 1) throw new ArgumentOutOfRangeException("The slice bounds should be expressed as unit percentages.");
+      var count = PopulationSizeParameter.ActualValue.Value;
+      var start = (int)Math.Round(PopulationSliceStart * count);
+      var end = (int)Math.Round(PopulationSliceEnd * count);
+      if (end > count) end = count;
+
+      if (start >= end) throw new ArgumentOutOfRangeException("Invalid PopulationSlice bounds.");
+      return new IntRange(start, end);
+    }
+
+    private IOperation CreatePruningOperation() {
+      var operations = new OperationCollection { Parallel = true };
+      var range = GetSliceBounds();
+      var qualities = Quality.Select(x => x.Value).ToArray();
+      var indices = Enumerable.Range(0, qualities.Length).ToArray();
+      indices.StableSort((a, b) => qualities[a].CompareTo(qualities[b]));
+
+      if (!Maximization.Value) Array.Reverse(indices);
+
+      var subscopes = ExecutionContext.Scope.SubScopes;
+      var random = RandomParameter.ActualValue;
+
+      var empty = new EmptyOperator();
+
+      for (int i = 0; i < indices.Length; ++i) {
+        IOperator @operator;
+        if (range.Start <= i && i < range.End && random.NextDouble() <= PruningProbability)
+          @operator = PruningOperator;
+        else @operator = empty;
+        var index = indices[i];
+        var subscope = subscopes[index];
+        operations.Add(ExecutionContext.CreateChildOperation(@operator, subscope));
+      }
+      return operations;
+    }
+
+    public override IOperation Apply() {
+      UpdateCounter++;
+      if (UpdateCounter != UpdateInterval) return base.Apply();
+      UpdateCounter = 0;
+
+      if (prunedNodesReducer == null || prunedSubtreesReducer == null || prunedTreesReducer == null || valuesCollector == null || resultsCollector == null) { InitializeOperators(); }
+
+      var prune = CreatePruningOperation();
+      var reducePrunedNodes = ExecutionContext.CreateChildOperation(prunedNodesReducer);
+      var reducePrunedSubtrees = ExecutionContext.CreateChildOperation(prunedSubtreesReducer);
+      var reducePrunedTrees = ExecutionContext.CreateChildOperation(prunedTreesReducer);
+      var collectValues = ExecutionContext.CreateChildOperation(valuesCollector);
+      var collectResults = ExecutionContext.CreateChildOperation(resultsCollector);
+
+      return new OperationCollection { prune, reducePrunedNodes, reducePrunedSubtrees, reducePrunedTrees, collectValues, collectResults, base.Apply() };
+    }
+
+    private void InitializeOperators() {
+      prunedNodesReducer = new DataReducer();
+      prunedNodesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedNodesParameter.ActualName;
+      prunedNodesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum); // sum all the pruned subtrees parameter values
+      prunedNodesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign); // asign the sum to the target parameter
+      prunedNodesReducer.TargetParameter.ActualName = TotalNumberOfPrunedNodesParameterName;
+
+      prunedSubtreesReducer = new DataReducer();
+      prunedSubtreesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedSubtreesParameter.ActualName;
+      prunedSubtreesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum); // sum all the pruned subtrees parameter values
+      prunedSubtreesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign); // asign the sum to the target parameter
+      prunedSubtreesReducer.TargetParameter.ActualName = TotalNumberOfPrunedSubtreesParameterName;
+
+      prunedTreesReducer = new DataReducer();
+      prunedTreesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedTreesParameter.ActualName;
+      prunedTreesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum);
+      prunedTreesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign);
+      prunedTreesReducer.TargetParameter.ActualName = TotalNumberOfPrunedTreesParameterName;
+
+      valuesCollector = new DataTableValuesCollector();
+      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedNodesParameterName));
+      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedSubtreesParameterName));
+      valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedTreesParameterName));
+      valuesCollector.DataTableParameter.ActualName = "Population pruning";
+
+      resultsCollector = new ResultsCollector();
+      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Population pruning"));
+      resultsCollector.ResultsParameter.ActualName = ResultsParameterName;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer.cs	(revision 16132)
@@ -0,0 +1,185 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// An operator that analyzes the training best symbolic data analysis solution for single objective symbolic data analysis problems.
+  /// </summary>
+  [Item("SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic data analysis solution for single objective symbolic data analysis problems.")]
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> : SymbolicDataAnalysisSingleObjectiveAnalyzer, IIterationBasedOperator where T : class, ISymbolicDataAnalysisSolution {
+    private const string TrainingBestSolutionParameterName = "Best training solution";
+    private const string TrainingBestSolutionQualityParameterName = "Best training solution quality";
+    private const string TrainingBestSolutionGenerationParameterName = "Best training solution generation";
+    private const string TrainingBestSolutionsHistoryParameterName = "Best training solutions history";
+    private const string UpdateAlwaysParameterName = "Always update best solution";
+    private const string IterationsParameterName = "Iterations";
+    private const string MaximumIterationsParameterName = "Maximum Iterations";
+    private const string StoreHistoryParameterName = "Store History";
+
+    #region parameter properties
+    public ILookupParameter<T> TrainingBestSolutionParameter {
+      get { return (ILookupParameter<T>)Parameters[TrainingBestSolutionParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> TrainingBestSolutionQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[TrainingBestSolutionQualityParameterName]; }
+    }
+    public ILookupParameter<IntValue> TrainingBestSolutionGenerationParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[TrainingBestSolutionGenerationParameterName]; }
+    }
+    public ILookupParameter<ItemList<T>> TrainingBestSolutionsHistoryParameter {
+      get { return (ILookupParameter<ItemList<T>>)Parameters[TrainingBestSolutionsHistoryParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> UpdateAlwaysParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; }
+    }
+    public ILookupParameter<IntValue> IterationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; }
+    }
+
+    public IFixedValueParameter<BoolValue> StoreHistoryParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[StoreHistoryParameterName]; }
+    }
+    #endregion
+    #region properties
+    public T TrainingBestSolution {
+      get { return TrainingBestSolutionParameter.ActualValue; }
+      set { TrainingBestSolutionParameter.ActualValue = value; }
+    }
+    public DoubleValue TrainingBestSolutionQuality {
+      get { return TrainingBestSolutionQualityParameter.ActualValue; }
+      set { TrainingBestSolutionQualityParameter.ActualValue = value; }
+    }
+    public bool UpdateAlways {
+      get { return UpdateAlwaysParameter.Value.Value; }
+      set { UpdateAlwaysParameter.Value.Value = value; }
+    }
+
+    public bool StoreHistory {
+      get { return StoreHistoryParameter.Value.Value; }
+      set { StoreHistoryParameter.Value.Value = value; }
+    }
+    #endregion
+
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<T> original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<T>(TrainingBestSolutionParameterName, "The best training symbolic data analyis solution."));
+      Parameters.Add(new LookupParameter<DoubleValue>(TrainingBestSolutionQualityParameterName, "The quality of the training best symbolic data analysis solution."));
+      Parameters.Add(new LookupParameter<IntValue>(TrainingBestSolutionGenerationParameterName, "The generation in which the best training solution was found."));
+      Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best training solution should always be updated regardless of its quality.", new BoolValue(false)));
+      Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
+      Parameters.Add(new FixedValueParameter<BoolValue>(StoreHistoryParameterName, "Flag that determines whether all encountered best solutions should be stored as results.", new BoolValue(false)));
+      Parameters.Add(new LookupParameter<ItemList<T>>(TrainingBestSolutionsHistoryParameterName, "The history of the best training symbolic data analysis solutions."));
+      UpdateAlwaysParameter.Hidden = true;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(UpdateAlwaysParameterName)) {
+        Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best training solution should always be updated regardless of its quality.", new BoolValue(false)));
+        UpdateAlwaysParameter.Hidden = true;
+      }
+      if (!Parameters.ContainsKey(TrainingBestSolutionGenerationParameterName))
+        Parameters.Add(new LookupParameter<IntValue>(TrainingBestSolutionGenerationParameterName, "The generation in which the best training solution was found."));
+      if (!Parameters.ContainsKey(IterationsParameterName))
+        Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
+      if (!Parameters.ContainsKey(MaximumIterationsParameterName))
+        Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
+      if (!Parameters.ContainsKey(StoreHistoryParameterName))
+        Parameters.Add(new FixedValueParameter<BoolValue>(StoreHistoryParameterName, "Flag that determines whether all encountered best solutions should be stored as results.", new BoolValue(false)));
+      if (!Parameters.ContainsKey(TrainingBestSolutionsHistoryParameterName))
+        Parameters.Add(new LookupParameter<ItemList<T>>(TrainingBestSolutionsHistoryParameterName, "The history of the best training symbolic data analysis solutions."));
+    }
+
+    public override IOperation Apply() {
+      var results = ResultCollection;
+      #region create results
+      if (!results.ContainsKey(TrainingBestSolutionParameter.Name))
+        results.Add(new Result(TrainingBestSolutionParameter.Name, TrainingBestSolutionParameter.Description, typeof(T)));
+      if (!results.ContainsKey(TrainingBestSolutionQualityParameter.Name))
+        results.Add(new Result(TrainingBestSolutionQualityParameter.Name, TrainingBestSolutionQualityParameter.Description, typeof(DoubleValue)));
+      if (!results.ContainsKey(TrainingBestSolutionGenerationParameter.Name) && IterationsParameter.ActualValue != null)
+        results.Add(new Result(TrainingBestSolutionGenerationParameter.Name, TrainingBestSolutionGenerationParameter.Description, typeof(IntValue)));
+      if (StoreHistory && !results.ContainsKey(TrainingBestSolutionsHistoryParameter.Name)) {
+
+        results.Add(new Result(TrainingBestSolutionsHistoryParameter.Name, TrainingBestSolutionsHistoryParameter.Description, typeof(ItemList<T>)));
+        TrainingBestSolutionsHistoryParameter.ActualValue = new ItemList<T>();
+        results[TrainingBestSolutionsHistoryParameter.Name].Value = TrainingBestSolutionsHistoryParameter.ActualValue;
+      }
+      #endregion
+
+      #region find best tree
+      double bestQuality = Maximization.Value ? double.NegativeInfinity : double.PositiveInfinity;
+      ISymbolicExpressionTree bestTree = null;
+      ISymbolicExpressionTree[] tree = SymbolicExpressionTree.ToArray();
+      double[] quality = Quality.Select(x => x.Value).ToArray();
+      for (int i = 0; i < tree.Length; i++) {
+        if (IsBetter(quality[i], bestQuality, Maximization.Value)) {
+          bestQuality = quality[i];
+          bestTree = tree[i];
+        }
+      }
+      #endregion
+
+      if (bestTree != null && (UpdateAlways || TrainingBestSolutionQuality == null ||
+        IsBetter(bestQuality, TrainingBestSolutionQuality.Value, Maximization.Value))) {
+        TrainingBestSolution = CreateSolution(bestTree, bestQuality);
+        TrainingBestSolutionQuality = new DoubleValue(bestQuality);
+        if (IterationsParameter.ActualValue != null)
+          TrainingBestSolutionGenerationParameter.ActualValue = new IntValue(IterationsParameter.ActualValue.Value);
+
+        results[TrainingBestSolutionParameter.Name].Value = TrainingBestSolution;
+        results[TrainingBestSolutionQualityParameter.Name].Value = TrainingBestSolutionQuality;
+        if (TrainingBestSolutionGenerationParameter.ActualValue != null)
+          results[TrainingBestSolutionGenerationParameter.Name].Value = TrainingBestSolutionGenerationParameter.ActualValue;
+
+        if (StoreHistory) {
+          TrainingBestSolutionsHistoryParameter.ActualValue.Add(TrainingBestSolution);
+        }
+      }
+      return base.Apply();
+    }
+
+    protected abstract T CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality);
+
+    private bool IsBetter(double lhs, double rhs, bool maximization) {
+      if (maximization) return lhs > rhs;
+      else return lhs < rhs;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs	(revision 16132)
@@ -0,0 +1,191 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// An operator that collects the Pareto-best symbolic data analysis solutions for single objective symbolic data analysis problems.
+  /// </summary>
+  [Item("SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer", "An operator that analyzes the Pareto-best symbolic data analysis solution for single objective symbolic data analysis problems.")]
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<S, T> : SymbolicDataAnalysisSingleObjectiveAnalyzer, ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator
+    where T : class, ISymbolicDataAnalysisSolution
+    where S : class, IDataAnalysisProblemData {
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string TrainingBestSolutionsParameterName = "Best training solutions";
+    private const string TrainingBestSolutionQualitiesParameterName = "Best training solution qualities";
+    private const string ComplexityParameterName = "Complexity";
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
+    private const string EstimationLimitsParameterName = "EstimationLimits";
+
+    public override bool EnabledByDefault {
+      get { return false; }
+    }
+
+    #region parameter properties
+    public ILookupParameter<ItemList<T>> TrainingBestSolutionsParameter {
+      get { return (ILookupParameter<ItemList<T>>)Parameters[TrainingBestSolutionsParameterName]; }
+    }
+    public ILookupParameter<ItemList<DoubleArray>> TrainingBestSolutionQualitiesParameter {
+      get { return (ILookupParameter<ItemList<DoubleArray>>)Parameters[TrainingBestSolutionQualitiesParameterName]; }
+    }
+    public IScopeTreeLookupParameter<DoubleValue> ComplexityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[ComplexityParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+    public ILookupParameter<S> ProblemDataParameter {
+      get { return (ILookupParameter<S>)Parameters[ProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
+      get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+    }
+    #endregion
+    #region properties
+    public ItemList<T> TrainingBestSolutions {
+      get { return TrainingBestSolutionsParameter.ActualValue; }
+      set { TrainingBestSolutionsParameter.ActualValue = value; }
+    }
+    public ItemList<DoubleArray> TrainingBestSolutionQualities {
+      get { return TrainingBestSolutionQualitiesParameter.ActualValue; }
+      set { TrainingBestSolutionQualitiesParameter.ActualValue = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<S, T> original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<S>(ProblemDataParameterName, "The problem data for the symbolic data analysis solution."));
+      Parameters.Add(new LookupParameter<ItemList<T>>(TrainingBestSolutionsParameterName, "The training best (Pareto-optimal) symbolic data analysis solutions."));
+      Parameters.Add(new LookupParameter<ItemList<DoubleArray>>(TrainingBestSolutionQualitiesParameterName, "The qualities of the training best (Pareto-optimal) solutions."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(ComplexityParameterName, "The complexity of each tree."));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model."));
+    }
+
+    public override IOperation Apply() {
+      var results = ResultCollection;
+      // create empty parameter and result values
+      if (TrainingBestSolutions == null) {
+        TrainingBestSolutions = new ItemList<T>();
+        TrainingBestSolutionQualities = new ItemList<DoubleArray>();
+        results.Add(new Result(TrainingBestSolutionQualitiesParameter.Name, TrainingBestSolutionQualitiesParameter.Description, TrainingBestSolutionQualities));
+        results.Add(new Result(TrainingBestSolutionsParameter.Name, TrainingBestSolutionsParameter.Description, TrainingBestSolutions));
+      }
+
+      IList<Tuple<double, double>> trainingBestQualities = TrainingBestSolutionQualities
+        .Select(x => Tuple.Create(x[0], x[1]))
+        .ToList();
+
+      #region find best trees
+      IList<int> nonDominatedIndexes = new List<int>();
+      ISymbolicExpressionTree[] tree = SymbolicExpressionTree.ToArray();
+      List<double> qualities = Quality.Select(x => x.Value).ToList();
+
+      List<double> complexities;
+      if (ComplexityParameter.ActualValue != null && ComplexityParameter.ActualValue.Length == qualities.Count) {
+        complexities = ComplexityParameter.ActualValue.Select(x => x.Value).ToList();
+      } else {
+        complexities = tree.Select(t => (double)t.Length).ToList();
+      }
+      List<Tuple<double, double>> fitness = new List<Tuple<double, double>>();
+      for (int i = 0; i < qualities.Count; i++)
+        fitness.Add(Tuple.Create(qualities[i], complexities[i]));
+      var maximization = Tuple.Create(Maximization.Value, false);// complexity must be minimized
+      List<Tuple<double, double>> newNonDominatedQualities = new List<Tuple<double, double>>();
+      for (int i = 0; i < tree.Length; i++) {
+        if (IsNonDominated(fitness[i], trainingBestQualities, maximization) &&
+          IsNonDominated(fitness[i], newNonDominatedQualities, maximization) &&
+          IsNonDominated(fitness[i], fitness.Skip(i + 1), maximization)) {
+          if (!newNonDominatedQualities.Contains(fitness[i])) {
+            newNonDominatedQualities.Add(fitness[i]);
+            nonDominatedIndexes.Add(i);
+          }
+        }
+      }
+      #endregion
+
+      #region update Pareto-optimal solution archive
+      if (nonDominatedIndexes.Count > 0) {
+        ItemList<DoubleArray> nonDominatedQualities = new ItemList<DoubleArray>();
+        ItemList<T> nonDominatedSolutions = new ItemList<T>();
+        // add all new non-dominated solutions to the archive
+        foreach (var index in nonDominatedIndexes) {
+          T solution = CreateSolution(tree[index]);
+          nonDominatedSolutions.Add(solution);
+          nonDominatedQualities.Add(new DoubleArray(new double[] { fitness[index].Item1, fitness[index].Item2 }));
+        }
+        // add old non-dominated solutions only if they are not dominated by one of the new solutions
+        for (int i = 0; i < trainingBestQualities.Count; i++) {
+          if (IsNonDominated(trainingBestQualities[i], newNonDominatedQualities, maximization)) {
+            if (!newNonDominatedQualities.Contains(trainingBestQualities[i])) {
+              nonDominatedSolutions.Add(TrainingBestSolutions[i]);
+              nonDominatedQualities.Add(TrainingBestSolutionQualities[i]);
+            }
+          }
+        }
+
+        // make sure solutions and qualities are ordered in the results
+        var orderedIndexes =
+          nonDominatedSolutions.Select((s, i) => i).OrderBy(i => nonDominatedQualities[i][0]).ToArray();
+
+        var orderedNonDominatedSolutions = new ItemList<T>();
+        var orderedNonDominatedQualities = new ItemList<DoubleArray>();
+        foreach (var i in orderedIndexes) {
+          orderedNonDominatedQualities.Add(nonDominatedQualities[i]);
+          orderedNonDominatedSolutions.Add(nonDominatedSolutions[i]);
+        }
+
+        TrainingBestSolutions = orderedNonDominatedSolutions;
+        TrainingBestSolutionQualities = orderedNonDominatedQualities;
+
+        results[TrainingBestSolutionsParameter.Name].Value = orderedNonDominatedSolutions;
+        results[TrainingBestSolutionQualitiesParameter.Name].Value = orderedNonDominatedQualities;
+      }
+      #endregion
+      return base.Apply();
+    }
+
+    protected abstract T CreateSolution(ISymbolicExpressionTree bestTree);
+
+    private bool IsNonDominated(Tuple<double, double> point, IEnumerable<Tuple<double, double>> points, Tuple<bool, bool> maximization) {
+      return !points.Any(p => IsBetterOrEqual(p.Item1, point.Item1, maximization.Item1) &&
+                             IsBetterOrEqual(p.Item2, point.Item2, maximization.Item2));
+    }
+    private bool IsBetterOrEqual(double lhs, double rhs, bool maximization) {
+      if (maximization) return lhs >= rhs;
+      else return lhs <= rhs;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationAnalyzer.cs	(revision 16132)
@@ -0,0 +1,112 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Abstract base class for symbolic data analysis analyzers that validate a solution on a separate data partition using the evaluator.
+  /// </summary>
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U> : SymbolicDataAnalysisSingleObjectiveAnalyzer,
+    ISymbolicDataAnalysisValidationAnalyzer<T, U>, IStochasticOperator
+    where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+    where U : class, IDataAnalysisProblemData {
+    private const string RandomParameterName = "Random";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string EvaluatorParameterName = "Evaluator";
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
+    private const string ValidationPartitionParameterName = "ValidationPartition";
+    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+    private const string PercentageOfBestSolutionsParameterName = "PercentageOfBestSolutions";
+
+    #region parameter properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public ILookupParameter<U> ProblemDataParameter {
+      get { return (ILookupParameter<U>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<T> EvaluatorParameter {
+      get { return (ILookupParameter<T>)Parameters[EvaluatorParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+    public IValueLookupParameter<IntRange> ValidationPartitionParameter {
+      get { return (IValueLookupParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
+    }
+    public IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+    }
+    public IValueLookupParameter<PercentValue> PercentageOfBestSolutionsParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[PercentageOfBestSolutionsParameterName]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSingleObjectiveValidationAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisSingleObjectiveValidationAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    protected SymbolicDataAnalysisSingleObjectiveValidationAnalyzer(): base() {
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator."));
+      Parameters.Add(new LookupParameter<U>(ProblemDataParameterName, "The problem data of the symbolic data analysis problem."));
+      Parameters.Add(new LookupParameter<T>(EvaluatorParameterName, "The operator to use for fitness evaluation on the validation partition."));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter for symbolic data analysis expression trees."));
+      Parameters.Add(new ValueLookupParameter<IntRange>(ValidationPartitionParameterName, "The validation partition."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>(PercentageOfBestSolutionsParameterName,
+                                                            "The percentage of the top solutions which should be analyzed.", new PercentValue(0.1)));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(PercentageOfBestSolutionsParameterName))
+        Parameters.Add(new ValueLookupParameter<PercentValue>(PercentageOfBestSolutionsParameterName,
+                                                               "The percentage of the top solutions which should be analyzed.", new PercentValue(1)));
+    }
+
+    protected IEnumerable<int> GenerateRowsToEvaluate() {
+      int seed = RandomParameter.ActualValue.Next();
+      int samplesStart = ValidationPartitionParameter.ActualValue.Start;
+      int samplesEnd = ValidationPartitionParameter.ActualValue.End;
+      int testPartitionStart = ProblemDataParameter.ActualValue.TestPartition.Start;
+      int testPartitionEnd = ProblemDataParameter.ActualValue.TestPartition.End;
+
+      if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value.");
+      int count = (int)((samplesEnd - samplesStart) * RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value);
+      if (count == 0) count = 1;
+      return RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count)
+        .Where(i => i < testPartitionStart || testPartitionEnd <= i);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer.cs	(revision 16132)
@@ -0,0 +1,185 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// An operator that analyzes the validation best symbolic data analysis solution for single objective symbolic data analysis problems.
+  /// </summary>
+  [Item("SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for single objective symbolic data analysis problems.")]
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>, IIterationBasedOperator
+    where S : class, ISymbolicDataAnalysisSolution
+    where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+    where U : class, IDataAnalysisProblemData {
+    private const string ValidationBestSolutionParameterName = "Best validation solution";
+    private const string ValidationBestSolutionQualityParameterName = "Best validation solution quality";
+    private const string ValidationBestSolutionGenerationParameterName = "Best validation solution generation";
+    private const string UpdateAlwaysParameterName = "Always update best solution";
+    private const string IterationsParameterName = "Iterations";
+    private const string MaximumIterationsParameterName = "Maximum Iterations";
+
+    #region parameter properties
+    public ILookupParameter<S> ValidationBestSolutionParameter {
+      get { return (ILookupParameter<S>)Parameters[ValidationBestSolutionParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> ValidationBestSolutionQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[ValidationBestSolutionQualityParameterName]; }
+    }
+    public ILookupParameter<IntValue> ValidationBestSolutionGenerationParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[ValidationBestSolutionGenerationParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> UpdateAlwaysParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; }
+    }
+    public ILookupParameter<IntValue> IterationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; }
+    }
+    #endregion
+    #region properties
+    public S ValidationBestSolution {
+      get { return ValidationBestSolutionParameter.ActualValue; }
+      set { ValidationBestSolutionParameter.ActualValue = value; }
+    }
+    public DoubleValue ValidationBestSolutionQuality {
+      get { return ValidationBestSolutionQualityParameter.ActualValue; }
+      set { ValidationBestSolutionQualityParameter.ActualValue = value; }
+    }
+    public BoolValue UpdateAlways {
+      get { return UpdateAlwaysParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<S>(ValidationBestSolutionParameterName, "The validation best symbolic data analyis solution."));
+      Parameters.Add(new LookupParameter<DoubleValue>(ValidationBestSolutionQualityParameterName, "The quality of the validation best symbolic data analysis solution."));
+      Parameters.Add(new LookupParameter<IntValue>(ValidationBestSolutionGenerationParameterName, "The generation in which the best validation solution was found."));
+      Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best validation solution should always be updated regardless of its quality.", new BoolValue(false)));
+      Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
+      UpdateAlwaysParameter.Hidden = true;
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(UpdateAlwaysParameterName)) {
+        Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best validation solution should always be updated regardless of its quality.", new BoolValue(false)));
+        UpdateAlwaysParameter.Hidden = true;
+      }
+      if (!Parameters.ContainsKey(ValidationBestSolutionGenerationParameterName))
+        Parameters.Add(new LookupParameter<IntValue>(ValidationBestSolutionGenerationParameterName, "The generation in which the best validation solution was found."));
+      if (!Parameters.ContainsKey(IterationsParameterName))
+        Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
+      if (!Parameters.ContainsKey(MaximumIterationsParameterName))
+        Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
+    }
+
+    public override IOperation Apply() {
+      IEnumerable<int> rows = GenerateRowsToEvaluate();
+      if (!rows.Any()) return base.Apply();
+
+      #region find best tree
+      var evaluator = EvaluatorParameter.ActualValue;
+      var problemData = ProblemDataParameter.ActualValue;
+      double bestValidationQuality = Maximization.Value ? double.NegativeInfinity : double.PositiveInfinity;
+      ISymbolicExpressionTree bestTree = null;
+      ISymbolicExpressionTree[] tree = SymbolicExpressionTree.ToArray();
+
+      // sort is ascending and we take the first n% => order so that best solutions are smallest
+      // sort order is determined by maximization parameter
+      double[] trainingQuality;
+      if (Maximization.Value) {
+        // largest values must be sorted first
+        trainingQuality = Quality.Select(x => -x.Value).ToArray();
+      } else {
+        // smallest values must be sorted first
+        trainingQuality = Quality.Select(x => x.Value).ToArray();
+      }
+
+      // sort trees by training qualities
+      Array.Sort(trainingQuality, tree);
+
+      // number of best training solutions to validate (at least 1)
+      int topN = (int)Math.Max(tree.Length * PercentageOfBestSolutionsParameter.ActualValue.Value, 1);
+
+      IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator);
+      // evaluate best n training trees on validiation set
+      var quality = tree
+        .Take(topN)
+        .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
+        .ToArray();
+
+      for (int i = 0; i < quality.Length; i++) {
+        if (IsBetter(quality[i], bestValidationQuality, Maximization.Value)) {
+          bestValidationQuality = quality[i];
+          bestTree = tree[i];
+        }
+      }
+      #endregion
+
+      var results = ResultCollection;
+      if (UpdateAlways.Value || ValidationBestSolutionQuality == null ||
+        IsBetter(bestValidationQuality, ValidationBestSolutionQuality.Value, Maximization.Value)) {
+        ValidationBestSolution = CreateSolution(bestTree, bestValidationQuality);
+        ValidationBestSolutionQuality = new DoubleValue(bestValidationQuality);
+        if (IterationsParameter.ActualValue != null)
+          ValidationBestSolutionGenerationParameter.ActualValue = new IntValue(IterationsParameter.ActualValue.Value);
+
+        if (!results.ContainsKey(ValidationBestSolutionParameter.Name)) {
+          results.Add(new Result(ValidationBestSolutionParameter.Name, ValidationBestSolutionParameter.Description, ValidationBestSolution));
+          results.Add(new Result(ValidationBestSolutionQualityParameter.Name, ValidationBestSolutionQualityParameter.Description, ValidationBestSolutionQuality));
+          if (ValidationBestSolutionGenerationParameter.ActualValue != null)
+            results.Add(new Result(ValidationBestSolutionGenerationParameter.Name, ValidationBestSolutionGenerationParameter.Description, ValidationBestSolutionGenerationParameter.ActualValue));
+        } else {
+          results[ValidationBestSolutionParameter.Name].Value = ValidationBestSolution;
+          results[ValidationBestSolutionQualityParameter.Name].Value = ValidationBestSolutionQuality;
+          if (ValidationBestSolutionGenerationParameter.ActualValue != null)
+            results[ValidationBestSolutionGenerationParameter.Name].Value = ValidationBestSolutionGenerationParameter.ActualValue;
+        }
+      }
+      return base.Apply();
+    }
+
+    protected abstract S CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality);
+
+    private bool IsBetter(double lhs, double rhs, bool maximization) {
+      if (maximization) return lhs > rhs;
+      else return lhs < rhs;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs	(revision 16132)
@@ -0,0 +1,218 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// An operator that collects the Pareto-best symbolic data analysis solutions for single objective symbolic data analysis problems.
+  /// </summary>
+  [Item("SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer", "An operator that analyzes the Pareto-best symbolic data analysis solution for single objective symbolic data analysis problems.")]
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>, ISymbolicDataAnalysisBoundedOperator
+    where S : class, ISymbolicDataAnalysisSolution
+    where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+    where U : class, IDataAnalysisProblemData {
+    private const string ValidationBestSolutionsParameterName = "Best validation solutions";
+    private const string ValidationBestSolutionQualitiesParameterName = "Best validation solution qualities";
+    private const string ComplexityParameterName = "Complexity";
+    private const string EstimationLimitsParameterName = "EstimationLimits";
+
+    public override bool EnabledByDefault {
+      get { return false; }
+    }
+
+    #region parameter properties
+    public ILookupParameter<ItemList<S>> ValidationBestSolutionsParameter {
+      get { return (ILookupParameter<ItemList<S>>)Parameters[ValidationBestSolutionsParameterName]; }
+    }
+    public ILookupParameter<ItemList<DoubleArray>> ValidationBestSolutionQualitiesParameter {
+      get { return (ILookupParameter<ItemList<DoubleArray>>)Parameters[ValidationBestSolutionQualitiesParameterName]; }
+    }
+    public IScopeTreeLookupParameter<DoubleValue> ComplexityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[ComplexityParameterName]; }
+    }
+    public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
+      get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+    }
+
+    #endregion
+    #region properties
+    public ItemList<S> ValidationBestSolutions {
+      get { return ValidationBestSolutionsParameter.ActualValue; }
+      set { ValidationBestSolutionsParameter.ActualValue = value; }
+    }
+    public ItemList<DoubleArray> ValidationBestSolutionQualities {
+      get { return ValidationBestSolutionQualitiesParameter.ActualValue; }
+      set { ValidationBestSolutionQualitiesParameter.ActualValue = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<ItemList<S>>(ValidationBestSolutionsParameterName, "The validation best (Pareto-optimal) symbolic data analysis solutions."));
+      Parameters.Add(new LookupParameter<ItemList<DoubleArray>>(ValidationBestSolutionQualitiesParameterName, "The qualities of the validation best (Pareto-optimal) solutions."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(ComplexityParameterName, "The complexity of each tree."));
+      Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model."));
+    }
+
+    public override IOperation Apply() {
+      IEnumerable<int> rows = GenerateRowsToEvaluate();
+      if (!rows.Any()) return base.Apply();
+
+      #region find best tree
+      var evaluator = EvaluatorParameter.ActualValue;
+      var problemData = ProblemDataParameter.ActualValue;
+      ISymbolicExpressionTree[] tree = SymbolicExpressionTree.ToArray();
+
+      // sort is ascending and we take the first n% => order so that best solutions are smallest
+      // sort order is determined by maximization parameter
+      double[] trainingQuality;
+      if (Maximization.Value) {
+        // largest values must be sorted first
+        trainingQuality = Quality.Select(x => -x.Value).ToArray();
+      } else {
+        // smallest values must be sorted first
+        trainingQuality = Quality.Select(x => x.Value).ToArray();
+      }
+
+      int[] treeIndexes = Enumerable.Range(0, tree.Length).ToArray();
+
+      // sort trees by training qualities
+      Array.Sort(trainingQuality, treeIndexes);
+
+      // number of best training solutions to validate (at least 1)
+      int topN = (int)Math.Max(tree.Length * PercentageOfBestSolutionsParameter.ActualValue.Value, 1);
+
+      IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator);
+      // evaluate best n training trees on validiation set
+      var qualities = treeIndexes
+        .Select(i => tree[i])
+        .Take(topN)
+        .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
+        .ToArray();
+      #endregion
+
+      var results = ResultCollection;
+      // create empty parameter and result values
+      if (ValidationBestSolutions == null) {
+        ValidationBestSolutions = new ItemList<S>();
+        ValidationBestSolutionQualities = new ItemList<DoubleArray>();
+        results.Add(new Result(ValidationBestSolutionQualitiesParameter.Name, ValidationBestSolutionQualitiesParameter.Description, ValidationBestSolutionQualities));
+        results.Add(new Result(ValidationBestSolutionsParameter.Name, ValidationBestSolutionsParameter.Description, ValidationBestSolutions));
+      }
+
+      IList<Tuple<double, double>> validationBestQualities = ValidationBestSolutionQualities
+        .Select(x => Tuple.Create(x[0], x[1]))
+        .ToList();
+
+      #region find best trees
+      IList<int> nonDominatedIndexes = new List<int>();
+
+      List<double> complexities;
+      if (ComplexityParameter.ActualValue != null && ComplexityParameter.ActualValue.Length == trainingQuality.Length) {
+        complexities = ComplexityParameter.ActualValue.Select(x => x.Value).ToList();
+      } else {
+        complexities = tree.Select(t => (double)t.Length).ToList();
+      }
+      List<Tuple<double, double>> fitness = new List<Tuple<double, double>>();
+      for (int i = 0; i < qualities.Length; i++)
+        fitness.Add(Tuple.Create(qualities[i], complexities[treeIndexes[i]]));
+
+      var maximization = Tuple.Create(Maximization.Value, false); // complexity must be minimized
+      List<Tuple<double, double>> newNonDominatedQualities = new List<Tuple<double, double>>();
+      for (int i = 0; i < fitness.Count; i++) {
+        if (IsNonDominated(fitness[i], validationBestQualities, maximization) &&
+          IsNonDominated(fitness[i], newNonDominatedQualities, maximization) &&
+          IsNonDominated(fitness[i], fitness.Skip(i + 1), maximization)) {
+          if (!newNonDominatedQualities.Contains(fitness[i])) {
+            newNonDominatedQualities.Add(fitness[i]);
+            nonDominatedIndexes.Add(i);
+          }
+        }
+      }
+      #endregion
+
+      #region update Pareto-optimal solution archive
+      if (nonDominatedIndexes.Count > 0) {
+        ItemList<DoubleArray> nonDominatedQualities = new ItemList<DoubleArray>();
+        ItemList<S> nonDominatedSolutions = new ItemList<S>();
+        // add all new non-dominated solutions to the archive
+        foreach (var index in nonDominatedIndexes) {
+          S solution = CreateSolution(tree[treeIndexes[index]]);
+          nonDominatedSolutions.Add(solution);
+          nonDominatedQualities.Add(new DoubleArray(new double[] { fitness[index].Item1, fitness[index].Item2 }));
+        }
+        // add old non-dominated solutions only if they are not dominated by one of the new solutions
+        for (int i = 0; i < validationBestQualities.Count; i++) {
+          if (IsNonDominated(validationBestQualities[i], newNonDominatedQualities, maximization)) {
+            if (!newNonDominatedQualities.Contains(validationBestQualities[i])) {
+              nonDominatedSolutions.Add(ValidationBestSolutions[i]);
+              nonDominatedQualities.Add(ValidationBestSolutionQualities[i]);
+            }
+          }
+        }
+
+        // make sure solutions and qualities are ordered in the results
+        var orderedIndexes =
+          nonDominatedSolutions.Select((s, i) => i).OrderBy(i => nonDominatedQualities[i][0]).ToArray();
+
+        var orderedNonDominatedSolutions = new ItemList<S>();
+        var orderedNonDominatedQualities = new ItemList<DoubleArray>();
+        foreach (var i in orderedIndexes) {
+          orderedNonDominatedQualities.Add(nonDominatedQualities[i]);
+          orderedNonDominatedSolutions.Add(nonDominatedSolutions[i]);
+        }
+
+        ValidationBestSolutions = orderedNonDominatedSolutions;
+        ValidationBestSolutionQualities = orderedNonDominatedQualities;
+
+        results[ValidationBestSolutionsParameter.Name].Value = orderedNonDominatedSolutions;
+        results[ValidationBestSolutionQualitiesParameter.Name].Value = orderedNonDominatedQualities;
+      }
+      #endregion
+      return base.Apply();
+    }
+
+    protected abstract S CreateSolution(ISymbolicExpressionTree bestTree);
+
+    private bool IsNonDominated(Tuple<double, double> point, IEnumerable<Tuple<double, double>> points, Tuple<bool, bool> maximization) {
+      return !points.Any(p => IsBetterOrEqual(p.Item1, point.Item1, maximization.Item1) &&
+                             IsBetterOrEqual(p.Item2, point.Item2, maximization.Item2));
+    }
+    private bool IsBetterOrEqual(double lhs, double rhs, bool maximization) {
+      if (maximization) return lhs >= rhs;
+      else return lhs <= rhs;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisUsefulGenesAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisUsefulGenesAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisUsefulGenesAnalyzer.cs	(revision 16132)
@@ -0,0 +1,268 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Analyzers {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisUsefulGenesAnalyzer", "An analyzer which performs pruning by promoting genes in the population that outperform their containing individuals (the individuals are replaced by their subparts).")]
+  public class SymbolicDataAnalysisUsefulGenesAnalyzer : SingleSuccessorOperator, ISymbolicDataAnalysisAnalyzer {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string QualityParameterName = "Quality";
+    private const string ResultCollectionParameterName = "Results";
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string GenerationsParameterName = "Generations";
+    private const string UpdateCounterParameterName = "UpdateCounter";
+    private const string UpdateIntervalParameterName = "UpdateInterval";
+    private const string MinimumGenerationsParameterName = "MinimumGenerations";
+    private const string PruningProbabilityParameterName = "PruningProbability";
+    private const string PercentageOfBestSolutionsParameterName = "PercentageOfBestSolutions";
+    private const string PromotedSubtreesResultName = "Promoted subtrees";
+    private const string AverageQualityImprovementResultName = "Average quality improvement";
+    private const string AverageLengthReductionResultName = "Average length reduction";
+    private const string RandomParameterName = "Random";
+
+    #region Parameters
+    public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+
+    public ILookupParameter<ResultCollection> ResultCollectionParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultCollectionParameterName]; }
+    }
+
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+
+    public ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+
+    public ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
+    }
+
+    public ValueParameter<IntValue> UpdateCounterParameter {
+      get { return (ValueParameter<IntValue>)Parameters[UpdateCounterParameterName]; }
+    }
+
+    public ValueParameter<IntValue> UpdateIntervalParameter {
+      get { return (ValueParameter<IntValue>)Parameters[UpdateIntervalParameterName]; }
+    }
+
+    public ValueParameter<IntValue> MinimumGenerationsParameter {
+      get { return (ValueParameter<IntValue>)Parameters[MinimumGenerationsParameterName]; }
+    }
+
+    public ValueParameter<PercentValue> PercentageOfBestSolutionsParameter {
+      get { return (ValueParameter<PercentValue>)Parameters[PercentageOfBestSolutionsParameterName]; }
+    }
+
+    public ValueParameter<PercentValue> PruningProbabilityParameter {
+      get { return (ValueParameter<PercentValue>)Parameters[PruningProbabilityParameterName]; }
+    }
+    #endregion
+
+    #region Parameter properties
+    public int UpdateCounter {
+      get { return UpdateCounterParameter.Value.Value; }
+      set { UpdateCounterParameter.Value.Value = value; }
+    }
+
+    public int UpdateInterval {
+      get { return UpdateIntervalParameter.Value.Value; }
+      set { UpdateIntervalParameter.Value.Value = value; }
+    }
+
+    public int MinimumGenerations {
+      get { return MinimumGenerationsParameter.Value.Value; }
+      set { MinimumGenerationsParameter.Value.Value = value; }
+    }
+
+    public double PercentageOfBestSolutions {
+      get { return PercentageOfBestSolutionsParameter.Value.Value; }
+      set { PercentageOfBestSolutionsParameter.Value.Value = value; }
+    }
+
+    public double PruningProbability {
+      get { return PruningProbabilityParameter.Value.Value; }
+      set { PruningProbabilityParameter.Value.Value = value; }
+    }
+    #endregion
+
+    public SymbolicDataAnalysisUsefulGenesAnalyzer() {
+      #region Add parameters
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName));
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultCollectionParameterName));
+      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName));
+      Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName));
+      Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, new IntValue(0)));
+      Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, new IntValue(1)));
+      Parameters.Add(new ValueParameter<IntValue>(MinimumGenerationsParameterName, "The minimum number of generations the algorithm must be let to evolve before applying this analyzer.", new IntValue(50)));
+      Parameters.Add(new ValueParameter<PercentValue>(PercentageOfBestSolutionsParameterName, "How many of the best individuals should be pruned using this method.", new PercentValue(1.0)));
+      Parameters.Add(new ValueParameter<PercentValue>(PruningProbabilityParameterName, "The probability to apply pruning", new PercentValue(0.1)));
+      #endregion
+    }
+
+    protected SymbolicDataAnalysisUsefulGenesAnalyzer(SymbolicDataAnalysisUsefulGenesAnalyzer original, Cloner cloner)
+      : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisUsefulGenesAnalyzer(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisUsefulGenesAnalyzer(bool deserializing)
+      : base(deserializing) {
+    }
+
+    public bool EnabledByDefault {
+      get { return false; }
+    }
+
+    public override void InitializeState() {
+      UpdateCounter = 0;
+      base.InitializeState();
+    }
+
+    public override IOperation Apply() {
+      int generations = GenerationsParameter.ActualValue.Value;
+      #region Update counter & update interval
+      if (generations < MinimumGenerations)
+        return base.Apply();
+      UpdateCounter++;
+      if (UpdateCounter != UpdateInterval) {
+        return base.Apply();
+      }
+      UpdateCounter = 0;
+      #endregion
+
+      var trees = SymbolicExpressionTreeParameter.ActualValue.ToArray();
+      var qualities = QualityParameter.ActualValue.ToArray();
+
+      Array.Sort(qualities, trees); // sort trees array based on qualities
+
+      var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
+      var problemData = (IRegressionProblemData)ProblemDataParameter.ActualValue;
+      var rows = problemData.TrainingIndices.ToList();
+      var random = RandomParameter.ActualValue;
+
+      int replacedTrees = 0;
+      int avgLengthReduction = 0;
+      double avgQualityImprovement = 0;
+
+      var count = (int)Math.Floor(trees.Length * PercentageOfBestSolutions);
+
+      for (int i = trees.Length - 1; i >= trees.Length - count; --i) {
+        if (random.NextDouble() > PruningProbability) continue;
+        var tree = trees[i];
+        var quality = qualities[i].Value;
+        var root = tree.Root.GetSubtree(0).GetSubtree(0);
+
+        foreach (var s in root.IterateNodesPrefix().Skip(1)) {
+          var r2 = EvaluateSubtree(s, interpreter, problemData, rows);
+          if (double.IsNaN(r2) || r2 <= quality) continue;
+          avgQualityImprovement += (r2 - quality);
+          avgLengthReduction += (tree.Length - s.GetLength());
+          replacedTrees++;
+          // replace tree with its own subtree
+          var startNode = tree.Root.GetSubtree(0);
+          startNode.RemoveSubtree(0);
+          startNode.AddSubtree(s);
+          // update tree quality
+          qualities[i].Value = r2;
+
+          break;
+        }
+      }
+
+      avgQualityImprovement = replacedTrees == 0 ? 0 : avgQualityImprovement / replacedTrees;
+      avgLengthReduction = replacedTrees == 0 ? 0 : (int)Math.Round((double)avgLengthReduction / replacedTrees);
+
+      var results = ResultCollectionParameter.ActualValue;
+      DataTable table;
+      if (results.ContainsKey(PromotedSubtreesResultName)) {
+        table = (DataTable)results[PromotedSubtreesResultName].Value;
+      } else {
+        table = new DataTable(PromotedSubtreesResultName);
+        table.Rows.Add(new DataRow(PromotedSubtreesResultName));
+        results.Add(new Result(PromotedSubtreesResultName, table));
+      }
+      table.Rows[PromotedSubtreesResultName].Values.Add(replacedTrees);
+
+      if (results.ContainsKey(AverageQualityImprovementResultName)) {
+        table = (DataTable)results[AverageQualityImprovementResultName].Value;
+      } else {
+        table = new DataTable(AverageQualityImprovementResultName);
+        table.Rows.Add(new DataRow(AverageQualityImprovementResultName));
+        results.Add(new Result(AverageQualityImprovementResultName, table));
+      }
+      table.Rows[AverageQualityImprovementResultName].Values.Add(avgQualityImprovement);
+
+      if (results.ContainsKey(AverageLengthReductionResultName)) {
+        table = (DataTable)results[AverageLengthReductionResultName].Value;
+      } else {
+        table = new DataTable(AverageLengthReductionResultName);
+        table.Rows.Add(new DataRow(AverageLengthReductionResultName));
+        results.Add(new Result(AverageLengthReductionResultName, table));
+      }
+      table.Rows[AverageLengthReductionResultName].Values.Add(avgLengthReduction);
+
+      return base.Apply();
+    }
+
+    private static double EvaluateSubtree(ISymbolicExpressionTreeNode subtree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IRegressionProblemData problemData, List<int> rows) {
+      var linearInterpreter = (SymbolicDataAnalysisExpressionTreeLinearInterpreter)interpreter;
+      var dataset = problemData.Dataset;
+
+      var targetValues = dataset.GetDoubleValues(problemData.TargetVariable, rows);
+      var estimatedValues = linearInterpreter.GetValues(subtree, dataset, rows);
+
+      OnlineCalculatorError error;
+      double r = OnlinePearsonsRCalculator.Calculate(targetValues, estimatedValues, out error);
+      return (error == OnlineCalculatorError.None) ? r * r : double.NaN;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisVariableFrequencyAnalyzer.cs	(revision 16132)
@@ -0,0 +1,235 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Calculates the accumulated frequencies of variable-symbols over all trees in the population.
+  /// </summary>
+  [Item("SymbolicDataAnalysisVariableFrequencyAnalyzer", "Calculates the accumulated frequencies of variable-symbols over all trees in the population.")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisVariableFrequencyAnalyzer : SymbolicDataAnalysisAnalyzer {
+    private const string VariableFrequenciesParameterName = "VariableFrequencies";
+    private const string AggregateLaggedVariablesParameterName = "AggregateLaggedVariables";
+    private const string AggregateFactorVariablesParameterName = "AggregateFactorVariables";
+    private const string VariableImpactsParameterName = "VariableImpacts";
+
+    #region parameter properties
+    public ILookupParameter<DataTable> VariableFrequenciesParameter {
+      get { return (ILookupParameter<DataTable>)Parameters[VariableFrequenciesParameterName]; }
+    }
+    public ILookupParameter<DoubleMatrix> VariableImpactsParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters[VariableImpactsParameterName]; }
+    }
+    public IValueLookupParameter<BoolValue> AggregateLaggedVariablesParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters[AggregateLaggedVariablesParameterName]; }
+    }
+    public IValueLookupParameter<BoolValue> AggregateFactorVariablesParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters[AggregateFactorVariablesParameterName]; }
+    }
+    #endregion
+    #region properties
+    public BoolValue AggregateLaggedVariables {
+      get { return AggregateLaggedVariablesParameter.ActualValue; }
+      set { AggregateLaggedVariablesParameter.Value = value; }
+    }
+    public BoolValue AggregateFactorVariables {
+      get { return AggregateFactorVariablesParameter.ActualValue; }
+      set { AggregateFactorVariablesParameter.Value = value; }
+    }
+    #endregion
+    [StorableConstructor]
+    private SymbolicDataAnalysisVariableFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisVariableFrequencyAnalyzer(SymbolicDataAnalysisVariableFrequencyAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDataAnalysisVariableFrequencyAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<DataTable>(VariableFrequenciesParameterName, "The relative variable reference frequencies aggregated over all trees in the population."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>(VariableImpactsParameterName, "The relative variable relevance calculated as the average relative variable frequency over the whole run."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>(AggregateLaggedVariablesParameterName, "Switch that determines whether all references to a variable should be aggregated regardless of time-offsets. Turn off to analyze all variable references with different time offsets separately.", new BoolValue(true)));
+      Parameters.Add(new ValueLookupParameter<BoolValue>(AggregateFactorVariablesParameterName, "Switch that determines whether all references to factor variables should be aggregated regardless of the value. Turn off to analyze all factor variable references with different values separately.", new BoolValue(true)));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      if (!Parameters.ContainsKey(AggregateFactorVariablesParameterName)) {
+        Parameters.Add(new ValueLookupParameter<BoolValue>(AggregateFactorVariablesParameterName, "Switch that determines whether all references to factor variables should be aggregated regardless of the value. Turn off to analyze all factor variable references with different values separately.", new BoolValue(true)));
+      }
+      #endregion
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisVariableFrequencyAnalyzer(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      ItemArray<ISymbolicExpressionTree> expressions = SymbolicExpressionTreeParameter.ActualValue;
+      ResultCollection results = ResultCollection;
+      DataTable datatable;
+      if (VariableFrequenciesParameter.ActualValue == null) {
+        datatable = new DataTable("Variable frequencies", "Relative frequency of variable references aggregated over the whole population.");
+        datatable.VisualProperties.XAxisTitle = "Generation";
+        datatable.VisualProperties.YAxisTitle = "Relative Variable Frequency";
+        VariableFrequenciesParameter.ActualValue = datatable;
+        results.Add(new Result("Variable frequencies", "Relative frequency of variable references aggregated over the whole population.", datatable));
+        results.Add(new Result("Variable impacts", "The relative variable relevance calculated as the average relative variable frequency over the whole run.", new DoubleMatrix()));
+      }
+
+      datatable = VariableFrequenciesParameter.ActualValue;
+      // all rows must have the same number of values so we can just take the first
+      int numberOfValues = datatable.Rows.Select(r => r.Values.Count).DefaultIfEmpty().First();
+
+      foreach (var pair in CalculateVariableFrequencies(expressions, AggregateLaggedVariables.Value, AggregateFactorVariables.Value)) {
+        if (!datatable.Rows.ContainsKey(pair.Key)) {
+          // initialize a new row for the variable and pad with zeros
+          DataRow row = new DataRow(pair.Key, "", Enumerable.Repeat(0.0, numberOfValues));
+          row.VisualProperties.StartIndexZero = true;
+          datatable.Rows.Add(row);
+        }
+        datatable.Rows[pair.Key].Values.Add(Math.Round(pair.Value, 3));
+      }
+
+      // add a zero for each data row that was not modified in the previous loop 
+      foreach (var row in datatable.Rows.Where(r => r.Values.Count != numberOfValues + 1))
+        row.Values.Add(0.0);
+
+      // update variable impacts matrix
+      var orderedImpacts = (from row in datatable.Rows
+                            select new { Name = row.Name, Impact = Math.Round(datatable.Rows[row.Name].Values.Average(), 3) })
+                           .OrderByDescending(p => p.Impact)
+                           .ToList();
+      var impacts = new DoubleMatrix();
+      var matrix = impacts as IStringConvertibleMatrix;
+      matrix.Rows = orderedImpacts.Count;
+      matrix.RowNames = orderedImpacts.Select(x => x.Name);
+      matrix.Columns = 1;
+      matrix.ColumnNames = new string[] { "Relative variable relevance" };
+      int i = 0;
+      foreach (var p in orderedImpacts) {
+        matrix.SetValue(p.Impact.ToString(), i++, 0);
+      }
+
+      VariableImpactsParameter.ActualValue = impacts;
+      results["Variable impacts"].Value = impacts;
+      return base.Apply();
+    }
+
+    public static IEnumerable<KeyValuePair<string, double>> CalculateVariableFrequencies(IEnumerable<ISymbolicExpressionTree> trees,
+      bool aggregateLaggedVariables = true, bool aggregateFactorVariables = true) {
+
+      var variableFrequencies = trees
+        .SelectMany(t => GetVariableReferences(t, aggregateLaggedVariables, aggregateFactorVariables))
+        .GroupBy(pair => pair.Key, pair => pair.Value)
+        .ToDictionary(g => g.Key, g => (double)g.Sum());
+
+      double totalNumberOfSymbols = variableFrequencies.Values.Sum();
+
+      foreach (var pair in variableFrequencies.OrderBy(p => p.Key, new NaturalStringComparer()))
+        yield return new KeyValuePair<string, double>(pair.Key, pair.Value / totalNumberOfSymbols);
+    }
+
+    private static IEnumerable<KeyValuePair<string, int>> GetVariableReferences(ISymbolicExpressionTree tree,
+      bool aggregateLaggedVariables = true, bool aggregateFactorVariables = true) {
+      Dictionary<string, int> references = new Dictionary<string, int>();
+      if (aggregateLaggedVariables) {
+        tree.Root.ForEachNodePrefix(node => {
+          if (node is IVariableTreeNode) {
+            var factorNode = node as BinaryFactorVariableTreeNode;
+            if (factorNode != null && !aggregateFactorVariables) {
+              IncReferenceCount(references, factorNode.VariableName + "=" + factorNode.VariableValue);
+            } else {
+              var varNode = node as IVariableTreeNode;
+              IncReferenceCount(references, varNode.VariableName);
+            }
+          }
+        });
+      } else {
+        GetVariableReferences(references, tree.Root, 0, aggregateFactorVariables);
+      }
+      return references;
+    }
+
+    private static void GetVariableReferences(Dictionary<string, int> references, ISymbolicExpressionTreeNode node, int currentLag, bool aggregateFactorVariables) {
+      if (node is IVariableTreeNode) {
+        var laggedVarTreeNode = node as LaggedVariableTreeNode;
+        var binFactorVariableTreeNode = node as BinaryFactorVariableTreeNode;
+        var varConditionTreeNode = node as VariableConditionTreeNode;
+        if (laggedVarTreeNode != null) {
+          IncReferenceCount(references, laggedVarTreeNode.VariableName, currentLag + laggedVarTreeNode.Lag);
+        } else if (binFactorVariableTreeNode != null) {
+          if (aggregateFactorVariables) {
+            IncReferenceCount(references, binFactorVariableTreeNode.VariableName, currentLag);
+          } else {
+            IncReferenceCount(references, binFactorVariableTreeNode.VariableName + "=" + binFactorVariableTreeNode.VariableValue, currentLag);
+          }
+        } else if (varConditionTreeNode != null) {
+          IncReferenceCount(references, varConditionTreeNode.VariableName, currentLag);
+          GetVariableReferences(references, node.GetSubtree(0), currentLag, aggregateFactorVariables);
+          GetVariableReferences(references, node.GetSubtree(1), currentLag, aggregateFactorVariables);
+        } else {
+          var varNode = node as IVariableTreeNode;
+          IncReferenceCount(references, varNode.VariableName, currentLag);
+        }
+      } else if (node.Symbol is Integral) {
+        var laggedNode = node as LaggedTreeNode;
+        for (int l = laggedNode.Lag; l <= 0; l++) {
+          GetVariableReferences(references, node.GetSubtree(0), currentLag + l, aggregateFactorVariables);
+        }
+      } else if (node.Symbol is Derivative) {
+        for (int l = -4; l <= 0; l++) {
+          GetVariableReferences(references, node.GetSubtree(0), currentLag + l, aggregateFactorVariables);
+        }
+      } else if (node.Symbol is TimeLag) {
+        var laggedNode = node as LaggedTreeNode;
+        GetVariableReferences(references, node.GetSubtree(0), currentLag + laggedNode.Lag, aggregateFactorVariables);
+      } else {
+        foreach (var subtree in node.Subtrees) {
+          GetVariableReferences(references, subtree, currentLag, aggregateFactorVariables);
+        }
+      }
+    }
+
+    private static void IncReferenceCount(Dictionary<string, int> references, string variableName, int timeLag = 0) {
+      string referenceId = variableName +
+        (timeLag == 0 ? "" : timeLag < 0 ? "(t" + timeLag + ")" : "(t+" + timeLag + ")");
+      if (references.ContainsKey(referenceId)) {
+        references[referenceId]++;
+      } else {
+        references[referenceId] = 1;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/LinearModelToTreeConverter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/LinearModelToTreeConverter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/LinearModelToTreeConverter.cs	(revision 16132)
@@ -0,0 +1,132 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public static class LinearModelToTreeConverter {
+    public static ISymbolicExpressionTree CreateTree(string[] variableNames, double[] coefficients,
+      double @const = 0) {
+      return CreateTree(variableNames, new int[variableNames.Length], coefficients, @const);
+    }
+
+    public static ISymbolicExpressionTree CreateTree(
+      IEnumerable<KeyValuePair<string, IEnumerable<string>>> factors, double[] factorCoefficients,
+      string[] variableNames, double[] coefficients,
+      double @const = 0) {
+
+      if (factorCoefficients.Length == 0 && coefficients.Length == 0) throw new ArgumentException();
+
+      // Create tree for double variables
+      ISymbolicExpressionTree tree = null;      
+      if (coefficients.Length > 0) {
+        tree = CreateTree(variableNames, new int[variableNames.Length], coefficients, @const);
+        if (factorCoefficients.Length == 0) return tree;
+      }
+
+      // Create tree for string variables
+      ISymbolicExpressionTree factorTree = null;      
+      if (factorCoefficients.Length > 0) {
+        factorTree = CreateTree(factors, factorCoefficients, @const);
+        if (tree == null) return factorTree;  
+      }
+
+      // Combine both trees
+      ISymbolicExpressionTreeNode add = tree.Root.GetSubtree(0).GetSubtree(0);
+      foreach (var binFactorNode in factorTree.IterateNodesPrefix().OfType<BinaryFactorVariableTreeNode>())
+        add.InsertSubtree(add.SubtreeCount - 1, binFactorNode);
+      return tree;
+
+      throw new ArgumentException();
+    }
+
+    public static ISymbolicExpressionTree CreateTree(string[] variableNames, int[] lags, double[] coefficients,
+      double @const = 0) {
+      if (variableNames.Length == 0 ||
+        variableNames.Length != coefficients.Length ||
+        variableNames.Length != lags.Length)
+        throw new ArgumentException("The length of the variable names, lags, and coefficients vectors must match");
+
+      ISymbolicExpressionTree tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode());
+      ISymbolicExpressionTreeNode startNode = new StartSymbol().CreateTreeNode();
+      tree.Root.AddSubtree(startNode);
+      ISymbolicExpressionTreeNode addition = new Addition().CreateTreeNode();
+      startNode.AddSubtree(addition);
+
+      for (int i = 0; i < variableNames.Length; i++) {
+        if (lags[i] == 0) {
+          VariableTreeNode vNode = (VariableTreeNode)new Variable().CreateTreeNode();
+          vNode.VariableName = variableNames[i];
+          vNode.Weight = coefficients[i];
+          addition.AddSubtree(vNode);
+        } else {
+          LaggedVariableTreeNode vNode = (LaggedVariableTreeNode)new LaggedVariable().CreateTreeNode();
+          vNode.VariableName = variableNames[i];
+          vNode.Weight = coefficients[i];
+          vNode.Lag = lags[i];
+          addition.AddSubtree(vNode);
+        }
+      }
+
+      if (!@const.IsAlmost(0.0)) {
+        ConstantTreeNode cNode = (ConstantTreeNode)new Constant().CreateTreeNode();
+        cNode.Value = @const;
+        addition.AddSubtree(cNode);
+      }
+      return tree;
+    }
+
+    public static ISymbolicExpressionTree CreateTree(IEnumerable<KeyValuePair<string, IEnumerable<string>>> factors,
+      double[] factorCoefficients,
+      double @const = 0) {
+
+      ISymbolicExpressionTree tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode());
+      ISymbolicExpressionTreeNode startNode = new StartSymbol().CreateTreeNode();
+      tree.Root.AddSubtree(startNode);
+      ISymbolicExpressionTreeNode addition = new Addition().CreateTreeNode();
+      startNode.AddSubtree(addition);
+
+      int i = 0;
+      foreach (var factor in factors) {
+        var varName = factor.Key;
+        foreach (var factorValue in factor.Value) {
+          var node = (BinaryFactorVariableTreeNode)new BinaryFactorVariable().CreateTreeNode();
+          node.VariableValue = factorValue;
+          node.VariableName = varName;
+          node.Weight = factorCoefficients[i];
+          addition.AddSubtree(node);
+          i++;
+        }
+      }
+
+      if (!@const.IsAlmost(0.0)) {
+        ConstantTreeNode cNode = (ConstantTreeNode)new Constant().CreateTreeNode();
+        cNode.Value = @const;
+        addition.AddSubtree(cNode);
+      }
+      return tree;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeSimplifier.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeSimplifier.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeSimplifier.cs	(revision 16132)
@@ -0,0 +1,1340 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Simplifier for symbolic expressions
+  /// </summary>
+  public class TreeSimplifier {
+    private static readonly Addition addSymbol = new Addition();
+    private static readonly Multiplication mulSymbol = new Multiplication();
+    private static readonly Division divSymbol = new Division();
+    private static readonly Constant constSymbol = new Constant();
+    private static readonly Logarithm logSymbol = new Logarithm();
+    private static readonly Exponential expSymbol = new Exponential();
+    private static readonly Root rootSymbol = new Root();
+    private static readonly Square sqrSymbol = new Square();
+    private static readonly SquareRoot sqrtSymbol = new SquareRoot();
+    private static readonly Power powSymbol = new Power();
+    private static readonly Sine sineSymbol = new Sine();
+    private static readonly Cosine cosineSymbol = new Cosine();
+    private static readonly Tangent tanSymbol = new Tangent();
+    private static readonly IfThenElse ifThenElseSymbol = new IfThenElse();
+    private static readonly And andSymbol = new And();
+    private static readonly Or orSymbol = new Or();
+    private static readonly Not notSymbol = new Not();
+    private static readonly GreaterThan gtSymbol = new GreaterThan();
+    private static readonly LessThan ltSymbol = new LessThan();
+    private static readonly Integral integralSymbol = new Integral();
+    private static readonly LaggedVariable laggedVariableSymbol = new LaggedVariable();
+    private static readonly TimeLag timeLagSymbol = new TimeLag();
+
+    [Obsolete("Use static method TreeSimplifier.Simplify instead")]
+    public TreeSimplifier() { }
+
+    public static ISymbolicExpressionTree Simplify(ISymbolicExpressionTree originalTree) {
+      var clone = (ISymbolicExpressionTreeNode)originalTree.Root.Clone();
+      // macro expand (initially no argument trees)
+      var macroExpandedTree = MacroExpand(clone, clone.GetSubtree(0), new List<ISymbolicExpressionTreeNode>());
+      ISymbolicExpressionTreeNode rootNode = (new ProgramRootSymbol()).CreateTreeNode();
+      rootNode.AddSubtree(GetSimplifiedTree(macroExpandedTree));
+
+#if DEBUG
+      // check that each node is only referenced once
+      var nodes = rootNode.IterateNodesPrefix().ToArray();
+      foreach (var n in nodes) if (nodes.Count(ni => ni == n) > 1) throw new InvalidOperationException();
+#endif
+      return new SymbolicExpressionTree(rootNode);
+    }
+
+    // the argumentTrees list contains already expanded trees used as arguments for invocations
+    private static ISymbolicExpressionTreeNode MacroExpand(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode node,
+      IList<ISymbolicExpressionTreeNode> argumentTrees) {
+      List<ISymbolicExpressionTreeNode> subtrees = new List<ISymbolicExpressionTreeNode>(node.Subtrees);
+      while (node.SubtreeCount > 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<ISymbolicExpressionTreeNode>();
+        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 static ISymbolicExpressionTreeNode FindFunctionDefinition(ISymbolicExpressionTreeNode root, string functionName) {
+      foreach (var subtree in root.Subtrees.OfType<DefunTreeNode>()) {
+        if (subtree.FunctionName == functionName) return subtree.GetSubtree(0);
+      }
+
+      throw new ArgumentException("Definition of function " + functionName + " not found.");
+    }
+
+    #region symbol predicates
+
+    // arithmetic
+    private static bool IsDivision(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Division;
+    }
+
+    private static bool IsMultiplication(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Multiplication;
+    }
+
+    private static bool IsSubtraction(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Subtraction;
+    }
+
+    private static bool IsAddition(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Addition;
+    }
+
+    private static bool IsAverage(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Average;
+    }
+
+    // exponential
+    private static bool IsLog(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Logarithm;
+    }
+
+    private static bool IsExp(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Exponential;
+    }
+
+    private static bool IsRoot(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Root;
+    }
+
+    private static bool IsSquare(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Square;
+    }
+
+    private static bool IsSquareRoot(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is SquareRoot;
+    }
+
+    private static bool IsPower(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Power;
+    }
+
+    // trigonometric
+    private static bool IsSine(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Sine;
+    }
+
+    private static bool IsCosine(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Cosine;
+    }
+
+    private static bool IsTangent(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Tangent;
+    }
+
+    // boolean
+    private static bool IsIfThenElse(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is IfThenElse;
+    }
+
+    private static bool IsAnd(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is And;
+    }
+
+    private static bool IsOr(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Or;
+    }
+
+    private static bool IsNot(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Not;
+    }
+
+    // comparison
+    private static bool IsGreaterThan(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is GreaterThan;
+    }
+
+    private static bool IsLessThan(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is LessThan;
+    }
+
+    private static bool IsBoolean(ISymbolicExpressionTreeNode node) {
+      return
+        node.Symbol is GreaterThan ||
+        node.Symbol is LessThan ||
+        node.Symbol is And ||
+        node.Symbol is Or;
+    }
+
+    // terminals
+    private static bool IsVariable(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Variable;
+    }
+
+    private static bool IsVariableBase(ISymbolicExpressionTreeNode node) {
+      return node is VariableTreeNodeBase;
+    }
+
+    private static bool IsFactor(ISymbolicExpressionTreeNode node) {
+      return node is FactorVariableTreeNode;
+    }
+
+    private static bool IsBinFactor(ISymbolicExpressionTreeNode node) {
+      return node is BinaryFactorVariableTreeNode;
+    }
+
+    private static bool IsConstant(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Constant;
+    }
+
+    // dynamic
+    private static bool IsTimeLag(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is TimeLag;
+    }
+
+    private static bool IsIntegral(ISymbolicExpressionTreeNode node) {
+      return node.Symbol is Integral;
+    }
+
+    #endregion
+
+    /// <summary>
+    /// Creates a new simplified tree
+    /// </summary>
+    /// <param name="original"></param>
+    /// <returns></returns>
+    public static ISymbolicExpressionTreeNode GetSimplifiedTree(ISymbolicExpressionTreeNode original) {
+      if (IsConstant(original) || IsVariableBase(original)) {
+        return (ISymbolicExpressionTreeNode)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)) {
+        return SimplifyLog(original);
+      } else if (IsExp(original)) {
+        return SimplifyExp(original);
+      } else if (IsSquare(original)) {
+        return SimplifySquare(original);
+      } else if (IsSquareRoot(original)) {
+        return SimplifySquareRoot(original);
+      } else if (IsPower(original)) {
+        return SimplifyPower(original);
+      } else if (IsRoot(original)) {
+        return SimplifyRoot(original);
+      } else if (IsSine(original)) {
+        return SimplifySine(original);
+      } else if (IsCosine(original)) {
+        return SimplifyCosine(original);
+      } else if (IsTangent(original)) {
+        return SimplifyTangent(original);
+      } else if (IsIfThenElse(original)) {
+        return SimplifyIfThenElse(original);
+      } else if (IsGreaterThan(original)) {
+        return SimplifyGreaterThan(original);
+      } else if (IsLessThan(original)) {
+        return SimplifyLessThan(original);
+      } else if (IsAnd(original)) {
+        return SimplifyAnd(original);
+      } else if (IsOr(original)) {
+        return SimplifyOr(original);
+      } else if (IsNot(original)) {
+        return SimplifyNot(original);
+      } else if (IsTimeLag(original)) {
+        return SimplifyTimeLag(original);
+      } else if (IsIntegral(original)) {
+        return SimplifyIntegral(original);
+      } else {
+        return SimplifyAny(original);
+      }
+    }
+
+    #region specific simplification routines
+
+    private static ISymbolicExpressionTreeNode SimplifyAny(ISymbolicExpressionTreeNode original) {
+      // can't simplify this function but simplify all subtrees 
+      List<ISymbolicExpressionTreeNode> subtrees = new List<ISymbolicExpressionTreeNode>(original.Subtrees);
+      while (original.Subtrees.Count() > 0) original.RemoveSubtree(0);
+      var clone = (SymbolicExpressionTreeNode)original.Clone();
+      List<ISymbolicExpressionTreeNode> simplifiedSubtrees = new List<ISymbolicExpressionTreeNode>();
+      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 static ISymbolicExpressionTreeNode SimplifyConstantExpression(ISymbolicExpressionTreeNode original) {
+      // not yet implemented
+      return original;
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyAverage(ISymbolicExpressionTreeNode original) {
+      if (original.Subtrees.Count() == 1) {
+        return GetSimplifiedTree(original.GetSubtree(0));
+      } else {
+        // simplify expressions x0..xn
+        // make sum(x0..xn) / n
+        var sum = original.Subtrees
+          .Select(GetSimplifiedTree)
+          .Aggregate(MakeSum);
+        return MakeFraction(sum, MakeConstant(original.Subtrees.Count()));
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyDivision(ISymbolicExpressionTreeNode original) {
+      if (original.Subtrees.Count() == 1) {
+        return Invert(GetSimplifiedTree(original.GetSubtree(0)));
+      } else {
+        // simplify expressions x0..xn
+        // make multiplication (x0 * 1/(x1 * x1 * .. * xn))
+        var first = original.GetSubtree(0);
+        var second = original.GetSubtree(1);
+        var remaining = original.Subtrees.Skip(2);
+        return
+          MakeProduct(GetSimplifiedTree(first),
+            Invert(remaining.Aggregate(GetSimplifiedTree(second), (a, b) => MakeProduct(a, GetSimplifiedTree(b)))));
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyMultiplication(ISymbolicExpressionTreeNode original) {
+      if (original.Subtrees.Count() == 1) {
+        return GetSimplifiedTree(original.GetSubtree(0));
+      } else {
+        return original.Subtrees
+          .Select(GetSimplifiedTree)
+          .Aggregate(MakeProduct);
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifySubtraction(ISymbolicExpressionTreeNode original) {
+      if (original.Subtrees.Count() == 1) {
+        return Negate(GetSimplifiedTree(original.GetSubtree(0)));
+      } else {
+        // simplify expressions x0..xn
+        // make addition (x0,-x1..-xn)
+        var first = original.Subtrees.First();
+        var remaining = original.Subtrees.Skip(1);
+        return remaining.Aggregate(GetSimplifiedTree(first), (a, b) => MakeSum(a, Negate(GetSimplifiedTree(b))));
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyAddition(ISymbolicExpressionTreeNode original) {
+      if (original.Subtrees.Count() == 1) {
+        return GetSimplifiedTree(original.GetSubtree(0));
+      } else {
+        // simplify expression x0..xn
+        // make addition (x0..xn)
+        return original.Subtrees
+          .Select(GetSimplifiedTree)
+          .Aggregate(MakeSum);
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyNot(ISymbolicExpressionTreeNode original) {
+      return MakeNot(GetSimplifiedTree(original.GetSubtree(0)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyOr(ISymbolicExpressionTreeNode original) {
+      return original.Subtrees
+        .Select(GetSimplifiedTree)
+        .Aggregate(MakeOr);
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyAnd(ISymbolicExpressionTreeNode original) {
+      return original.Subtrees
+        .Select(GetSimplifiedTree)
+        .Aggregate(MakeAnd);
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyLessThan(ISymbolicExpressionTreeNode original) {
+      return MakeLessThan(GetSimplifiedTree(original.GetSubtree(0)), GetSimplifiedTree(original.GetSubtree(1)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyGreaterThan(ISymbolicExpressionTreeNode original) {
+      return MakeGreaterThan(GetSimplifiedTree(original.GetSubtree(0)), GetSimplifiedTree(original.GetSubtree(1)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyIfThenElse(ISymbolicExpressionTreeNode original) {
+      return MakeIfThenElse(GetSimplifiedTree(original.GetSubtree(0)), GetSimplifiedTree(original.GetSubtree(1)),
+        GetSimplifiedTree(original.GetSubtree(2)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyTangent(ISymbolicExpressionTreeNode original) {
+      return MakeTangent(GetSimplifiedTree(original.GetSubtree(0)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyCosine(ISymbolicExpressionTreeNode original) {
+      return MakeCosine(GetSimplifiedTree(original.GetSubtree(0)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifySine(ISymbolicExpressionTreeNode original) {
+      return MakeSine(GetSimplifiedTree(original.GetSubtree(0)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyExp(ISymbolicExpressionTreeNode original) {
+      return MakeExp(GetSimplifiedTree(original.GetSubtree(0)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifySquare(ISymbolicExpressionTreeNode original) {
+      return MakeSquare(GetSimplifiedTree(original.GetSubtree(0)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifySquareRoot(ISymbolicExpressionTreeNode original) {
+      return MakeSquareRoot(GetSimplifiedTree(original.GetSubtree(0)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyLog(ISymbolicExpressionTreeNode original) {
+      return MakeLog(GetSimplifiedTree(original.GetSubtree(0)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyRoot(ISymbolicExpressionTreeNode original) {
+      return MakeRoot(GetSimplifiedTree(original.GetSubtree(0)), GetSimplifiedTree(original.GetSubtree(1)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyPower(ISymbolicExpressionTreeNode original) {
+      return MakePower(GetSimplifiedTree(original.GetSubtree(0)), GetSimplifiedTree(original.GetSubtree(1)));
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyTimeLag(ISymbolicExpressionTreeNode original) {
+      var laggedTreeNode = original as ILaggedTreeNode;
+      var simplifiedSubtree = GetSimplifiedTree(original.GetSubtree(0));
+      if (!ContainsVariableCondition(simplifiedSubtree)) {
+        return AddLagToDynamicNodes(simplifiedSubtree, laggedTreeNode.Lag);
+      } else {
+        return MakeTimeLag(simplifiedSubtree, laggedTreeNode.Lag);
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode SimplifyIntegral(ISymbolicExpressionTreeNode original) {
+      var laggedTreeNode = original as ILaggedTreeNode;
+      var simplifiedSubtree = GetSimplifiedTree(original.GetSubtree(0));
+      if (IsConstant(simplifiedSubtree)) {
+        return GetSimplifiedTree(MakeProduct(simplifiedSubtree, MakeConstant(-laggedTreeNode.Lag)));
+      } else {
+        return MakeIntegral(simplifiedSubtree, laggedTreeNode.Lag);
+      }
+    }
+
+    #endregion
+
+    #region low level tree restructuring
+
+    private static ISymbolicExpressionTreeNode MakeTimeLag(ISymbolicExpressionTreeNode subtree, int lag) {
+      if (lag == 0) return subtree;
+      if (IsConstant(subtree)) return subtree;
+      var lagNode = (LaggedTreeNode)timeLagSymbol.CreateTreeNode();
+      lagNode.Lag = lag;
+      lagNode.AddSubtree(subtree);
+      return lagNode;
+    }
+
+    private static ISymbolicExpressionTreeNode MakeIntegral(ISymbolicExpressionTreeNode subtree, int lag) {
+      if (lag == 0) return subtree;
+      else if (lag == -1 || lag == 1) {
+        return MakeSum(subtree, AddLagToDynamicNodes((ISymbolicExpressionTreeNode)subtree.Clone(), lag));
+      } else {
+        var node = (LaggedTreeNode)integralSymbol.CreateTreeNode();
+        node.Lag = lag;
+        node.AddSubtree(subtree);
+        return node;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeNot(ISymbolicExpressionTreeNode t) {
+      if (IsConstant(t)) {
+        var constNode = t as ConstantTreeNode;
+        if (constNode.Value > 0) return MakeConstant(-1.0);
+        else return MakeConstant(1.0);
+      } else if (IsNot(t)) {
+        return t.GetSubtree(0);
+      } else if (!IsBoolean(t)) {
+        var gtNode = gtSymbol.CreateTreeNode();
+        gtNode.AddSubtree(t);
+        gtNode.AddSubtree(MakeConstant(0.0));
+        var notNode = notSymbol.CreateTreeNode();
+        notNode.AddSubtree(gtNode);
+        return notNode;
+      } else {
+        var notNode = notSymbol.CreateTreeNode();
+        notNode.AddSubtree(t);
+        return notNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeOr(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        var constA = a as ConstantTreeNode;
+        var constB = b as ConstantTreeNode;
+        if (constA.Value > 0.0 || constB.Value > 0.0) {
+          return MakeConstant(1.0);
+        } else {
+          return MakeConstant(-1.0);
+        }
+      } else if (IsConstant(a)) {
+        return MakeOr(b, a);
+      } else if (IsConstant(b)) {
+        var constT = b as ConstantTreeNode;
+        if (constT.Value > 0.0) {
+          // boolean expression is necessarily true
+          return MakeConstant(1.0);
+        } else {
+          // the constant value has no effect on the result of the boolean condition so we can drop the constant term
+          var orNode = orSymbol.CreateTreeNode();
+          orNode.AddSubtree(a);
+          return orNode;
+        }
+      } else {
+        var orNode = orSymbol.CreateTreeNode();
+        orNode.AddSubtree(a);
+        orNode.AddSubtree(b);
+        return orNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeAnd(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        var constA = a as ConstantTreeNode;
+        var constB = b as ConstantTreeNode;
+        if (constA.Value > 0.0 && constB.Value > 0.0) {
+          return MakeConstant(1.0);
+        } else {
+          return MakeConstant(-1.0);
+        }
+      } else if (IsConstant(a)) {
+        return MakeAnd(b, a);
+      } else if (IsConstant(b)) {
+        var constB = b as ConstantTreeNode;
+        if (constB.Value > 0.0) {
+          // the constant value has no effect on the result of the boolean condition so we can drop the constant term
+          var andNode = andSymbol.CreateTreeNode();
+          andNode.AddSubtree(a);
+          return andNode;
+        } else {
+          // boolean expression is necessarily false
+          return MakeConstant(-1.0);
+        }
+      } else {
+        var andNode = andSymbol.CreateTreeNode();
+        andNode.AddSubtree(a);
+        andNode.AddSubtree(b);
+        return andNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeLessThan(ISymbolicExpressionTreeNode leftSide,
+      ISymbolicExpressionTreeNode rightSide) {
+      if (IsConstant(leftSide) && IsConstant(rightSide)) {
+        var lsConst = leftSide as ConstantTreeNode;
+        var rsConst = rightSide as ConstantTreeNode;
+        if (lsConst.Value < rsConst.Value) return MakeConstant(1.0);
+        else return MakeConstant(-1.0);
+      } else {
+        var ltNode = ltSymbol.CreateTreeNode();
+        ltNode.AddSubtree(leftSide);
+        ltNode.AddSubtree(rightSide);
+        return ltNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeGreaterThan(ISymbolicExpressionTreeNode leftSide,
+      ISymbolicExpressionTreeNode rightSide) {
+      if (IsConstant(leftSide) && IsConstant(rightSide)) {
+        var lsConst = leftSide as ConstantTreeNode;
+        var rsConst = rightSide as ConstantTreeNode;
+        if (lsConst.Value > rsConst.Value) return MakeConstant(1.0);
+        else return MakeConstant(-1.0);
+      } else {
+        var gtNode = gtSymbol.CreateTreeNode();
+        gtNode.AddSubtree(leftSide);
+        gtNode.AddSubtree(rightSide);
+        return gtNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeIfThenElse(ISymbolicExpressionTreeNode condition,
+      ISymbolicExpressionTreeNode trueBranch, ISymbolicExpressionTreeNode falseBranch) {
+      if (IsConstant(condition)) {
+        var constT = condition as ConstantTreeNode;
+        if (constT.Value > 0.0) return trueBranch;
+        else return falseBranch;
+      } else {
+        var ifNode = ifThenElseSymbol.CreateTreeNode();
+        if (IsBoolean(condition)) {
+          ifNode.AddSubtree(condition);
+        } else {
+          var gtNode = gtSymbol.CreateTreeNode();
+          gtNode.AddSubtree(condition);
+          gtNode.AddSubtree(MakeConstant(0.0));
+          ifNode.AddSubtree(gtNode);
+        }
+        ifNode.AddSubtree(trueBranch);
+        ifNode.AddSubtree(falseBranch);
+        return ifNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeSine(ISymbolicExpressionTreeNode node) {
+      if (IsConstant(node)) {
+        var constT = node as ConstantTreeNode;
+        return MakeConstant(Math.Sin(constT.Value));
+      } else if (IsFactor(node)) {
+        var factor = node as FactorVariableTreeNode;
+        return MakeFactor(factor.Symbol, factor.VariableName, factor.Weights.Select(Math.Sin));
+      } else if (IsBinFactor(node)) {
+        var binFactor = node as BinaryFactorVariableTreeNode;
+        return MakeBinFactor(binFactor.Symbol, binFactor.VariableName, binFactor.VariableValue, Math.Sin(binFactor.Weight));
+      } else {
+        var sineNode = sineSymbol.CreateTreeNode();
+        sineNode.AddSubtree(node);
+        return sineNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeTangent(ISymbolicExpressionTreeNode node) {
+      if (IsConstant(node)) {
+        var constT = node as ConstantTreeNode;
+        return MakeConstant(Math.Tan(constT.Value));
+      } else if (IsFactor(node)) {
+        var factor = node as FactorVariableTreeNode;
+        return MakeFactor(factor.Symbol, factor.VariableName, factor.Weights.Select(Math.Tan));
+      } else if (IsBinFactor(node)) {
+        var binFactor = node as BinaryFactorVariableTreeNode;
+        return MakeBinFactor(binFactor.Symbol, binFactor.VariableName, binFactor.VariableValue, Math.Tan(binFactor.Weight));
+      } else {
+        var tanNode = tanSymbol.CreateTreeNode();
+        tanNode.AddSubtree(node);
+        return tanNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeCosine(ISymbolicExpressionTreeNode node) {
+      if (IsConstant(node)) {
+        var constT = node as ConstantTreeNode;
+        return MakeConstant(Math.Cos(constT.Value));
+      } else if (IsFactor(node)) {
+        var factor = node as FactorVariableTreeNode;
+        return MakeFactor(factor.Symbol, factor.VariableName, factor.Weights.Select(Math.Cos));
+      } else if (IsBinFactor(node)) {
+        var binFactor = node as BinaryFactorVariableTreeNode;
+        // cos(0) = 1 see similar case for Exp(binfactor)
+        return MakeSum(MakeBinFactor(binFactor.Symbol, binFactor.VariableName, binFactor.VariableValue, Math.Cos(binFactor.Weight) - 1),
+          MakeConstant(1.0));
+      } else {
+        var cosNode = cosineSymbol.CreateTreeNode();
+        cosNode.AddSubtree(node);
+        return cosNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeExp(ISymbolicExpressionTreeNode node) {
+      if (IsConstant(node)) {
+        var constT = node as ConstantTreeNode;
+        return MakeConstant(Math.Exp(constT.Value));
+      } else if (IsFactor(node)) {
+        var factNode = node as FactorVariableTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName, factNode.Weights.Select(w => Math.Exp(w)));
+      } else if (IsBinFactor(node)) {
+        // exp( binfactor w val=a) = if(val=a) exp(w) else exp(0) = binfactor( (exp(w) - 1) val a) + 1
+        var binFactor = node as BinaryFactorVariableTreeNode;
+        return
+          MakeSum(MakeBinFactor(binFactor.Symbol, binFactor.VariableName, binFactor.VariableValue, Math.Exp(binFactor.Weight) - 1), MakeConstant(1.0));
+      } else if (IsLog(node)) {
+        return node.GetSubtree(0);
+      } else if (IsAddition(node)) {
+        return node.Subtrees.Select(s => MakeExp(s)).Aggregate((s, t) => MakeProduct(s, t));
+      } else if (IsSubtraction(node)) {
+        return node.Subtrees.Select(s => MakeExp(s)).Aggregate((s, t) => MakeProduct(s, Negate(t)));
+      } else {
+        var expNode = expSymbol.CreateTreeNode();
+        expNode.AddSubtree(node);
+        return expNode;
+      }
+    }
+    private static ISymbolicExpressionTreeNode MakeLog(ISymbolicExpressionTreeNode node) {
+      if (IsConstant(node)) {
+        var constT = node as ConstantTreeNode;
+        return MakeConstant(Math.Log(constT.Value));
+      } else if (IsFactor(node)) {
+        var factNode = node as FactorVariableTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName, factNode.Weights.Select(w => Math.Log(w)));
+      } else if (IsExp(node)) {
+        return node.GetSubtree(0);
+      } else if (IsSquareRoot(node)) {
+        return MakeFraction(MakeLog(node.GetSubtree(0)), MakeConstant(2.0));
+      } else {
+        var logNode = logSymbol.CreateTreeNode();
+        logNode.AddSubtree(node);
+        return logNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeSquare(ISymbolicExpressionTreeNode node) {
+      if (IsConstant(node)) {
+        var constT = node as ConstantTreeNode;
+        return MakeConstant(constT.Value * constT.Value);
+      } else if (IsFactor(node)) {
+        var factNode = node as FactorVariableTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName, factNode.Weights.Select(w => w * w));
+      } else if (IsBinFactor(node)) {
+        var binFactor = node as BinaryFactorVariableTreeNode;
+        return MakeBinFactor(binFactor.Symbol, binFactor.VariableName, binFactor.VariableValue, binFactor.Weight * binFactor.Weight);
+      } else if (IsSquareRoot(node)) {
+        return node.GetSubtree(0);
+      } else {
+        var sqrNode = sqrSymbol.CreateTreeNode();
+        sqrNode.AddSubtree(node);
+        return sqrNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeSquareRoot(ISymbolicExpressionTreeNode node) {
+      if (IsConstant(node)) {
+        var constT = node as ConstantTreeNode;
+        return MakeConstant(Math.Sqrt(constT.Value));
+      } else if (IsFactor(node)) {
+        var factNode = node as FactorVariableTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName, factNode.Weights.Select(w => Math.Sqrt(w)));
+      } else if (IsBinFactor(node)) {
+        var binFactor = node as BinaryFactorVariableTreeNode;
+        return MakeBinFactor(binFactor.Symbol, binFactor.VariableName, binFactor.VariableValue, Math.Sqrt(binFactor.Weight));
+      } else if (IsSquare(node)) {
+        return node.GetSubtree(0);
+      } else {
+        var sqrtNode = sqrtSymbol.CreateTreeNode();
+        sqrtNode.AddSubtree(node);
+        return sqrtNode;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeRoot(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        var constA = a as ConstantTreeNode;
+        var constB = b as ConstantTreeNode;
+        return MakeConstant(Math.Pow(constA.Value, 1.0 / Math.Round(constB.Value)));
+      } else if (IsFactor(a) && IsConstant(b)) {
+        var factNode = a as FactorVariableTreeNode;
+        var constNode = b as ConstantTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName,
+          factNode.Weights.Select(w => Math.Pow(w, 1.0 / Math.Round(constNode.Value))));
+      } else if (IsBinFactor(a) && IsConstant(b)) {
+        var binFactor = a as BinaryFactorVariableTreeNode;
+        var constNode = b as ConstantTreeNode;
+        return MakeBinFactor(binFactor.Symbol, binFactor.VariableName, binFactor.VariableValue, Math.Pow(binFactor.Weight, 1.0 / Math.Round(constNode.Value)));
+      } else if (IsConstant(a) && IsFactor(b)) {
+        var constNode = a as ConstantTreeNode;
+        var factNode = b as FactorVariableTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName, factNode.Weights.Select(w => Math.Pow(constNode.Value, 1.0 / Math.Round(w))));
+      } else if (IsConstant(a) && IsBinFactor(b)) {
+        var constNode = a as ConstantTreeNode;
+        var factNode = b as BinaryFactorVariableTreeNode;
+        return MakeBinFactor(factNode.Symbol, factNode.VariableName, factNode.VariableValue, Math.Pow(constNode.Value, 1.0 / Math.Round(factNode.Weight)));
+      } else if (IsFactor(a) && IsFactor(b) && AreSameTypeAndVariable(a, b)) {
+        var node0 = a as FactorVariableTreeNode;
+        var node1 = b as FactorVariableTreeNode;
+        return MakeFactor(node0.Symbol, node0.VariableName, node0.Weights.Zip(node1.Weights, (u, v) => Math.Pow(u, 1.0 / Math.Round(v))));
+      } else if (IsConstant(b)) {
+        var constB = b as ConstantTreeNode;
+        var constBValue = Math.Round(constB.Value);
+        if (constBValue.IsAlmost(1.0)) {
+          return a;
+        } else if (constBValue.IsAlmost(0.0)) {
+          return MakeConstant(1.0);
+        } else if (constBValue.IsAlmost(-1.0)) {
+          return MakeFraction(MakeConstant(1.0), a);
+        } else if (constBValue < 0) {
+          var rootNode = rootSymbol.CreateTreeNode();
+          rootNode.AddSubtree(a);
+          rootNode.AddSubtree(MakeConstant(-1.0 * constBValue));
+          return MakeFraction(MakeConstant(1.0), rootNode);
+        } else {
+          var rootNode = rootSymbol.CreateTreeNode();
+          rootNode.AddSubtree(a);
+          rootNode.AddSubtree(MakeConstant(constBValue));
+          return rootNode;
+        }
+      } else {
+        var rootNode = rootSymbol.CreateTreeNode();
+        rootNode.AddSubtree(a);
+        rootNode.AddSubtree(b);
+        return rootNode;
+      }
+    }
+
+
+    private static ISymbolicExpressionTreeNode MakePower(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        var constA = a as ConstantTreeNode;
+        var constB = b as ConstantTreeNode;
+        return MakeConstant(Math.Pow(constA.Value, Math.Round(constB.Value)));
+      } else if (IsFactor(a) && IsConstant(b)) {
+        var factNode = a as FactorVariableTreeNode;
+        var constNode = b as ConstantTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName, factNode.Weights.Select(w => Math.Pow(w, Math.Round(constNode.Value))));
+      } else if (IsBinFactor(a) && IsConstant(b)) {
+        var binFactor = a as BinaryFactorVariableTreeNode;
+        var constNode = b as ConstantTreeNode;
+        return MakeBinFactor(binFactor.Symbol, binFactor.VariableName, binFactor.VariableValue, Math.Pow(binFactor.Weight, Math.Round(constNode.Value)));
+      } else if (IsConstant(a) && IsFactor(b)) {
+        var constNode = a as ConstantTreeNode;
+        var factNode = b as FactorVariableTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName, factNode.Weights.Select(w => Math.Pow(constNode.Value, Math.Round(w))));
+      } else if (IsConstant(a) && IsBinFactor(b)) {
+        var constNode = a as ConstantTreeNode;
+        var factNode = b as BinaryFactorVariableTreeNode;
+        return MakeBinFactor(factNode.Symbol, factNode.VariableName, factNode.VariableValue, Math.Pow(constNode.Value, Math.Round(factNode.Weight)));
+      } else if (IsFactor(a) && IsFactor(b) && AreSameTypeAndVariable(a, b)) {
+        var node0 = a as FactorVariableTreeNode;
+        var node1 = b as FactorVariableTreeNode;
+        return MakeFactor(node0.Symbol, node0.VariableName, node0.Weights.Zip(node1.Weights, (u, v) => Math.Pow(u, Math.Round(v))));
+      } else if (IsConstant(b)) {
+        var constB = b as ConstantTreeNode;
+        double exponent = Math.Round(constB.Value);
+        if (exponent.IsAlmost(0.0)) {
+          return MakeConstant(1.0);
+        } else if (exponent.IsAlmost(1.0)) {
+          return a;
+        } else if (exponent.IsAlmost(-1.0)) {
+          return MakeFraction(MakeConstant(1.0), a);
+        } else if (exponent < 0) {
+          var powNode = powSymbol.CreateTreeNode();
+          powNode.AddSubtree(a);
+          powNode.AddSubtree(MakeConstant(-1.0 * exponent));
+          return MakeFraction(MakeConstant(1.0), powNode);
+        } else {
+          var powNode = powSymbol.CreateTreeNode();
+          powNode.AddSubtree(a);
+          powNode.AddSubtree(MakeConstant(exponent));
+          return powNode;
+        }
+      } else {
+        var powNode = powSymbol.CreateTreeNode();
+        powNode.AddSubtree(a);
+        powNode.AddSubtree(b);
+        return powNode;
+      }
+    }
+
+
+    // MakeFraction, MakeProduct and MakeSum take two already simplified trees and create a new simplified tree
+    private static ISymbolicExpressionTreeNode MakeFraction(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        // fold constants
+        return MakeConstant(((ConstantTreeNode)a).Value / ((ConstantTreeNode)b).Value);
+      } else if ((IsConstant(a) && !((ConstantTreeNode)a).Value.IsAlmost(1.0))) {
+        return MakeFraction(MakeConstant(1.0), MakeProduct(b, Invert(a)));
+      } else if (IsVariableBase(a) && IsConstant(b)) {
+        // merge constant values into variable weights
+        var constB = ((ConstantTreeNode)b).Value;
+        ((VariableTreeNodeBase)a).Weight /= constB;
+        return a;
+      } else if (IsFactor(a) && IsConstant(b)) {
+        var factNode = a as FactorVariableTreeNode;
+        var constNode = b as ConstantTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName, factNode.Weights.Select(w => w / constNode.Value));
+      } else if (IsBinFactor(a) && IsConstant(b)) {
+        var factNode = a as BinaryFactorVariableTreeNode;
+        var constNode = b as ConstantTreeNode;
+        return MakeBinFactor(factNode.Symbol, factNode.VariableName, factNode.VariableValue, factNode.Weight / constNode.Value);
+      } else if (IsFactor(a) && IsFactor(b) && AreSameTypeAndVariable(a, b)) {
+        var node0 = a as FactorVariableTreeNode;
+        var node1 = b as FactorVariableTreeNode;
+        return MakeFactor(node0.Symbol, node0.VariableName, node0.Weights.Zip(node1.Weights, (u, v) => u / v));
+      } else if (IsFactor(a) && IsBinFactor(b) && ((IVariableTreeNode)a).VariableName == ((IVariableTreeNode)b).VariableName) {
+        var node0 = a as FactorVariableTreeNode;
+        var node1 = b as BinaryFactorVariableTreeNode;
+        var varValues = node0.Symbol.GetVariableValues(node0.VariableName).ToArray();
+        var wi = Array.IndexOf(varValues, node1.VariableValue);
+        if (wi < 0) throw new ArgumentException();
+        var newWeighs = new double[varValues.Length];
+        node0.Weights.CopyTo(newWeighs, 0);
+        for (int i = 0; i < newWeighs.Length; i++)
+          if (wi == i) newWeighs[i] /= node1.Weight;
+          else newWeighs[i] /= 0.0;
+        return MakeFactor(node0.Symbol, node0.VariableName, newWeighs);
+      } else if (IsFactor(a)) {
+        return MakeFraction(MakeConstant(1.0), MakeProduct(b, Invert(a)));
+      } else if (IsVariableBase(a) && IsVariableBase(b) && AreSameTypeAndVariable(a, b) && !IsBinFactor(b)) {
+        // cancel variables (not allowed for bin factors because of division by zero)
+        var aVar = a as VariableTreeNode;
+        var bVar = b as VariableTreeNode;
+        return MakeConstant(aVar.Weight / bVar.Weight);
+      } else if (IsAddition(a) && IsConstant(b)) {
+        return a.Subtrees
+          .Select(x => GetSimplifiedTree(x))
+          .Select(x => MakeFraction(x, GetSimplifiedTree(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))
+        return MakeFraction(a.GetSubtree(0), MakeProduct(a.GetSubtree(1), b));
+      } else if (IsDivision(a) && IsDivision(b)) {
+        // (a1 / a2) / (b1 / b2) => 
+        return MakeFraction(MakeProduct(a.GetSubtree(0), b.GetSubtree(1)), MakeProduct(a.GetSubtree(1), b.GetSubtree(0)));
+      } else if (IsDivision(a)) {
+        // (a1 / a2) / b => (a1 / (a2 * b))
+        return MakeFraction(a.GetSubtree(0), MakeProduct(a.GetSubtree(1), b));
+      } else if (IsDivision(b)) {
+        // a / (b1 / b2) => (a * b2) / b1
+        return MakeFraction(MakeProduct(a, b.GetSubtree(1)), b.GetSubtree(0));
+      } else {
+        var div = divSymbol.CreateTreeNode();
+        div.AddSubtree(a);
+        div.AddSubtree(b);
+        return div;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeSum(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode 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 (IsFactor(a) && IsConstant(b)) {
+        var factNode = a as FactorVariableTreeNode;
+        var constNode = b as ConstantTreeNode;
+        return MakeFactor(factNode.Symbol, factNode.VariableName, factNode.Weights.Select((w) => w + constNode.Value));
+      } else if (IsFactor(a) && IsFactor(b) && AreSameTypeAndVariable(a, b)) {
+        var node0 = a as FactorVariableTreeNode;
+        var node1 = b as FactorVariableTreeNode;
+        return MakeFactor(node0.Symbol, node0.VariableName, node0.Weights.Zip(node1.Weights, (u, v) => u + v));
+      } else if (IsBinFactor(a) && IsFactor(b)) {
+        return MakeSum(b, a);
+      } else if (IsFactor(a) && IsBinFactor(b) &&
+        ((IVariableTreeNode)a).VariableName == ((IVariableTreeNode)b).VariableName) {
+        var node0 = a as FactorVariableTreeNode;
+        var node1 = b as BinaryFactorVariableTreeNode;
+        var varValues = node0.Symbol.GetVariableValues(node0.VariableName).ToArray();
+        var wi = Array.IndexOf(varValues, node1.VariableValue);
+        if (wi < 0) throw new ArgumentException();
+        var newWeighs = new double[varValues.Length];
+        node0.Weights.CopyTo(newWeighs, 0);
+        newWeighs[wi] += node1.Weight;
+        return MakeFactor(node0.Symbol, node0.VariableName, newWeighs);
+      } else if (IsAddition(a) && IsAddition(b)) {
+        // merge additions
+        var add = addSymbol.CreateTreeNode();
+        // add all sub trees except for the last
+        for (int i = 0; i < a.Subtrees.Count() - 1; i++) add.AddSubtree(a.GetSubtree(i));
+        for (int i = 0; i < b.Subtrees.Count() - 1; i++) add.AddSubtree(b.GetSubtree(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);
+        if (add.Subtrees.Count() == 1) {
+          return add.GetSubtree(0);
+        } else {
+          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();
+        // add all sub trees except for the last
+        for (int i = 0; i < a.Subtrees.Count() - 1; i++) add.AddSubtree(a.GetSubtree(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);
+        if (add.Subtrees.Count() == 1) {
+          return add.GetSubtree(0);
+        } else {
+          return add;
+        }
+      } else {
+        var add = addSymbol.CreateTreeNode();
+        add.AddSubtree(a);
+        add.AddSubtree(b);
+        MergeVariablesInSum(add);
+        if (add.Subtrees.Count() == 1) {
+          return add.GetSubtree(0);
+        } else {
+          return add;
+        }
+      }
+    }
+
+    // makes sure variable symbols in sums are combined
+    private static void MergeVariablesInSum(ISymbolicExpressionTreeNode sum) {
+      var subtrees = new List<ISymbolicExpressionTreeNode>(sum.Subtrees);
+      while (sum.Subtrees.Any()) sum.RemoveSubtree(0);
+      var groupedVarNodes = from node in subtrees.OfType<IVariableTreeNode>()
+                            where node.SubtreeCount == 0
+                            group node by GroupId(node) into g
+                            select g;
+      var constant = (from node in subtrees.OfType<ConstantTreeNode>()
+                      select node.Value).DefaultIfEmpty(0.0).Sum();
+      var unchangedSubtrees = subtrees.Where(t => t.SubtreeCount > 0 || !(t is IVariableTreeNode) && !(t is ConstantTreeNode));
+
+      foreach (var variableNodeGroup in groupedVarNodes) {
+        var firstNode = variableNodeGroup.First();
+        if (firstNode is VariableTreeNodeBase) {
+          var representative = firstNode as VariableTreeNodeBase;
+          var weightSum = variableNodeGroup.Cast<VariableTreeNodeBase>().Select(t => t.Weight).Sum();
+          representative.Weight = weightSum;
+          sum.AddSubtree(representative);
+        } else if (firstNode is FactorVariableTreeNode) {
+          var representative = firstNode as FactorVariableTreeNode;
+          foreach (var node in variableNodeGroup.Skip(1).Cast<FactorVariableTreeNode>()) {
+            for (int j = 0; j < representative.Weights.Length; j++) {
+              representative.Weights[j] += node.Weights[j];
+            }
+          }
+          sum.AddSubtree(representative);
+        }
+      }
+      foreach (var unchangedSubtree in unchangedSubtrees)
+        sum.AddSubtree(unchangedSubtree);
+      if (!constant.IsAlmost(0.0)) {
+        sum.AddSubtree(MakeConstant(constant));
+      }
+    }
+
+    // nodes referencing variables can be grouped if they have
+    private static string GroupId(IVariableTreeNode node) {
+      var binaryFactorNode = node as BinaryFactorVariableTreeNode;
+      var factorNode = node as FactorVariableTreeNode;
+      var variableNode = node as VariableTreeNode;
+      var laggedVarNode = node as LaggedVariableTreeNode;
+      if (variableNode != null) {
+        return "var " + variableNode.VariableName;
+      } else if (binaryFactorNode != null) {
+        return "binfactor " + binaryFactorNode.VariableName + " " + binaryFactorNode.VariableValue;
+      } else if (factorNode != null) {
+        return "factor " + factorNode.VariableName;
+      } else if (laggedVarNode != null) {
+        return "lagged " + laggedVarNode.VariableName + " " + laggedVarNode.Lag;
+      } else {
+        throw new NotSupportedException();
+      }
+    }
+
+
+    private static ISymbolicExpressionTreeNode MakeProduct(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+      if (IsConstant(a) && IsConstant(b)) {
+        // fold constants
+        return MakeConstant(((ConstantTreeNode)a).Value * ((ConstantTreeNode)b).Value);
+      } else if (IsConstant(a)) {
+        // a * $ => $ * a
+        return MakeProduct(b, a);
+      } else if (IsFactor(a) && IsFactor(b) && AreSameTypeAndVariable(a, b)) {
+        var node0 = a as FactorVariableTreeNode;
+        var node1 = b as FactorVariableTreeNode;
+        return MakeFactor(node0.Symbol, node0.VariableName, node0.Weights.Zip(node1.Weights, (u, v) => u * v));
+      } else if (IsBinFactor(a) && IsBinFactor(b) && AreSameTypeAndVariable(a, b)) {
+        var node0 = a as BinaryFactorVariableTreeNode;
+        var node1 = b as BinaryFactorVariableTreeNode;
+        return MakeBinFactor(node0.Symbol, node0.VariableName, node0.VariableValue, node0.Weight * node1.Weight);
+      } else if (IsFactor(a) && IsConstant(b)) {
+        var node0 = a as FactorVariableTreeNode;
+        var node1 = b as ConstantTreeNode;
+        return MakeFactor(node0.Symbol, node0.VariableName, node0.Weights.Select(w => w * node1.Value));
+      } else if (IsBinFactor(a) && IsConstant(b)) {
+        var node0 = a as BinaryFactorVariableTreeNode;
+        var node1 = b as ConstantTreeNode;
+        return MakeBinFactor(node0.Symbol, node0.VariableName, node0.VariableValue, node0.Weight * node1.Value);
+      } else if (IsBinFactor(a) && IsFactor(b)) {
+        return MakeProduct(b, a);
+      } else if (IsFactor(a) && IsBinFactor(b) &&
+        ((IVariableTreeNode)a).VariableName == ((IVariableTreeNode)b).VariableName) {
+        var node0 = a as FactorVariableTreeNode;
+        var node1 = b as BinaryFactorVariableTreeNode;
+        var varValues = node0.Symbol.GetVariableValues(node0.VariableName).ToArray();
+        var wi = Array.IndexOf(varValues, node1.VariableValue);
+        if (wi < 0) throw new ArgumentException();
+        return MakeBinFactor(node1.Symbol, node1.VariableName, node1.VariableValue, node1.Weight * node0.Weights[wi]);
+      } else if (IsConstant(b) && ((ConstantTreeNode)b).Value.IsAlmost(1.0)) {
+        // $ * 1.0 => $
+        return a;
+      } else if (IsConstant(b) && IsVariableBase(a)) {
+        // multiply constants into variables weights
+        ((VariableTreeNodeBase)a).Weight *= ((ConstantTreeNode)b).Value;
+        return a;
+      } else if (IsConstant(b) && IsAddition(a) ||
+          IsFactor(b) && IsAddition(a) ||
+          IsBinFactor(b) && IsAddition(a)) {
+        // multiply constants into additions
+        return a.Subtrees.Select(x => MakeProduct(GetSimplifiedTree(x), GetSimplifiedTree(b))).Aggregate((c, d) => MakeSum(c, d));
+      } else if (IsDivision(a) && IsDivision(b)) {
+        // (a1 / a2) * (b1 / b2) => (a1 * b1) / (a2 * b2)
+        return MakeFraction(MakeProduct(a.GetSubtree(0), b.GetSubtree(0)), MakeProduct(a.GetSubtree(1), b.GetSubtree(1)));
+      } else if (IsDivision(a)) {
+        // (a1 / a2) * b => (a1 * b) / a2
+        return MakeFraction(MakeProduct(a.GetSubtree(0), b), a.GetSubtree(1));
+      } else if (IsDivision(b)) {
+        // a * (b1 / b2) => (b1 * a) / b2
+        return MakeFraction(MakeProduct(b.GetSubtree(0), a), b.GetSubtree(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.GetSubtree(i));
+        for (int i = 0; i < b.Subtrees.Count(); i++) mul.AddSubtree(b.GetSubtree(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(GetSimplifiedTree(b));
+        MergeVariablesAndConstantsInProduct(a);
+        return a;
+      } else {
+        var mul = mulSymbol.CreateTreeNode();
+        mul.AddSubtree(a);
+        mul.AddSubtree(b);
+        MergeVariablesAndConstantsInProduct(mul);
+        return mul;
+      }
+    }
+
+    #endregion
+
+    #region helper functions
+
+    private static bool ContainsVariableCondition(ISymbolicExpressionTreeNode node) {
+      if (node.Symbol is VariableCondition) return true;
+      foreach (var subtree in node.Subtrees)
+        if (ContainsVariableCondition(subtree)) return true;
+      return false;
+    }
+
+    private static ISymbolicExpressionTreeNode AddLagToDynamicNodes(ISymbolicExpressionTreeNode node, int lag) {
+      var laggedTreeNode = node as ILaggedTreeNode;
+      var variableNode = node as VariableTreeNode;
+      var variableConditionNode = node as VariableConditionTreeNode;
+      if (laggedTreeNode != null)
+        laggedTreeNode.Lag += lag;
+      else if (variableNode != null) {
+        var laggedVariableNode = (LaggedVariableTreeNode)laggedVariableSymbol.CreateTreeNode();
+        laggedVariableNode.Lag = lag;
+        laggedVariableNode.VariableName = variableNode.VariableName;
+        return laggedVariableNode;
+      } else if (variableConditionNode != null) {
+        throw new NotSupportedException("Removal of time lags around variable condition symbols is not allowed.");
+      }
+      var subtrees = new List<ISymbolicExpressionTreeNode>(node.Subtrees);
+      while (node.SubtreeCount > 0) node.RemoveSubtree(0);
+      foreach (var subtree in subtrees) {
+        node.AddSubtree(AddLagToDynamicNodes(subtree, lag));
+      }
+      return node;
+    }
+
+    private static bool AreSameTypeAndVariable(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+      return GroupId((IVariableTreeNode)a) == GroupId((IVariableTreeNode)b);
+    }
+
+    // helper to combine the constant factors in products and to combine variables (powers of 2, 3...)
+    private static void MergeVariablesAndConstantsInProduct(ISymbolicExpressionTreeNode prod) {
+      var subtrees = new List<ISymbolicExpressionTreeNode>(prod.Subtrees);
+      while (prod.Subtrees.Any()) prod.RemoveSubtree(0);
+      var groupedVarNodes = from node in subtrees.OfType<IVariableTreeNode>()
+                            where node.SubtreeCount == 0
+                            group node by GroupId(node) into g
+                            orderby g.Count()
+                            select g;
+      var constantProduct = (from node in subtrees.OfType<VariableTreeNodeBase>()
+                             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.SubtreeCount > 0 || !(tree is IVariableTreeNode) && !(tree is ConstantTreeNode)
+                              select tree;
+
+      foreach (var variableNodeGroup in groupedVarNodes) {
+        var firstNode = variableNodeGroup.First();
+        if (firstNode is VariableTreeNodeBase) {
+          var representative = (VariableTreeNodeBase)firstNode;
+          representative.Weight = 1.0;
+          if (variableNodeGroup.Count() > 1) {
+            var poly = mulSymbol.CreateTreeNode();
+            for (int p = 0; p < variableNodeGroup.Count(); p++) {
+              poly.AddSubtree((ISymbolicExpressionTreeNode)representative.Clone());
+            }
+            prod.AddSubtree(poly);
+          } else {
+            prod.AddSubtree(representative);
+          }
+        } else if (firstNode is FactorVariableTreeNode) {
+          var representative = (FactorVariableTreeNode)firstNode;
+          foreach (var node in variableNodeGroup.Skip(1).Cast<FactorVariableTreeNode>()) {
+            for (int j = 0; j < representative.Weights.Length; j++) {
+              representative.Weights[j] *= node.Weights[j];
+            }
+          }
+          for (int j = 0; j < representative.Weights.Length; j++) {
+            representative.Weights[j] *= constantProduct;
+          }
+          constantProduct = 1.0;
+          // if the product already contains a factor it is not necessary to multiply a constant below
+          prod.AddSubtree(representative);
+        }
+      }
+
+      foreach (var unchangedSubtree in unchangedSubtrees)
+        prod.AddSubtree(unchangedSubtree);
+
+      if (!constantProduct.IsAlmost(1.0)) {
+        prod.AddSubtree(MakeConstant(constantProduct));
+      }
+    }
+
+
+    /// <summary>
+    /// x => x * -1
+    /// Is only used in cases where it is not necessary to create new tree nodes. Manipulates x directly.
+    /// </summary>
+    /// <param name="x"></param>
+    /// <returns>-x</returns>
+    private static ISymbolicExpressionTreeNode Negate(ISymbolicExpressionTreeNode x) {
+      if (IsConstant(x)) {
+        ((ConstantTreeNode)x).Value *= -1;
+      } else if (IsVariableBase(x)) {
+        var variableTree = (VariableTreeNodeBase)x;
+        variableTree.Weight *= -1.0;
+      } else if (IsFactor(x)) {
+        var factorNode = (FactorVariableTreeNode)x;
+        for (int i = 0; i < factorNode.Weights.Length; i++) factorNode.Weights[i] *= -1;
+      } else if (IsBinFactor(x)) {
+        var factorNode = (BinaryFactorVariableTreeNode)x;
+        factorNode.Weight *= -1;
+      } else if (IsAddition(x)) {
+        // (x0 + x1 + .. + xn) * -1 => (-x0 + -x1 + .. + -xn)        
+        var subtrees = new List<ISymbolicExpressionTreeNode>(x.Subtrees);
+        while (x.Subtrees.Any()) x.RemoveSubtree(0);
+        foreach (var subtree in subtrees) {
+          x.AddSubtree(Negate(subtree));
+        }
+      } else if (IsMultiplication(x) || IsDivision(x)) {
+        // x0 * x1 * .. * xn * -1 => x0 * x1 * .. * -xn
+        var lastSubTree = x.Subtrees.Last();
+        x.RemoveSubtree(x.SubtreeCount - 1);
+        x.AddSubtree(Negate(lastSubTree)); // 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
+    /// Must create new tree nodes
+    /// </summary>
+    /// <param name="x"></param>
+    /// <returns></returns>
+    private static ISymbolicExpressionTreeNode Invert(ISymbolicExpressionTreeNode x) {
+      if (IsConstant(x)) {
+        return MakeConstant(1.0 / ((ConstantTreeNode)x).Value);
+      } else if (IsFactor(x)) {
+        var factorNode = (FactorVariableTreeNode)x;
+        return MakeFactor(factorNode.Symbol, factorNode.VariableName, factorNode.Weights.Select(w => 1.0 / w));
+      } else if (IsDivision(x)) {
+        return MakeFraction(x.GetSubtree(1), x.GetSubtree(0));
+      } else {
+        // any other function
+        return MakeFraction(MakeConstant(1), x);
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeConstant(double value) {
+      ConstantTreeNode constantTreeNode = (ConstantTreeNode)(constSymbol.CreateTreeNode());
+      constantTreeNode.Value = value;
+      return constantTreeNode;
+    }
+
+    private static ISymbolicExpressionTreeNode MakeFactor(FactorVariable sy, string variableName, IEnumerable<double> weights) {
+      var tree = (FactorVariableTreeNode)sy.CreateTreeNode();
+      tree.VariableName = variableName;
+      tree.Weights = weights.ToArray();
+      return tree;
+    }
+    private static ISymbolicExpressionTreeNode MakeBinFactor(BinaryFactorVariable sy, string variableName, string variableValue, double weight) {
+      var tree = (BinaryFactorVariableTreeNode)sy.CreateTreeNode();
+      tree.VariableName = variableName;
+      tree.VariableValue = variableValue;
+      tree.Weight = weight;
+      return tree;
+    }
+
+
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs	(revision 16132)
@@ -0,0 +1,327 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Runtime.Serialization;
+using AutoDiff;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public class TreeToAutoDiffTermConverter {
+    public delegate double ParametricFunction(double[] vars, double[] @params);
+
+    public delegate Tuple<double[], double> ParametricFunctionGradient(double[] vars, double[] @params);
+
+    #region helper class
+    public class DataForVariable {
+      public readonly string variableName;
+      public readonly string variableValue; // for factor vars
+      public readonly int lag;
+
+      public DataForVariable(string varName, string varValue, int lag) {
+        this.variableName = varName;
+        this.variableValue = varValue;
+        this.lag = lag;
+      }
+
+      public override bool Equals(object obj) {
+        var other = obj as DataForVariable;
+        if (other == null) return false;
+        return other.variableName.Equals(this.variableName) &&
+               other.variableValue.Equals(this.variableValue) &&
+               other.lag == this.lag;
+      }
+
+      public override int GetHashCode() {
+        return variableName.GetHashCode() ^ variableValue.GetHashCode() ^ lag;
+      }
+    }
+    #endregion
+
+    #region derivations of functions
+    // create function factory for arctangent
+    private static readonly Func<Term, UnaryFunc> arctan = UnaryFunc.Factory(
+      eval: Math.Atan,
+      diff: x => 1 / (1 + x * x));
+
+    private static readonly Func<Term, UnaryFunc> sin = UnaryFunc.Factory(
+      eval: Math.Sin,
+      diff: Math.Cos);
+
+    private static readonly Func<Term, UnaryFunc> cos = UnaryFunc.Factory(
+      eval: Math.Cos,
+      diff: x => -Math.Sin(x));
+
+    private static readonly Func<Term, UnaryFunc> tan = UnaryFunc.Factory(
+      eval: Math.Tan,
+      diff: x => 1 + Math.Tan(x) * Math.Tan(x));
+
+    private static readonly Func<Term, UnaryFunc> erf = UnaryFunc.Factory(
+      eval: alglib.errorfunction,
+      diff: x => 2.0 * Math.Exp(-(x * x)) / Math.Sqrt(Math.PI));
+
+    private static readonly Func<Term, UnaryFunc> norm = UnaryFunc.Factory(
+      eval: alglib.normaldistribution,
+      diff: x => -(Math.Exp(-(x * x)) * Math.Sqrt(Math.Exp(x * x)) * x) / Math.Sqrt(2 * Math.PI));
+
+    #endregion
+
+    public static bool TryConvertToAutoDiff(ISymbolicExpressionTree tree, bool makeVariableWeightsVariable, bool addLinearScalingTerms,
+      out List<DataForVariable> parameters, out double[] initialConstants,
+      out ParametricFunction func,
+      out ParametricFunctionGradient func_grad) {
+
+      // use a transformator object which holds the state (variable list, parameter list, ...) for recursive transformation of the tree
+      var transformator = new TreeToAutoDiffTermConverter(makeVariableWeightsVariable, addLinearScalingTerms);
+      AutoDiff.Term term;
+      try {
+        term = transformator.ConvertToAutoDiff(tree.Root.GetSubtree(0));
+        var parameterEntries = transformator.parameters.ToArray(); // guarantee same order for keys and values
+        var compiledTerm = term.Compile(transformator.variables.ToArray(),
+          parameterEntries.Select(kvp => kvp.Value).ToArray());
+        parameters = new List<DataForVariable>(parameterEntries.Select(kvp => kvp.Key));
+        initialConstants = transformator.initialConstants.ToArray();
+        func = (vars, @params) => compiledTerm.Evaluate(vars, @params);
+        func_grad = (vars, @params) => compiledTerm.Differentiate(vars, @params);
+        return true;
+      } catch (ConversionException) {
+        func = null;
+        func_grad = null;
+        parameters = null;
+        initialConstants = null;
+      }
+      return false;
+    }
+
+    // state for recursive transformation of trees 
+    private readonly
+    List<double> initialConstants;
+    private readonly Dictionary<DataForVariable, AutoDiff.Variable> parameters;
+    private readonly List<AutoDiff.Variable> variables;
+    private readonly bool makeVariableWeightsVariable;
+    private readonly bool addLinearScalingTerms;
+
+    private TreeToAutoDiffTermConverter(bool makeVariableWeightsVariable, bool addLinearScalingTerms) {
+      this.makeVariableWeightsVariable = makeVariableWeightsVariable;
+      this.addLinearScalingTerms = addLinearScalingTerms;
+      this.initialConstants = new List<double>();
+      this.parameters = new Dictionary<DataForVariable, AutoDiff.Variable>();
+      this.variables = new List<AutoDiff.Variable>();
+    }
+
+    private AutoDiff.Term ConvertToAutoDiff(ISymbolicExpressionTreeNode node) {
+      if (node.Symbol is Constant) {
+        initialConstants.Add(((ConstantTreeNode)node).Value);
+        var var = new AutoDiff.Variable();
+        variables.Add(var);
+        return var;
+      }
+      if (node.Symbol is Variable || node.Symbol is BinaryFactorVariable) {
+        var varNode = node as VariableTreeNodeBase;
+        var factorVarNode = node as BinaryFactorVariableTreeNode;
+        // factor variable values are only 0 or 1 and set in x accordingly
+        var varValue = factorVarNode != null ? factorVarNode.VariableValue : string.Empty;
+        var par = FindOrCreateParameter(parameters, varNode.VariableName, varValue);
+
+        if (makeVariableWeightsVariable) {
+          initialConstants.Add(varNode.Weight);
+          var w = new AutoDiff.Variable();
+          variables.Add(w);
+          return AutoDiff.TermBuilder.Product(w, par);
+        } else {
+          return varNode.Weight * par;
+        }
+      }
+      if (node.Symbol is FactorVariable) {
+        var factorVarNode = node as FactorVariableTreeNode;
+        var products = new List<Term>();
+        foreach (var variableValue in factorVarNode.Symbol.GetVariableValues(factorVarNode.VariableName)) {
+          var par = FindOrCreateParameter(parameters, factorVarNode.VariableName, variableValue);
+
+          initialConstants.Add(factorVarNode.GetValue(variableValue));
+          var wVar = new AutoDiff.Variable();
+          variables.Add(wVar);
+
+          products.Add(AutoDiff.TermBuilder.Product(wVar, par));
+        }
+        return AutoDiff.TermBuilder.Sum(products);
+      }
+      if (node.Symbol is LaggedVariable) {
+        var varNode = node as LaggedVariableTreeNode;
+        var par = FindOrCreateParameter(parameters, varNode.VariableName, string.Empty, varNode.Lag);
+
+        if (makeVariableWeightsVariable) {
+          initialConstants.Add(varNode.Weight);
+          var w = new AutoDiff.Variable();
+          variables.Add(w);
+          return AutoDiff.TermBuilder.Product(w, par);
+        } else {
+          return varNode.Weight * par;
+        }
+      }
+      if (node.Symbol is Addition) {
+        List<AutoDiff.Term> terms = new List<Term>();
+        foreach (var subTree in node.Subtrees) {
+          terms.Add(ConvertToAutoDiff(subTree));
+        }
+        return AutoDiff.TermBuilder.Sum(terms);
+      }
+      if (node.Symbol is Subtraction) {
+        List<AutoDiff.Term> terms = new List<Term>();
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          AutoDiff.Term t = ConvertToAutoDiff(node.GetSubtree(i));
+          if (i > 0) t = -t;
+          terms.Add(t);
+        }
+        if (terms.Count == 1) return -terms[0];
+        else return AutoDiff.TermBuilder.Sum(terms);
+      }
+      if (node.Symbol is Multiplication) {
+        List<AutoDiff.Term> terms = new List<Term>();
+        foreach (var subTree in node.Subtrees) {
+          terms.Add(ConvertToAutoDiff(subTree));
+        }
+        if (terms.Count == 1) return terms[0];
+        else return terms.Aggregate((a, b) => new AutoDiff.Product(a, b));
+      }
+      if (node.Symbol is Division) {
+        List<AutoDiff.Term> terms = new List<Term>();
+        foreach (var subTree in node.Subtrees) {
+          terms.Add(ConvertToAutoDiff(subTree));
+        }
+        if (terms.Count == 1) return 1.0 / terms[0];
+        else return terms.Aggregate((a, b) => new AutoDiff.Product(a, 1.0 / b));
+      }
+      if (node.Symbol is Logarithm) {
+        return AutoDiff.TermBuilder.Log(
+          ConvertToAutoDiff(node.GetSubtree(0)));
+      }
+      if (node.Symbol is Exponential) {
+        return AutoDiff.TermBuilder.Exp(
+          ConvertToAutoDiff(node.GetSubtree(0)));
+      }
+      if (node.Symbol is Square) {
+        return AutoDiff.TermBuilder.Power(
+          ConvertToAutoDiff(node.GetSubtree(0)), 2.0);
+      }
+      if (node.Symbol is SquareRoot) {
+        return AutoDiff.TermBuilder.Power(
+          ConvertToAutoDiff(node.GetSubtree(0)), 0.5);
+      }
+      if (node.Symbol is Sine) {
+        return sin(
+          ConvertToAutoDiff(node.GetSubtree(0)));
+      }
+      if (node.Symbol is Cosine) {
+        return cos(
+          ConvertToAutoDiff(node.GetSubtree(0)));
+      }
+      if (node.Symbol is Tangent) {
+        return tan(
+          ConvertToAutoDiff(node.GetSubtree(0)));
+      }
+      if (node.Symbol is Erf) {
+        return erf(
+          ConvertToAutoDiff(node.GetSubtree(0)));
+      }
+      if (node.Symbol is Norm) {
+        return norm(
+          ConvertToAutoDiff(node.GetSubtree(0)));
+      }
+      if (node.Symbol is StartSymbol) {
+        if (addLinearScalingTerms) {
+          // scaling variables α, β are given at the beginning of the parameter vector
+          var alpha = new AutoDiff.Variable();
+          var beta = new AutoDiff.Variable();
+          variables.Add(beta);
+          variables.Add(alpha);
+          var t = ConvertToAutoDiff(node.GetSubtree(0));
+          return t * alpha + beta;
+        } else return ConvertToAutoDiff(node.GetSubtree(0));
+      }
+      throw new ConversionException();
+    }
+
+
+    // for each factor variable value we need a parameter which represents a binary indicator for that variable & value combination
+    // each binary indicator is only necessary once. So we only create a parameter if this combination is not yet available
+    private static Term FindOrCreateParameter(Dictionary<DataForVariable, AutoDiff.Variable> parameters,
+      string varName, string varValue = "", int lag = 0) {
+      var data = new DataForVariable(varName, varValue, lag);
+
+      AutoDiff.Variable par = null;
+      if (!parameters.TryGetValue(data, out par)) {
+        // not found -> create new parameter and entries in names and values lists
+        par = new AutoDiff.Variable();
+        parameters.Add(data, par);
+      }
+      return par;
+    }
+
+    public static bool IsCompatible(ISymbolicExpressionTree tree) {
+      var containsUnknownSymbol = (
+        from n in tree.Root.GetSubtree(0).IterateNodesPrefix()
+        where
+          !(n.Symbol is Variable) &&
+          !(n.Symbol is BinaryFactorVariable) &&
+          !(n.Symbol is FactorVariable) &&
+          !(n.Symbol is LaggedVariable) &&
+          !(n.Symbol is Constant) &&
+          !(n.Symbol is Addition) &&
+          !(n.Symbol is Subtraction) &&
+          !(n.Symbol is Multiplication) &&
+          !(n.Symbol is Division) &&
+          !(n.Symbol is Logarithm) &&
+          !(n.Symbol is Exponential) &&
+          !(n.Symbol is SquareRoot) &&
+          !(n.Symbol is Square) &&
+          !(n.Symbol is Sine) &&
+          !(n.Symbol is Cosine) &&
+          !(n.Symbol is Tangent) &&
+          !(n.Symbol is Erf) &&
+          !(n.Symbol is Norm) &&
+          !(n.Symbol is StartSymbol)
+        select n).Any();
+      return !containsUnknownSymbol;
+    }
+    #region exception class
+    [Serializable]
+    public class ConversionException : Exception {
+
+      public ConversionException() {
+      }
+
+      public ConversionException(string message) : base(message) {
+      }
+
+      public ConversionException(string message, Exception inner) : base(message, inner) {
+      }
+
+      protected ConversionException(
+        SerializationInfo info,
+        StreamingContext context) : base(info, context) {
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/MultiSymbolicDataAnalysisExpressionCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/MultiSymbolicDataAnalysisExpressionCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/MultiSymbolicDataAnalysisExpressionCreator.cs	(revision 16132)
@@ -0,0 +1,153 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Collections;
+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.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Creators {
+  [StorableClass]
+  public class MultiSymbolicDataAnalysisExpressionCreator : StochasticMultiBranch<ISymbolicDataAnalysisSolutionCreator>,
+    ISymbolicDataAnalysisSolutionCreator,
+    ISymbolicExpressionTreeSizeConstraintOperator,
+  ISymbolicExpressionTreeGrammarBasedOperator {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    private const string SymbolicExpressionTreeGrammarParameterName = "SymbolicExpressionTreeGrammar";
+    private const string ClonedSymbolicExpressionTreeGrammarParameterName = "ClonedSymbolicExpressionTreeGrammar";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    protected override bool CreateChildOperation {
+      get { return true; }
+    }
+
+    #region parameter properties
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    public IValueLookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionTreeGrammarParameter {
+      get { return (IValueLookupParameter<ISymbolicExpressionGrammar>)Parameters[SymbolicExpressionTreeGrammarParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionGrammar> ClonedSymbolicExpressionTreeGrammarParameter {
+      get { return (ILookupParameter<ISymbolicExpressionGrammar>)Parameters[ClonedSymbolicExpressionTreeGrammarParameterName]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected MultiSymbolicDataAnalysisExpressionCreator(bool deserializing) : base(deserializing) { }
+    protected MultiSymbolicDataAnalysisExpressionCreator(MultiSymbolicDataAnalysisExpressionCreator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new MultiSymbolicDataAnalysisExpressionCreator(this, cloner); }
+    public MultiSymbolicDataAnalysisExpressionCreator()
+      : base() {
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+      Parameters.Add(new ValueLookupParameter<ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName, "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
+
+      List<ISymbolicDataAnalysisSolutionCreator> list = new List<ISymbolicDataAnalysisSolutionCreator>();
+      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicDataAnalysisSolutionCreator))) {
+        if (this.GetType().Assembly != type.Assembly) continue;
+        if (typeof(IMultiOperator<ISymbolicDataAnalysisSolutionCreator>).IsAssignableFrom(type)) continue;
+        list.Add((ISymbolicDataAnalysisSolutionCreator)Activator.CreateInstance(type));
+      }
+      CheckedItemList<ISymbolicDataAnalysisSolutionCreator> checkedItemList = new CheckedItemList<ISymbolicDataAnalysisSolutionCreator>();
+      checkedItemList.AddRange(list.OrderBy(op => op.Name));
+      Operators = checkedItemList.AsReadOnly();
+      Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicDataAnalysisSolutionCreator>>(Operators.CheckedItems));
+
+    }
+
+    public override IOperation InstrumentedApply() {
+      if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) {
+        SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true;
+        IScope globalScope = ExecutionContext.Scope;
+        while (globalScope.Parent != null)
+          globalScope = globalScope.Parent;
+
+        globalScope.Variables.Add(new Core.Variable(ClonedSymbolicExpressionTreeGrammarParameterName, (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone()));
+      }
+      return base.InstrumentedApply();
+    }
+
+    public ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxTreeLength, int maxTreeDepth) {
+      double sum = Operators.CheckedItems.Sum(o => Probabilities[o.Index]);
+      if (sum.IsAlmost(0)) throw new InvalidOperationException(Name + ": All selected operators have zero probability.");
+      double r = random.NextDouble() * sum;
+      sum = 0;
+      int index = -1;
+      foreach (var indexedItem in Operators.CheckedItems) {
+        sum += Probabilities[indexedItem.Index];
+        if (sum > r) {
+          index = indexedItem.Index;
+          break;
+        }
+      }
+      return Operators[index].CreateTree(random, grammar, maxTreeLength, maxTreeDepth);
+    }
+
+    protected override void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicDataAnalysisSolutionCreator>> e) {
+      base.Operators_ItemsReplaced(sender, e);
+      ParameterizeTreeCreators();
+    }
+
+    protected override void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicDataAnalysisSolutionCreator>> e) {
+      base.Operators_ItemsAdded(sender, e);
+      ParameterizeTreeCreators();
+    }
+    private void ParameterizeTreeCreators() {
+      foreach (IStochasticOperator creator in Operators.OfType<IStochasticOperator>()) {
+        creator.RandomParameter.ActualName = RandomParameter.Name;
+      }
+      foreach (ISymbolicExpressionTreeCreator creator in Operators.OfType<ISymbolicExpressionTreeCreator>()) {
+        creator.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+      }
+      foreach (ISymbolicExpressionTreeSizeConstraintOperator creator in Operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) {
+        creator.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameter.Name;
+        creator.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter.Name;
+      }
+
+      foreach (ISymbolicExpressionTreeGrammarBasedOperator creator in Operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>()) {
+        creator.SymbolicExpressionTreeGrammarParameter.ActualName = SymbolicExpressionTreeGrammarParameter.Name;
+      }
+    }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionFullTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionFullTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionFullTreeCreator.cs	(revision 16132)
@@ -0,0 +1,40 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("FullTreeCreator", "An operator that creates new symbolic expression trees using the 'Full' method")]
+  public class SymbolicDataAnalysisExpressionFullTreeCreator : FullTreeCreator, ISymbolicDataAnalysisSolutionCreator {
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionFullTreeCreator(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionFullTreeCreator(SymbolicDataAnalysisExpressionFullTreeCreator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicDataAnalysisExpressionFullTreeCreator(this, cloner); }
+
+    public SymbolicDataAnalysisExpressionFullTreeCreator() : base() { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionGrowTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionGrowTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionGrowTreeCreator.cs	(revision 16132)
@@ -0,0 +1,40 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PluginInfrastructure;
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("GrowTreeCreator", "An operator that creates new symbolic expression trees using the 'Grow' method")]
+  public class SymbolicDataAnalysisExpressionGrowTreeCreator : GrowTreeCreator, ISymbolicDataAnalysisSolutionCreator {
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionGrowTreeCreator(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionGrowTreeCreator(SymbolicDataAnalysisExpressionGrowTreeCreator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicDataAnalysisExpressionGrowTreeCreator(this, cloner); }
+
+    public SymbolicDataAnalysisExpressionGrowTreeCreator() : base() { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator.cs	(revision 16132)
@@ -0,0 +1,40 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PluginInfrastructure;
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("RampedHalfAndHalfTreeCreator", "An operator that creates new symbolic expression trees in an alternate way: half the trees are created usign the 'Grow' method while the other half are created using the 'Full' method")]
+  public class SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator : RampedHalfAndHalfTreeCreator, ISymbolicDataAnalysisSolutionCreator {
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator(SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator(this, cloner); }
+
+    public SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator() : base() { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionTreeCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionTreeCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionTreeCreator.cs	(revision 16132)
@@ -0,0 +1,38 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("ProbabilisticTreeCreator", "An operator that creates new symbolic expression trees with uniformly distributed length")]
+  public class SymbolicDataAnalysisExpressionTreeCreator : ProbabilisticTreeCreator, ISymbolicDataAnalysisSolutionCreator {
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionTreeCreator(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionTreeCreator(SymbolicDataAnalysisExpressionTreeCreator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicDataAnalysisExpressionTreeCreator(this, cloner); }
+
+    public SymbolicDataAnalysisExpressionTreeCreator() : base() { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/MultiSymbolicDataAnalysisExpressionCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/MultiSymbolicDataAnalysisExpressionCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/MultiSymbolicDataAnalysisExpressionCrossover.cs	(revision 16132)
@@ -0,0 +1,189 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("MultiSymbolicDataAnalysisExpressionCrossover", "Randomly selects and applies one of its crossovers every time it is called.")]
+  [StorableClass]
+  public class MultiSymbolicDataAnalysisExpressionCrossover<T> : StochasticMultiBranch<ISymbolicExpressionTreeCrossover>,
+    ISymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
+    private const string ParentsParameterName = "Parents";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string EvaluatorParameterName = "Evaluator";
+    private const string SymbolicDataAnalysisEvaluationPartitionParameterName = "EvaluationPartition";
+    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+    private const string ProblemDataParameterName = "ProblemData";
+
+    protected override bool CreateChildOperation {
+      get { return true; }
+    }
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    #region parameter properties
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+    public ILookupParameter<ItemArray<ISymbolicExpressionTree>> ParentsParameter {
+      get { return (ScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[ParentsParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<T>> EvaluatorParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<T>>)Parameters[EvaluatorParameterName]; }
+    }
+    public IValueLookupParameter<IntRange> EvaluationPartitionParameter {
+      get { return (IValueLookupParameter<IntRange>)Parameters[SymbolicDataAnalysisEvaluationPartitionParameterName]; }
+    }
+    public IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+    }
+    public IValueLookupParameter<T> ProblemDataParameter {
+      get { return (IValueLookupParameter<T>)Parameters[ProblemDataParameterName]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected MultiSymbolicDataAnalysisExpressionCrossover(bool deserializing) : base(deserializing) { }
+    protected MultiSymbolicDataAnalysisExpressionCrossover(MultiSymbolicDataAnalysisExpressionCrossover<T> original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new MultiSymbolicDataAnalysisExpressionCrossover<T>(this, cloner); }
+    public MultiSymbolicDataAnalysisExpressionCrossover()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index."));
+      Parameters.Add(new ValueLookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated."));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<T>>(EvaluatorParameterName, "The single objective solution evaluator"));
+      Parameters.Add(new ValueLookupParameter<IntRange>(SymbolicDataAnalysisEvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated."));
+      Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed."));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The child symbolic expression tree resulting from the crossover."));
+
+      EvaluatorParameter.Hidden = true;
+      EvaluationPartitionParameter.Hidden = true;
+      SymbolicDataAnalysisTreeInterpreterParameter.Hidden = true;
+      ProblemDataParameter.Hidden = true;
+      RelativeNumberOfEvaluatedSamplesParameter.Hidden = true;
+
+      InitializeOperators();
+      name = "MultiSymbolicDataAnalysisExpressionCrossover";
+
+      SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator";
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      if (!Parameters.ContainsKey(SymbolicExpressionTreeParameterName))
+        Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
+      #endregion
+    }
+
+    private void InitializeOperators() {
+      var list = ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeCrossover>().ToList();
+      var dataAnalysisCrossovers = from type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicDataAnalysisExpressionCrossover<T>))
+                                   where this.GetType().Assembly == type.Assembly
+                                   where !typeof(IMultiOperator<ISymbolicExpressionTreeCrossover>).IsAssignableFrom(type)
+                                   select (ISymbolicDataAnalysisExpressionCrossover<T>)Activator.CreateInstance(type);
+      list.AddRange(dataAnalysisCrossovers);
+
+      var checkedItemList = new CheckedItemList<ISymbolicExpressionTreeCrossover>();
+      checkedItemList.AddRange(list.OrderBy(op => op.Name));
+      Operators = checkedItemList;
+      Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeCrossover>>(Operators.CheckedItems));
+    }
+
+    public ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
+      double sum = Operators.CheckedItems.Sum(o => Probabilities[o.Index]);
+      if (sum.IsAlmost(0)) throw new InvalidOperationException(Name + ": All selected operators have zero probability.");
+      double r = random.NextDouble() * sum;
+      sum = 0;
+      int index = -1;
+      foreach (var indexedItem in Operators.CheckedItems) {
+        sum += Probabilities[indexedItem.Index];
+        if (sum > r) {
+          index = indexedItem.Index;
+          break;
+        }
+      }
+      return Operators[index].Crossover(random, parent0, parent1);
+    }
+
+    protected override void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeCrossover>> e) {
+      base.Operators_ItemsReplaced(sender, e);
+      ParameterizeCrossovers();
+    }
+
+    protected override void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeCrossover>> e) {
+      base.Operators_ItemsAdded(sender, e);
+      ParameterizeCrossovers();
+    }
+
+    private void ParameterizeCrossovers() {
+      foreach (ISymbolicExpressionTreeCrossover op in Operators) {
+        op.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
+        op.ParentsParameter.ActualName = ParentsParameter.Name;
+      }
+      foreach (IStochasticOperator op in Operators.OfType<IStochasticOperator>()) {
+        op.RandomParameter.ActualName = RandomParameter.Name;
+      }
+      foreach (ISymbolicExpressionTreeSizeConstraintOperator op in Operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) {
+        op.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameter.Name;
+        op.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter.Name;
+      }
+
+      foreach (ISymbolicDataAnalysisInterpreterOperator op in Operators.OfType<ISymbolicDataAnalysisInterpreterOperator>()) {
+        op.SymbolicDataAnalysisTreeInterpreterParameter.ActualName = SymbolicDataAnalysisTreeInterpreterParameter.Name;
+      }
+      foreach (var op in Operators.OfType<ISymbolicDataAnalysisExpressionCrossover<T>>()) {
+        op.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
+        op.EvaluationPartitionParameter.ActualName = EvaluationPartitionParameter.Name;
+        op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
+        op.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionContextAwareCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionContextAwareCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionContextAwareCrossover.cs	(revision 16132)
@@ -0,0 +1,115 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("ContextAwareCrossover", "An operator which deterministically choses the best insertion point for a randomly selected node:\n" +
+                                 "- Take two parent individuals P0 and P1\n" +
+                                 "- Randomly choose a node N from P1\n" +
+                                 "- Test all crossover points from P0 to determine the best location for N to be inserted")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisExpressionContextAwareCrossover<T> : SymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionContextAwareCrossover(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionContextAwareCrossover(SymbolicDataAnalysisExpressionCrossover<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDataAnalysisExpressionContextAwareCrossover()
+      : base() {
+      name = "ContextAwareCrossover";
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionContextAwareCrossover<T>(this, cloner);
+    }
+    public override ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
+      if (this.ExecutionContext == null)
+        throw new InvalidOperationException("ExecutionContext not set.");
+      List<int> rows = GenerateRowsToEvaluate().ToList();
+      T problemData = ProblemDataParameter.ActualValue;
+      ISymbolicDataAnalysisSingleObjectiveEvaluator<T> evaluator = EvaluatorParameter.ActualValue;
+
+      return Cross(random, parent0, parent1, this.ExecutionContext, evaluator, problemData, rows, MaximumSymbolicExpressionTreeDepth.Value, MaximumSymbolicExpressionTreeLength.Value);
+    }
+
+    /// <summary>
+    /// Takes two parent individuals P0 and P1. 
+    /// Randomly choose a node i from the second parent, then test all possible crossover points from the first parent to determine the best location for i to be inserted.
+    /// </summary>
+    public static ISymbolicExpressionTree Cross(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1, IExecutionContext context,
+                                                ISymbolicDataAnalysisSingleObjectiveEvaluator<T> evaluator, T problemData, List<int> rows, int maxDepth, int maxLength) {
+      // randomly choose a node from the second parent
+      var possibleChildren = new List<ISymbolicExpressionTreeNode>();
+      parent1.Root.ForEachNodePostfix((n) => {
+        if (n.Parent != null && n.Parent != parent1.Root)
+          possibleChildren.Add(n);
+      });
+
+      var selectedChild = possibleChildren.SampleRandom(random);
+      var crossoverPoints = new List<CutPoint>();
+      var qualities = new List<Tuple<CutPoint, double>>();
+
+      parent0.Root.ForEachNodePostfix((n) => {
+        if (n.Parent != null && n.Parent != parent0.Root) {
+          var totalDepth = parent0.Root.GetBranchLevel(n) + selectedChild.GetDepth();
+          var totalLength = parent0.Root.GetLength() - n.GetLength() + selectedChild.GetLength();
+          if (totalDepth <= maxDepth && totalLength <= maxLength) {
+            var crossoverPoint = new CutPoint(n.Parent, n);
+            if (crossoverPoint.IsMatchingPointType(selectedChild))
+              crossoverPoints.Add(crossoverPoint);
+          }
+        }
+      });
+
+      if (crossoverPoints.Any()) {
+        // this loop will perform two swap operations per each crossover point
+        foreach (var crossoverPoint in crossoverPoints) {
+          // save the old parent so we can restore it later
+          var parent = selectedChild.Parent;
+          // perform a swap and check the quality of the solution
+          Swap(crossoverPoint, selectedChild);
+          IExecutionContext childContext = new ExecutionContext(context, evaluator, context.Scope);
+          double quality = evaluator.Evaluate(childContext, parent0, problemData, rows);
+          qualities.Add(new Tuple<CutPoint, double>(crossoverPoint, quality));
+          // restore the correct parent
+          selectedChild.Parent = parent;
+          // swap the replaced subtree back into the tree so that the structure is preserved
+          Swap(crossoverPoint, crossoverPoint.Child);
+        }
+
+        qualities.Sort((a, b) => a.Item2.CompareTo(b.Item2)); // assuming this sorts the list in ascending order
+        var crossoverPoint0 = evaluator.Maximization ? qualities.Last().Item1 : qualities.First().Item1;
+        // swap the node that would create the best offspring
+        // this last swap makes a total of (2 * crossoverPoints.Count() + 1) swap operations.
+        Swap(crossoverPoint0, selectedChild);
+      }
+
+      return parent0;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionCrossover.cs	(revision 16132)
@@ -0,0 +1,161 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisExpressionCrossover<T> : SymbolicExpressionTreeCrossover, ISymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string EvaluatorParameterName = "Evaluator";
+    private const string EvaluationPartitionParameterName = "EvaluationPartition";
+    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+
+    #region Parameter properties
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+    public IValueLookupParameter<T> ProblemDataParameter {
+      get { return (IValueLookupParameter<T>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<T>> EvaluatorParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<T>>)Parameters[EvaluatorParameterName]; }
+    }
+    public IValueLookupParameter<IntRange> EvaluationPartitionParameter {
+      get { return (IValueLookupParameter<IntRange>)Parameters[EvaluationPartitionParameterName]; }
+    }
+    public IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.ActualValue; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionCrossover(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionCrossover(SymbolicDataAnalysisExpressionCrossover<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDataAnalysisExpressionCrossover()
+      : base() {
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree."));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<T>>(EvaluatorParameterName, "The single objective solution evaluator"));
+      Parameters.Add(new ValueLookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntRange>(EvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximum tree depth."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum tree length."));
+
+      EvaluatorParameter.Hidden = true;
+      EvaluationPartitionParameter.Hidden = true;
+      SymbolicDataAnalysisTreeInterpreterParameter.Hidden = true;
+      ProblemDataParameter.Hidden = true;
+      RelativeNumberOfEvaluatedSamplesParameter.Hidden = true;
+    }
+
+    /// <summary>
+    /// Creates a SymbolicExpressionTreeNode reusing the root and start symbols (since they are expensive to create).
+    /// </summary>
+    /// <param name="random"></param>
+    /// <param name="node"></param>
+    /// <param name="rootSymbol"></param>
+    /// <param name="startSymbol"></param>
+    /// <returns></returns>
+    protected static ISymbolicExpressionTree CreateTreeFromNode(IRandom random, ISymbolicExpressionTreeNode node, ISymbol rootSymbol, ISymbol startSymbol) {
+      var rootNode = new SymbolicExpressionTreeTopLevelNode(rootSymbol);
+      if (rootNode.HasLocalParameters) rootNode.ResetLocalParameters(random);
+
+      var startNode = new SymbolicExpressionTreeTopLevelNode(startSymbol);
+      if (startNode.HasLocalParameters) startNode.ResetLocalParameters(random);
+
+      startNode.AddSubtree(node);
+      rootNode.AddSubtree(startNode);
+
+      return new SymbolicExpressionTree(rootNode);
+    }
+
+    protected IEnumerable<int> GenerateRowsToEvaluate() {
+      return GenerateRowsToEvaluate(RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value);
+    }
+
+    protected IEnumerable<int> GenerateRowsToEvaluate(double percentageOfRows) {
+      IEnumerable<int> rows;
+      int samplesStart = EvaluationPartitionParameter.ActualValue.Start;
+      int samplesEnd = EvaluationPartitionParameter.ActualValue.End;
+      int testPartitionStart = ProblemDataParameter.ActualValue.TestPartition.Start;
+      int testPartitionEnd = ProblemDataParameter.ActualValue.TestPartition.End;
+
+      if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value.");
+
+      if (percentageOfRows.IsAlmost(1.0))
+        rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart);
+      else {
+        int seed = RandomParameter.ActualValue.Next();
+        int count = (int)((samplesEnd - samplesStart) * percentageOfRows);
+        if (count == 0) count = 1;
+        rows = RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count);
+      }
+
+      return rows.Where(i => i < testPartitionStart || testPartitionEnd <= i);
+    }
+
+    protected static void Swap(CutPoint crossoverPoint, ISymbolicExpressionTreeNode selectedBranch) {
+      if (crossoverPoint.Child != null) {
+        // manipulate the tree of parent0 in place
+        // replace the branch in tree0 with the selected branch from tree1
+        crossoverPoint.Parent.RemoveSubtree(crossoverPoint.ChildIndex);
+        if (selectedBranch != null) {
+          crossoverPoint.Parent.InsertSubtree(crossoverPoint.ChildIndex, selectedBranch);
+        }
+      } else {
+        // child is null (additional child should be added under the parent)
+        if (selectedBranch != null) {
+          crossoverPoint.Parent.AddSubtree(selectedBranch);
+        }
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDepthConstrainedCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDepthConstrainedCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDepthConstrainedCrossover.cs	(revision 16132)
@@ -0,0 +1,144 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("DepthConstrainedCrossover", "An operator which performs subtree swapping within a specific depth range. The range parameter controls the crossover behavior:\n" +
+                                     "- HighLevel (upper 25% of the tree)\n" +
+                                     "- Standard (mid 50% of the tree)\n" +
+                                     "- LowLevel (lower 25% of the tree)")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisExpressionDepthConstrainedCrossover<T> :
+    SymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
+    private enum Ranges { HighLevel, Standard, LowLevel };
+    private const string DepthRangeParameterName = "DepthRange";
+
+    #region Parameter properties
+    public IConstrainedValueParameter<StringValue> DepthRangeParameter {
+      get { return (IConstrainedValueParameter<StringValue>)Parameters[DepthRangeParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public StringValue DepthRange {
+      get { return (StringValue)DepthRangeParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionDepthConstrainedCrossover(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionDepthConstrainedCrossover(SymbolicDataAnalysisExpressionCrossover<T> original, Cloner cloner)
+      : base(original, cloner) { }
+    public SymbolicDataAnalysisExpressionDepthConstrainedCrossover()
+      : base() {
+      Parameters.Add(new ConstrainedValueParameter<StringValue>(DepthRangeParameterName, "Depth range specifier"));
+      DepthRangeParameter.ValidValues.Add(new StringValue(Enum.GetName(typeof(Ranges), Ranges.HighLevel)).AsReadOnly());
+      DepthRangeParameter.ValidValues.Add(new StringValue(Enum.GetName(typeof(Ranges), Ranges.Standard)).AsReadOnly());
+      DepthRangeParameter.ValidValues.Add(new StringValue(Enum.GetName(typeof(Ranges), Ranges.LowLevel)).AsReadOnly());
+      name = "DepthConstrainedCrossover";
+    }
+    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicDataAnalysisExpressionDepthConstrainedCrossover<T>(this, cloner); }
+
+    public override ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
+      return Cross(random, parent0, parent1, MaximumSymbolicExpressionTreeDepth.Value, MaximumSymbolicExpressionTreeLength.Value, DepthRange.Value);
+    }
+
+
+    /// <summary>
+    /// Takes two parent individuals P0 and P1. 
+    /// Randomly choose nodes that fall within the specified depth range in both parents.
+    /// </summary>
+    /// <param name="random">Pseudo-random number generator.</param>
+    /// <param name="parent0">First parent.</param>
+    /// <param name="parent1">Second parent.</param>
+    /// <param name="maxDepth">Maximum allowed length depth.</param>
+    /// <param name="maxLength">Maximum allowed tree length.</param>
+    /// <param name="mode">Controls the crossover behavior: 
+    /// - HighLevel (upper 25% of the tree),
+    /// - Standard (mid 50%)
+    /// - LowLevel (low 25%)</param>
+    /// <returns></returns>
+    public static ISymbolicExpressionTree Cross(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1, int maxDepth, int maxLength, string mode) {
+      int depth = parent0.Root.GetDepth() - 1; // substract 1 because the tree levels are counted from 0 
+      var depthRange = new IntRange();
+      const int depthOffset = 2; // skip the first 2 levels (root + startNode)
+      switch ((Ranges)Enum.Parse(typeof(Ranges), mode)) {
+        case Ranges.HighLevel:
+          depthRange.Start = depthOffset; // skip the first 2 levels (root + startNode)
+          depthRange.End = depthRange.Start + (int)Math.Round(depth * 0.25);
+          break;
+        case Ranges.Standard:
+          depthRange.Start = depthOffset + (int)Math.Round(depth * 0.25);
+          depthRange.End = depthRange.Start + (int)Math.Round(depth * 0.5);
+          break;
+        case Ranges.LowLevel:
+          depthRange.Start = depthOffset + (int)Math.Round(depth * 0.75);
+          depthRange.End = Math.Max(depthRange.Start, depth);
+          break;
+      }
+
+      // make sure that the depth range does not exceeded the actual depth of parent0
+      if (depthRange.Start > depth)
+        depthRange.Start = depth;
+      if (depthRange.End < depthRange.Start)
+        depthRange.End = depthRange.Start;
+
+      var crossoverPoints0 = (from node in GetNodesAtDepth(parent0, depthRange) select new CutPoint(node.Parent, node)).ToList();
+
+      if (crossoverPoints0.Count == 0)
+        throw new Exception("No crossover points available in the first parent");
+
+      var crossoverPoint0 = crossoverPoints0.SampleRandom(random);
+      int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child);
+      int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength();
+
+      var allowedBranches = (from s in GetNodesAtDepth(parent1, depthRange)
+                             where s.GetDepth() + level <= maxDepth
+                             where s.GetLength() + length <= maxLength
+                             where crossoverPoint0.IsMatchingPointType(s)
+                             select s).ToList();
+      if (allowedBranches.Count == 0) return parent0;
+
+      var selectedBranch = allowedBranches.SampleRandom(random);
+      Swap(crossoverPoint0, selectedBranch);
+      return parent0;
+    }
+
+    private static IEnumerable<ISymbolicExpressionTreeNode> GetNodesAtDepth(ISymbolicExpressionTree tree, IntRange depthRange) {
+      var treeDepth = tree.Root.GetDepth();
+      return from node in tree.Root.IterateNodesPostfix()
+             let depth = treeDepth - node.GetDepth()
+             where depthRange.Start <= depth
+             where depth <= depthRange.End
+             select node;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDeterministicBestCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDeterministicBestCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDeterministicBestCrossover.cs	(revision 16132)
@@ -0,0 +1,110 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("DeterministicBestCrossover", "An operator which performs subtree swapping by choosing the best subtree to be swapped in a certain position:\n" +
+                                      "- Take two parent individuals P0 and P1\n" +
+                                      "- Randomly choose a crossover point C from P0\n" +
+                                      "- Test all nodes from P1 to determine the one that produces the best child when inserted at place C in P0")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisExpressionDeterministicBestCrossover<T> : SymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionDeterministicBestCrossover(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionDeterministicBestCrossover(SymbolicDataAnalysisExpressionCrossover<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDataAnalysisExpressionDeterministicBestCrossover()
+      : base() {
+      name = "DeterministicBestCrossover";
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionDeterministicBestCrossover<T>(this, cloner);
+    }
+    public override ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
+      if (this.ExecutionContext == null)
+        throw new InvalidOperationException("ExecutionContext not set.");
+      List<int> rows = GenerateRowsToEvaluate().ToList();
+      T problemData = ProblemDataParameter.ActualValue;
+      ISymbolicDataAnalysisSingleObjectiveEvaluator<T> evaluator = EvaluatorParameter.ActualValue;
+
+      return Cross(random, parent0, parent1, this.ExecutionContext, evaluator, problemData, rows, MaximumSymbolicExpressionTreeDepth.Value, MaximumSymbolicExpressionTreeLength.Value);
+    }
+
+    /// <summary>
+    /// Takes two parent individuals P0 and P1. 
+    /// Randomly choose a node i from the first parent, then test all nodes j from the second parent to determine the best child that would be obtained by swapping i for j.
+    /// </summary>
+    public static ISymbolicExpressionTree Cross(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1, IExecutionContext context,
+                                                ISymbolicDataAnalysisSingleObjectiveEvaluator<T> evaluator, T problemData, List<int> rows, int maxDepth, int maxLength) {
+      var crossoverPoints0 = new List<CutPoint>();
+      parent0.Root.ForEachNodePostfix((n) => {
+        if (n.Parent != null && n.Parent != parent0.Root)
+          crossoverPoints0.Add(new CutPoint(n.Parent, n));
+      });
+
+      CutPoint crossoverPoint0 = crossoverPoints0.SampleRandom(random);
+      int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child);
+      int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength();
+
+      var allowedBranches = new List<ISymbolicExpressionTreeNode>();
+      parent1.Root.ForEachNodePostfix((n) => {
+        if (n.Parent != null && n.Parent != parent1.Root) {
+          if (n.GetDepth() + level <= maxDepth && n.GetLength() + length <= maxLength && crossoverPoint0.IsMatchingPointType(n))
+            allowedBranches.Add(n);
+        }
+      });
+
+      if (allowedBranches.Count == 0)
+        return parent0;
+
+      // create symbols in order to improvize an ad-hoc tree so that the child can be evaluated
+      ISymbolicExpressionTreeNode selectedBranch = null;
+      var nodeQualities = new List<Tuple<ISymbolicExpressionTreeNode, double>>();
+      var originalChild = crossoverPoint0.Child;
+
+      foreach (var node in allowedBranches) {
+        var parent = node.Parent;
+        Swap(crossoverPoint0, node); // the swap will set the nodes parent to crossoverPoint0.Parent
+        IExecutionContext childContext = new ExecutionContext(context, evaluator, context.Scope);
+        double quality = evaluator.Evaluate(childContext, parent0, problemData, rows);
+        Swap(crossoverPoint0, originalChild); // swap the child back (so that the next swap will not affect the currently swapped node from parent1)
+        nodeQualities.Add(new Tuple<ISymbolicExpressionTreeNode, double>(node, quality));
+        node.Parent = parent; // restore correct parent
+      }
+
+      nodeQualities.Sort((a, b) => a.Item2.CompareTo(b.Item2));
+      selectedBranch = evaluator.Maximization ? nodeQualities.Last().Item1 : nodeQualities.First().Item1;
+
+      // swap the node that would create the best offspring
+      Swap(crossoverPoint0, selectedBranch);
+      return parent0;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover.cs	(revision 16132)
@@ -0,0 +1,150 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("ProbabilisticFunctionalCrossover", "An operator which performs subtree swapping based on the behavioral similarity between subtrees:\n" +
+                                            "- Take two parent individuals P0 and P1\n" +
+                                            "- Randomly choose a node N from P0\n" +
+                                            "- For each matching node M from P1, calculate the behavioral distance:\n" +
+                                            "\t\tD(N,M) = 0.5 * ( abs(max(N) - max(M)) + abs(min(N) - min(M)) )\n" +
+                                            "- Make a probabilistic weighted choice of node M from P1, based on the inversed and normalized behavioral distance")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover<T> : SymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover(SymbolicDataAnalysisExpressionCrossover<T> original, Cloner cloner)
+      : base(original, cloner) { }
+    public SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover()
+      : base() {
+      name = "ProbabilisticFunctionalCrossover";
+    }
+    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover<T>(this, cloner); }
+
+    public override ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
+      ISymbolicDataAnalysisExpressionTreeInterpreter interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
+      List<int> rows = GenerateRowsToEvaluate().ToList();
+      T problemData = ProblemDataParameter.ActualValue;
+      return Cross(random, parent0, parent1, interpreter, problemData,
+                   rows, MaximumSymbolicExpressionTreeDepth.Value, MaximumSymbolicExpressionTreeLength.Value);
+    }
+
+    /// <summary>
+    /// Takes two parent individuals P0 and P1. 
+    /// Randomly choose a node i from the first parent, then for each matching node j from the second parent, calculate the behavioral distance based on the range:
+    /// d(i,j) = 0.5 * ( abs(max(i) - max(j)) + abs(min(i) - min(j)) ).
+    /// Next, assign probabilities for the selection of a node j based on the inversed and normalized behavioral distance, then make a random weighted choice.
+    /// </summary>
+    public static ISymbolicExpressionTree Cross(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1,
+                                                ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, T problemData, IList<int> rows, int maxDepth, int maxLength) {
+      var crossoverPoints0 = new List<CutPoint>();
+      parent0.Root.ForEachNodePostfix((n) => {
+        // the if clauses prevent the root or the startnode from being selected, although the startnode can be the parent of the node being swapped.
+        if (n.Parent != null && n.Parent != parent0.Root) {
+          crossoverPoints0.Add(new CutPoint(n.Parent, n));
+        }
+      });
+
+      var crossoverPoint0 = crossoverPoints0.SampleRandom(random);
+      int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child);
+      int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength();
+
+      var allowedBranches = new List<ISymbolicExpressionTreeNode>();
+      parent1.Root.ForEachNodePostfix((n) => {
+        if (n.Parent != null && n.Parent != parent1.Root) {
+          if (n.GetDepth() + level <= maxDepth && n.GetLength() + length <= maxLength && crossoverPoint0.IsMatchingPointType(n))
+            allowedBranches.Add(n);
+        }
+      });
+
+      if (allowedBranches.Count == 0)
+        return parent0;
+
+      var dataset = problemData.Dataset;
+
+      // create symbols in order to improvize an ad-hoc tree so that the child can be evaluated
+      var rootSymbol = new ProgramRootSymbol();
+      var startSymbol = new StartSymbol();
+      var tree0 = CreateTreeFromNode(random, crossoverPoint0.Child, rootSymbol, startSymbol); // this will change crossoverPoint0.Child.Parent
+      double min0 = 0.0, max0 = 0.0;
+      foreach (double v in interpreter.GetSymbolicExpressionTreeValues(tree0, dataset, rows)) {
+        if (min0 > v) min0 = v;
+        if (max0 < v) max0 = v;
+      }
+      crossoverPoint0.Child.Parent = crossoverPoint0.Parent; // restore correct parent 
+
+      var weights = new List<double>();
+      foreach (var node in allowedBranches) {
+        var parent = node.Parent;
+        var tree1 = CreateTreeFromNode(random, node, rootSymbol, startSymbol);
+        double min1 = 0.0, max1 = 0.0;
+        foreach (double v in interpreter.GetSymbolicExpressionTreeValues(tree1, dataset, rows)) {
+          if (min1 > v) min1 = v;
+          if (max1 < v) max1 = v;
+        }
+        double behavioralDistance = (Math.Abs(min0 - min1) + Math.Abs(max0 - max1)) / 2; // this can be NaN of Infinity because some trees are crazy like exp(exp(exp(...))), we correct that below
+        weights.Add(behavioralDistance);
+        node.Parent = parent; // restore correct node parent
+      }
+
+      // remove branches with an infinite or NaN behavioral distance
+      for (int i = weights.Count - 1; i >= 0; --i) {
+        if (Double.IsNaN(weights[i]) || Double.IsInfinity(weights[i])) {
+          weights.RemoveAt(i);
+          allowedBranches.RemoveAt(i);
+        }
+      }
+      // check if there are any allowed branches left
+      if (allowedBranches.Count == 0)
+        return parent0;
+
+      ISymbolicExpressionTreeNode selectedBranch;
+      double sum = weights.Sum();
+
+      if (sum.IsAlmost(0.0) || weights.Count == 1) // if there is only one allowed branch, or if all weights are zero
+        selectedBranch = allowedBranches[0];
+      else {
+        for (int i = 0; i != weights.Count; ++i) // normalize and invert values
+          weights[i] = 1 - weights[i] / sum;
+
+        sum = weights.Sum(); // take new sum
+
+        // compute the probabilities (selection weights)
+        for (int i = 0; i != weights.Count; ++i)
+          weights[i] /= sum;
+
+#pragma warning disable 612, 618
+        selectedBranch = allowedBranches.SelectRandom(weights, random);
+#pragma warning restore 612, 618
+      }
+      Swap(crossoverPoint0, selectedBranch);
+      return parent0;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs	(revision 16132)
@@ -0,0 +1,133 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SemanticSimilarityCrossover", "An operator which performs subtree swapping based on the notion semantic similarity between subtrees\n" +
+                                       "(criteria: mean of the absolute differences between the estimated output values of the two subtrees, falling into a user-defined range)\n" +
+                                       "- Take two parent individuals P0 and P1\n" +
+                                       "- Randomly choose a node N from the P0\n" +
+                                       "- Find the first node M that satisfies the semantic similarity criteria\n" +
+                                       "- Swap N for M and return P0")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisExpressionSemanticSimilarityCrossover<T> : SymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
+    private const string SemanticSimilarityRangeParameterName = "SemanticSimilarityRange";
+
+    #region Parameter properties
+    public IValueParameter<DoubleRange> SemanticSimilarityRangeParameter {
+      get { return (IValueParameter<DoubleRange>)Parameters[SemanticSimilarityRangeParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public DoubleRange SemanticSimilarityRange {
+      get { return SemanticSimilarityRangeParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionSemanticSimilarityCrossover(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionSemanticSimilarityCrossover(SymbolicDataAnalysisExpressionCrossover<T> original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisExpressionSemanticSimilarityCrossover()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<DoubleRange>(SemanticSimilarityRangeParameterName, "Semantic similarity interval.", new DoubleRange(0.0001, 10)));
+      name = "SemanticSimilarityCrossover";
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionSemanticSimilarityCrossover<T>(this, cloner);
+    }
+
+    public override ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
+      ISymbolicDataAnalysisExpressionTreeInterpreter interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
+      List<int> rows = GenerateRowsToEvaluate().ToList();
+      T problemData = ProblemDataParameter.ActualValue;
+      return Cross(random, parent0, parent1, interpreter, problemData, rows, MaximumSymbolicExpressionTreeDepth.Value, MaximumSymbolicExpressionTreeLength.Value, SemanticSimilarityRange);
+    }
+
+    /// <summary>
+    /// Takes two parent individuals P0 and P1. 
+    /// Randomly choose a node i from the first parent, then get a node j from the second parent that matches the semantic similarity criteria.
+    /// </summary>
+    public static ISymbolicExpressionTree Cross(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+                                                T problemData, List<int> rows, int maxDepth, int maxLength, DoubleRange range) {
+      var crossoverPoints0 = new List<CutPoint>();
+      parent0.Root.ForEachNodePostfix((n) => {
+        if (n.Parent != null && n.Parent != parent0.Root)
+          crossoverPoints0.Add(new CutPoint(n.Parent, n));
+      });
+
+      var crossoverPoint0 = crossoverPoints0.SampleRandom(random);
+      int level = parent0.Root.GetBranchLevel(crossoverPoint0.Child);
+      int length = parent0.Root.GetLength() - crossoverPoint0.Child.GetLength();
+
+      var allowedBranches = new List<ISymbolicExpressionTreeNode>();
+      parent1.Root.ForEachNodePostfix((n) => {
+        if (n.Parent != null && n.Parent != parent1.Root) {
+          if (n.GetDepth() + level <= maxDepth && n.GetLength() + length <= maxLength && crossoverPoint0.IsMatchingPointType(n))
+            allowedBranches.Add(n);
+        }
+      });
+
+      if (allowedBranches.Count == 0)
+        return parent0;
+
+      var dataset = problemData.Dataset;
+
+      // create symbols in order to improvize an ad-hoc tree so that the child can be evaluated
+      var rootSymbol = new ProgramRootSymbol();
+      var startSymbol = new StartSymbol();
+      var tree0 = CreateTreeFromNode(random, crossoverPoint0.Child, rootSymbol, startSymbol);
+      List<double> estimatedValues0 = interpreter.GetSymbolicExpressionTreeValues(tree0, dataset, rows).ToList();
+      crossoverPoint0.Child.Parent = crossoverPoint0.Parent; // restore parent
+      ISymbolicExpressionTreeNode selectedBranch = null;
+
+      // pick the first node that fulfills the semantic similarity conditions
+      foreach (var node in allowedBranches) {
+        var parent = node.Parent;
+        var tree1 = CreateTreeFromNode(random, node, startSymbol, rootSymbol); // this will affect node.Parent 
+        List<double> estimatedValues1 = interpreter.GetSymbolicExpressionTreeValues(tree1, dataset, rows).ToList();
+        node.Parent = parent; // restore parent
+
+        OnlineCalculatorError errorState;
+        double ssd = OnlineMeanAbsoluteErrorCalculator.Calculate(estimatedValues0, estimatedValues1, out errorState);
+
+        if (range.Start <= ssd && ssd <= range.End) {
+          selectedBranch = node;
+          break;
+        }
+      }
+
+      // perform the actual swap
+      if (selectedBranch != null)
+        Swap(crossoverPoint0, selectedBranch);
+      return parent0;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs	(revision 16132)
@@ -0,0 +1,189 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisEvaluator<T> : InstrumentedOperator,
+    ISymbolicDataAnalysisEvaluator<T>, ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator, IStochasticOperator
+  where T : class, IDataAnalysisProblemData {
+    private const string RandomParameterName = "Random";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string EstimationLimitsParameterName = "EstimationLimits";
+    private const string EvaluationPartitionParameterName = "EvaluationPartition";
+    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
+    private const string ValidRowIndicatorParameterName = "ValidRowIndicator";
+
+    public override bool CanChangeName { get { return false; } }
+
+    #region parameter properties
+    ILookupParameter<IRandom> IStochasticOperator.RandomParameter {
+      get { return RandomParameter; }
+    }
+
+    public IValueLookupParameter<IRandom> RandomParameter {
+      get { return (IValueLookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+    public IValueLookupParameter<T> ProblemDataParameter {
+      get { return (IValueLookupParameter<T>)Parameters[ProblemDataParameterName]; }
+    }
+
+    public IValueLookupParameter<IntRange> EvaluationPartitionParameter {
+      get { return (IValueLookupParameter<IntRange>)Parameters[EvaluationPartitionParameterName]; }
+    }
+    public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
+      get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+    }
+    public IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+    }
+    public ILookupParameter<BoolValue> ApplyLinearScalingParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> ValidRowIndicatorParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[ValidRowIndicatorParameterName]; }
+    }
+    #endregion
+
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisEvaluator(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisEvaluator(SymbolicDataAnalysisEvaluator<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDataAnalysisEvaluator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IRandom>(RandomParameterName, "The random generator to use.") { Hidden = true });
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree.") { Hidden = true });
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic data analysis solution encoded as a symbolic expression tree.") { Hidden = true });
+      Parameters.Add(new ValueLookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated.") { Hidden = true });
+      Parameters.Add(new ValueLookupParameter<IntRange>(EvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated.") { Hidden = true });
+      Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The upper and lower limit that should be used as cut off value for the output values of symbolic data analysis trees.") { Hidden = true });
+      Parameters.Add(new ValueLookupParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index.") { Hidden = true });
+      Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating.") { Hidden = true });
+      Parameters.Add(new ValueLookupParameter<StringValue>(ValidRowIndicatorParameterName, "An indicator variable in the data set that specifies which rows should be evaluated (those for which the indicator <> 0) (optional).") { Hidden = true });
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (Parameters.ContainsKey(ApplyLinearScalingParameterName) && !(Parameters[ApplyLinearScalingParameterName] is LookupParameter<BoolValue>))
+        Parameters.Remove(ApplyLinearScalingParameterName);
+      if (!Parameters.ContainsKey(ApplyLinearScalingParameterName))
+        Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the individual should be linearly scaled before evaluating."));
+      if (!Parameters.ContainsKey(ValidRowIndicatorParameterName))
+        Parameters.Add(new ValueLookupParameter<StringValue>(ValidRowIndicatorParameterName, "An indicator variable in the data set that specifies which rows should be evaluated (those for which the indicator <> 0) (optional)."));
+    }
+
+    protected IEnumerable<int> GenerateRowsToEvaluate() {
+      return GenerateRowsToEvaluate(RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value);
+    }
+
+    protected IEnumerable<int> GenerateRowsToEvaluate(double percentageOfRows) {
+      IEnumerable<int> rows;
+      int samplesStart = EvaluationPartitionParameter.ActualValue.Start;
+      int samplesEnd = EvaluationPartitionParameter.ActualValue.End;
+      int testPartitionStart = ProblemDataParameter.ActualValue.TestPartition.Start;
+      int testPartitionEnd = ProblemDataParameter.ActualValue.TestPartition.End;
+      if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value.");
+
+      if (percentageOfRows.IsAlmost(1.0))
+        rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart);
+      else {
+        int seed = RandomParameter.ActualValue.Next();
+        int count = (int)((samplesEnd - samplesStart) * percentageOfRows);
+        if (count == 0) count = 1;
+        rows = RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count);
+      }
+
+      rows = rows.Where(i => i < testPartitionStart || testPartitionEnd <= i);
+      if (ValidRowIndicatorParameter.ActualValue != null) {
+        string indicatorVar = ValidRowIndicatorParameter.ActualValue.Value;
+        var problemData = ProblemDataParameter.ActualValue;
+        var indicatorRow = problemData.Dataset.GetReadOnlyDoubleValues(indicatorVar);
+        rows = rows.Where(r => !indicatorRow[r].IsAlmost(0.0));
+      }
+      return rows;
+    }
+
+    [ThreadStatic]
+    private static double[] cache;
+    protected static void CalculateWithScaling(IEnumerable<double> targetValues, IEnumerable<double> estimatedValues,
+      double lowerEstimationLimit, double upperEstimationLimit,
+      IOnlineCalculator calculator, int maxRows) {
+      if (cache == null || cache.Length < maxRows) {
+        cache = new double[maxRows];
+      }
+
+      // calculate linear scaling
+      int i = 0;
+      var linearScalingCalculator = new OnlineLinearScalingParameterCalculator();
+      var targetValuesEnumerator = targetValues.GetEnumerator();
+      var estimatedValuesEnumerator = estimatedValues.GetEnumerator();
+      while (targetValuesEnumerator.MoveNext() & estimatedValuesEnumerator.MoveNext()) {
+        double target = targetValuesEnumerator.Current;
+        double estimated = estimatedValuesEnumerator.Current;
+        cache[i] = estimated;
+        if (!double.IsNaN(estimated) && !double.IsInfinity(estimated))
+          linearScalingCalculator.Add(estimated, target);
+        i++;
+      }
+      if (linearScalingCalculator.ErrorState == OnlineCalculatorError.None && (targetValuesEnumerator.MoveNext() || estimatedValuesEnumerator.MoveNext()))
+        throw new ArgumentException("Number of elements in target and estimated values enumeration do not match.");
+
+      double alpha = linearScalingCalculator.Alpha;
+      double beta = linearScalingCalculator.Beta;
+      if (linearScalingCalculator.ErrorState != OnlineCalculatorError.None) {
+        alpha = 0.0;
+        beta = 1.0;
+      }
+
+      //calculate the quality by using the passed online calculator
+      targetValuesEnumerator = targetValues.GetEnumerator();
+      var scaledBoundedEstimatedValuesEnumerator = Enumerable.Range(0, i).Select(x => cache[x] * beta + alpha)
+        .LimitToRange(lowerEstimationLimit, upperEstimationLimit).GetEnumerator();
+
+      while (targetValuesEnumerator.MoveNext() & scaledBoundedEstimatedValuesEnumerator.MoveNext()) {
+        calculator.Add(targetValuesEnumerator.Current, scaledBoundedEstimatedValuesEnumerator.Current);
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisMultiObjectiveEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisMultiObjectiveEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisMultiObjectiveEvaluator.cs	(revision 16132)
@@ -0,0 +1,54 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisMultiObjectiveEvaluator<T> : SymbolicDataAnalysisEvaluator<T>, ISymbolicDataAnalysisMultiObjectiveEvaluator<T>
+   where T : class, IDataAnalysisProblemData {
+    private const string QualitiesParameterName = "Qualities";
+    public ILookupParameter<DoubleArray> QualitiesParameter {
+      get { return (ILookupParameter<DoubleArray>)Parameters[QualitiesParameterName]; }
+    }
+
+    public abstract IEnumerable<bool> Maximization { get; }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisMultiObjectiveEvaluator(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisMultiObjectiveEvaluator(SymbolicDataAnalysisMultiObjectiveEvaluator<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    protected SymbolicDataAnalysisMultiObjectiveEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleArray>(QualitiesParameterName, "The qualities of the evaluated symbolic data analysis solution."));
+    }
+
+    public abstract double[] Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, T problemData, IEnumerable<int> rows);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisSingleObjectiveEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisSingleObjectiveEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisSingleObjectiveEvaluator.cs	(revision 16132)
@@ -0,0 +1,57 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System.Collections.Generic;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisSingleObjectiveEvaluator<T> : SymbolicDataAnalysisEvaluator<T>, ISymbolicDataAnalysisSingleObjectiveEvaluator<T>
+   where T : class, IDataAnalysisProblemData {
+    private const string QualityParameterName = "Quality";
+    #region parameter properties
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    #endregion
+    #region properties
+    public abstract bool Maximization { get; }
+    #endregion
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSingleObjectiveEvaluator(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisSingleObjectiveEvaluator(SymbolicDataAnalysisSingleObjectiveEvaluator<T> original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    protected SymbolicDataAnalysisSingleObjectiveEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The quality of the evaluated symbolic data analysis solution."));
+    }
+
+    public abstract double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, T problemData, IEnumerable<int> rows);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs	(revision 16132)
@@ -0,0 +1,192 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Formats mathematical expressions in infix form. E.g. x1 * (3.0 * x2 + x3)
+  /// </summary>
+  [StorableClass]
+  [Item("Infix Symbolic Expression Tree Formatter", "A string formatter that converts symbolic expression trees to infix expressions.")]
+
+  public sealed class InfixExpressionFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+
+
+    [StorableConstructor]
+    private InfixExpressionFormatter(bool deserializing) : base(deserializing) { }
+    private InfixExpressionFormatter(InfixExpressionFormatter original, Cloner cloner) : base(original, cloner) { }
+    public InfixExpressionFormatter()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new InfixExpressionFormatter(this, cloner);
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      // skip root and start symbols
+      StringBuilder strBuilder = new StringBuilder();
+      FormatRecursively(symbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0), strBuilder);
+      return strBuilder.ToString();
+    }
+
+    private void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.SubtreeCount > 1) {
+        var token = GetToken(node.Symbol);
+        if (token == "+" || token == "-" || token == "OR" || token == "XOR") {
+          strBuilder.Append("(");
+          FormatRecursively(node.Subtrees.First(), strBuilder);
+
+          foreach (var subtree in node.Subtrees.Skip(1)) {
+            strBuilder.Append(" ").Append(token).Append(" ");
+            FormatRecursively(subtree, strBuilder);
+          }
+          strBuilder.Append(")");
+
+        } else if (token == "*" || token == "/" || token == "AND") {
+          strBuilder.Append("(");
+          FormatRecursively(node.Subtrees.First(), strBuilder);
+
+          foreach (var subtree in node.Subtrees.Skip(1)) {
+            strBuilder.Append(" ").Append(token).Append(" ");
+            FormatRecursively(subtree, strBuilder);
+          }
+          strBuilder.Append(")");
+        } else {
+          // function with multiple arguments
+          strBuilder.Append(token).Append("(");
+          FormatRecursively(node.Subtrees.First(), strBuilder);
+          foreach (var subtree in node.Subtrees.Skip(1)) {
+            strBuilder.Append(", ");
+            FormatRecursively(subtree, strBuilder);
+          }
+          strBuilder.Append(")");
+        }
+      } else if (node.SubtreeCount == 1) {
+        var token = GetToken(node.Symbol);
+        if (token == "-" || token == "NOT") {
+          strBuilder.Append("(").Append(token).Append("(");
+          FormatRecursively(node.GetSubtree(0), strBuilder);
+          strBuilder.Append("))");
+        } else if (token == "/") {
+          strBuilder.Append("1/");
+          FormatRecursively(node.GetSubtree(0), strBuilder);
+        } else if (token == "+" || token == "*") {
+          FormatRecursively(node.GetSubtree(0), strBuilder);
+        } else {
+          // function with only one argument
+          strBuilder.Append(token).Append("(");
+          FormatRecursively(node.GetSubtree(0), strBuilder);
+          strBuilder.Append(")");
+        }
+      } else {
+        // no subtrees
+        if (node.Symbol is LaggedVariable) {
+          var varNode = node as LaggedVariableTreeNode;
+          if (!varNode.Weight.IsAlmost(1.0)) {
+            strBuilder.Append("(");
+            strBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}", varNode.Weight);
+            strBuilder.Append("*");
+          }
+          strBuilder.Append("LAG(");
+          if (varNode.VariableName.Contains("'")) {
+            strBuilder.AppendFormat("\"{0}\"", varNode.VariableName);
+          } else {
+            strBuilder.AppendFormat("'{0}'", varNode.VariableName);
+          }
+          strBuilder.Append(", ")
+            .AppendFormat(CultureInfo.InvariantCulture, "{0}", varNode.Lag)
+            .Append(")");
+        } else if (node.Symbol is Variable) {
+          var varNode = node as VariableTreeNode;
+          if (!varNode.Weight.IsAlmost(1.0)) {
+            strBuilder.Append("(");
+            strBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}", varNode.Weight);
+            strBuilder.Append("*");
+          }
+          if (varNode.VariableName.Contains("'")) {
+            strBuilder.AppendFormat("\"{0}\"", varNode.VariableName);
+          } else {
+            strBuilder.AppendFormat("'{0}'", varNode.VariableName);
+          }
+          if (!varNode.Weight.IsAlmost(1.0)) {
+            strBuilder.Append(")");
+          }
+        } else if (node.Symbol is FactorVariable) {
+          var factorNode = node as FactorVariableTreeNode;
+          if (factorNode.VariableName.Contains("'")) {
+            strBuilder.AppendFormat("\"{0}\"", factorNode.VariableName);
+          } else {
+            strBuilder.AppendFormat("'{0}'", factorNode.VariableName);
+          }
+          strBuilder.AppendFormat("[{0}]",
+            string.Join(", ", factorNode.Weights.Select(w => w.ToString(CultureInfo.InvariantCulture))));
+        } else if (node.Symbol is BinaryFactorVariable) {
+          var factorNode = node as BinaryFactorVariableTreeNode;
+          if (!factorNode.Weight.IsAlmost(1.0)) {
+            strBuilder.Append("(");
+            strBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}", factorNode.Weight);
+            strBuilder.Append("*");
+          }
+          if (factorNode.VariableName.Contains("'")) {
+            strBuilder.AppendFormat("\"{0}\"", factorNode.VariableName);
+          } else {
+            strBuilder.AppendFormat("'{0}'", factorNode.VariableName);
+          }
+          strBuilder.Append(" = ");
+          if (factorNode.VariableValue.Contains("'")) {
+            strBuilder.AppendFormat("\"{0}\"", factorNode.VariableValue);
+          } else {
+            strBuilder.AppendFormat("'{0}'", factorNode.VariableValue);
+          }
+
+          if (!factorNode.Weight.IsAlmost(1.0)) {
+            strBuilder.Append(")");
+          }
+
+        } else if (node.Symbol is Constant) {
+          var constNode = node as ConstantTreeNode;
+          if (constNode.Value >= 0.0)
+            strBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}", constNode.Value);
+          else
+            strBuilder.AppendFormat(CultureInfo.InvariantCulture, "({0})", constNode.Value); // (-1
+        }
+      }
+    }
+
+    private string GetToken(ISymbol symbol) {
+      var tok = InfixExpressionParser.knownSymbols.GetBySecond(symbol).SingleOrDefault();
+      if (tok == null)
+        throw new ArgumentException(string.Format("Unknown symbol {0} found.", symbol.Name));
+      return tok;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs	(revision 16132)
@@ -0,0 +1,302 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 System.Text;
+using System.Text.RegularExpressions;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("C# Symbolic Expression Tree Formatter", "A string formatter that converts symbolic expression trees to C# code.")]
+  [StorableClass]
+  public sealed class CSharpSymbolicExpressionTreeStringFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+    [StorableConstructor]
+    private CSharpSymbolicExpressionTreeStringFormatter(bool deserializing) : base(deserializing) { }
+    private CSharpSymbolicExpressionTreeStringFormatter(CSharpSymbolicExpressionTreeStringFormatter original, Cloner cloner) : base(original, cloner) { }
+    public CSharpSymbolicExpressionTreeStringFormatter()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CSharpSymbolicExpressionTreeStringFormatter(this, cloner);
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      // skip root and start symbols
+      StringBuilder strBuilder = new StringBuilder();
+      GenerateHeader(strBuilder, symbolicExpressionTree);
+      FormatRecursively(symbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0), strBuilder);
+      GenerateFooter(strBuilder);
+      return strBuilder.ToString();
+    }
+
+    private string VariableName2Identifier(string name) {     
+      /*
+       * identifier-start-character:
+       *    letter-character
+       *    _ (the underscore character U+005F)
+       *  identifier-part-characters:
+       *    identifier-part-character
+       *    identifier-part-characters   identifier-part-character
+       *  identifier-part-character:
+       *    letter-character
+       *    decimal-digit-character
+       *    connecting-character
+       *    combining-character
+       *    formatting-character
+       *  letter-character:
+       *    A Unicode character of classes Lu, Ll, Lt, Lm, Lo, or Nl 
+       *    A unicode-escape-sequence representing a character of classes Lu, Ll, Lt, Lm, Lo, or Nl
+       *  combining-character:
+       *    A Unicode character of classes Mn or Mc 
+       *    A unicode-escape-sequence representing a character of classes Mn or Mc
+       *  decimal-digit-character:
+       *    A Unicode character of the class Nd 
+       *    A unicode-escape-sequence representing a character of the class Nd
+       *  connecting-character:
+       *    A Unicode character of the class Pc 
+       *    A unicode-escape-sequence representing a character of the class Pc
+       *  formatting-character:
+       *    A Unicode character of the class Cf 
+       *    A unicode-escape-sequence representing a character of the class Cf
+       */
+
+      var invalidIdentifierStarts = new Regex(@"[^_\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lo}\p{Nl}]");
+      var invalidIdentifierParts = new Regex(@"[^\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lo}\p{Nl}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\p{Cf}]");
+      return "@" +
+        (invalidIdentifierStarts.IsMatch(name.Substring(0, 1)) ? "_" : "") + // prepend '_' if necessary
+        invalidIdentifierParts.Replace(name, "_");
+    }
+
+    private void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      // TODO: adapt to interpreter semantics. The HL interpreter also allows Boolean operations on reals
+      if (node.Subtrees.Any()) {
+        if (node.Symbol is Addition) {
+          FormatOperator(node, "+", strBuilder);
+        } else if (node.Symbol is And) {
+          FormatOperator(node, "&&", strBuilder);
+        } else if (node.Symbol is Average) {
+          FormatFunction(node, "Average", strBuilder);
+        } else if (node.Symbol is Cosine) {
+          FormatFunction(node, "Math.Cos", strBuilder);
+        } else if (node.Symbol is Division) {
+          FormatDivision(node, strBuilder);
+        } else if (node.Symbol is Exponential) {
+          FormatFunction(node, "Math.Exp", strBuilder);
+        } else if (node.Symbol is GreaterThan) {
+          FormatOperator(node, ">", strBuilder);
+        } else if (node.Symbol is IfThenElse) {
+          FormatFunction(node, "EvaluateIf", strBuilder);
+        } else if (node.Symbol is LessThan) {
+          FormatOperator(node, "<", strBuilder);
+        } else if (node.Symbol is Logarithm) {
+          FormatFunction(node, "Math.Log", strBuilder);
+        } else if (node.Symbol is Multiplication) {
+          FormatOperator(node, "*", strBuilder);
+        } else if (node.Symbol is Not) {
+          FormatOperator(node, "!", strBuilder);
+        } else if (node.Symbol is Or) {
+          FormatOperator(node, "||", strBuilder);
+        } else if (node.Symbol is Xor) {
+          FormatOperator(node, "^", strBuilder);
+        } else if (node.Symbol is Sine) {
+          FormatFunction(node, "Math.Sin", strBuilder);
+        } else if (node.Symbol is Subtraction) {
+          FormatSubtraction(node, strBuilder);
+        } else if (node.Symbol is Tangent) {
+          FormatFunction(node, "Math.Tan", strBuilder);
+        } else if (node.Symbol is Square) {
+          FormatSquare(node, strBuilder);
+        } else if (node.Symbol is SquareRoot) {
+          FormatFunction(node, "Math.Sqrt", strBuilder);
+        } else if (node.Symbol is Power) {
+          FormatFunction(node, "Math.Pow", strBuilder);
+        } else if (node.Symbol is Root) {
+          FormatRoot(node, strBuilder);
+        } else {
+          throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " not supported for C# symbolic expression tree formatter.");
+        }
+      } else {
+        if (node is VariableTreeNode) {
+          var varNode = node as VariableTreeNode;
+          strBuilder.AppendFormat("{0} * {1}", VariableName2Identifier(varNode.VariableName), varNode.Weight.ToString("g17", CultureInfo.InvariantCulture));
+        } else if (node is ConstantTreeNode) {
+          var constNode = node as ConstantTreeNode;
+          strBuilder.Append(constNode.Value.ToString("g17", CultureInfo.InvariantCulture));
+        } else if (node.Symbol is FactorVariable) {
+          var factorNode = node as FactorVariableTreeNode;
+          FormatFactor(factorNode, strBuilder);
+        } else if (node.Symbol is BinaryFactorVariable) {
+          var binFactorNode = node as BinaryFactorVariableTreeNode;
+          FormatBinaryFactor(binFactorNode, strBuilder);
+        } else {
+          throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " not supported for C# symbolic expression tree formatter.");
+        }
+      }
+    }
+
+    private void FormatFactor(FactorVariableTreeNode node, StringBuilder strBuilder) {
+      strBuilder.AppendFormat("EvaluateFactor({0}, new [] {{ {1} }}, new [] {{ {2} }})", VariableName2Identifier(node.VariableName),
+        string.Join(",", node.Symbol.GetVariableValues(node.VariableName).Select(name => "\"" + name + "\"")), string.Join(",", node.Weights.Select(v => v.ToString(CultureInfo.InvariantCulture))));
+    }
+
+    private void FormatBinaryFactor(BinaryFactorVariableTreeNode node, StringBuilder strBuilder) {
+      strBuilder.AppendFormat(CultureInfo.InvariantCulture, "EvaluateBinaryFactor({0}, \"{1}\", {2})", VariableName2Identifier(node.VariableName), node.VariableValue, node.Weight);
+    }
+
+    private void FormatSquare(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("Math.Pow(");
+      FormatRecursively(node.GetSubtree(0), strBuilder);
+      strBuilder.Append(", 2)");
+    }
+
+    private void FormatRoot(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("Math.Pow(");
+      FormatRecursively(node.GetSubtree(0), strBuilder);
+      strBuilder.Append(", 1.0 / (");
+      FormatRecursively(node.GetSubtree(1), strBuilder);
+      strBuilder.Append("))");
+    }
+
+    private void FormatDivision(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.SubtreeCount == 1) {
+        strBuilder.Append("1.0 / ");
+        FormatRecursively(node.GetSubtree(0), strBuilder);
+      } else {
+        FormatRecursively(node.GetSubtree(0), strBuilder);
+        strBuilder.Append("/ (");
+        for (int i = 1; i < node.SubtreeCount; i++) {
+          if (i > 1) strBuilder.Append(" * ");
+          FormatRecursively(node.GetSubtree(i), strBuilder);
+        }
+        strBuilder.Append(")");
+      }
+    }
+
+    private void FormatSubtraction(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.SubtreeCount == 1) {
+        strBuilder.Append("-");
+        FormatRecursively(node.GetSubtree(0), strBuilder);
+        return;
+      }
+      //Default case: more than 1 child
+      FormatOperator(node, "-", strBuilder);
+    }
+
+    private void FormatOperator(ISymbolicExpressionTreeNode node, string symbol, StringBuilder strBuilder) {
+      strBuilder.Append("(");
+      foreach (var child in node.Subtrees) {
+        FormatRecursively(child, strBuilder);
+        if (child != node.Subtrees.Last())
+          strBuilder.Append(" " + symbol + " ");
+      }
+      strBuilder.Append(")");
+    }
+
+    private void FormatFunction(ISymbolicExpressionTreeNode node, string function, StringBuilder strBuilder) {
+      strBuilder.Append(function + "(");
+      foreach (var child in node.Subtrees) {
+        FormatRecursively(child, strBuilder);
+        if (child != node.Subtrees.Last())
+          strBuilder.Append(", ");
+      }
+      strBuilder.Append(")");
+    }
+
+    private void GenerateHeader(StringBuilder strBuilder, ISymbolicExpressionTree symbolicExpressionTree) {
+      strBuilder.AppendLine("using System;");
+      strBuilder.AppendLine("using System.Linq;" + Environment.NewLine);
+      strBuilder.AppendLine("namespace HeuristicLab.Models {");
+      strBuilder.AppendLine("public static class Model {");
+      GenerateAverageSource(strBuilder);
+      GenerateIfThenElseSource(strBuilder);
+      GenerateFactorSource(strBuilder);
+      GenerateBinaryFactorSource(strBuilder);
+      strBuilder.Append(Environment.NewLine + "public static double Evaluate (");
+
+      // here we don't have access to problemData to determine the type for each variable (double/string) therefore we must distinguish based on the symbol type
+      HashSet<string> doubleVarNames = new HashSet<string>();
+      foreach (var node in symbolicExpressionTree.IterateNodesPostfix().Where(x => x is VariableTreeNode || x is VariableConditionTreeNode)) {
+        doubleVarNames.Add(((IVariableTreeNode)node).VariableName);
+      }
+
+      HashSet<string> stringVarNames = new HashSet<string>();
+      foreach (var node in symbolicExpressionTree.IterateNodesPostfix().Where(x => x is BinaryFactorVariableTreeNode || x is FactorVariableTreeNode)) {
+        stringVarNames.Add(((IVariableTreeNode)node).VariableName);
+      }
+
+      var orderedNames = stringVarNames.OrderBy(n => n, new NaturalStringComparer()).Select(n => "string " + VariableName2Identifier(n) + " /* " + n + " */");
+      strBuilder.Append(string.Join(", ", orderedNames));
+
+      if (stringVarNames.Any() && doubleVarNames.Any())
+        strBuilder.AppendLine(",");
+      orderedNames = doubleVarNames.OrderBy(n => n, new NaturalStringComparer()).Select(n => "double " + VariableName2Identifier(n) + " /* " + n + " */");
+      strBuilder.Append(string.Join(", ", orderedNames));
+
+
+      strBuilder.AppendLine(") {");
+      strBuilder.Append("double result = ");
+    }
+
+    private void GenerateFooter(StringBuilder strBuilder) {
+      strBuilder.AppendLine(";");
+
+      strBuilder.AppendLine("return result;");
+      strBuilder.AppendLine("}");
+      strBuilder.AppendLine("}");
+      strBuilder.AppendLine("}");
+    }
+
+    private void GenerateAverageSource(StringBuilder strBuilder) {
+      strBuilder.AppendLine("private static double Average(params double[] values) {");
+      strBuilder.AppendLine("  return values.Average();");
+      strBuilder.AppendLine("}");
+    }
+
+    private void GenerateIfThenElseSource(StringBuilder strBuilder) {
+      strBuilder.AppendLine("private static double EvaluateIf(bool condition, double then, double @else) {");
+      strBuilder.AppendLine("   return condition ? then : @else;");
+      strBuilder.AppendLine("}");
+    }
+
+    private void GenerateFactorSource(StringBuilder strBuilder) {
+      strBuilder.AppendLine("private static double EvaluateFactor(string factorValue, string[] factorValues, double[] constants) {");
+      strBuilder.AppendLine("   for(int i=0;i<factorValues.Length;i++) " +
+                            "      if(factorValues[i] == factorValue) return constants[i];" +
+                            "   throw new ArgumentException();");
+      strBuilder.AppendLine("}");
+    }
+
+    private void GenerateBinaryFactorSource(StringBuilder strBuilder) {
+      strBuilder.AppendLine("private static double EvaluateBinaryFactor(string factorValue, string targetValue, double weight) {");
+      strBuilder.AppendLine("  return factorValue == targetValue ? weight : 0.0;");
+      strBuilder.AppendLine("}");
+    }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs	(revision 16132)
@@ -0,0 +1,305 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("Excel String Formatter", "String formatter for string representations of symbolic data analysis expressions in Excel syntax.")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisExpressionExcelFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionExcelFormatter(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionExcelFormatter(SymbolicDataAnalysisExpressionExcelFormatter original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisExpressionExcelFormatter()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionExcelFormatter(this, cloner);
+    }
+    private string GetExcelColumnName(int columnNumber) {
+      int dividend = columnNumber;
+      string columnName = String.Empty;
+
+      while (dividend > 0) {
+        int modulo = (dividend - 1) % 26;
+        columnName = System.Convert.ToChar(65 + modulo) + columnName;
+        dividend = (int)((dividend - modulo) / 26);
+      }
+
+      return columnName;
+    }
+
+    private readonly Dictionary<string, string> variableNameMapping = new Dictionary<string, string>();
+    private int currentVariableIndex = 0;
+    private string GetColumnToVariableName(string varName) {
+      if (!variableNameMapping.ContainsKey(varName)) {
+        currentVariableIndex++;
+        variableNameMapping.Add(varName, GetExcelColumnName(currentVariableIndex));
+      }
+      return string.Format("${0}1", variableNameMapping[varName]);
+    }
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      return Format(symbolicExpressionTree, null);
+    }
+
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree, IDataset dataset) {
+      if (dataset != null)
+        return FormatWithMapping(symbolicExpressionTree, CalculateVariableMapping(symbolicExpressionTree, dataset));
+      else return FormatWithMapping(symbolicExpressionTree, new Dictionary<string, string>());
+    }
+
+    public string FormatWithMapping(ISymbolicExpressionTree symbolicExpressionTree, Dictionary<string, string> variableNameMapping) {
+      foreach (var kvp in variableNameMapping) this.variableNameMapping.Add(kvp.Key, kvp.Value);
+      var stringBuilder = new StringBuilder();
+
+      stringBuilder.Append("=");
+      stringBuilder.Append(FormatRecursively(symbolicExpressionTree.Root));
+
+      foreach (var variable in this.variableNameMapping) {
+        stringBuilder.AppendLine();
+        stringBuilder.Append(variable.Key + " = " + variable.Value);
+      }
+      return stringBuilder.ToString();
+    }
+
+    private Dictionary<string, string> CalculateVariableMapping(ISymbolicExpressionTree tree, IDataset dataset) {
+      var mapping = new Dictionary<string, string>();
+      int inputIndex = 0;
+      var usedVariables = tree.IterateNodesPrefix().OfType<IVariableTreeNode>().Select(v => v.VariableName).Distinct().ToArray();
+      foreach (var variable in dataset.VariableNames) {
+        if (!usedVariables.Contains(variable)) continue;
+        inputIndex++;
+        mapping[variable] = GetExcelColumnName(inputIndex);
+      }
+      return mapping;
+    }
+
+    private string FormatRecursively(ISymbolicExpressionTreeNode node) {
+      ISymbol symbol = node.Symbol;
+      StringBuilder stringBuilder = new StringBuilder();
+
+      if (symbol is ProgramRootSymbol) {
+        stringBuilder.AppendLine(FormatRecursively(node.GetSubtree(0)));
+      } else if (symbol is StartSymbol)
+        return FormatRecursively(node.GetSubtree(0));
+      else if (symbol is Addition) {
+        stringBuilder.Append("(");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("+");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+        }
+        stringBuilder.Append(")");
+      } else if (symbol is Average) {
+        stringBuilder.Append("(1/");
+        stringBuilder.Append(node.SubtreeCount);
+        stringBuilder.Append(")*(");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("+");
+          stringBuilder.Append("(");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          stringBuilder.Append(")");
+        }
+        stringBuilder.Append(")");
+      } else if (symbol is Constant) {
+        ConstantTreeNode constantTreeNode = node as ConstantTreeNode;
+        stringBuilder.Append(constantTreeNode.Value.ToString(CultureInfo.InvariantCulture));
+      } else if (symbol is Cosine) {
+        stringBuilder.Append("COS(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is Division) {
+        if (node.SubtreeCount == 1) {
+          stringBuilder.Append("1/");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        } else {
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+          stringBuilder.Append("/(");
+          for (int i = 1; i < node.SubtreeCount; i++) {
+            if (i > 1) stringBuilder.Append("*");
+            stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          }
+          stringBuilder.Append(")");
+        }
+      } else if (symbol is Exponential) {
+        stringBuilder.Append("EXP(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is Square) {
+        stringBuilder.Append("POWER(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(",2)");
+      } else if (symbol is SquareRoot) {
+        stringBuilder.Append("SQRT(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is Logarithm) {
+        stringBuilder.Append("LN(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is Multiplication) {
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("*");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+        }
+      } else if (symbol is Sine) {
+        stringBuilder.Append("SIN(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is Subtraction) {
+        stringBuilder.Append("(");
+        if (node.SubtreeCount == 1) {
+          stringBuilder.Append("-");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        } else {
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+          for (int i = 1; i < node.SubtreeCount; i++) {
+            stringBuilder.Append("-");
+            stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          }
+        }
+        stringBuilder.Append(")");
+      } else if (symbol is Tangent) {
+        stringBuilder.Append("TAN(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+
+      } else if (symbol is Variable) {
+        VariableTreeNode variableTreeNode = node as VariableTreeNode;
+        stringBuilder.Append(variableTreeNode.Weight.ToString(CultureInfo.InvariantCulture));
+        stringBuilder.Append("*");
+        stringBuilder.Append(GetColumnToVariableName(variableTreeNode.VariableName));
+      } else if (symbol is BinaryFactorVariable) {
+        var binFactorNode = node as BinaryFactorVariableTreeNode;
+        stringBuilder.AppendFormat("IF({0}=\"{1}\", {2}, 0)",
+          GetColumnToVariableName(binFactorNode.VariableName),
+          binFactorNode.VariableValue,
+          binFactorNode.Weight.ToString(CultureInfo.InvariantCulture)
+          );
+      } else if (symbol is FactorVariable) {
+        var factorNode = node as FactorVariableTreeNode;
+        var values = factorNode.Symbol.GetVariableValues(factorNode.VariableName).ToArray();
+        var w = factorNode.Weights;
+        // create nested if
+        for (int i = 0; i < values.Length; i++) {
+          stringBuilder.AppendFormat("IF({0}=\"{1}\", {2}, ",
+            GetColumnToVariableName(factorNode.VariableName),
+            values[i],
+            w[i].ToString(CultureInfo.InvariantCulture));
+        }
+        stringBuilder.Append("\"\""); // return empty string on unknown value
+        stringBuilder.Append(')', values.Length); // add closing parenthesis
+      } else if (symbol is Power) {
+        stringBuilder.Append("POWER(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(",ROUND(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append(",0))");
+      } else if (symbol is Root) {
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")^(1 / ROUND(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append(",0))");
+      } else if (symbol is IfThenElse) {
+        stringBuilder.Append("IF(");
+        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + " ) > 0");
+        stringBuilder.Append(",");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append(",");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(2)));
+        stringBuilder.Append(")");
+      } else if (symbol is VariableCondition) {
+        VariableConditionTreeNode variableConditionTreeNode = node as VariableConditionTreeNode;
+        if (!variableConditionTreeNode.Symbol.IgnoreSlope) {
+          double threshold = variableConditionTreeNode.Threshold;
+          double slope = variableConditionTreeNode.Slope;
+          string p = "(1 / (1 + EXP(-" + slope.ToString(CultureInfo.InvariantCulture) + " * (" +
+                     GetColumnToVariableName(variableConditionTreeNode.VariableName) + "-" +
+                     threshold.ToString(CultureInfo.InvariantCulture) + "))))";
+          stringBuilder.Append("((");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+          stringBuilder.Append("*");
+          stringBuilder.Append(p);
+          stringBuilder.Append(") + (");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+          stringBuilder.Append("*(");
+          stringBuilder.Append("1 - " + p + ")");
+          stringBuilder.Append("))");
+        } else {
+          stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "(IF({0} <= {1}, {2}, {3}))",
+            GetColumnToVariableName(variableConditionTreeNode.VariableName),
+            variableConditionTreeNode.Threshold,
+            FormatRecursively(node.GetSubtree(0)),
+            FormatRecursively(node.GetSubtree(1))
+            );
+        }
+      } else if (symbol is Xor) {
+        stringBuilder.Append("IF(");
+        stringBuilder.Append("XOR(");
+        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + ") > 0,");
+        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(1)) + ") > 0");
+        stringBuilder.Append("), 1.0, -1.0)");
+      } else if (symbol is Or) {
+        stringBuilder.Append("IF(");
+        stringBuilder.Append("OR(");
+        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + ") > 0,");
+        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(1)) + ") > 0");
+        stringBuilder.Append("), 1.0, -1.0)");
+      } else if (symbol is And) {
+        stringBuilder.Append("IF(");
+        stringBuilder.Append("AND(");
+        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + ") > 0,");
+        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(1)) + ") > 0");
+        stringBuilder.Append("), 1.0, -1.0)");
+      } else if (symbol is Not) {
+        stringBuilder.Append("IF(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(" > 0, -1.0, 1.0)");
+      } else if (symbol is GreaterThan) {
+        stringBuilder.Append("IF((");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(") > (");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append("), 1.0, -1.0)");
+      } else if (symbol is LessThan) {
+        stringBuilder.Append("IF((");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(") < (");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append("), 1.0, -1.0)");
+      } else {
+        throw new NotImplementedException("Excel export of " + node.Symbol + " is not implemented.");
+      }
+      return stringBuilder.ToString();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs	(revision 16132)
@@ -0,0 +1,512 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("LaTeX String Formatter", "Formatter for symbolic expression trees for import into LaTeX documents.")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisExpressionLatexFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+    private readonly List<KeyValuePair<string, double>> constants;
+    private int constIndex;
+    private int targetCount;
+    private int currentLag;
+    private string targetVariable;
+    private bool containsTimeSeriesSymbol;
+
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionLatexFormatter(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionLatexFormatter(SymbolicDataAnalysisExpressionLatexFormatter original, Cloner cloner)
+      : base(original, cloner) {
+      constants = new List<KeyValuePair<string, double>>(original.constants);
+      constIndex = original.constIndex;
+      currentLag = original.currentLag;
+      targetCount = original.targetCount;
+    }
+    public SymbolicDataAnalysisExpressionLatexFormatter()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+      constants = new List<KeyValuePair<string, double>>();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionLatexFormatter(this, cloner);
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      return Format(symbolicExpressionTree, null);
+    }
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree, string targetVariable) {
+      try {
+        StringBuilder strBuilder = new StringBuilder();
+        constants.Clear();
+        constIndex = 0;
+        this.targetVariable = targetVariable;
+        containsTimeSeriesSymbol = symbolicExpressionTree.IterateNodesBreadth().Any(n => IsTimeSeriesSymbol(n.Symbol));
+        strBuilder.AppendLine(FormatRecursively(symbolicExpressionTree.Root));
+        return strBuilder.ToString();
+      } catch (NotImplementedException ex) {
+        return ex.Message + Environment.NewLine + ex.StackTrace;
+      }
+    }
+    static bool IsTimeSeriesSymbol(ISymbol s) {
+      return s is TimeLag || s is Integral || s is Derivative || s is LaggedVariable;
+    }
+
+    private string FormatRecursively(ISymbolicExpressionTreeNode node) {
+      StringBuilder strBuilder = new StringBuilder();
+      currentLag = 0;
+      FormatBegin(node, strBuilder);
+
+      if (node.SubtreeCount > 0) {
+        strBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+      }
+      int i = 1;
+      foreach (var subTree in node.Subtrees.Skip(1)) {
+        FormatSep(node, strBuilder, i);
+        // format the whole subtree
+        strBuilder.Append(FormatRecursively(subTree));
+        i++;
+      }
+
+      FormatEnd(node, strBuilder);
+
+      return strBuilder.ToString();
+    }
+
+    private void FormatBegin(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.Symbol is Addition) {
+        strBuilder.Append(@" \left( ");
+      } else if (node.Symbol is Subtraction) {
+        if (node.SubtreeCount == 1) {
+          strBuilder.Append(@"- \left( ");
+        } else {
+          strBuilder.Append(@" \left( ");
+        }
+      } else if (node.Symbol is Multiplication) {
+      } else if (node.Symbol is Division) {
+        if (node.SubtreeCount == 1) {
+          strBuilder.Append(@" \cfrac{1}{");
+        } else {
+          strBuilder.Append(@" \cfrac{ ");
+        }
+      } else if (node.Symbol is Average) {
+        // skip output of (1/1) if only one subtree
+        if (node.SubtreeCount > 1) {
+          strBuilder.Append(@" \cfrac{1}{" + node.SubtreeCount + @"}");
+        }
+        strBuilder.Append(@" \left( ");
+      } else if (node.Symbol is Logarithm) {
+        strBuilder.Append(@"\log \left( ");
+      } else if (node.Symbol is Exponential) {
+        strBuilder.Append(@"\exp \left( ");
+      } else if (node.Symbol is Square) {
+        strBuilder.Append(@"\left(");
+      } else if (node.Symbol is SquareRoot) {
+        strBuilder.Append(@"\sqrt{");
+      } else if (node.Symbol is Sine) {
+        strBuilder.Append(@"\sin \left( ");
+      } else if (node.Symbol is Cosine) {
+        strBuilder.Append(@"\cos \left( ");
+      } else if (node.Symbol is Tangent) {
+        strBuilder.Append(@"\tan \left( ");
+      } else if (node.Symbol is AiryA) {
+        strBuilder.Append(@"\operatorname{airy}_a \left( ");
+      } else if (node.Symbol is AiryB) {
+        strBuilder.Append(@"\operatorname{airy}_b \left( ");
+      } else if (node.Symbol is Bessel) {
+        strBuilder.Append(@"\operatorname{bessel}_1 \left( ");
+      } else if (node.Symbol is CosineIntegral) {
+        strBuilder.Append(@"\operatorname{cosInt} \left( ");
+      } else if (node.Symbol is Dawson) {
+        strBuilder.Append(@"\operatorname{dawson} \left( ");
+      } else if (node.Symbol is Erf) {
+        strBuilder.Append(@"\operatorname{erf} \left( ");
+      } else if (node.Symbol is ExponentialIntegralEi) {
+        strBuilder.Append(@"\operatorname{expInt}_i \left( ");
+      } else if (node.Symbol is FresnelCosineIntegral) {
+        strBuilder.Append(@"\operatorname{fresnel}_\operatorname{cosInt} \left( ");
+      } else if (node.Symbol is FresnelSineIntegral) {
+        strBuilder.Append(@"\operatorname{fresnel}_\operatorname{sinInt} \left( ");
+      } else if (node.Symbol is Gamma) {
+        strBuilder.Append(@"\Gamma \left( ");
+      } else if (node.Symbol is HyperbolicCosineIntegral) {
+        strBuilder.Append(@"\operatorname{hypCosInt} \left( ");
+      } else if (node.Symbol is HyperbolicSineIntegral) {
+        strBuilder.Append(@"\operatorname{hypSinInt} \left( ");
+      } else if (node.Symbol is Norm) {
+        strBuilder.Append(@"\operatorname{norm} \left( ");
+      } else if (node.Symbol is Psi) {
+        strBuilder.Append(@"\operatorname{digamma} \left( ");
+      } else if (node.Symbol is SineIntegral) {
+        strBuilder.Append(@"\operatorname{sinInt} \left( ");
+      } else if (node.Symbol is GreaterThan) {
+        strBuilder.Append(@"  \left( ");
+      } else if (node.Symbol is LessThan) {
+        strBuilder.Append(@"  \left( ");
+      } else if (node.Symbol is And) {
+        strBuilder.Append(@"  \left( \left( ");
+      } else if (node.Symbol is Or) {
+        strBuilder.Append(@"   \left( \left( ");
+      } else if (node.Symbol is Not) {
+        strBuilder.Append(@" \neg \left( ");
+      } else if (node.Symbol is IfThenElse) {
+        strBuilder.Append(@" \operatorname{if}  \left( ");
+      } else if (node.Symbol is Constant) {
+        var constName = "c_{" + constIndex + "}";
+        constIndex++;
+        var constNode = node as ConstantTreeNode;
+        if (constNode.Value.IsAlmost(1.0)) {
+          strBuilder.Append("1 ");
+        } else {
+          strBuilder.Append(constName);
+          constants.Add(new KeyValuePair<string, double>(constName, constNode.Value));
+        }
+
+      } else if (node.Symbol is FactorVariable) {
+        var factorNode = node as FactorVariableTreeNode;
+        var constName = "c_{" + constIndex + "}";
+        strBuilder.Append(constName + " ");
+        foreach (var e in factorNode.Symbol.GetVariableValues(factorNode.VariableName)
+          .Zip(factorNode.Weights, Tuple.Create)) {
+          constants.Add(new KeyValuePair<string, double>("c_{" + constIndex + ", " + EscapeLatexString(factorNode.VariableName) + "=" + EscapeLatexString(e.Item1) + "}", e.Item2));
+        }
+        constIndex++;
+      } else if (node.Symbol is BinaryFactorVariable) {
+        var binFactorNode = node as BinaryFactorVariableTreeNode;
+        if (!binFactorNode.Weight.IsAlmost((1.0))) {
+          var constName = "c_{" + constIndex + "}";
+          strBuilder.Append(constName + "  \\cdot");
+          constants.Add(new KeyValuePair<string, double>(constName, binFactorNode.Weight));
+          constIndex++;
+        }
+        strBuilder.Append("(" + EscapeLatexString(binFactorNode.VariableName));
+        strBuilder.Append(LagToString(currentLag));
+        strBuilder.Append(" = " + EscapeLatexString(binFactorNode.VariableValue) + " )");
+      } else if (node.Symbol is LaggedVariable) {
+        var laggedVarNode = node as LaggedVariableTreeNode;
+        if (!laggedVarNode.Weight.IsAlmost(1.0)) {
+          var constName = "c_{" + constIndex + "}";
+          strBuilder.Append(constName + "  \\cdot");
+          constants.Add(new KeyValuePair<string, double>(constName, laggedVarNode.Weight));
+          constIndex++;
+        }
+        strBuilder.Append(EscapeLatexString(laggedVarNode.VariableName));
+        strBuilder.Append(LagToString(currentLag + laggedVarNode.Lag));
+
+      } else if (node.Symbol is Variable) {
+        var varNode = node as VariableTreeNode;
+        if (!varNode.Weight.IsAlmost((1.0))) {
+          var constName = "c_{" + constIndex + "}";
+          strBuilder.Append(constName + "  \\cdot");
+          constants.Add(new KeyValuePair<string, double>(constName, varNode.Weight));
+          constIndex++;
+        }
+        strBuilder.Append(EscapeLatexString(varNode.VariableName));
+        strBuilder.Append(LagToString(currentLag));
+      } else if (node.Symbol is ProgramRootSymbol) {
+        strBuilder
+          .AppendLine("\\begin{align*}")
+          .AppendLine("\\nonumber");
+      } else if (node.Symbol is Defun) {
+        var defunNode = node as DefunTreeNode;
+        strBuilder.Append(defunNode.FunctionName + " & = ");
+      } else if (node.Symbol is InvokeFunction) {
+        var invokeNode = node as InvokeFunctionTreeNode;
+        strBuilder.Append(invokeNode.Symbol.FunctionName + @" \left( ");
+      } else if (node.Symbol is StartSymbol) {
+        FormatStartSymbol(strBuilder);
+      } else if (node.Symbol is Argument) {
+        var argSym = node.Symbol as Argument;
+        strBuilder.Append(" ARG+" + argSym.ArgumentIndex + " ");
+      } else if (node.Symbol is Derivative) {
+        strBuilder.Append(@" \cfrac{d \left( ");
+      } else if (node.Symbol is TimeLag) {
+        var laggedNode = node as ILaggedTreeNode;
+        currentLag += laggedNode.Lag;
+      } else if (node.Symbol is Power) {
+        strBuilder.Append(@" \left( ");
+      } else if (node.Symbol is Root) {
+        strBuilder.Append(@" \left( ");
+      } else if (node.Symbol is Integral) {
+        // actually a new variable for t is needed in all subtrees (TODO)
+        var laggedTreeNode = node as ILaggedTreeNode;
+        strBuilder.Append(@"\sum_{t=" + (laggedTreeNode.Lag + currentLag) + @"}^0 \left( ");
+      } else if (node.Symbol is VariableCondition) {
+        var conditionTreeNode = node as VariableConditionTreeNode;
+        var constName = "c_{" + constants.Count + "}";
+        string p = @"1 /  1 + \exp  - " + constName + " ";
+        constants.Add(new KeyValuePair<string, double>(constName, conditionTreeNode.Slope));
+        constIndex++;
+        var const2Name = "c_{" + constants.Count + @"}";
+        p += @" \cdot " + EscapeLatexString(conditionTreeNode.VariableName) + LagToString(currentLag) + " - " + const2Name + "   ";
+        constants.Add(new KeyValuePair<string, double>(const2Name, conditionTreeNode.Threshold));
+        constIndex++;
+        strBuilder.Append(@" \left( " + p + @"\cdot ");
+      } else {
+        throw new NotImplementedException("Export of " + node.Symbol + " is not implemented.");
+      }
+    }
+
+    private void FormatSep(ISymbolicExpressionTreeNode node, StringBuilder strBuilder, int step) {
+      if (node.Symbol is Addition) {
+        strBuilder.Append(" + ");
+      } else if (node.Symbol is Subtraction) {
+        strBuilder.Append(" - ");
+      } else if (node.Symbol is Multiplication) {
+        strBuilder.Append(@" \cdot ");
+      } else if (node.Symbol is Division) {
+        if (step + 1 == node.SubtreeCount)
+          strBuilder.Append(@"}{");
+        else
+          strBuilder.Append(@" }{ \cfrac{ ");
+      } else if (node.Symbol is Average) {
+        strBuilder.Append(@" + ");
+      } else if (node.Symbol is Logarithm) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Exponential) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Square) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is SquareRoot) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Sine) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Cosine) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Tangent) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is AiryA) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is AiryB) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Bessel) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is CosineIntegral) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Dawson) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Erf) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is ExponentialIntegralEi) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is FresnelCosineIntegral) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is FresnelSineIntegral) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Gamma) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is HyperbolicCosineIntegral) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is HyperbolicSineIntegral) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Norm) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is Psi) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is SineIntegral) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is GreaterThan) {
+        strBuilder.Append(@" > ");
+      } else if (node.Symbol is LessThan) {
+        strBuilder.Append(@" < ");
+      } else if (node.Symbol is And) {
+        strBuilder.Append(@" > 0  \right) \land \left(");
+      } else if (node.Symbol is Or) {
+        strBuilder.Append(@" > 0  \right) \lor \left(");
+      } else if (node.Symbol is Not) {
+        throw new InvalidOperationException();
+      } else if (node.Symbol is IfThenElse) {
+        strBuilder.Append(@" , ");
+      } else if (node.Symbol is ProgramRootSymbol) {
+        strBuilder.Append(@"\\" + Environment.NewLine);
+      } else if (node.Symbol is Defun) {
+      } else if (node.Symbol is InvokeFunction) {
+        strBuilder.Append(" , ");
+      } else if (node.Symbol is StartSymbol) {
+        strBuilder.Append(@"\\" + Environment.NewLine);
+        FormatStartSymbol(strBuilder);
+      } else if (node.Symbol is Power) {
+        strBuilder.Append(@"\right) ^ { \operatorname{round} \left(");
+      } else if (node.Symbol is Root) {
+        strBuilder.Append(@"\right) ^ {  \cfrac{1}{ \operatorname{round} \left(");
+      } else if (node.Symbol is VariableCondition) {
+        var conditionTreeNode = node as VariableConditionTreeNode;
+        var const1Name = "c_{" + constants.Count + "}";
+        string p = @"1 / \left( 1 + \exp \left( - " + const1Name + " ";
+        constants.Add(new KeyValuePair<string, double>(const1Name, conditionTreeNode.Slope));
+        constIndex++;
+        var const2Name = "c_{" + constants.Count + "}";
+        p += @" \cdot " + EscapeLatexString(conditionTreeNode.VariableName) + LagToString(currentLag) + " - " + const2Name + " \right) \right) \right)   ";
+        constants.Add(new KeyValuePair<string, double>(const2Name, conditionTreeNode.Threshold));
+        constIndex++;
+        strBuilder.Append(@" +  \left( 1 - " + p + @" \right) \cdot ");
+      } else {
+        throw new NotImplementedException("Export of " + node.Symbol + " is not implemented.");
+      }
+    }
+
+    private void FormatEnd(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.Symbol is Addition) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Subtraction) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Multiplication) {
+      } else if (node.Symbol is Division) {
+        strBuilder.Append(" } ");
+        for (int i = 2; i < node.SubtreeCount; i++)
+          strBuilder.Append(" } ");
+      } else if (node.Symbol is Average) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Logarithm) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Exponential) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Square) {
+        strBuilder.Append(@"\right)^2");
+      } else if (node.Symbol is SquareRoot) {
+        strBuilder.Append(@"}");
+      } else if (node.Symbol is Sine) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Cosine) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Tangent) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is AiryA) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is AiryB) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Bessel) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is CosineIntegral) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Dawson) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Erf) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is ExponentialIntegralEi) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is FresnelCosineIntegral) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is FresnelSineIntegral) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Gamma) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is HyperbolicCosineIntegral) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is HyperbolicSineIntegral) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Norm) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Psi) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is SineIntegral) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is GreaterThan) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is LessThan) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is And) {
+        strBuilder.Append(@" > 0 \right) \right) ");
+      } else if (node.Symbol is Or) {
+        strBuilder.Append(@" > 0 \right) \right) ");
+      } else if (node.Symbol is Not) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is IfThenElse) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is Constant) {
+      } else if (node.Symbol is LaggedVariable) {
+      } else if (node.Symbol is Variable) {
+      } else if (node.Symbol is FactorVariable) {
+      } else if (node.Symbol is BinaryFactorVariable) {
+      } else if (node.Symbol is ProgramRootSymbol) {
+        strBuilder
+          .AppendLine("\\end{align*}")
+          .AppendLine("\\begin{align*}")
+          .AppendLine("\\nonumber");
+        // output all constant values
+        if (constants.Count > 0) {
+          foreach (var constant in constants) {
+            // replace "." with ".&" to align decimal points
+            var constStr = string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, "{0:G5}", constant.Value);
+            if (!constStr.Contains(".")) constStr = constStr + ".0";
+            constStr = constStr.Replace(".", "&.");  // fix problem in rendering of aligned expressions
+            strBuilder.Append(constant.Key + "& = & " + constStr);
+            strBuilder.Append(@"\\");
+          }
+        }
+        strBuilder.AppendLine("\\end{align*}");
+      } else if (node.Symbol is Defun) {
+      } else if (node.Symbol is InvokeFunction) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is StartSymbol) {
+      } else if (node.Symbol is Argument) {
+      } else if (node.Symbol is Derivative) {
+        strBuilder.Append(@" \right) }{dt} ");
+      } else if (node.Symbol is TimeLag) {
+        var laggedNode = node as ILaggedTreeNode;
+        currentLag -= laggedNode.Lag;
+      } else if (node.Symbol is Power) {
+        strBuilder.Append(@" \right) } ");
+      } else if (node.Symbol is Root) {
+        strBuilder.Append(@" \right) } } ");
+      } else if (node.Symbol is Integral) {
+        strBuilder.Append(@" \right) ");
+      } else if (node.Symbol is VariableCondition) {
+        strBuilder.Append(@"\right) ");
+      } else {
+        throw new NotImplementedException("Export of " + node.Symbol + " is not implemented.");
+      }
+    }
+
+    private void FormatStartSymbol(StringBuilder strBuilder) {
+      strBuilder.Append(targetVariable ?? "target_" + (targetCount++));
+      if (containsTimeSeriesSymbol)
+        strBuilder.Append("(t)");
+      strBuilder.Append(" & = ");
+    }
+
+    private string LagToString(int lag) {
+      if (lag < 0) {
+        return "(t" + lag + ")";
+      } else if (lag > 0) {
+        return "(t+" + lag + ")";
+      } else return "";
+    }
+
+    private string EscapeLatexString(string s) {
+      return "\\text{" +
+        s
+         .Replace("\\", "\\\\")
+         .Replace("{", "\\{")
+         .Replace("}", "\\}")
+        + "}";
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs	(revision 16132)
@@ -0,0 +1,390 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+
+  [Item("MATLAB String Formatter", "String formatter for string representations of symbolic data analysis expressions in MATLAB syntax.")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisExpressionMATLABFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+    private int currentLag;
+
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionMATLABFormatter(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionMATLABFormatter(SymbolicDataAnalysisExpressionMATLABFormatter original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisExpressionMATLABFormatter()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionMATLABFormatter(this, cloner);
+    }
+    private int currentIndexNumber;
+    public string CurrentIndexVariable {
+      get {
+        return "i" + currentIndexNumber;
+      }
+    }
+    private void ReleaseIndexVariable() {
+      currentIndexNumber--;
+    }
+
+    private string AllocateIndexVariable() {
+      currentIndexNumber++;
+      return CurrentIndexVariable;
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      currentLag = 0;
+      currentIndexNumber = 0;
+
+      var stringBuilder = new StringBuilder();
+      stringBuilder.AppendLine("rows = ???");
+      stringBuilder.AppendLine(FormatOnlyExpression(symbolicExpressionTree.Root) + ";");
+      stringBuilder.AppendLine();
+      stringBuilder.AppendLine("function y = log_(x)");
+      stringBuilder.AppendLine("  if(x<=0) y = NaN;");
+      stringBuilder.AppendLine("  else     y = log(x);");
+      stringBuilder.AppendLine("  end");
+      stringBuilder.AppendLine("end");
+      stringBuilder.AppendLine();
+      stringBuilder.AppendLine("function y = fivePoint(f0, f1, f3, f4)");
+      stringBuilder.AppendLine("  y = (f0 + 2*f1 - 2*f3 - f4) / 8;");
+      stringBuilder.AppendLine("end");
+
+      var factorVariableNames =
+        symbolicExpressionTree.IterateNodesPostfix()
+          .OfType<FactorVariableTreeNode>()
+          .Select(n => n.VariableName)
+          .Distinct();
+
+      foreach (var factorVarName in factorVariableNames) {
+        var factorSymb = symbolicExpressionTree.IterateNodesPostfix()
+          .OfType<FactorVariableTreeNode>()
+          .First(n => n.VariableName == factorVarName)
+          .Symbol;
+        stringBuilder.AppendFormat("function y = switch_{0}(val, v)", factorVarName).AppendLine();
+        var values = factorSymb.GetVariableValues(factorVarName).ToArray();
+        stringBuilder.AppendLine("switch val");
+        for (int i = 0; i < values.Length; i++) {
+          stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "  case \"{0}\" y = v({1})", values[i], i).AppendLine();
+        }
+        stringBuilder.AppendLine("end");
+        stringBuilder.AppendLine();
+      }
+
+      return stringBuilder.ToString();
+    }
+
+    public string FormatOnlyExpression(ISymbolicExpressionTreeNode expressionNode) {
+      var stringBuilder = new StringBuilder();
+      stringBuilder.AppendLine("  for " + CurrentIndexVariable + " = 1:1:rows");
+      stringBuilder.AppendLine("    estimated(" + CurrentIndexVariable + ") = " + FormatRecursively(expressionNode.GetSubtree(0)) + ";");
+      stringBuilder.AppendLine("  end;");
+      return stringBuilder.ToString();
+    }
+
+    private string FormatRecursively(ISymbolicExpressionTreeNode node) {
+      ISymbol symbol = node.Symbol;
+      StringBuilder stringBuilder = new StringBuilder();
+
+      if (symbol is ProgramRootSymbol) {
+        stringBuilder.AppendLine(FormatRecursively(node.GetSubtree(0)));
+      } else if (symbol is StartSymbol)
+        return FormatRecursively(node.GetSubtree(0));
+      else if (symbol is Addition) {
+        stringBuilder.Append("(");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("+");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+        }
+        stringBuilder.Append(")");
+      } else if (symbol is And) {
+        stringBuilder.Append("((");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("&");
+          stringBuilder.Append("((");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          stringBuilder.Append(")>0)");
+        }
+        stringBuilder.Append(")-0.5)*2");
+        // MATLAB maps false and true to 0 and 1, resp., we map this result to -1.0 and +1.0, resp.
+      } else if (symbol is Average) {
+        stringBuilder.Append("(1/");
+        stringBuilder.Append(node.SubtreeCount);
+        stringBuilder.Append(")*(");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("+");
+          stringBuilder.Append("(");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          stringBuilder.Append(")");
+        }
+        stringBuilder.Append(")");
+      } else if (symbol is Constant) {
+        ConstantTreeNode constantTreeNode = node as ConstantTreeNode;
+        stringBuilder.Append(constantTreeNode.Value.ToString(CultureInfo.InvariantCulture));
+      } else if (symbol is Cosine) {
+        stringBuilder.Append("cos(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is Division) {
+        if (node.SubtreeCount == 1) {
+          stringBuilder.Append("1/");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        } else {
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+          stringBuilder.Append("/(");
+          for (int i = 1; i < node.SubtreeCount; i++) {
+            if (i > 1) stringBuilder.Append("*");
+            stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          }
+          stringBuilder.Append(")");
+        }
+      } else if (symbol is Exponential) {
+        stringBuilder.Append("exp(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is Square) {
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(").^2");
+      } else if (symbol is SquareRoot) {
+        stringBuilder.Append("sqrt(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is GreaterThan) {
+        stringBuilder.Append("((");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(">");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append(")-0.5)*2");
+        // MATLAB maps false and true to 0 and 1, resp., we map this result to -1.0 and +1.0, resp.
+      } else if (symbol is IfThenElse) {
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(">0)*");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append("+");
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append("<=0)*");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(2)));
+      } else if (symbol is LaggedVariable) {
+        // this if must be checked before if(symbol is LaggedVariable)
+        LaggedVariableTreeNode laggedVariableTreeNode = node as LaggedVariableTreeNode;
+        stringBuilder.Append(laggedVariableTreeNode.Weight.ToString(CultureInfo.InvariantCulture));
+        stringBuilder.Append("*");
+        stringBuilder.Append(laggedVariableTreeNode.VariableName +
+                             LagToString(currentLag + laggedVariableTreeNode.Lag));
+      } else if (symbol is LessThan) {
+        stringBuilder.Append("((");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append("<");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append(")-0.5)*2");
+        // MATLAB maps false and true to 0 and 1, resp., we map this result to -1.0 and +1.0, resp.
+      } else if (symbol is Logarithm) {
+        stringBuilder.Append("log_(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is Multiplication) {
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("*");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+        }
+      } else if (symbol is Not) {
+        stringBuilder.Append("~(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(" > 0 )");
+      } else if (symbol is Or) {
+        stringBuilder.Append("((");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("|");
+          stringBuilder.Append("((");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          stringBuilder.Append(")>0)");
+        }
+        stringBuilder.Append(")-0.5)*2");
+        // MATLAB maps false and true to 0 and 1, resp., we map this result to -1.0 and +1.0, resp.
+      } else if (symbol is Sine) {
+        stringBuilder.Append("sin(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is Subtraction) {
+        stringBuilder.Append("(");
+        if (node.SubtreeCount == 1) {
+          stringBuilder.Append("-");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        } else {
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+          for (int i = 1; i < node.SubtreeCount; i++) {
+            stringBuilder.Append("-");
+            stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          }
+        }
+        stringBuilder.Append(")");
+      } else if (symbol is Tangent) {
+        stringBuilder.Append("tan(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is AiryA) {
+        stringBuilder.Append("airy(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is AiryB) {
+        stringBuilder.Append("airy(2, ");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is Bessel) {
+        stringBuilder.Append("besseli(0.0,");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is CosineIntegral) {
+        stringBuilder.Append("cosint(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is Dawson) {
+        stringBuilder.Append("dawson(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is Erf) {
+        stringBuilder.Append("erf(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is ExponentialIntegralEi) {
+        stringBuilder.Append("expint(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is FresnelCosineIntegral) {
+        stringBuilder.Append("FresnelC(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is FresnelSineIntegral) {
+        stringBuilder.Append("FresnelS(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is Gamma) {
+        stringBuilder.Append("gamma(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is HyperbolicCosineIntegral) {
+        stringBuilder.Append("Chi(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is HyperbolicSineIntegral) {
+        stringBuilder.Append("Shi(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is Norm) {
+        stringBuilder.Append("normpdf(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is Psi) {
+        stringBuilder.Append("psi(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (node.Symbol is SineIntegral) {
+        stringBuilder.Append("sinint(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+      } else if (symbol is HeuristicLab.Problems.DataAnalysis.Symbolic.Variable) {
+        VariableTreeNode variableTreeNode = node as VariableTreeNode;
+        stringBuilder.Append(variableTreeNode.Weight.ToString(CultureInfo.InvariantCulture));
+        stringBuilder.Append("*");
+        stringBuilder.Append(variableTreeNode.VariableName + LagToString(currentLag));
+      } else if (symbol is HeuristicLab.Problems.DataAnalysis.Symbolic.FactorVariable) {
+        var factorNode = node as FactorVariableTreeNode;
+        var weights = string.Join(" ", factorNode.Weights.Select(w => w.ToString("G17", CultureInfo.InvariantCulture)));
+        stringBuilder.AppendFormat("switch_{0}(\"{1}\",[{2}])",
+          factorNode.VariableName, factorNode.VariableName, weights)
+          .AppendLine();
+      } else if (symbol is HeuristicLab.Problems.DataAnalysis.Symbolic.BinaryFactorVariable) {
+        var factorNode = node as BinaryFactorVariableTreeNode;
+        stringBuilder.AppendFormat(CultureInfo.InvariantCulture,
+          "((strcmp({0},\"{1}\")==1) * {2:G17})", factorNode.VariableName, factorNode.VariableValue, factorNode.Weight);
+      } else if (symbol is Power) {
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")^round(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append(")");
+      } else if (symbol is Root) {
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")^(1 / round(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append("))");
+      } else if (symbol is Derivative) {
+        stringBuilder.Append("fivePoint(");
+        // f0
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(", ");
+        // f1
+        currentLag--;
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(", ");
+        // f3
+        currentLag -= 2;
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(", ");
+        currentLag--;
+        // f4
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(")");
+        currentLag += 4;
+      } else if (symbol is Integral) {
+        var laggedNode = node as LaggedTreeNode;
+        string prevCounterVariable = CurrentIndexVariable;
+        string counterVariable = AllocateIndexVariable();
+        stringBuilder.AppendLine(" sum (map(@(" + counterVariable + ") " + FormatRecursively(node.GetSubtree(0)) +
+                                 ", (" + prevCounterVariable + "+" + laggedNode.Lag + "):" + prevCounterVariable +
+                                 "))");
+        ReleaseIndexVariable();
+      } else if (symbol is TimeLag) {
+        var laggedNode = node as LaggedTreeNode;
+        currentLag += laggedNode.Lag;
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        currentLag -= laggedNode.Lag;
+      } else {
+        stringBuilder.Append("ERROR");
+      }
+      return stringBuilder.ToString();
+    }
+
+
+    private string LagToString(int lag) {
+      if (lag < 0) {
+        return "(" + CurrentIndexVariable + "" + lag + ")";
+      } else if (lag > 0) {
+        return "(" + CurrentIndexVariable + "+" + lag + ")";
+      } else return "(" + CurrentIndexVariable + ")";
+    }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMathematicaFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMathematicaFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMathematicaFormatter.cs	(revision 16132)
@@ -0,0 +1,246 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Globalization;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("Mathematica Symbolic Expression Tree Formatter", "A string formatter that converts symbolic expression trees to Mathematica expressions.")]
+  [StorableClass]
+  public sealed class SymbolicDataAnalysisExpressionMathematicaFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionMathematicaFormatter(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionMathematicaFormatter(SymbolicDataAnalysisExpressionMathematicaFormatter original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisExpressionMathematicaFormatter()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionMathematicaFormatter(this, cloner);
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      // skip root and start symbols
+      StringBuilder strBuilder = new StringBuilder();
+      FormatRecursively(symbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0), strBuilder);
+      return strBuilder.ToString();
+    }
+
+    private void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.Subtrees.Any()) {
+        if (node.Symbol is Addition) {
+          FormatFunction(node, "Plus", strBuilder);
+        } else if (node.Symbol is Average) {
+          FormatAverage(node, strBuilder);
+        } else if (node.Symbol is Multiplication) {
+          FormatFunction(node, "Times", strBuilder);
+        } else if (node.Symbol is Subtraction) {
+          FormatSubtraction(node, strBuilder);
+        } else if (node.Symbol is Division) {
+          FormatDivision(node, strBuilder);
+        } else if (node.Symbol is Sine) {
+          FormatFunction(node, "Sin", strBuilder);
+        } else if (node.Symbol is Cosine) {
+          FormatFunction(node, "Cos", strBuilder);
+        } else if (node.Symbol is Tangent) {
+          FormatFunction(node, "Tan", strBuilder);
+        } else if (node.Symbol is Exponential) {
+          FormatFunction(node, "Exp", strBuilder);
+        } else if (node.Symbol is Logarithm) {
+          FormatFunction(node, "Log", strBuilder);
+        } else if (node.Symbol is IfThenElse) {
+          FormatIf(node, strBuilder);
+        } else if (node.Symbol is GreaterThan) {
+          strBuilder.Append("If[Greater[");
+          FormatRecursively(node.GetSubtree(0), strBuilder);
+          strBuilder.Append(",");
+          FormatRecursively(node.GetSubtree(1), strBuilder);
+          strBuilder.Append("], 1, -1]");
+        } else if (node.Symbol is LessThan) {
+          strBuilder.Append("If[Less[");
+          FormatRecursively(node.GetSubtree(0), strBuilder);
+          strBuilder.Append(",");
+          FormatRecursively(node.GetSubtree(1), strBuilder);
+          strBuilder.Append("], 1, -1]");
+        } else if (node.Symbol is And) {
+          FormatAnd(node, strBuilder);
+        } else if (node.Symbol is Not) {
+          strBuilder.Append("If[Greater[");
+          FormatRecursively(node.GetSubtree(0), strBuilder);
+          strBuilder.Append(", 0], -1, 1]");
+        } else if (node.Symbol is Or) {
+          FormatOr(node, strBuilder);
+        } else if (node.Symbol is Xor) {
+          FormatXor(node, strBuilder);
+        } else if (node.Symbol is Square) {
+          FormatSquare(node, strBuilder);
+        } else if (node.Symbol is SquareRoot) {
+          FormatFunction(node, "Sqrt", strBuilder);
+        } else if (node.Symbol is Power) {
+          FormatFunction(node, "Power", strBuilder);
+        } else if (node.Symbol is Root) {
+          FormatRoot(node, strBuilder);
+        } else {
+          throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " is not supported.");
+        }
+      } else {
+        // terminals
+        if (node.Symbol is Variable) {
+          var varNode = node as VariableTreeNode;
+          strBuilder.AppendFormat("Times[{0}, {1}]", varNode.VariableName, varNode.Weight.ToString("G17", CultureInfo.InvariantCulture));
+        } else if (node.Symbol is Constant) {
+          var constNode = node as ConstantTreeNode;
+          strBuilder.Append(constNode.Value.ToString("G17", CultureInfo.InvariantCulture));
+        } else if (node.Symbol is FactorVariable) {
+          var factorNode = node as FactorVariableTreeNode;
+          strBuilder.AppendFormat("Switch[{0},", factorNode.VariableName);
+          var varValues = factorNode.Symbol.GetVariableValues(factorNode.VariableName).ToArray();
+          var weights = varValues.Select(factorNode.GetValue).ToArray();
+
+          var weightStr = string.Join(", ",
+            varValues.Zip(weights, (s, d) => string.Format(CultureInfo.InvariantCulture, "\"{0}\", {1:G17}", s, d)));
+          strBuilder.Append(weightStr);
+          strBuilder.Append("]");
+        } else if (node.Symbol is BinaryFactorVariable) {
+          var factorNode = node as BinaryFactorVariableTreeNode;
+          strBuilder.AppendFormat(CultureInfo.InvariantCulture, "If[{0}==\"{1}\",{2:G17},0.0]",
+            factorNode.VariableName, factorNode.VariableValue, factorNode.Weight);
+        } else {
+          throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " is not supported.");
+        }
+      }
+    }
+
+    private void FormatXor(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("If[Xor[");
+      foreach (var t in node.Subtrees) {
+        strBuilder.Append("Greater[");
+        FormatRecursively(t, strBuilder);
+        strBuilder.Append(", 0]");
+        if (t != node.Subtrees.Last()) strBuilder.Append(",");
+      }
+      strBuilder.Append("], 1, -1]");
+    }
+
+    private void FormatOr(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("If[Or[");
+      foreach (var t in node.Subtrees) {
+        strBuilder.Append("Greater[");
+        FormatRecursively(t, strBuilder);
+        strBuilder.Append(", 0]");
+        if (t != node.Subtrees.Last()) strBuilder.Append(",");
+      }
+      strBuilder.Append("], 1, -1]");
+    }
+
+    private void FormatAnd(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("If[And[");
+      foreach (var t in node.Subtrees) {
+        strBuilder.Append("Greater[");
+        FormatRecursively(t, strBuilder);
+        strBuilder.Append(", 0]");
+        if (t != node.Subtrees.Last()) strBuilder.Append(",");
+      }
+      strBuilder.Append("], 1, -1]");
+    }
+
+    private void FormatIf(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("If[Greater[");
+      FormatRecursively(node.GetSubtree(0), strBuilder);
+      strBuilder.Append(", 0], ");
+      FormatRecursively(node.GetSubtree(1), strBuilder);
+      strBuilder.Append(", ");
+      FormatRecursively(node.GetSubtree(2), strBuilder);
+      strBuilder.Append("]");
+    }
+
+    private void FormatAverage(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      // mean function needs a list of values
+      strBuilder.Append("Mean[{");
+      FormatRecursively(node.GetSubtree(0), strBuilder);
+      for (int i = 1; i < node.SubtreeCount; i++) {
+        strBuilder.Append(",");
+        FormatRecursively(node.GetSubtree(i), strBuilder);
+      }
+      strBuilder.Append("}]");
+    }
+
+    private void FormatSubtraction(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("Subtract[");
+      FormatRecursively(node.GetSubtree(0), strBuilder);
+      strBuilder.Append(", Times[-1");
+      foreach (var t in node.Subtrees) {
+        strBuilder.Append(",");
+        FormatRecursively(t, strBuilder);
+      }
+      strBuilder.Append("]]");
+    }
+
+    private void FormatSquare(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("Power[");
+      FormatRecursively(node.GetSubtree(0), strBuilder);
+      strBuilder.Append(", 2]");
+    }
+
+    private void FormatRoot(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("Power[");
+      FormatRecursively(node.GetSubtree(0), strBuilder);
+      strBuilder.Append(", Divide[1,");
+      FormatRecursively(node.GetSubtree(1), strBuilder);
+      strBuilder.Append("]]");
+    }
+
+    private void FormatDivision(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.SubtreeCount == 1) {
+        strBuilder.Append("Divide[1, ");
+        FormatRecursively(node.GetSubtree(0), strBuilder);
+        strBuilder.Append("]");
+      } else {
+        strBuilder.Append("Divide[");
+        FormatRecursively(node.GetSubtree(0), strBuilder);
+        strBuilder.Append(", Times[");
+        FormatRecursively(node.GetSubtree(1), strBuilder);
+        for (int i = 2; i < node.SubtreeCount; i++) {
+          strBuilder.Append(",");
+          FormatRecursively(node.GetSubtree(i), strBuilder);
+        }
+        strBuilder.Append("]]");
+      }
+    }
+
+    private void FormatFunction(ISymbolicExpressionTreeNode node, string function, StringBuilder strBuilder) {
+      strBuilder.Append(function + "[");
+      foreach (var child in node.Subtrees) {
+        FormatRecursively(child, strBuilder);
+        if (child != node.Subtrees.Last())
+          strBuilder.Append(", ");
+      }
+      strBuilder.Append("]");
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionSmalltalkFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionSmalltalkFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionSmalltalkFormatter.cs	(revision 16132)
@@ -0,0 +1,187 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+
+  [Item("Smalltalk String Formatter", "String formatter for string representations of symbolic expression trees in Smalltalk syntax.")]
+  public class SymbolicDataAnalysisExpressionSmalltalkFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+
+    protected SymbolicDataAnalysisExpressionSmalltalkFormatter(SymbolicDataAnalysisExpressionSmalltalkFormatter original, Cloner cloner) : base(original, cloner) { }
+    public SymbolicDataAnalysisExpressionSmalltalkFormatter()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      return FormatRecursively(symbolicExpressionTree.Root);
+    }
+
+    // returns the smalltalk expression corresponding to the node 
+    // smalltalk expressions are always surrounded by parantheses "(<expr>)"
+    private string FormatRecursively(ISymbolicExpressionTreeNode node) {
+
+      ISymbol symbol = node.Symbol;
+
+      if (symbol is ProgramRootSymbol || symbol is StartSymbol)
+        return FormatRecursively(node.GetSubtree(0));
+
+      StringBuilder stringBuilder = new StringBuilder(20);
+
+      stringBuilder.Append("(");
+
+      if (symbol is Addition) {
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("+");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+        }
+      } else if (symbol is And) {
+        stringBuilder.Append("(");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("&");
+          stringBuilder.Append("(");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          stringBuilder.Append(" > 0)");
+        }
+        stringBuilder.Append(") ifTrue:[1] ifFalse:[-1]");
+      } else if (symbol is Average) {
+        stringBuilder.Append("(1/");
+        stringBuilder.Append(node.SubtreeCount);
+        stringBuilder.Append(")*(");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("+");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+        }
+        stringBuilder.Append(")");
+      } else if (symbol is Constant) {
+        ConstantTreeNode constantTreeNode = node as ConstantTreeNode;
+        stringBuilder.Append(constantTreeNode.Value.ToString(CultureInfo.InvariantCulture));
+      } else if (symbol is Cosine) {
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(" cos");
+      } else if (symbol is Division) {
+        if (node.SubtreeCount == 1) {
+          stringBuilder.Append("1/");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        } else {
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+          stringBuilder.Append("/(");
+          for (int i = 1; i < node.SubtreeCount; i++) {
+            if (i > 1) stringBuilder.Append("*");
+            stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          }
+          stringBuilder.Append(")");
+        }
+      } else if (symbol is Exponential) {
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(" exp");
+      } else if (symbol is GreaterThan) {
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(" > ");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append(") ifTrue: [1] ifFalse: [-1]");
+      } else if (symbol is IfThenElse) {
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(" > 0) ifTrue: [");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append("] ifFalse: [");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(2)));
+        stringBuilder.Append("]");
+      } else if (symbol is LaggedVariable) {
+        stringBuilder.Append("lagged variables are not supported");
+      } else if (symbol is LessThan) {
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(" < ");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
+        stringBuilder.Append(") ifTrue: [1] ifFalse: [-1]");
+      } else if (symbol is Logarithm) {
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append("ln");
+      } else if (symbol is Multiplication) {
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("*");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+        }
+      } else if (symbol is Not) {
+        stringBuilder.Append("(");
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(">0) ifTrue: [-1] ifFalse: [1.0]");
+      } else if (symbol is Or) {
+        stringBuilder.Append("(");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append("|");
+          stringBuilder.Append("(");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          stringBuilder.Append(">0)");
+        }
+        stringBuilder.Append(") ifTrue:[1] ifFalse:[-1]");
+      } else if (symbol is Sine) {
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(" sin");
+      } else if (symbol is Subtraction) {
+        if (node.SubtreeCount == 1) {
+          stringBuilder.Append("-1*");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        } else {
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+          for (int i = 1; i < node.SubtreeCount; i++) {
+            stringBuilder.Append(" - ");
+            stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+          }
+        }
+      } else if (symbol is Tangent) {
+        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(" tan");
+      } else if (symbol is Variable) {
+        VariableTreeNode variableTreeNode = node as VariableTreeNode;
+        stringBuilder.Append(variableTreeNode.Weight.ToString(CultureInfo.InvariantCulture));
+        stringBuilder.Append("*");
+        stringBuilder.Append(variableTreeNode.VariableName);
+      } else if (symbol is BinaryFactorVariable || symbol is FactorVariable) {
+        stringBuilder.Append("factor variables are not supported");
+      } else {
+        stringBuilder.Append("(");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append(", ");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+        }
+        stringBuilder.AppendFormat(" {0} [Not Supported] )", node.Symbol.Name);
+      }
+
+      stringBuilder.Append(")");
+
+      return stringBuilder.ToString();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionSmalltalkFormatter(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/TSQLExpressionFormatter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/TSQLExpressionFormatter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/TSQLExpressionFormatter.cs	(revision 16132)
@@ -0,0 +1,278 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  internal static class StringBuilderExtensions {
+    internal static void AppendIndented(this StringBuilder strBuilder, int level, string text) {
+      strBuilder.Append(new string(' ', level * 2));
+      strBuilder.Append(text);
+    }
+    internal static void AppendLineIndented(this StringBuilder strBuilder, int level, string text) {
+      strBuilder.Append(new string(' ', level * 2));
+      strBuilder.AppendLine(text);
+    }
+  }
+
+  [Item("TSQL String Formatter", "String formatter for string representations of symbolic data analysis expressions in TSQL syntax.")]
+  [StorableClass]
+  public sealed class TSQLExpressionFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter {
+    [StorableConstructor]
+    private TSQLExpressionFormatter(bool deserializing) : base(deserializing) { }
+    private TSQLExpressionFormatter(TSQLExpressionFormatter original, Cloner cloner) : base(original, cloner) { }
+    public TSQLExpressionFormatter()
+      : base() {
+      Name = ItemName;
+      Description = ItemDescription;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSQLExpressionFormatter(this, cloner);
+    }
+
+    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
+      // skip root and start symbols
+      StringBuilder strBuilder = new StringBuilder();
+      GenerateHeader(strBuilder, symbolicExpressionTree);
+
+      //generate function body
+      FormatRecursively(1, symbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0), strBuilder);
+
+      GenerateFooter(strBuilder);
+      return strBuilder.ToString();
+    }
+
+    private void GenerateHeader(StringBuilder strBuilder, ISymbolicExpressionTree symbolicExpressionTree) {
+      HashSet<string> floatVarNames = new HashSet<string>();
+      foreach (var node in symbolicExpressionTree.IterateNodesPostfix().Where(x => x is VariableTreeNode || x is VariableConditionTreeNode)) {
+        floatVarNames.Add(((IVariableTreeNode)node).VariableName);
+      }
+      var sortedFloatIdentifiers = floatVarNames.OrderBy(n => n, new NaturalStringComparer()).Select(n => VariableName2Identifier(n)).ToList();
+
+      HashSet<string> varcharVarNames = new HashSet<string>();
+      foreach (var node in symbolicExpressionTree.IterateNodesPostfix().Where(x => x is BinaryFactorVariableTreeNode || x is FactorVariableTreeNode)) {
+        varcharVarNames.Add(((IVariableTreeNode)node).VariableName);
+      }
+      var sortedVarcharIdentifiers = varcharVarNames.OrderBy(n => n, new NaturalStringComparer()).Select(n => VariableName2Identifier(n)).ToList();
+
+      //Generate comment and instructions
+      strBuilder.Append("-- generated. created function can be used like 'SELECT dbo.REGRESSIONMODEL(");
+      strBuilder.Append(string.Join(", ", sortedVarcharIdentifiers));
+      if (varcharVarNames.Any() && floatVarNames.Any())
+        strBuilder.Append(",");
+      strBuilder.Append(string.Join(", ", sortedFloatIdentifiers));
+      strBuilder.AppendLine(")'");
+      strBuilder.AppendLine("-- use the expression after the RETURN statement if you want to incorporate the model in a query without creating a function.");
+
+      //Generate function header
+      strBuilder.Append("CREATE FUNCTION dbo.REGRESSIONMODEL(");
+      strBuilder.Append(string.Join(", ", sortedVarcharIdentifiers.Select(n => string.Format("{0} NVARCHAR(max)",n))));
+      if (varcharVarNames.Any() && floatVarNames.Any())
+        strBuilder.Append(",");
+      strBuilder.Append(string.Join(", ", sortedFloatIdentifiers.Select(n => string.Format("{0} FLOAT",n))));
+      strBuilder.AppendLine(")");
+
+      //start function body
+      strBuilder.AppendLine("RETURNS FLOAT");
+      strBuilder.AppendLine("BEGIN");
+
+      //add variable declaration for convenience
+      strBuilder.AppendLineIndented(1, "-- added variable declaration for convenience");
+      foreach (var name in sortedVarcharIdentifiers)
+        strBuilder.AppendLineIndented(1, string.Format("-- DECLARE {0} NVARCHAR(max) = ''", name));
+      foreach (var name in sortedFloatIdentifiers)
+        strBuilder.AppendLineIndented(1, string.Format("-- DECLARE {0} FLOAT = 0.0", name));
+      strBuilder.AppendLineIndented(1, "-- SELECT");
+      strBuilder.AppendLine("RETURN ");
+    }
+
+    private void FormatRecursively(int level, ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.Subtrees.Any()) {
+        if (node.Symbol is Addition) {
+          FormatOperator(level, node, "+", strBuilder);
+        } else if (node.Symbol is And) {
+          FormatOperator(level, node, "AND", strBuilder);
+        } else if (node.Symbol is Average) {
+          FormatAverage(level, node, strBuilder);
+        } else if (node.Symbol is Cosine) {
+          FormatFunction(level, node, "COS", strBuilder);
+        } else if (node.Symbol is Division) {
+          FormatDivision(level, node, strBuilder);
+        } else if (node.Symbol is Exponential) {
+          FormatFunction(level, node, "EXP", strBuilder);
+        } else if (node.Symbol is GreaterThan) {
+          FormatOperator(level, node, ">", strBuilder);
+        } else if (node.Symbol is IfThenElse) {
+          FormatIfThenElse(level, node, strBuilder);
+        } else if (node.Symbol is LessThan) {
+          FormatOperator(level, node, "<", strBuilder);
+        } else if (node.Symbol is Logarithm) {
+          FormatFunction(level, node, "LOG", strBuilder);
+        } else if (node.Symbol is Multiplication) {
+          FormatOperator(level, node, "*", strBuilder);
+        } else if (node.Symbol is Not) {
+          FormatOperator(level, node, "NOT LIKE", strBuilder);
+        } else if (node.Symbol is Or) {
+          FormatOperator(level, node, "OR", strBuilder);
+        } else if (node.Symbol is Xor) {
+          throw new NotSupportedException(string.Format("Symbol {0} not yet supported.", node.Symbol.GetType().Name));
+        } else if (node.Symbol is Sine) {
+          FormatFunction(level, node, "SIN", strBuilder);
+        } else if (node.Symbol is Subtraction) {
+          FormatSubtraction(level, node, strBuilder);
+        } else if (node.Symbol is Tangent) {
+          FormatFunction(level, node, "TAN", strBuilder);
+        } else if (node.Symbol is Square) {
+          FormatFunction(level, node, "SQUARE", strBuilder);
+        } else if (node.Symbol is SquareRoot) {
+          FormatFunction(level, node, "SQRT", strBuilder);
+        } else if (node.Symbol is Power) {
+          FormatFunction(level, node, "POWER", strBuilder);
+        } else if (node.Symbol is Root) {
+          FormatRoot(level, node, strBuilder);
+        } else {
+          throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " not supported for TSQL symbolic expression tree formatter.");
+        }
+      } else {
+        if (node is VariableTreeNode) {
+          var varNode = node as VariableTreeNode;
+          strBuilder.AppendFormat("{0} * {1}", VariableName2Identifier(varNode.VariableName), varNode.Weight.ToString("g17", CultureInfo.InvariantCulture));
+        } else if (node is ConstantTreeNode) {
+          var constNode = node as ConstantTreeNode;
+          strBuilder.Append(constNode.Value.ToString("g17", CultureInfo.InvariantCulture));
+        } else if (node.Symbol is FactorVariable) {
+          var factorNode = node as FactorVariableTreeNode;
+          FormatFactor(level, factorNode, strBuilder);
+        } else if (node.Symbol is BinaryFactorVariable) {
+          var binFactorNode = node as BinaryFactorVariableTreeNode;
+          throw new NotSupportedException(string.Format("Symbol {0} not yet supported.", node.Symbol.GetType().Name));
+        } else {
+          throw new NotSupportedException("Formatting of symbol: " + node.Symbol + " not supported for TSQL symbolic expression tree formatter.");
+        }
+      }
+    }
+
+    private void FormatIfThenElse(int level, ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("CASE ISNULL((SELECT 1 WHERE");
+      FormatRecursively(level,node.GetSubtree(0), strBuilder);
+      strBuilder.AppendLine("),0)");
+      strBuilder.AppendIndented(level,"WHEN 1 THEN ");
+      FormatRecursively(level, node.GetSubtree(1), strBuilder);
+      strBuilder.AppendLine();
+      strBuilder.AppendIndented(level, "WHEN 0 THEN ");
+      FormatRecursively(level, node.GetSubtree(2), strBuilder);
+      strBuilder.AppendLine();
+      strBuilder.AppendIndented(level, "END");
+    }
+
+    private void FormatAverage(int level, ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.Append("(");
+      foreach (var child in node.Subtrees) {
+        FormatRecursively(level, child, strBuilder);
+        if (child != node.Subtrees.Last())
+          strBuilder.Append(" + ");
+      }
+      strBuilder.AppendFormat(") / {0}", node.Subtrees.Count());
+    }
+
+    private string VariableName2Identifier(string variableName) {
+      return "@"+variableName.Replace(' ', '_');
+    }
+
+    private void GenerateFooter(StringBuilder strBuilder) {
+      strBuilder.Append(Environment.NewLine);
+      strBuilder.AppendLine("END");
+    }
+
+
+    private void FormatOperator(int level, ISymbolicExpressionTreeNode node, string symbol, StringBuilder strBuilder) {
+      strBuilder.Append("(");
+      foreach (var child in node.Subtrees) {
+        FormatRecursively(level, child, strBuilder);
+        if (child != node.Subtrees.Last())
+          strBuilder.Append(" " + symbol + " ");
+      }
+      strBuilder.Append(")");
+    }
+
+    private void FormatFunction(int level, ISymbolicExpressionTreeNode node, string function, StringBuilder strBuilder) {
+      strBuilder.Append(function + "(");
+      foreach (var child in node.Subtrees) {
+        FormatRecursively(level++, child, strBuilder);
+        if (child != node.Subtrees.Last())
+          strBuilder.Append(", ");
+      }
+      strBuilder.Append(")");
+    }
+
+    private void FormatDivision(int level, ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.SubtreeCount == 1) {
+        strBuilder.Append("1.0 / ");
+        FormatRecursively(level, node.GetSubtree(0), strBuilder);
+      } else {
+        FormatRecursively(level, node.GetSubtree(0), strBuilder);
+        strBuilder.Append("/ (");
+        for (int i = 1; i < node.SubtreeCount; i++) {
+          if (i > 1) strBuilder.Append(" * ");
+          FormatRecursively(level, node.GetSubtree(i), strBuilder);
+        }
+        strBuilder.Append(")");
+      }
+    }
+
+    private void FormatSubtraction(int level, ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      if (node.SubtreeCount == 1) {
+        strBuilder.Append("-");
+        FormatRecursively(level, node.GetSubtree(0), strBuilder);
+        return;
+      }
+      //Default case: more than 1 child
+      FormatOperator(level, node, "-", strBuilder);
+    }
+
+    private void FormatRoot(int level, ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
+      strBuilder.AppendLine("POWER(");
+      FormatRecursively(level, node.GetSubtree(0), strBuilder);
+      strBuilder.AppendLineIndented(level, " , 1.0 / (");
+      FormatRecursively(level, node.GetSubtree(1), strBuilder);
+      strBuilder.AppendLineIndented(level, "))");
+    }
+
+    private void FormatFactor(int level, FactorVariableTreeNode node, StringBuilder strBuilder) {
+      strBuilder.AppendLine("( ");
+      strBuilder.AppendLineIndented(level + 1, string.Format("CASE {0}", VariableName2Identifier(node.VariableName)));
+      foreach (var name in node.Symbol.GetVariableValues(node.VariableName)) {
+        strBuilder.AppendLineIndented(level + 2, string.Format("WHEN '{0}' THEN {1}", name, node.GetValue(name).ToString(CultureInfo.InvariantCulture)));
+      }
+      strBuilder.AppendLineIndented(level + 1, "ELSE NULL END");
+      strBuilder.AppendIndented(level, ")");
+    }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs	(revision 16132)
@@ -0,0 +1,85 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [NonDiscoverableType]
+  [StorableClass]
+  [Item("ArithmeticExpressionGrammar", "Represents a grammar for functional expressions using only arithmetic operations.")]
+  public class ArithmeticExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+
+    [StorableConstructor]
+    protected ArithmeticExpressionGrammar(bool deserializing) : base(deserializing) { }
+    protected ArithmeticExpressionGrammar(ArithmeticExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public ArithmeticExpressionGrammar()
+      : base(ItemAttribute.GetName(typeof(ArithmeticExpressionGrammar)), ItemAttribute.GetDescription(typeof(ArithmeticExpressionGrammar))) {
+      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.Variable();
+      var binFactorVariableSymbol = new BinaryFactorVariable();
+      var factorVariableSymbol = new FactorVariable();
+
+      var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol, binFactorVariableSymbol, factorVariableSymbol};
+      var functionSymbols = new List<Symbol>() { add, sub, mul, div };
+
+      foreach (var symb in allSymbols)
+        AddSymbol(symb);
+
+      foreach (var funSymb in functionSymbols) {
+        SetSubtreeCount(funSymb, 1, 3);
+      }
+      SetSubtreeCount(constant, 0, 0);
+      SetSubtreeCount(variableSymbol, 0, 0);
+      SetSubtreeCount(binFactorVariableSymbol, 0, 0);
+      SetSubtreeCount(factorVariableSymbol, 0, 0);
+
+      // allow each symbol as child of the start symbol
+      foreach (var symb in allSymbols) {
+        AddAllowedChildSymbol(StartSymbol, symb);
+        AddAllowedChildSymbol(DefunSymbol, symb);
+      }
+
+      // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
+      foreach (var parent in functionSymbols) {
+        foreach (var child in allSymbols)
+          AddAllowedChildSymbol(parent, child);
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs	(revision 16132)
@@ -0,0 +1,168 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("FullFunctionalExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
+  public class FullFunctionalExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+    [StorableConstructor]
+    protected FullFunctionalExpressionGrammar(bool deserializing) : base(deserializing) { }
+    protected FullFunctionalExpressionGrammar(FullFunctionalExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public FullFunctionalExpressionGrammar()
+      : base(ItemAttribute.GetName(typeof(FullFunctionalExpressionGrammar)), ItemAttribute.GetDescription(typeof(FullFunctionalExpressionGrammar))) {
+      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 pow = new Power();
+      pow.InitialFrequency = 0.0;
+      var square = new Square();
+      square.InitialFrequency = 0.0;
+      var root = new Root();
+      root.InitialFrequency = 0.0;
+      var sqrt = new SquareRoot();
+      sqrt.InitialFrequency = 0.0;
+      var airyA = new AiryA();
+      airyA.InitialFrequency = 0.0;
+      var airyB = new AiryB();
+      airyB.InitialFrequency = 0.0;
+      var bessel = new Bessel();
+      bessel.InitialFrequency = 0.0;
+      var cosineIntegral = new CosineIntegral();
+      cosineIntegral.InitialFrequency = 0.0;
+      var dawson = new Dawson();
+      dawson.InitialFrequency = 0.0;
+      var erf = new Erf();
+      erf.InitialFrequency = 0.0;
+      var expIntegralEi = new ExponentialIntegralEi();
+      expIntegralEi.InitialFrequency = 0.0;
+      var fresnelCosineIntegral = new FresnelCosineIntegral();
+      fresnelCosineIntegral.InitialFrequency = 0.0;
+      var fresnelSineIntegral = new FresnelSineIntegral();
+      fresnelSineIntegral.InitialFrequency = 0.0;
+      var gamma = new Gamma();
+      gamma.InitialFrequency = 0.0;
+      var hypCosineIntegral = new HyperbolicCosineIntegral();
+      hypCosineIntegral.InitialFrequency = 0.0;
+      var hypSineIntegral = new HyperbolicSineIntegral();
+      hypSineIntegral.InitialFrequency = 0.0;
+      var norm = new Norm();
+      norm.InitialFrequency = 0.0;
+      var psi = new Psi();
+      psi.InitialFrequency = 0.0;
+      var sineIntegral = new SineIntegral();
+      sineIntegral.InitialFrequency = 0.0;
+
+      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 xor = new Xor();
+
+      var timeLag = new TimeLag();
+      timeLag.InitialFrequency = 0.0;
+      var integral = new Integral();
+      integral.InitialFrequency = 0.0;
+      var derivative = new Derivative();
+      derivative.InitialFrequency = 0.0;
+
+      var variableCondition = new VariableCondition();
+      variableCondition.InitialFrequency = 0.0;
+
+      var constant = new Constant();
+      constant.MinValue = -20;
+      constant.MaxValue = 20;
+      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable();
+      var binFactorVariable = new BinaryFactorVariable();
+      var factorVariable = new FactorVariable();
+      var laggedVariable = new LaggedVariable();
+      laggedVariable.InitialFrequency = 0.0;
+      var autoregressiveVariable = new AutoregressiveTargetVariable();
+      autoregressiveVariable.InitialFrequency = 0.0;
+      autoregressiveVariable.Enabled = false;
+
+      var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, square, pow, sqrt, root, exp,
+        airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral,
+        @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition };
+      var unaryFunctionSymbols = new List<Symbol>() { square, sqrt, sin, cos, tan, log, exp, not, timeLag, integral, derivative,
+        airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral
+      };
+
+      var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt, variableCondition };
+      var ternarySymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or, xor };
+      var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, laggedVariable, autoregressiveVariable };
+
+      foreach (var symb in allSymbols)
+        AddSymbol(symb);
+
+      foreach (var funSymb in ternarySymbols) {
+        SetSubtreeCount(funSymb, 1, 3);
+      }
+      foreach (var funSymb in unaryFunctionSymbols) {
+        SetSubtreeCount(funSymb, 1, 1);
+      }
+      foreach (var funSymb in binaryFunctionSymbols) {
+        SetSubtreeCount(funSymb, 2, 2);
+      }
+      foreach (var terminalSymbol in terminalSymbols) {
+        SetSubtreeCount(terminalSymbol, 0, 0);
+      }
+
+      SetSubtreeCount(@if, 3, 3);
+
+
+      // allow each symbol as child of the start symbol
+      foreach (var symb in allSymbols) {
+        AddAllowedChildSymbol(StartSymbol, symb);
+        AddAllowedChildSymbol(DefunSymbol, symb);
+      }
+
+      // allow each symbol as child of every other symbol (except for terminals that have maxSubtreeCount == 0)
+      foreach (var parent in allSymbols.Except(terminalSymbols)) {
+        foreach (var child in allSymbols)
+          AddAllowedChildSymbol(parent, child);
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 16132)
@@ -0,0 +1,266 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("TypeCoherentExpressionGrammar", "Represents a grammar for functional expressions in which special syntactic constraints are enforced so that boolean and real-valued expressions are not mixed.")]
+  public class TypeCoherentExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+    private const string ArithmeticFunctionsName = "Arithmetic Functions";
+    private const string TrigonometricFunctionsName = "Trigonometric Functions";
+    private const string ExponentialFunctionsName = "Exponential and Logarithmic Functions";
+    private const string RealValuedSymbolsName = "Real Valued Symbols";
+    private const string TerminalsName = "Terminals";
+    private const string PowerFunctionsName = "Power Functions";
+    private const string ConditionsName = "Conditions";
+    private const string ComparisonsName = "Comparisons";
+    private const string BooleanOperatorsName = "Boolean Operators";
+    private const string ConditionalSymbolsName = "ConditionalSymbols";
+    private const string SpecialFunctionsName = "Special Functions";
+    private const string TimeSeriesSymbolsName = "Time Series Symbols";
+
+    [StorableConstructor]
+    protected TypeCoherentExpressionGrammar(bool deserializing) : base(deserializing) { }
+    protected TypeCoherentExpressionGrammar(TypeCoherentExpressionGrammar original, Cloner cloner) : base(original, cloner) { }
+    public TypeCoherentExpressionGrammar()
+      : base(ItemAttribute.GetName(typeof(TypeCoherentExpressionGrammar)), ItemAttribute.GetDescription(typeof(TypeCoherentExpressionGrammar))) {
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TypeCoherentExpressionGrammar(this, cloner);
+    }
+
+    private void Initialize() {
+      #region symbol declaration
+      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 pow = new Power();
+      var square = new Square();
+      var root = new Root();
+      var sqrt = new SquareRoot();
+      var exp = new Exponential();
+
+      var airyA = new AiryA();
+      var airyB = new AiryB();
+      var bessel = new Bessel();
+      var cosineIntegral = new CosineIntegral();
+      var dawson = new Dawson();
+      var erf = new Erf();
+      var expIntegralEi = new ExponentialIntegralEi();
+      var fresnelCosineIntegral = new FresnelCosineIntegral();
+      var fresnelSineIntegral = new FresnelSineIntegral();
+      var gamma = new Gamma();
+      var hypCosineIntegral = new HyperbolicCosineIntegral();
+      var hypSineIntegral = new HyperbolicSineIntegral();
+      var norm = new Norm();
+      var psi = new Psi();
+      var sineIntegral = new SineIntegral();
+
+      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 xor = new Xor();
+      var variableCondition = new VariableCondition();
+
+      var timeLag = new TimeLag();
+      var integral = new Integral();
+      var derivative = new Derivative();
+
+      var constant = new Constant();
+      constant.MinValue = -20;
+      constant.MaxValue = 20;
+      var variableSymbol = new Variable();
+      var binFactorVariable = new BinaryFactorVariable();
+      var factorVariable = new FactorVariable();
+      var laggedVariable = new LaggedVariable();
+      var autoregressiveVariable = new AutoregressiveTargetVariable();
+      #endregion
+
+      #region group symbol declaration
+      var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean });
+      var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan });
+      var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log });
+      var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi,
+        fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral});
+      var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol, binFactorVariable, factorVariable });
+      var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, specialFunctions, terminalSymbols });
+
+      var powerSymbols = new GroupSymbol(PowerFunctionsName, new List<ISymbol> { square, pow, sqrt, root });
+
+      var conditionSymbols = new GroupSymbol(ConditionsName, new List<ISymbol> { @if, variableCondition });
+      var comparisonSymbols = new GroupSymbol(ComparisonsName, new List<ISymbol> { gt, lt });
+      var booleanOperationSymbols = new GroupSymbol(BooleanOperatorsName, new List<ISymbol> { and, or, not, xor });
+      var conditionalSymbols = new GroupSymbol(ConditionalSymbolsName, new List<ISymbol> { conditionSymbols, comparisonSymbols, booleanOperationSymbols });
+
+      var timeSeriesSymbols = new GroupSymbol(TimeSeriesSymbolsName, new List<ISymbol> { timeLag, integral, derivative, laggedVariable, autoregressiveVariable });
+      #endregion
+
+      AddSymbol(realValuedSymbols);
+      AddSymbol(powerSymbols);
+      AddSymbol(conditionalSymbols);
+      AddSymbol(timeSeriesSymbols);
+
+      #region subtree count configuration
+      SetSubtreeCount(arithmeticSymbols, 2, 2);
+      SetSubtreeCount(trigonometricSymbols, 1, 1);
+      SetSubtreeCount(pow, 2, 2);
+      SetSubtreeCount(root, 2, 2);
+      SetSubtreeCount(square, 1, 1);
+      SetSubtreeCount(sqrt, 1, 1);
+      SetSubtreeCount(exponentialAndLogarithmicSymbols, 1, 1);
+      SetSubtreeCount(specialFunctions, 1, 1);
+      SetSubtreeCount(terminalSymbols, 0, 0);
+
+      SetSubtreeCount(@if, 3, 3);
+      SetSubtreeCount(variableCondition, 2, 2);
+      SetSubtreeCount(comparisonSymbols, 2, 2);
+      SetSubtreeCount(and, 2, 2);
+      SetSubtreeCount(or, 2, 2);
+      SetSubtreeCount(not, 1, 1);
+      SetSubtreeCount(xor, 2, 2);
+
+      SetSubtreeCount(timeLag, 1, 1);
+      SetSubtreeCount(integral, 1, 1);
+      SetSubtreeCount(derivative, 1, 1);
+      SetSubtreeCount(laggedVariable, 0, 0);
+      SetSubtreeCount(autoregressiveVariable, 0, 0);
+      #endregion
+
+      #region allowed child symbols configuration
+      AddAllowedChildSymbol(StartSymbol, realValuedSymbols);
+      AddAllowedChildSymbol(StartSymbol, powerSymbols);
+      AddAllowedChildSymbol(StartSymbol, conditionSymbols);
+      AddAllowedChildSymbol(StartSymbol, timeSeriesSymbols);
+      AddAllowedChildSymbol(StartSymbol, specialFunctions);
+
+      AddAllowedChildSymbol(DefunSymbol, realValuedSymbols);
+      AddAllowedChildSymbol(DefunSymbol, powerSymbols);
+      AddAllowedChildSymbol(DefunSymbol, conditionSymbols);
+      AddAllowedChildSymbol(DefunSymbol, timeSeriesSymbols);
+      AddAllowedChildSymbol(DefunSymbol, specialFunctions);
+
+      AddAllowedChildSymbol(realValuedSymbols, realValuedSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, powerSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, conditionSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, timeSeriesSymbols);
+      AddAllowedChildSymbol(realValuedSymbols, specialFunctions);
+
+      AddAllowedChildSymbol(powerSymbols, variableSymbol, 0);
+      AddAllowedChildSymbol(powerSymbols, laggedVariable, 0);
+      AddAllowedChildSymbol(powerSymbols, autoregressiveVariable, 0);
+      AddAllowedChildSymbol(powerSymbols, constant, 1);
+
+      AddAllowedChildSymbol(square, realValuedSymbols, 0);
+      AddAllowedChildSymbol(square, conditionSymbols, 0);
+      AddAllowedChildSymbol(square, timeSeriesSymbols, 0);
+
+      AddAllowedChildSymbol(sqrt, realValuedSymbols, 0);
+      AddAllowedChildSymbol(sqrt, conditionSymbols, 0);
+      AddAllowedChildSymbol(sqrt, timeSeriesSymbols, 0);
+
+      AddAllowedChildSymbol(@if, comparisonSymbols, 0);
+      AddAllowedChildSymbol(@if, booleanOperationSymbols, 0);
+      AddAllowedChildSymbol(@if, conditionSymbols, 1);
+      AddAllowedChildSymbol(@if, realValuedSymbols, 1);
+      AddAllowedChildSymbol(@if, powerSymbols, 1);
+      AddAllowedChildSymbol(@if, timeSeriesSymbols, 1);
+      AddAllowedChildSymbol(@if, conditionSymbols, 2);
+      AddAllowedChildSymbol(@if, realValuedSymbols, 2);
+      AddAllowedChildSymbol(@if, powerSymbols, 2);
+      AddAllowedChildSymbol(@if, timeSeriesSymbols, 2);
+
+      AddAllowedChildSymbol(booleanOperationSymbols, comparisonSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, realValuedSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, powerSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, conditionSymbols);
+      AddAllowedChildSymbol(comparisonSymbols, timeSeriesSymbols);
+
+      AddAllowedChildSymbol(variableCondition, realValuedSymbols);
+      AddAllowedChildSymbol(variableCondition, powerSymbols);
+      AddAllowedChildSymbol(variableCondition, conditionSymbols);
+      AddAllowedChildSymbol(variableCondition, timeSeriesSymbols);
+
+
+      AddAllowedChildSymbol(timeLag, realValuedSymbols);
+      AddAllowedChildSymbol(timeLag, powerSymbols);
+      AddAllowedChildSymbol(timeLag, conditionSymbols);
+
+      AddAllowedChildSymbol(integral, realValuedSymbols);
+      AddAllowedChildSymbol(integral, powerSymbols);
+      AddAllowedChildSymbol(integral, conditionSymbols);
+
+      AddAllowedChildSymbol(derivative, realValuedSymbols);
+      AddAllowedChildSymbol(derivative, powerSymbols);
+      AddAllowedChildSymbol(derivative, conditionSymbols);
+      #endregion
+    }
+
+    public void ConfigureAsDefaultRegressionGrammar() {
+      Symbols.First(s => s is Average).Enabled = false;
+      Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false;
+      Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
+      Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false;
+      Symbols.First(s => s.Name == ConditionalSymbolsName).Enabled = false;
+      Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false;
+    }
+
+    public void ConfigureAsDefaultClassificationGrammar() {
+      Symbols.First(s => s is Average).Enabled = false;
+      Symbols.First(s => s is VariableCondition).Enabled = false;
+      Symbols.First(s => s is Xor).Enabled = false;
+      Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false;
+      Symbols.First(s => s.Name == ExponentialFunctionsName).Enabled = false;
+      Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false;
+      Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
+      Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = false;
+    }
+
+    public void ConfigureAsDefaultTimeSeriesPrognosisGrammar() {
+      Symbols.First(s => s is Average).Enabled = false;
+      Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false;
+      Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
+      Symbols.First(s => s.Name == ConditionalSymbolsName).Enabled = false;
+      Symbols.First(s => s.Name == SpecialFunctionsName).Enabled = false;
+
+      Symbols.Single(s => s.Name == "Variable").Enabled = false;
+      Symbols.First(s => s.Name == TimeSeriesSymbolsName).Enabled = true;
+      Symbols.First(s => s is Derivative).Enabled = false;
+      Symbols.First(s => s is Integral).Enabled = false;
+      Symbols.First(s => s is TimeLag).Enabled = false;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 16132)
@@ -0,0 +1,397 @@
+﻿<?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>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <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>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-3.7.0">
+      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath>
+    </Reference>
+    <Reference Include="AutoDiff-1.0">
+      <HintPath>..\..\..\..\trunk\sources\bin\AutoDiff-1.0.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\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.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\SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisGenealogyAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisMultiObjectiveValidationAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveValidationAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisMultiObjectiveAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Converters\LinearModelToTreeConverter.cs" />
+    <Compile Include="Converters\TreeSimplifier.cs" />
+    <Compile Include="Converters\TreeToAutoDiffTermConverter.cs" />
+    <Compile Include="Formatters\InfixExpressionFormatter.cs" />
+    <Compile Include="Formatters\TSQLExpressionFormatter.cs" />
+    <Compile Include="Formatters\SymbolicDataAnalysisExpressionMathematicaFormatter.cs" />
+    <Compile Include="Formatters\SymbolicDataAnalysisExpressionCSharpFormatter.cs" />
+    <Compile Include="Importer\InfixExpressionParser.cs" />
+    <Compile Include="Importer\SymbolicExpressionImporter.cs" />
+    <Compile Include="Importer\Token.cs" />
+    <Compile Include="Interfaces\IModelBacktransformator.cs" />
+    <Compile Include="Interfaces\IVariableTreeNode.cs" />
+    <Compile Include="Interfaces\IVariableSymbol.cs" />
+    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs" />
+    <Compile Include="SymbolicDataAnalysisExpressionTreeSimplificationOperator.cs" />
+    <Compile Include="SymbolicDataAnalysisModelComplexityCalculator.cs" />
+    <Compile Include="SymbolicDataAnalysisExpressionPruningOperator.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisVariableFrequencyAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisAlleleFrequencyAnalyzer.cs" />
+    <Compile Include="Creators\MultiSymbolicDataAnalysisExpressionCreator.cs" />
+    <Compile Include="Creators\SymbolicDataAnalysisExpressionFullTreeCreator.cs" />
+    <Compile Include="Creators\SymbolicDataAnalysisExpressionGrowTreeCreator.cs" />
+    <Compile Include="Creators\SymbolicDataAnalysisExpressionRampedHalfAndHalfTreeCreator.cs" />
+    <Compile Include="Creators\SymbolicDataAnalysisExpressionTreeCreator.cs" />
+    <Compile Include="Crossovers\MultiSymbolicDataAnalysisExpressionCrossover.cs" />
+    <Compile Include="Crossovers\SymbolicDataAnalysisExpressionContextAwareCrossover.cs" />
+    <Compile Include="Crossovers\SymbolicDataAnalysisExpressionCrossover.cs" />
+    <Compile Include="Crossovers\SymbolicDataAnalysisExpressionDepthConstrainedCrossover.cs" />
+    <Compile Include="Crossovers\SymbolicDataAnalysisExpressionDeterministicBestCrossover.cs" />
+    <Compile Include="Crossovers\SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover.cs" />
+    <Compile Include="Crossovers\SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs" />
+    <Compile Include="Formatters\SymbolicDataAnalysisExpressionExcelFormatter.cs" />
+    <Compile Include="Formatters\SymbolicDataAnalysisExpressionSmalltalkFormatter.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionCrossover.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisImpactValuesCalculator.cs" />
+    <Compile Include="Interpreter\InterpreterState.cs" />
+    <Compile Include="Interpreter\OpCodes.cs" />
+    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs" />
+    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeInterpreter.cs" />
+    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Formatters\SymbolicDataAnalysisExpressionLatexFormatter.cs" />
+    <Compile Include="Formatters\SymbolicDataAnalysisExpressionMATLABFormatter.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisBoundedOperator.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionTreeInterpreter.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisProblem.cs" />
+    <Compile Include="SymbolicDataAnalysisModel.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="SymbolicDataAnalysisMultiObjectiveProblem.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisValidationAnalyzer.cs" />
+    <Compile Include="Grammars\ArithmeticExpressionGrammar.cs" />
+    <Compile Include="Grammars\FullFunctionalExpressionGrammar.cs" />
+    <Compile Include="Grammars\TypeCoherentExpressionGrammar.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisMultiObjectiveAnalyzer.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisSingleObjectiveAnalyzer.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisAnalyzer.cs" />
+    <Compile Include="SymbolicDataAnalysisSingleObjectiveProblem.cs" />
+    <Compile Include="SymbolicDataAnalysisProblem.cs" />
+    <Compile Include="SymbolicDataAnalysisSolutionImpactValuesCalculator.cs" />
+    <Compile Include="Symbols\Addition.cs" />
+    <Compile Include="Symbols\And.cs" />
+    <Compile Include="Symbols\AutoregressiveVariable.cs" />
+    <Compile Include="Symbols\Average.cs" />
+    <Compile Include="Symbols\Constant.cs" />
+    <Compile Include="Symbols\ConstantTreeNode.cs" />
+    <Compile Include="Symbols\AiryA.cs" />
+    <Compile Include="Symbols\AiryB.cs" />
+    <Compile Include="Symbols\Bessel.cs" />
+    <Compile Include="Symbols\BinaryFactorVariable.cs" />
+    <Compile Include="Symbols\BinaryFactorVariableTreeNode.cs" />
+    <Compile Include="Symbols\FactorVariableTreeNode.cs" />
+    <Compile Include="Symbols\FactorVariable.cs" />
+    <Compile Include="Symbols\VariableBase.cs" />
+    <Compile Include="Symbols\VariableTreeNodeBase.cs" />
+    <Compile Include="Symbols\Wildcards\AnyNode.cs" />
+    <Compile Include="Symbols\Wildcards\AnyNodeSymbol.cs" />
+    <Compile Include="Symbols\Wildcards\AnySubtree.cs" />
+    <Compile Include="Symbols\Wildcards\AnySubtreeSymbol.cs" />
+    <Compile Include="Symbols\Xor.cs" />
+    <Compile Include="Symbols\Erf.cs" />
+    <Compile Include="Symbols\Norm.cs" />
+    <Compile Include="Symbols\FresnelCosineIntegral.cs" />
+    <Compile Include="Symbols\FresnelSineIntegral.cs" />
+    <Compile Include="Symbols\HyperbolicSineIntegral.cs" />
+    <Compile Include="Symbols\HyperbolicCosineIntegral.cs" />
+    <Compile Include="Symbols\SineIntegral.cs" />
+    <Compile Include="Symbols\CosineIntegral.cs" />
+    <Compile Include="Symbols\ExponentialIntegralEi.cs" />
+    <Compile Include="Symbols\Dawson.cs" />
+    <Compile Include="Symbols\Psi.cs" />
+    <Compile Include="Symbols\Gamma.cs" />
+    <Compile Include="Symbols\SquareRoot.cs" />
+    <Compile Include="Symbols\Square.cs" />
+    <Compile Include="Symbols\Cosine.cs" />
+    <Compile Include="Symbols\Derivative.cs" />
+    <Compile Include="Symbols\Division.cs" />
+    <Compile Include="Symbols\Exponential.cs" />
+    <Compile Include="Symbols\GreaterThan.cs" />
+    <Compile Include="Symbols\IfThenElse.cs" />
+    <Compile Include="Symbols\ILaggedTreeNode.cs" />
+    <Compile Include="Symbols\Integral.cs" />
+    <Compile Include="Symbols\LaggedSymbol.cs" />
+    <Compile Include="Symbols\LaggedTreeNode.cs" />
+    <Compile Include="Symbols\LaggedVariable.cs" />
+    <Compile Include="Symbols\LaggedVariableTreeNode.cs" />
+    <Compile Include="Symbols\LessThan.cs" />
+    <Compile Include="Symbols\Logarithm.cs" />
+    <Compile Include="Symbols\Multiplication.cs" />
+    <Compile Include="Symbols\Not.cs" />
+    <Compile Include="Symbols\Or.cs" />
+    <Compile Include="Symbols\Power.cs" />
+    <Compile Include="Symbols\Root.cs" />
+    <Compile Include="Symbols\Sine.cs" />
+    <Compile Include="Symbols\Subtraction.cs" />
+    <Compile Include="Symbols\Tangent.cs" />
+    <Compile Include="Symbols\TimeLag.cs" />
+    <Compile Include="Symbols\Variable.cs" />
+    <Compile Include="Symbols\VariableCondition.cs" />
+    <Compile Include="Symbols\VariableConditionTreeNode.cs" />
+    <Compile Include="Symbols\VariableTreeNode.cs" />
+    <Compile Include="Tracking\Analyzers\SymbolicDataAnalysisFragmentLengthAnalyzer.cs" />
+    <Compile Include="Tracking\Analyzers\SymbolicDataAnalysisSchemaFrequencyAnalyzer.cs" />
+    <Compile Include="Tracking\Analyzers\SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs" />
+    <Compile Include="Tracking\Analyzers\SymbolicDataAnalysisTraceOverlapAnalyzer.cs" />
+    <Compile Include="Tracking\SchemaDiversification\DiversificationStatisticsOperator.cs" />
+    <Compile Include="Tracking\SchemaDiversification\SchemaCreator.cs" />
+    <Compile Include="Tracking\SchemaDiversification\SchemaEvaluator.cs" />
+    <Compile Include="Tracking\SchemaDiversification\SchemaUtil.cs" />
+    <Compile Include="Tracking\SchemaDiversification\UpdateQualityOperator.cs" />
+    <Compile Include="Tracking\SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs" />
+    <Compile Include="Tracking\SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs" />
+    <Compile Include="Tracking\SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs" />
+    <Compile Include="Tracking\SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs" />
+    <Compile Include="Tracking\TraceCalculator.cs" />
+    <Compile Include="Transformations\SymbolicExpressionTreeBacktransformator.cs" />
+    <Compile Include="Transformations\TransformationToSymbolicTreeMapper.cs" />
+    <Compile Include="TreeMatching\QueryMatch.cs" />
+    <Compile Include="TreeMatching\SymbolicExpressionTreeBottomUpSimilarityCalculator.cs" />
+    <Compile Include="TreeMatching\SymbolicExpressionTreeCanonicalSorter.cs" />
+    <Compile Include="TreeMatching\SymbolicExpressionTreeEqualityComparer.cs" />
+    <Compile Include="TreeMatching\SymbolicExpressionTreeMatching.cs" />
+    <Compile Include="TreeMatching\SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs" />
+    <Compile Include="TreeMatching\SymbolicExpressionTreeNodeComparer.cs" />
+    <Compile Include="TreeMatching\SymbolicExpressionTreeNodeEqualityComparer.cs" />
+    <Compile Include="TreeMatching\SymbolicExpressionTreePhenotypicSimilarityCalculator.cs" />
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+    <Compile Include="Evaluators\SymbolicDataAnalysisMultiObjectiveEvaluator.cs" />
+    <Compile Include="Evaluators\SymbolicDataAnalysisSingleObjectiveEvaluator.cs" />
+    <Compile Include="Evaluators\SymbolicDataAnalysisEvaluator.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisInterpreterOperator.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisMultiObjectiveEvaluator.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisEvaluator.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisGrammar.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisModel.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisSingleObjectiveEvaluator.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisSolution.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisSolutionCreator.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </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>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
+      <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.EvolutionTracking\3.4\HeuristicLab.EvolutionTracking-3.4.csproj">
+      <Project>{1f75cea3-464f-4a6f-b2f0-04b9841ebc16}</Project>
+      <Name>HeuristicLab.EvolutionTracking-3.4</Name>
+    </ProjectReference>
+  </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 Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs	(revision 16132)
@@ -0,0 +1,505 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 System.Text;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Parses mathematical expressions in infix form. E.g. x1 * (3.0 * x2 + x3)
+  /// Identifier format (functions or variables): '_' | letter { '_' | letter | digit }
+  /// Variables names and variable values can be set under quotes "" or '' because variable names might contain spaces. 
+  ///   Variable = ident | " ident " | ' ident ' 
+  /// It is also possible to use functions e.g. log("x1") or real-valued constants e.g. 3.1415 . 
+  /// Variable names are case sensitive. Function names are not case sensitive.
+  /// 
+  /// 
+  /// S             = Expr EOF
+  /// Expr          = ['-' | '+'] Term { '+' Term | '-' Term }
+  /// Term          = Fact { '*' Fact | '/' Fact }
+  /// Fact          = '(' Expr ')' 
+  ///                 | 'LAG' '(' varId ',' ['+' | '-' ] number ')' 
+  ///                 | funcId '(' ArgList ')' 
+  ///                 | VarExpr | number
+  /// ArgList       = Expr { ',' Expr }
+  /// VarExpr       = varId OptFactorPart
+  /// OptFactorPart = [ ('=' varVal | '[' ['+' | '-' ] number {',' ['+' | '-' ] number } ']' ) ]
+  /// varId         =  ident | ' ident ' | " ident "
+  /// varVal        =  ident | ' ident ' | " ident "
+  /// ident         =  '_' | letter { '_' | letter | digit }
+  /// </summary>
+  public sealed class InfixExpressionParser {
+    private enum TokenType { Operator, Identifier, Number, LeftPar, RightPar, LeftBracket, RightBracket, Comma, Eq, End, NA };
+    private class Token {
+      internal double doubleVal;
+      internal string strVal;
+      internal TokenType TokenType;
+    }
+
+    private class SymbolNameComparer : IEqualityComparer<ISymbol>, IComparer<ISymbol> {
+      public int Compare(ISymbol x, ISymbol y) {
+        return x.Name.CompareTo(y.Name);
+      }
+
+      public bool Equals(ISymbol x, ISymbol y) {
+        return Compare(x, y) == 0;
+      }
+
+      public int GetHashCode(ISymbol obj) {
+        return obj.Name.GetHashCode();
+      }
+    }
+    // format name <-> symbol 
+    // the lookup table is also used in the corresponding formatter
+    internal static readonly BidirectionalLookup<string, ISymbol>
+      knownSymbols = new BidirectionalLookup<string, ISymbol>(StringComparer.InvariantCulture, new SymbolNameComparer());
+
+    private Constant constant = new Constant();
+    private Variable variable = new Variable();
+    private BinaryFactorVariable binaryFactorVar = new BinaryFactorVariable();
+    private FactorVariable factorVar = new FactorVariable();
+
+    private ProgramRootSymbol programRootSymbol = new ProgramRootSymbol();
+    private StartSymbol startSymbol = new StartSymbol();
+
+    static InfixExpressionParser() {
+      // populate bidirectional lookup
+      var dict = new Dictionary<string, ISymbol>
+      {
+        { "+", new Addition()},
+        { "/", new Division()},
+        { "*", new Multiplication()},
+        { "-", new Subtraction()},
+        { "EXP", new Exponential()},
+        { "LOG", new Logarithm()},
+        { "POW", new Power()},
+        { "ROOT", new Root()},
+        { "SQR", new Square() },
+        { "SQRT", new SquareRoot() },
+        { "SIN",new Sine()},
+        { "COS", new Cosine()},
+        { "TAN", new Tangent()},
+        { "AIRYA", new AiryA()},
+        { "AIRYB", new AiryB()},
+        { "BESSEL", new Bessel()},
+        { "COSINT", new CosineIntegral()},
+        { "SININT", new SineIntegral()},
+        { "HYPCOSINT", new HyperbolicCosineIntegral()},
+        { "HYPSININT", new HyperbolicSineIntegral()},
+        { "FRESNELSININT", new FresnelSineIntegral()},
+        { "FRESNELCOSINT", new FresnelCosineIntegral()},
+        { "NORM", new Norm()},
+        { "ERF", new Erf()},
+        { "GAMMA", new Gamma()},
+        { "PSI", new Psi()},
+        { "DAWSON", new Dawson()},
+        { "EXPINT", new ExponentialIntegralEi()},
+        { "MEAN", new Average()},
+        { "IF", new IfThenElse()},
+        { "GT", new GreaterThan()},
+        { "LT", new LessThan()},
+        { "AND", new And()},
+        { "OR", new Or()},
+        { "NOT", new Not()},
+        { "XOR", new Xor()},
+        { "DIFF", new Derivative()},
+        { "LAG", new LaggedVariable() },
+      };
+
+
+      foreach (var kvp in dict) {
+        knownSymbols.Add(kvp.Key, kvp.Value);
+      }
+    }
+
+    public ISymbolicExpressionTree Parse(string str) {
+      ISymbolicExpressionTreeNode root = programRootSymbol.CreateTreeNode();
+      ISymbolicExpressionTreeNode start = startSymbol.CreateTreeNode();
+      var allTokens = GetAllTokens(str).ToArray();
+      ISymbolicExpressionTreeNode mainBranch = ParseS(new Queue<Token>(allTokens));
+
+      // 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> GetAllTokens(string str) {
+      int pos = 0;
+      while (true) {
+        while (pos < str.Length && Char.IsWhiteSpace(str[pos])) pos++;
+        if (pos >= str.Length) {
+          yield return new Token { TokenType = TokenType.End, strVal = "" };
+          yield break;
+        }
+        if (char.IsDigit(str[pos])) {
+          // read number (=> read until white space or operator or comma)
+          var sb = new StringBuilder();
+          sb.Append(str[pos]);
+          pos++;
+          while (pos < str.Length && !char.IsWhiteSpace(str[pos])
+            && (str[pos] != '+' || str[pos - 1] == 'e' || str[pos - 1] == 'E')     // continue reading exponents
+            && (str[pos] != '-' || str[pos - 1] == 'e' || str[pos - 1] == 'E')
+            && str[pos] != '*'
+            && str[pos] != '/'
+            && str[pos] != ')'
+            && str[pos] != ']'
+            && str[pos] != ',') {
+            sb.Append(str[pos]);
+            pos++;
+          }
+          double dblVal;
+          if (double.TryParse(sb.ToString(), NumberStyles.Float, CultureInfo.InvariantCulture, out dblVal))
+            yield return new Token { TokenType = TokenType.Number, strVal = sb.ToString(), doubleVal = dblVal };
+          else yield return new Token { TokenType = TokenType.NA, strVal = sb.ToString() };
+        } else if (char.IsLetter(str[pos]) || str[pos] == '_') {
+          // read ident
+          var sb = new StringBuilder();
+          sb.Append(str[pos]);
+          pos++;
+          while (pos < str.Length &&
+            (char.IsLetter(str[pos]) || str[pos] == '_' || char.IsDigit(str[pos]))) {
+            sb.Append(str[pos]);
+            pos++;
+          }
+          yield return new Token { TokenType = TokenType.Identifier, strVal = sb.ToString() };
+        } else if (str[pos] == '"') {
+          // read to next " 
+          pos++;
+          var sb = new StringBuilder();
+          while (pos < str.Length && str[pos] != '"') {
+            sb.Append(str[pos]);
+            pos++;
+          }
+          if (pos < str.Length && str[pos] == '"') {
+            pos++; // skip "
+            yield return new Token { TokenType = TokenType.Identifier, strVal = sb.ToString() };
+          } else
+            yield return new Token { TokenType = TokenType.NA };
+
+        } else if (str[pos] == '\'') {
+          // read to next '
+          pos++;
+          var sb = new StringBuilder();
+          while (pos < str.Length && str[pos] != '\'') {
+            sb.Append(str[pos]);
+            pos++;
+          }
+          if (pos < str.Length && str[pos] == '\'') {
+            pos++; // skip '
+            yield return new Token { TokenType = TokenType.Identifier, strVal = sb.ToString() };
+          } else
+            yield return new Token { TokenType = TokenType.NA };
+        } else if (str[pos] == '+') {
+          pos++;
+          yield return new Token { TokenType = TokenType.Operator, strVal = "+" };
+        } else if (str[pos] == '-') {
+          pos++;
+          yield return new Token { TokenType = TokenType.Operator, strVal = "-" };
+        } else if (str[pos] == '/') {
+          pos++;
+          yield return new Token { TokenType = TokenType.Operator, strVal = "/" };
+        } else if (str[pos] == '*') {
+          pos++;
+          yield return new Token { TokenType = TokenType.Operator, strVal = "*" };
+        } else if (str[pos] == '(') {
+          pos++;
+          yield return new Token { TokenType = TokenType.LeftPar, strVal = "(" };
+        } else if (str[pos] == ')') {
+          pos++;
+          yield return new Token { TokenType = TokenType.RightPar, strVal = ")" };
+        } else if (str[pos] == '[') {
+          pos++;
+          yield return new Token { TokenType = TokenType.LeftBracket, strVal = "[" };
+        } else if (str[pos] == ']') {
+          pos++;
+          yield return new Token { TokenType = TokenType.RightBracket, strVal = "]" };
+        } else if (str[pos] == '=') {
+          pos++;
+          yield return new Token { TokenType = TokenType.Eq, strVal = "=" };
+        } else if (str[pos] == ',') {
+          pos++;
+          yield return new Token { TokenType = TokenType.Comma, strVal = "," };
+        } else {
+          throw new ArgumentException("Invalid character: " + str[pos]);
+        }
+      }
+    }
+    /// S             = Expr EOF
+    private ISymbolicExpressionTreeNode ParseS(Queue<Token> tokens) {
+      var expr = ParseExpr(tokens);
+
+      var endTok = tokens.Dequeue();
+      if (endTok.TokenType != TokenType.End)
+        throw new ArgumentException(string.Format("Expected end of expression (got {0})", endTok.strVal));
+
+      return expr;
+    }
+
+    /// Expr          = ['-' | '+'] Term { '+' Term | '-' Term }
+    private ISymbolicExpressionTreeNode ParseExpr(Queue<Token> tokens) {
+      var next = tokens.Peek();
+      var posTerms = new List<ISymbolicExpressionTreeNode>();
+      var negTerms = new List<ISymbolicExpressionTreeNode>();
+      bool negateFirstTerm = false;
+      if (next.TokenType == TokenType.Operator && (next.strVal == "+" || next.strVal == "-")) {
+        tokens.Dequeue();
+        if (next.strVal == "-")
+          negateFirstTerm = true;
+      }
+      var t = ParseTerm(tokens);
+      if (negateFirstTerm) negTerms.Add(t);
+      else posTerms.Add(t);
+
+      next = tokens.Peek();
+      while (next.strVal == "+" || next.strVal == "-") {
+        switch (next.strVal) {
+          case "+": {
+              tokens.Dequeue();
+              var term = ParseTerm(tokens);
+              posTerms.Add(term);
+              break;
+            }
+          case "-": {
+              tokens.Dequeue();
+              var term = ParseTerm(tokens);
+              negTerms.Add(term);
+              break;
+            }
+        }
+        next = tokens.Peek();
+      }
+
+      var sum = GetSymbol("+").CreateTreeNode();
+      foreach (var posTerm in posTerms) sum.AddSubtree(posTerm);
+      if (negTerms.Any()) {
+        if (negTerms.Count == 1) {
+          var sub = GetSymbol("-").CreateTreeNode();
+          sub.AddSubtree(negTerms.Single());
+          sum.AddSubtree(sub);
+        } else {
+          var sumNeg = GetSymbol("+").CreateTreeNode();
+          foreach (var negTerm in negTerms) sumNeg.AddSubtree(negTerm);
+
+          var constNode = (ConstantTreeNode)constant.CreateTreeNode();
+          constNode.Value = -1.0;
+          var prod = GetSymbol("*").CreateTreeNode();
+          prod.AddSubtree(constNode);
+          prod.AddSubtree(sumNeg);
+
+          sum.AddSubtree(prod);
+        }
+      }
+      if (sum.SubtreeCount == 1) return sum.Subtrees.First();
+      else return sum;
+    }
+
+    private ISymbol GetSymbol(string tok) {
+      var symb = knownSymbols.GetByFirst(tok).FirstOrDefault();
+      if (symb == null) throw new ArgumentException(string.Format("Unknown token {0} found.", tok));
+      return symb;
+    }
+
+    /// Term          = Fact { '*' Fact | '/' Fact }
+    private ISymbolicExpressionTreeNode ParseTerm(Queue<Token> tokens) {
+      var factors = new List<ISymbolicExpressionTreeNode>();
+      var firstFactor = ParseFact(tokens);
+      factors.Add(firstFactor);
+
+      var next = tokens.Peek();
+      while (next.strVal == "*" || next.strVal == "/") {
+        switch (next.strVal) {
+          case "*": {
+              tokens.Dequeue();
+              var fact = ParseFact(tokens);
+              factors.Add(fact);
+              break;
+            }
+          case "/": {
+              tokens.Dequeue();
+              var invFact = ParseFact(tokens);
+              var divNode = GetSymbol("/").CreateTreeNode(); // 1/x
+              divNode.AddSubtree(invFact);
+              factors.Add(divNode);
+              break;
+            }
+        }
+
+        next = tokens.Peek();
+      }
+      if (factors.Count == 1) return factors.First();
+      else {
+        var prod = GetSymbol("*").CreateTreeNode();
+        foreach (var f in factors) prod.AddSubtree(f);
+        return prod;
+      }
+    }
+
+    /// Fact          = '(' Expr ')' 
+    ///                 | 'LAG' '(' varId ',' ['+' | '-' ] number ')' 
+    ///                 | funcId '(' ArgList ')' 
+    ///                 | VarExpr | number
+    /// ArgList       = Expr { ',' Expr }
+    /// VarExpr       = varId OptFactorPart
+    /// OptFactorPart = [ ('=' varVal | '[' ['+' | '-' ] number {',' ['+' | '-' ] number } ']' ) ]
+    /// varId         =  ident | ' ident ' | " ident "
+    /// varVal        =  ident | ' ident ' | " ident "
+    /// ident         =  '_' | letter { '_' | letter | digit }
+    private ISymbolicExpressionTreeNode ParseFact(Queue<Token> tokens) {
+      var next = tokens.Peek();
+      if (next.TokenType == TokenType.LeftPar) {
+        tokens.Dequeue();
+        var expr = ParseExpr(tokens);
+        var rPar = tokens.Dequeue();
+        if (rPar.TokenType != TokenType.RightPar)
+          throw new ArgumentException("expected )");
+        return expr;
+      } else if (next.TokenType == TokenType.Identifier) {
+        var idTok = tokens.Dequeue();
+        if (tokens.Peek().TokenType == TokenType.LeftPar) {
+          // function identifier or LAG
+          var funcId = idTok.strVal.ToUpperInvariant();
+
+          var funcNode = GetSymbol(funcId).CreateTreeNode();
+          var lPar = tokens.Dequeue();
+          if (lPar.TokenType != TokenType.LeftPar)
+            throw new ArgumentException("expected (");
+
+          // handle 'lag' specifically
+          if (funcNode.Symbol is LaggedVariable) {
+            var varId = tokens.Dequeue();
+            if (varId.TokenType != TokenType.Identifier) throw new ArgumentException("Identifier expected. Format for lagged variables: \"lag(x, -1)\"");
+            var comma = tokens.Dequeue();
+            if (comma.TokenType != TokenType.Comma) throw new ArgumentException("',' expected, Format for lagged variables: \"lag(x, -1)\"");
+            double sign = 1.0;
+            if (tokens.Peek().strVal == "+" || tokens.Peek().strVal == "-") {
+              // read sign
+              var signTok = tokens.Dequeue();
+              if (signTok.strVal == "-") sign = -1.0;
+            }
+            var lagToken = tokens.Dequeue();
+            if (lagToken.TokenType != TokenType.Number) throw new ArgumentException("Number expected, Format for lagged variables: \"lag(x, -1)\"");
+            if (!lagToken.doubleVal.IsAlmost(Math.Round(lagToken.doubleVal)))
+              throw new ArgumentException("Time lags must be integer values");
+            var laggedVarNode = funcNode as LaggedVariableTreeNode;
+            laggedVarNode.VariableName = varId.strVal;
+            laggedVarNode.Lag = (int)Math.Round(sign * lagToken.doubleVal);
+            laggedVarNode.Weight = 1.0;
+          } else {
+            // functions
+            var args = ParseArgList(tokens);
+            // check number of arguments
+            if (funcNode.Symbol.MinimumArity > args.Length || funcNode.Symbol.MaximumArity < args.Length) {
+              throw new ArgumentException(string.Format("Symbol {0} requires between {1} and  {2} arguments.", funcId,
+                funcNode.Symbol.MinimumArity, funcNode.Symbol.MaximumArity));
+            }
+            foreach (var arg in args) funcNode.AddSubtree(arg);
+          }
+
+          var rPar = tokens.Dequeue();
+          if (rPar.TokenType != TokenType.RightPar)
+            throw new ArgumentException("expected )");
+
+          return funcNode;
+        } else {
+          // variable
+          if (tokens.Peek().TokenType == TokenType.Eq) {
+            // binary factor
+            tokens.Dequeue(); // skip Eq
+            var valTok = tokens.Dequeue();
+            if (valTok.TokenType != TokenType.Identifier) throw new ArgumentException("expected identifier");
+            var binFactorNode = (BinaryFactorVariableTreeNode)binaryFactorVar.CreateTreeNode();
+            binFactorNode.Weight = 1.0;
+            binFactorNode.VariableName = idTok.strVal;
+            binFactorNode.VariableValue = valTok.strVal;
+            return binFactorNode;
+          } else if (tokens.Peek().TokenType == TokenType.LeftBracket) {
+            // factor variable
+            var factorVariableNode = (FactorVariableTreeNode)factorVar.CreateTreeNode();
+            factorVariableNode.VariableName = idTok.strVal;
+
+            tokens.Dequeue(); // skip [
+            var weights = new List<double>();
+            // at least one weight is necessary
+            var sign = 1.0;
+            if (tokens.Peek().TokenType == TokenType.Operator) {
+              var opToken = tokens.Dequeue();
+              if (opToken.strVal == "+") sign = 1.0;
+              else if (opToken.strVal == "-") sign = -1.0;
+              else throw new ArgumentException();
+            }
+            if (tokens.Peek().TokenType != TokenType.Number) throw new ArgumentException("number expected");
+            var weightTok = tokens.Dequeue();
+            weights.Add(sign * weightTok.doubleVal);
+            while (tokens.Peek().TokenType == TokenType.Comma) {
+              // skip comma
+              tokens.Dequeue();
+              if (tokens.Peek().TokenType == TokenType.Operator) {
+                var opToken = tokens.Dequeue();
+                if (opToken.strVal == "+") sign = 1.0;
+                else if (opToken.strVal == "-") sign = -1.0;
+                else throw new ArgumentException();
+              }
+              weightTok = tokens.Dequeue();
+              if (weightTok.TokenType != TokenType.Number) throw new ArgumentException("number expected");
+              weights.Add(sign * weightTok.doubleVal);
+            }
+            var rightBracketToken = tokens.Dequeue();
+            if (rightBracketToken.TokenType != TokenType.RightBracket) throw new ArgumentException("closing bracket ] expected");
+            factorVariableNode.Weights = weights.ToArray();
+            return factorVariableNode;
+          } else {
+            // variable
+            var varNode = (VariableTreeNode)variable.CreateTreeNode();
+            varNode.Weight = 1.0;
+            varNode.VariableName = idTok.strVal;
+            return varNode;
+          }
+        }
+      } else if (next.TokenType == TokenType.Number) {
+        var numTok = tokens.Dequeue();
+        var constNode = (ConstantTreeNode)constant.CreateTreeNode();
+        constNode.Value = numTok.doubleVal;
+        return constNode;
+      } else {
+        throw new ArgumentException(string.Format("unexpected token in expression {0}", next.strVal));
+      }
+    }
+
+    // ArgList = Expr { ',' Expr }
+    private ISymbolicExpressionTreeNode[] ParseArgList(Queue<Token> tokens) {
+      var exprList = new List<ISymbolicExpressionTreeNode>();
+      exprList.Add(ParseExpr(tokens));
+      while (tokens.Peek().TokenType != TokenType.RightPar) {
+        var comma = tokens.Dequeue();
+        if (comma.TokenType != TokenType.Comma) throw new ArgumentException("expected ',' ");
+        exprList.Add(ParseExpr(tokens));
+      }
+      return exprList.ToArray();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/SymbolicExpressionImporter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/SymbolicExpressionImporter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/SymbolicExpressionImporter.cs	(revision 16132)
@@ -0,0 +1,277 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public class SymbolicExpressionImporter {
+    private const string VARSTART = "VAR";
+    private const string LAGGEDVARSTART = "LAGVARIABLE";
+    private const string INTEGRALSTART = "INTEG";
+    private const string DEFUNSTART = "DEFUN";
+    private const string ARGSTART = "ARG";
+    private const string INVOKESTART = "CALL";
+    private const string TIMELAGSTART = "LAG";
+    private Dictionary<string, Symbol> knownSymbols = new Dictionary<string, Symbol>()
+      {
+        {"+", new Addition()},
+        {"/", new Division()},
+        {"*", new Multiplication()},
+        {"-", new Subtraction()},
+        {"EXP", new Exponential()},
+        {"LOG", new Logarithm()},
+        {"POW", new Power()},
+        {"ROOT", new Root()},
+        {"SQR", new Square()},
+        {"SQRT", new SquareRoot()},
+        {"SIN",new Sine()},
+        {"COS", new Cosine()},
+        {"TAN", new Tangent()},
+        {"AIRYA", new AiryA()},
+        {"AIRYB", new AiryB()},
+        {"BESSEL", new Bessel()},
+        {"COSINT", new CosineIntegral()},
+        {"SININT", new SineIntegral()},
+        {"HYPCOSINT", new HyperbolicCosineIntegral()},
+        {"HYPSININT", new HyperbolicSineIntegral()},
+        {"FRESNELSININT", new FresnelSineIntegral()},
+        {"FRESNELCOSINT", new FresnelCosineIntegral()},
+        {"NORM", new Norm()},
+        {"ERF", new Erf()},
+        {"GAMMA", new Gamma()},
+        {"PSI", new Psi()},
+        {"DAWSON", new Dawson()},
+        {"EXPINT", new ExponentialIntegralEi()},
+        {"MEAN", new Average()},
+        {"IF", new IfThenElse()},
+        {">", new GreaterThan()},
+        {"<", new LessThan()},
+        {"AND", new And()},
+        {"OR", new Or()},
+        {"NOT", new Not()},
+        {"XOR", new Xor()},
+        {"DIFF", new Derivative()},
+        {"PROG", new ProgramRootSymbol()},
+        {"MAIN", new StartSymbol()},
+        {"FACTOR", new FactorVariable() },
+        {"BINFACTOR", new BinaryFactorVariable()}
+      };
+
+    Constant constant = new Constant();
+    Variable variable = new Variable();
+    LaggedVariable laggedVariable = new LaggedVariable();
+    Defun defun = new Defun();
+    TimeLag timeLag = new TimeLag();
+    Integral integral = new Integral();
+    FactorVariable factorVar = new FactorVariable();
+    BinaryFactorVariable binFactorVar = new BinaryFactorVariable();
+
+    ProgramRootSymbol programRootSymbol = new ProgramRootSymbol();
+    StartSymbol startSymbol = new StartSymbol();
+
+    public ISymbolicExpressionTree Import(string str) {
+      str = str.Replace("(", " ( ").Replace(")", " ) ");
+      ISymbolicExpressionTreeNode root = programRootSymbol.CreateTreeNode();
+      ISymbolicExpressionTreeNode start = startSymbol.CreateTreeNode();
+      ISymbolicExpressionTreeNode 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 ISymbolicExpressionTreeNode ParseSexp(Queue<Token> tokens) {
+      if (tokens.Peek().Symbol == TokenSymbol.LPAR) {
+        ISymbolicExpressionTreeNode tree;
+        Expect(Token.LPAR, tokens);
+        if (tokens.Peek().StringValue.StartsWith(VARSTART)) {
+          tree = ParseVariable(tokens);
+        } else if (tokens.Peek().StringValue.StartsWith(LAGGEDVARSTART)) {
+          tree = ParseLaggedVariable(tokens);
+        } else if (tokens.Peek().StringValue.StartsWith(TIMELAGSTART)) {
+          tree = ParseTimeLag(tokens);
+          tree.AddSubtree(ParseSexp(tokens));
+        } else if (tokens.Peek().StringValue.StartsWith(INTEGRALSTART)) {
+          tree = ParseIntegral(tokens);
+          tree.AddSubtree(ParseSexp(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 if (tokens.Peek().StringValue.StartsWith("FACTOR")) {
+          tree = ParseFactor(tokens);
+        } else if (tokens.Peek().StringValue.StartsWith("BINFACTOR")) {
+          tree = ParseBinaryFactor(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 ISymbolicExpressionTreeNode ParseInvoke(Queue<Token> tokens) {
+      Token invokeTok = tokens.Dequeue();
+      Debug.Assert(invokeTok.StringValue == "CALL");
+      InvokeFunction invokeSym = new InvokeFunction(tokens.Dequeue().StringValue);
+      ISymbolicExpressionTreeNode invokeNode = invokeSym.CreateTreeNode();
+      return invokeNode;
+    }
+
+    private ISymbolicExpressionTreeNode ParseArgument(Queue<Token> tokens) {
+      Token argTok = tokens.Dequeue();
+      Debug.Assert(argTok.StringValue == "ARG");
+      Argument argument = new Argument((int)tokens.Dequeue().DoubleValue);
+      ISymbolicExpressionTreeNode argNode = argument.CreateTreeNode();
+      return argNode;
+    }
+
+    private ISymbolicExpressionTreeNode 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 ISymbolicExpressionTreeNode ParseTimeLag(Queue<Token> tokens) {
+      Token varTok = tokens.Dequeue();
+      Debug.Assert(varTok.StringValue == "LAG");
+      LaggedTreeNode t = (LaggedTreeNode)timeLag.CreateTreeNode();
+      t.Lag = (int)tokens.Dequeue().DoubleValue;
+      return t;
+    }
+
+    private ISymbolicExpressionTreeNode ParseIntegral(Queue<Token> tokens) {
+      Token varTok = tokens.Dequeue();
+      Debug.Assert(varTok.StringValue == "INTEGRAL");
+      LaggedTreeNode t = (LaggedTreeNode)integral.CreateTreeNode();
+      t.Lag = (int)tokens.Dequeue().DoubleValue;
+      return t;
+    }
+
+    private ISymbolicExpressionTreeNode 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 ISymbolicExpressionTreeNode ParseFactor(Queue<Token> tokens) {
+      Token tok = tokens.Dequeue();
+      Debug.Assert(tok.StringValue == "FACTOR");
+      FactorVariableTreeNode t = (FactorVariableTreeNode)(new FactorVariable()).CreateTreeNode(); // create a new symbol each time on purpose
+      var varNameTok = tokens.Dequeue();
+      Debug.Assert(tok.Symbol == TokenSymbol.SYMB);
+      t.VariableName = varNameTok.StringValue;
+
+      var weights = new List<double>();
+      while (tokens.Peek().Symbol == TokenSymbol.NUMBER) {
+        weights.Add(tokens.Dequeue().DoubleValue);
+      }
+
+      t.Weights = weights.ToArray();
+
+      // create a set of (virtual) values to match the number of weights
+      t.Symbol.VariableNames = new string[] { t.VariableName };
+      t.Symbol.VariableValues = new[]
+      { new KeyValuePair<string, Dictionary<string,int>>(
+        t.VariableName,
+        weights.Select((_, i) => Tuple.Create(_,i)).ToDictionary(tup=>"X" + tup.Item2, tup=>tup.Item2)) };
+      return t;
+    }
+
+    private ISymbolicExpressionTreeNode ParseBinaryFactor(Queue<Token> tokens) {
+      Token tok = tokens.Dequeue();
+      Debug.Assert(tok.StringValue == "BINFACTOR");
+      var t = (BinaryFactorVariableTreeNode)binFactorVar.CreateTreeNode();
+      var varNameTok = tokens.Dequeue();
+      Debug.Assert(varNameTok.Symbol == TokenSymbol.SYMB);
+      t.VariableName = varNameTok.StringValue;
+
+      var varValTok = tokens.Dequeue();
+      Debug.Assert(varValTok.Symbol == TokenSymbol.SYMB);
+      t.VariableValue = varValTok.StringValue;
+
+      var weightTok = tokens.Dequeue();
+      Debug.Assert(weightTok.Symbol == TokenSymbol.NUMBER);
+      t.Weight = weightTok.DoubleValue;
+
+      return t;
+    }
+
+
+    private ISymbolicExpressionTreeNode ParseLaggedVariable(Queue<Token> tokens) {
+      Token varTok = tokens.Dequeue();
+      Debug.Assert(varTok.StringValue == "LAGVARIABLE");
+      LaggedVariableTreeNode t = (LaggedVariableTreeNode)laggedVariable.CreateTreeNode();
+      t.Weight = tokens.Dequeue().DoubleValue;
+      t.VariableName = tokens.Dequeue().StringValue;
+      t.Lag = (int)tokens.Dequeue().DoubleValue;
+      return t;
+    }
+
+    private ISymbolicExpressionTreeNode 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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/Token.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/Token.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/Token.cs	(revision 16132)
@@ -0,0 +1,67 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+  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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IModelBacktransformator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IModelBacktransformator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IModelBacktransformator.cs	(revision 16132)
@@ -0,0 +1,29 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface IModelBacktransformator {
+    ISymbolicDataAnalysisModel Backtransform(ISymbolicDataAnalysisModel model, IEnumerable<ITransformation> transformations, string targetVariable);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisAnalyzer.cs	(revision 16132)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Parameters;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisAnalyzer : IAnalyzer {
+    IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+    ILookupParameter<ResultCollection> ResultCollectionParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisBoundedOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisBoundedOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisBoundedOperator.cs	(revision 16132)
@@ -0,0 +1,27 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisBoundedOperator : IOperator {
+    IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisEvaluator.cs	(revision 16132)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+  public interface ISymbolicDataAnalysisEvaluator<T> : IEvaluator
+  where T : class,IDataAnalysisProblemData {
+    ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { get; }
+    IValueLookupParameter<IntRange> EvaluationPartitionParameter { get; }
+    IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter { get; }
+    ILookupParameter<BoolValue> ApplyLinearScalingParameter { get; }
+
+    IValueLookupParameter<T> ProblemDataParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionCrossover.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionCrossover.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionCrossover.cs	(revision 16132)
@@ -0,0 +1,35 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisExpressionCrossover<T> : ISymbolicExpressionTreeCrossover,
+    ISymbolicExpressionTreeSizeConstraintOperator, ISymbolicDataAnalysisInterpreterOperator
+    where T : class, IDataAnalysisProblemData {
+    IValueLookupParameter<T> ProblemDataParameter { get; }
+    ILookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<T>> EvaluatorParameter { get; }
+    IValueLookupParameter<IntRange> EvaluationPartitionParameter { get; }
+    IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionSimilarityCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionSimilarityCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionSimilarityCalculator.cs	(revision 16132)
@@ -0,0 +1,29 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisExpressionSimilarityCalculator : IItem {
+    double CalculateSimilarity(ISymbolicExpressionTree t1, ISymbolicExpressionTree t2);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionTreeInterpreter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 16132)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 ISymbolicDataAnalysisExpressionTreeInterpreter : INamedItem, IStatefulItem {
+    IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows);
+    int EvaluatedSolutions { get; set; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisGrammar.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisGrammar.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisGrammar.cs	(revision 16132)
@@ -0,0 +1,27 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+  public interface ISymbolicDataAnalysisGrammar : ISymbolicExpressionGrammar {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs	(revision 16132)
@@ -0,0 +1,10 @@
+﻿using System.Collections.Generic;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisSolutionImpactValuesCalculator : IItem {
+    void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData,
+      IEnumerable<int> rows, out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation, double qualityForImpactsCalculation = double.NaN);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisInterpreterOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisInterpreterOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisInterpreterOperator.cs	(revision 16132)
@@ -0,0 +1,28 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisInterpreterOperator : IOperator {
+    ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisModel.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisModel.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisModel.cs	(revision 16132)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+  public interface ISymbolicDataAnalysisModel : IDataAnalysisModel {
+    ISymbolicExpressionTree SymbolicExpressionTree { get; }
+    ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get; }
+
+    double LowerEstimationLimit { get; }
+    double UpperEstimationLimit { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisMultiObjectiveAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisMultiObjectiveAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisMultiObjectiveAnalyzer.cs	(revision 16132)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisMultiObjectiveAnalyzer : ISymbolicDataAnalysisAnalyzer {
+    IScopeTreeLookupParameter<DoubleArray> QualitiesParameter { get; }
+    ILookupParameter<BoolArray> MaximizationParameter { get; }
+    ILookupParameter<BoolValue> ApplyLinearScalingParameter { get; }
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisMultiObjectiveEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisMultiObjectiveEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisMultiObjectiveEvaluator.cs	(revision 16132)
@@ -0,0 +1,34 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisMultiObjectiveEvaluator<T> : ISymbolicDataAnalysisEvaluator<T>, IMultiObjectiveEvaluator
+  where T : class,IDataAnalysisProblemData {
+    IEnumerable<bool> Maximization { get; }
+    double[] Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, T problemData, IEnumerable<int> rows);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisProblem.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisProblem.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisProblem.cs	(revision 16132)
@@ -0,0 +1,51 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisProblem : IDataAnalysisProblem, IHeuristicOptimizationProblem {
+    IValueParameter<ISymbolicDataAnalysisGrammar> SymbolicExpressionTreeGrammarParameter { get; }
+    IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter { get; }
+    IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter { get; }
+    IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter { get; }
+    IFixedValueParameter<IntValue> MaximumFunctionDefinitionsParameter { get; }
+    IFixedValueParameter<IntValue> MaximumFunctionArgumentsParameter { get; }
+    IFixedValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter { get; }
+    IFixedValueParameter<IntRange> FitnessCalculationPartitionParameter { get; }
+    IFixedValueParameter<IntRange> ValidationPartitionParameter { get; }
+
+    ISymbolicDataAnalysisGrammar SymbolicExpressionTreeGrammar { get; set; }
+    ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicExpressionTreeInterpreter { get; set; }
+    IntValue MaximumSymbolicExpressionTreeDepth { get; }
+    IntValue MaximumSymbolicExpressionTreeLength { get; }
+    IntValue MaximumFunctionDefinitions { get; }
+    IntValue MaximumFunctionArguments { get; }
+    PercentValue RelativeNumberOfEvaluatedSamples { get; }
+    IntRange FitnessCalculationPartition { get; }
+    IntRange ValidationPartition { get; }
+  }
+
+  public interface ISymbolicDataAnalysisSingleObjectiveProblem : ISymbolicDataAnalysisProblem, ISingleObjectiveHeuristicOptimizationProblem { }
+  public interface ISymbolicDataAnalysisMultiObjectiveProblem : ISymbolicDataAnalysisProblem, IMultiObjectiveHeuristicOptimizationProblem { }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSingleObjectiveAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSingleObjectiveAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSingleObjectiveAnalyzer.cs	(revision 16132)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Parameters;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisSingleObjectiveAnalyzer : ISymbolicDataAnalysisAnalyzer {
+    IScopeTreeLookupParameter<DoubleValue> QualityParameter { get; }
+    ILookupParameter<BoolValue> MaximizationParameter { get; }
+    ILookupParameter<BoolValue> ApplyLinearScalingParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSingleObjectiveEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSingleObjectiveEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSingleObjectiveEvaluator.cs	(revision 16132)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding;
+using System.Collections.Generic;
+using HeuristicLab.Core;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisSingleObjectiveEvaluator<T> : ISymbolicDataAnalysisEvaluator<T>, ISingleObjectiveEvaluator
+    where T : class,IDataAnalysisProblemData {
+    bool Maximization { get; }
+
+    double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, T problemData, IEnumerable<int> rows);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSolution.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSolution.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSolution.cs	(revision 16132)
@@ -0,0 +1,27 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+  public interface ISymbolicDataAnalysisSolution : IDataAnalysisSolution {
+    new ISymbolicDataAnalysisModel Model { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSolutionCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSolutionCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisSolutionCreator.cs	(revision 16132)
@@ -0,0 +1,27 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Optimization;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisSolutionCreator : ISymbolicExpressionTreeCreator, ISolutionCreator {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisValidationAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisValidationAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisValidationAnalyzer.cs	(revision 16132)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Problems.DataAnalysis.Symbolic {
+  public interface ISymbolicDataAnalysisValidationAnalyzer<T, U> : ISymbolicDataAnalysisAnalyzer, ISymbolicDataAnalysisInterpreterOperator
+    where T : class,ISymbolicDataAnalysisEvaluator<U>
+    where U : class, IDataAnalysisProblemData {
+    ILookupParameter<IRandom> RandomParameter { get; }
+    ILookupParameter<U> ProblemDataParameter { get; }
+    ILookupParameter<T> EvaluatorParameter { get; }
+    IValueLookupParameter<IntRange> ValidationPartitionParameter { get; }
+    IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IVariableSymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IVariableSymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IVariableSymbol.cs	(revision 16132)
@@ -0,0 +1,30 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+
+  /// <summary>
+  /// Any symbol that references a variable (includes terminal as well as non-terminal symbols)
+  /// </summary>
+  public interface IVariableSymbol : ISymbol {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IVariableTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IVariableTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IVariableTreeNode.cs	(revision 16132)
@@ -0,0 +1,30 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+  /// <summary>
+  /// Any tree node that references a variable 
+  /// </summary>
+  public interface IVariableTreeNode : ISymbolicExpressionTreeNode {
+    string VariableName { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs	(revision 16132)
@@ -0,0 +1,93 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+  public class InterpreterState {
+    private readonly double[] argumentStack;
+    private int argumentStackPointer;
+    private readonly Instruction[] code;
+
+    public int ProgramCounter { get; set; }
+    public bool InLaggedContext { get; set; }
+
+    public InterpreterState(Instruction[] code, int argumentStackSize) {
+      this.code = code;
+      this.ProgramCounter = 0;
+      this.InLaggedContext = false;
+      if (argumentStackSize > 0) {
+        this.argumentStack = new double[argumentStackSize];
+      }
+      this.argumentStackPointer = 0;
+    }
+
+    public void Reset() {
+      this.ProgramCounter = 0;
+      this.argumentStackPointer = 0;
+      this.InLaggedContext = false;
+    }
+
+    public Instruction NextInstruction() {
+      return code[ProgramCounter++];
+    }
+    // skips a whole branch
+    public void SkipInstructions() {
+      int i = 1;
+      while (i > 0) {
+        i += NextInstruction().nArguments;
+        i--;
+      }
+    }
+
+    private void Push(double val) {
+      argumentStack[argumentStackPointer++] = val;
+    }
+    private double Pop() {
+      return argumentStack[--argumentStackPointer];
+    }
+
+    public void CreateStackFrame(double[] argValues) {
+      // push in reverse order to make indexing easier
+      for (int i = argValues.Length - 1; i >= 0; i--) {
+        argumentStack[argumentStackPointer++] = argValues[i];
+      }
+      Push(argValues.Length);
+    }
+
+    public void RemoveStackFrame() {
+      int size = (int)Pop();
+      argumentStackPointer -= size;
+    }
+
+    public double GetStackFrameValue(ushort index) {
+      // layout of stack:
+      // [0]   <- argumentStackPointer
+      // [StackFrameSize = N + 1]
+      // [Arg0] <- argumentStackPointer - 2 - 0
+      // [Arg1] <- argumentStackPointer - 2 - 1
+      // [...]
+      // [ArgN] <- argumentStackPointer - 2 - N
+      // <Begin of stack frame>
+      return argumentStack[argumentStackPointer - index - 2];
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 16132)
@@ -0,0 +1,146 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public static 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 XOR = 45;
+
+
+    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 Power = 22;
+    public const byte Root = 23;
+    public const byte TimeLag = 24;
+    public const byte Integral = 25;
+    public const byte Derivative = 26;
+
+    public const byte VariableCondition = 27;
+
+    public const byte Square = 28;
+    public const byte SquareRoot = 29;
+    public const byte Gamma = 30;
+    public const byte Psi = 31;
+    public const byte Dawson = 32;
+    public const byte ExponentialIntegralEi = 33;
+    public const byte CosineIntegral = 34;
+    public const byte SineIntegral = 35;
+    public const byte HyperbolicCosineIntegral = 36;
+    public const byte HyperbolicSineIntegral = 37;
+    public const byte FresnelCosineIntegral = 38;
+    public const byte FresnelSineIntegral = 39;
+    public const byte AiryA = 40;
+    public const byte AiryB = 41;
+    public const byte Norm = 42;
+    public const byte Erf = 43;
+    public const byte Bessel = 44;
+    public const byte FactorVariable = 46;
+    public const byte BinaryFactorVariable = 47;
+
+
+    private static 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(Xor),OpCodes.XOR},
+      { typeof(Average), OpCodes.Average},
+      { typeof(InvokeFunction), OpCodes.Call },
+      { typeof(Variable), OpCodes.Variable },
+      { typeof(LaggedVariable), OpCodes.LagVariable },
+      { typeof(AutoregressiveTargetVariable),OpCodes.LagVariable},
+      { typeof(Constant), OpCodes.Constant },
+      { typeof(Argument), OpCodes.Arg },
+      { typeof(Power),OpCodes.Power},
+      { typeof(Root),OpCodes.Root},
+      { typeof(TimeLag), OpCodes.TimeLag}, 
+      { typeof(Integral), OpCodes.Integral},
+      { typeof(Derivative), OpCodes.Derivative},
+      { typeof(VariableCondition),OpCodes.VariableCondition},
+      { typeof(Square),OpCodes.Square},
+      { typeof(SquareRoot),OpCodes.SquareRoot},
+      { typeof(Gamma), OpCodes.Gamma },
+      { typeof(Psi), OpCodes.Psi },
+      { typeof(Dawson), OpCodes.Dawson},
+      { typeof(ExponentialIntegralEi), OpCodes.ExponentialIntegralEi },
+      { typeof(CosineIntegral), OpCodes.CosineIntegral },
+      { typeof(SineIntegral), OpCodes.SineIntegral },
+      { typeof(HyperbolicCosineIntegral), OpCodes.HyperbolicCosineIntegral },
+      { typeof(HyperbolicSineIntegral), OpCodes.HyperbolicSineIntegral },
+      { typeof(FresnelCosineIntegral), OpCodes.FresnelCosineIntegral },
+      { typeof(FresnelSineIntegral), OpCodes.FresnelSineIntegral },
+      { typeof(AiryA), OpCodes.AiryA },
+      { typeof(AiryB), OpCodes.AiryB },
+      { typeof(Norm), OpCodes.Norm},
+      { typeof(Erf), OpCodes.Erf},
+      { typeof(Bessel), OpCodes.Bessel},
+      { typeof(FactorVariable), OpCodes.FactorVariable },
+      { typeof(BinaryFactorVariable), OpCodes.BinaryFactorVariable }
+    };
+
+    public static byte MapSymbolToOpCode(ISymbolicExpressionTreeNode treeNode) {
+      byte opCode;
+      if (symbolToOpcode.TryGetValue(treeNode.Symbol.GetType(), out opCode)) return opCode;
+      else throw new NotSupportedException("Symbol: " + treeNode.Symbol);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 16132)
@@ -0,0 +1,641 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Linq.Expressions;
+using System.Reflection;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionCompiledTreeInterpreter", "Interpreter that converts the tree into a Linq.Expression then compiles it.")]
+  public sealed class SymbolicDataAnalysisExpressionCompiledTreeInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
+    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string CheckExpressionsWithIntervalArithmeticParameterDescription = "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.";
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
+
+    #region method info for the commonly called functions
+    private static readonly MethodInfo Sin = typeof(Math).GetMethod("Sin", new[] { typeof(double) });
+    private static readonly MethodInfo Cos = typeof(Math).GetMethod("Cos", new[] { typeof(double) });
+    private static readonly MethodInfo Tan = typeof(Math).GetMethod("Tan", new[] { typeof(double) });
+    private static readonly MethodInfo Sqrt = typeof(Math).GetMethod("Sqrt", new[] { typeof(double) });
+    private static readonly MethodInfo Floor = typeof(Math).GetMethod("Floor", new[] { typeof(double) });
+    private static readonly MethodInfo Round = typeof(Math).GetMethod("Round", new[] { typeof(double) });
+    private static readonly MethodInfo Exp = typeof(Math).GetMethod("Exp", new[] { typeof(double) });
+    private static readonly MethodInfo Log = typeof(Math).GetMethod("Log", new[] { typeof(double) });
+    private static readonly MethodInfo IsNaN = typeof(double).GetMethod("IsNaN");
+    private static readonly MethodInfo IsAlmost = typeof(DoubleExtensions).GetMethod("IsAlmost");
+    private static readonly MethodInfo Gamma = typeof(alglib).GetMethod("gammafunction", new[] { typeof(double) });
+    private static readonly MethodInfo Psi = typeof(alglib).GetMethod("psi", new[] { typeof(double) });
+    private static readonly MethodInfo DawsonIntegral = typeof(alglib).GetMethod("dawsonintegral", new[] { typeof(double) });
+    private static readonly MethodInfo ExponentialIntegralEi = typeof(alglib).GetMethod("exponentialintegralei", new[] { typeof(double) });
+    private static readonly MethodInfo SineCosineIntegrals = typeof(alglib).GetMethod("sinecosineintegrals", new[] { typeof(double), typeof(double).MakeByRefType(), typeof(double).MakeByRefType() });
+    private static readonly MethodInfo HyperbolicSineCosineIntegrals = typeof(alglib).GetMethod("hyperbolicsinecosineintegrals", new[] { typeof(double), typeof(double).MakeByRefType(), typeof(double).MakeByRefType() });
+    private static readonly MethodInfo FresnelIntegral = typeof(alglib).GetMethod("fresnelintegral", new[] { typeof(double), typeof(double).MakeByRefType(), typeof(double).MakeByRefType() });
+    private static readonly MethodInfo Airy = typeof(alglib).GetMethod("airy", new[] { typeof(double), typeof(double).MakeByRefType(), typeof(double).MakeByRefType(), typeof(double).MakeByRefType(), typeof(double).MakeByRefType() });
+    private static readonly MethodInfo NormalDistribution = typeof(alglib).GetMethod("normaldistribution", new[] { typeof(double) });
+    private static readonly MethodInfo ErrorFunction = typeof(alglib).GetMethod("errorfunction", new[] { typeof(double) });
+    private static readonly MethodInfo Bessel = typeof(alglib).GetMethod("besseli0", new[] { typeof(double) });
+    #endregion
+
+    public override bool CanChangeName { get { return false; } }
+    public override bool CanChangeDescription { get { return false; } }
+
+    #region parameter properties
+    public IFixedValueParameter<BoolValue> CheckExpressionsWithIntervalArithmeticParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; }
+    }
+
+    public IFixedValueParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public bool CheckExpressionsWithIntervalArithmetic {
+      get { return CheckExpressionsWithIntervalArithmeticParameter.Value.Value; }
+      set { CheckExpressionsWithIntervalArithmeticParameter.Value.Value = value; }
+    }
+    public int EvaluatedSolutions {
+      get { return EvaluatedSolutionsParameter.Value.Value; }
+      set { EvaluatedSolutionsParameter.Value.Value = value; }
+    }
+    #endregion
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionCompiledTreeInterpreter(this, cloner);
+    }
+
+    private SymbolicDataAnalysisExpressionCompiledTreeInterpreter(SymbolicDataAnalysisExpressionCompiledTreeInterpreter original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionCompiledTreeInterpreter(bool deserializing)
+      : base(deserializing) {
+    }
+
+    public SymbolicDataAnalysisExpressionCompiledTreeInterpreter() :
+      base("SymbolicDataAnalysisExpressionCompiledTreeInterpreter", "Interpreter which compiles the tree into a lambda") {
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    public SymbolicDataAnalysisExpressionCompiledTreeInterpreter(string name, string description) :
+      base(name, description) {
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    public void InitializeState() {
+      EvaluatedSolutions = 0;
+    }
+
+    public void ClearState() { }
+
+    private readonly object syncRoot = new object();
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
+      if (CheckExpressionsWithIntervalArithmetic)
+        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
+
+      lock (syncRoot) {
+        EvaluatedSolutions++; // increment the evaluated solutions counter
+      }
+      var columns = dataset.DoubleVariables.Select(x => (IList<double>)dataset.GetReadOnlyDoubleValues(x)).ToArray();
+      var compiled = CompileTree(tree, dataset);
+      return rows.Select(x => compiled(x, columns));
+    }
+
+    public static Func<int, IList<double>[], double> CompileTree(ISymbolicExpressionTree tree, IDataset dataset) {
+      var lambda = CreateDelegate(tree, dataset);
+      return lambda.Compile();
+    }
+
+    public static Expression<Func<int, IList<double>[], double>> CreateDelegate(ISymbolicExpressionTree tree, IDataset dataset) {
+      var row = Expression.Parameter(typeof(int));
+      var columns = Expression.Parameter(typeof(IList<double>[]));
+      var variableIndices = dataset.DoubleVariables.Select((x, i) => new { x, i }).ToDictionary(e => e.x, e => e.i);
+      var expr = MakeExpr(tree, variableIndices, row, columns);
+      var lambda = Expression.Lambda<Func<int, IList<double>[], double>>(expr, row, columns);
+      return lambda;
+    }
+
+    private static Expression MakeExpr(ISymbolicExpressionTree tree, Dictionary<string, int> variableIndices, Expression row, Expression columns) {
+      var actualRoot = tree.Root.GetSubtree(0).GetSubtree(0);
+      return MakeExpr(actualRoot, variableIndices, row, columns);
+    }
+
+    private static readonly PropertyInfo Indexer = typeof(IList<double>).GetProperty("Item");
+    private static Expression MakeExpr(ISymbolicExpressionTreeNode node, Dictionary<string, int> variableIndices, Expression row, Expression columns) {
+      var opcode = OpCodes.MapSymbolToOpCode(node);
+      #region switch opcode
+      switch (opcode) {
+        case OpCodes.Constant: {
+            var constantTreeNode = (ConstantTreeNode)node;
+            return Expression.Constant(constantTreeNode.Value);
+          }
+        case OpCodes.Variable: {
+            var variableTreeNode = (VariableTreeNode)node;
+            var variableWeight = Expression.Constant(variableTreeNode.Weight);
+            var variableName = variableTreeNode.VariableName;
+            var indexExpr = Expression.Constant(variableIndices[variableName]);
+            var valuesExpr = Expression.ArrayIndex(columns, indexExpr);
+            return Expression.Multiply(variableWeight, Expression.Property(valuesExpr, Indexer, row));
+          }
+        case OpCodes.Add: {
+            Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            for (int i = 1; i < node.SubtreeCount; ++i) {
+              result = Expression.Add(result, MakeExpr(node.GetSubtree(i), variableIndices, row, columns));
+            }
+            return result;
+          }
+        case OpCodes.Sub: {
+            Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            if (node.SubtreeCount == 1)
+              return Expression.Negate(result);
+            for (int i = 1; i < node.SubtreeCount; ++i) {
+              result = Expression.Subtract(result, MakeExpr(node.GetSubtree(i), variableIndices, row, columns));
+            }
+            return result;
+          }
+        case OpCodes.Mul: {
+            Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            for (int i = 1; i < node.SubtreeCount; ++i) {
+              result = Expression.Multiply(result, MakeExpr(node.GetSubtree(i), variableIndices, row, columns));
+            }
+            return result;
+          }
+        case OpCodes.Div: {
+            Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            if (node.SubtreeCount == 1)
+              return Expression.Divide(Expression.Constant(1.0), result);
+            for (int i = 1; i < node.SubtreeCount; ++i) {
+              result = Expression.Divide(result, MakeExpr(node.GetSubtree(i), variableIndices, row, columns));
+            }
+            return result;
+          }
+        case OpCodes.Average: {
+            Expression result = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            for (int i = 1; i < node.SubtreeCount; ++i) {
+              result = Expression.Add(result, MakeExpr(node.GetSubtree(i), variableIndices, row, columns));
+            }
+            return Expression.Divide(result, Expression.Constant((double)node.SubtreeCount));
+          }
+        case OpCodes.Cos: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            return Expression.Call(Cos, arg);
+          }
+        case OpCodes.Sin: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            return Expression.Call(Sin, arg);
+          }
+        case OpCodes.Tan: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            return Expression.Call(Tan, arg);
+          }
+        case OpCodes.Square: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            return Expression.Power(arg, Expression.Constant(2.0));
+          }
+        case OpCodes.Power: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var power = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
+            return Expression.Power(arg, Expression.Call(Round, power));
+          }
+        case OpCodes.SquareRoot: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            return Expression.Call(Sqrt, arg);
+          }
+        case OpCodes.Root: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var power = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
+            return Expression.Power(arg, Expression.Divide(Expression.Constant(1.0), Expression.Call(Round, power)));
+          }
+        case OpCodes.Exp: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            return Expression.Call(Exp, arg);
+          }
+        case OpCodes.Log: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            return Expression.Call(Log, arg);
+          }
+        case OpCodes.Gamma: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(
+              new[] { result },
+              Expression.IfThenElse(
+                isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, Expression.Call(Gamma, arg))
+                ),
+              result
+              );
+            return expr;
+          }
+        case OpCodes.Psi: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+
+            var result = Expression.Variable(typeof(double));
+            var floor = Expression.Call(Floor, arg);
+            var expr = Expression.Block(
+              new[] { result },
+              Expression.IfThenElse(
+                isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.IfThenElse(
+                  Expression.AndAlso(
+                    Expression.LessThanOrEqual(arg, Expression.Constant(0.0)),
+                    Expression.Call(IsAlmost, Expression.Subtract(floor, arg), Expression.Constant(0.0))),
+                  Expression.Assign(result, Expression.Constant(double.NaN)),
+                  Expression.Assign(result, Expression.Call(Psi, arg)))
+                ),
+              result);
+
+            return expr;
+          }
+        case OpCodes.Dawson: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(
+              new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, Expression.Call(DawsonIntegral, arg))),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.ExponentialIntegralEi: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(
+              new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, Expression.Call(ExponentialIntegralEi, arg))),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.SineIntegral: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var si = Expression.Variable(typeof(double));
+            var ci = Expression.Variable(typeof(double));
+            var block = Expression.Block(
+              new[] { si, ci },
+              Expression.Call(SineCosineIntegrals, arg, si, ci),
+              si
+              );
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, block)),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.CosineIntegral: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var si = Expression.Variable(typeof(double));
+            var ci = Expression.Variable(typeof(double));
+            var block = Expression.Block(
+              new[] { si, ci },
+              Expression.Call(SineCosineIntegrals, arg, si, ci),
+              ci
+              );
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, block)),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.HyperbolicSineIntegral: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var shi = Expression.Variable(typeof(double));
+            var chi = Expression.Variable(typeof(double));
+            var block = Expression.Block(
+              new[] { shi, chi },
+              Expression.Call(HyperbolicSineCosineIntegrals, arg, shi, chi),
+              shi
+              );
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, block)),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.HyperbolicCosineIntegral: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var shi = Expression.Variable(typeof(double));
+            var chi = Expression.Variable(typeof(double));
+            var block = Expression.Block(
+              new[] { shi, chi },
+              Expression.Call(HyperbolicSineCosineIntegrals, arg, shi, chi),
+              chi
+              );
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, block)),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.FresnelSineIntegral: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var s = Expression.Variable(typeof(double));
+            var c = Expression.Variable(typeof(double));
+            var block = Expression.Block(new[] { s, c }, Expression.Call(FresnelIntegral, arg, c, s), s);
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, block)),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.FresnelCosineIntegral: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var s = Expression.Variable(typeof(double));
+            var c = Expression.Variable(typeof(double));
+            var block = Expression.Block(new[] { s, c }, Expression.Call(FresnelIntegral, arg, c, s), c);
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, block)),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.AiryA: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var ai = Expression.Variable(typeof(double));
+            var aip = Expression.Variable(typeof(double));
+            var bi = Expression.Variable(typeof(double));
+            var bip = Expression.Variable(typeof(double));
+            var block = Expression.Block(new[] { ai, aip, bi, bip }, Expression.Call(Airy, arg, ai, aip, bi, bip), ai);
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, block)),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.AiryB: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var ai = Expression.Variable(typeof(double));
+            var aip = Expression.Variable(typeof(double));
+            var bi = Expression.Variable(typeof(double));
+            var bip = Expression.Variable(typeof(double));
+            var block = Expression.Block(new[] { ai, aip, bi, bip }, Expression.Call(Airy, arg, ai, aip, bi, bip), bi);
+            var result = Expression.Variable(typeof(double));
+            var expr = Expression.Block(new[] { result },
+              Expression.IfThenElse(isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, block)),
+              result
+              );
+
+            return expr;
+          }
+        case OpCodes.Norm: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var result = Expression.Variable(typeof(double));
+            return Expression.Block(
+              new[] { result },
+              Expression.IfThenElse(
+                Expression.Call(IsNaN, arg),
+                Expression.Assign(result, arg),
+                Expression.Assign(result, Expression.Call(NormalDistribution, arg))),
+              result);
+          }
+        case OpCodes.Erf: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var result = Expression.Variable(typeof(double));
+            return Expression.Block(
+              new[] { result },
+              Expression.IfThenElse(
+                isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, Expression.Call(ErrorFunction, arg))),
+              result);
+          }
+        case OpCodes.Bessel: {
+            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var isNaN = Expression.Call(IsNaN, arg);
+            var result = Expression.Variable(typeof(double));
+            return Expression.Block(
+              new[] { result },
+              Expression.IfThenElse(
+                isNaN,
+                Expression.Assign(result, Expression.Constant(double.NaN)),
+                Expression.Assign(result, Expression.Call(Bessel, arg))),
+              result);
+          }
+        case OpCodes.IfThenElse: {
+            var test = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var result = Expression.Variable(typeof(double));
+            var condition = Expression.IfThenElse(Expression.GreaterThan(test, Expression.Constant(0.0)),
+              Expression.Assign(result, MakeExpr(node.GetSubtree(1), variableIndices, row, columns)),
+              Expression.Assign(result, MakeExpr(node.GetSubtree(2), variableIndices, row, columns)));
+            return Expression.Block(new[] { result }, condition, result);
+          }
+        case OpCodes.AND: {
+            var result = Expression.Variable(typeof(double));
+            var expr = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+
+            for (int i = 1; i < node.SubtreeCount; ++i) {
+              expr = Expression.Block(new[] { result },
+                Expression.IfThenElse(
+                  Expression.GreaterThan(expr, Expression.Constant(0.0)),
+                  Expression.Assign(result, MakeExpr(node.GetSubtree(i), variableIndices, row, columns)),
+                  Expression.Assign(result, expr)),
+                result
+                );
+            }
+
+            return Expression.Block(
+              new[] { result },
+              Expression.Assign(result, expr),
+              Expression.IfThenElse(
+                Expression.GreaterThan(result, Expression.Constant(0.0)),
+                Expression.Assign(result, Expression.Constant(1.0)),
+                Expression.Assign(result, Expression.Constant(-1.0))
+                ),
+              result
+              );
+          }
+        case OpCodes.OR: {
+            var result = Expression.Variable(typeof(double));
+            var expr = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+
+            for (int i = 1; i < node.SubtreeCount; ++i) {
+              expr = Expression.Block(new[] { result },
+                Expression.IfThenElse(
+                  Expression.LessThanOrEqual(expr, Expression.Constant(0.0)),
+                  Expression.Assign(result, MakeExpr(node.GetSubtree(i), variableIndices, row, columns)),
+                  Expression.Assign(result, expr)),
+                result
+                );
+            }
+
+            return Expression.Block(
+              new[] { result },
+              Expression.Assign(result, expr),
+              Expression.IfThenElse(
+                Expression.GreaterThan(result, Expression.Constant(0.0)),
+                Expression.Assign(result, Expression.Constant(1.0)),
+                Expression.Assign(result, Expression.Constant(-1.0))
+                ),
+              result
+              );
+          }
+        case OpCodes.NOT: {
+            var value = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var result = Expression.Variable(typeof(double));
+            var condition = Expression.IfThenElse(Expression.GreaterThan(value, Expression.Constant(0.0)),
+              Expression.Assign(result, Expression.Constant(-1.0)),
+              Expression.Assign(result, Expression.Constant(1.0)));
+            return Expression.Block(new[] { result }, condition, result);
+          }
+        case OpCodes.XOR: {
+            var ps = Expression.Variable(typeof(int));
+            var block = Expression.Block(
+              new[] { ps },
+              Expression.Assign(ps, Expression.Constant(0)),
+              ps
+              );
+
+            foreach (var subtree in node.Subtrees) {
+              var expr = MakeExpr(subtree, variableIndices, row, columns);
+              block = Expression.Block(
+                new[] { ps },
+                Expression.Assign(ps, block),
+                Expression.IfThen(Expression.GreaterThan(expr, Expression.Constant(0.0)),
+                  Expression.PostIncrementAssign(ps)),
+                ps
+                );
+            }
+
+            var result = Expression.Variable(typeof(double));
+            var xorExpr = Expression.Block(
+              new[] { result },
+              Expression.IfThenElse(
+                Expression.Equal(Expression.Modulo(block, Expression.Constant(2)), Expression.Constant(0)),
+                Expression.Assign(result, Expression.Constant(-1.0)),
+                Expression.Assign(result, Expression.Constant(1.0))
+                ),
+              result
+              );
+            return xorExpr;
+          }
+        case OpCodes.GT: {
+            var left = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var right = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
+            var result = Expression.Variable(typeof(double));
+
+            var condition = Expression.IfThenElse(Expression.GreaterThan(left, right),
+              Expression.Assign(result, Expression.Constant(1.0)), Expression.Assign(result, Expression.Constant(-1.0)));
+            return Expression.Block(
+              new[] { result },
+              condition,
+              result);
+          }
+        case OpCodes.LT: {
+            var left = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var right = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
+            var result = Expression.Variable(typeof(double));
+
+            var condition = Expression.IfThenElse(Expression.LessThan(left, right),
+              Expression.Assign(result, Expression.Constant(1.0)), Expression.Assign(result, Expression.Constant(-1.0)));
+            return Expression.Block(new[] { result }, condition, result);
+          }
+        case OpCodes.VariableCondition: {
+            var variableConditionTreeNode = (VariableConditionTreeNode)node;
+            if (variableConditionTreeNode.Symbol.IgnoreSlope) throw new NotSupportedException("Strict variable conditionals are not supported");
+            var variableName = variableConditionTreeNode.VariableName;
+            var indexExpr = Expression.Constant(variableIndices[variableName]);
+            var valuesExpr = Expression.ArrayIndex(columns, indexExpr);
+            var variableValue = Expression.Property(valuesExpr, Indexer, row);
+            var variableThreshold = Expression.Constant(variableConditionTreeNode.Threshold);
+            var variableSlope = Expression.Constant(variableConditionTreeNode.Slope);
+
+            var x = Expression.Subtract(variableValue, variableThreshold);
+            var xSlope = Expression.Multiply(Expression.Negate(variableSlope), x);
+            var xSlopeExp = Expression.Call(Exp, xSlope);
+            var p = Expression.Divide(Expression.Constant(1), Expression.Add(Expression.Constant(1), xSlopeExp));
+            var trueBranch = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
+            var falseBranch = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
+            return Expression.Add(
+              Expression.Multiply(trueBranch, p),
+              Expression.Multiply(falseBranch, Expression.Subtract(Expression.Constant(1), p))
+              );
+          }
+        default:
+          throw new NotSupportedException("Unsupported symbol: " + node.Symbol);
+      }
+      #endregion
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 16132)
@@ -0,0 +1,772 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Reflection;
+using System.Reflection.Emit;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionTreeILEmittingInterpreter", "Interpreter for symbolic expression trees.")]
+  public sealed class SymbolicDataAnalysisExpressionTreeILEmittingInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
+    private static readonly Type thisType = typeof(SymbolicDataAnalysisExpressionTreeILEmittingInterpreter);
+    internal delegate double CompiledFunction(int sampleIndex, IList<double>[] columns);
+
+    #region method infos
+    private static MethodInfo listGetValue = typeof(IList<double>).GetProperty("Item", new Type[] { typeof(int) }).GetGetMethod();
+
+    private static MethodInfo cos = typeof(Math).GetMethod("Cos", new Type[] { typeof(double) });
+    private static MethodInfo sin = typeof(Math).GetMethod("Sin", new Type[] { typeof(double) });
+    private static MethodInfo tan = typeof(Math).GetMethod("Tan", new Type[] { typeof(double) });
+    private static MethodInfo exp = typeof(Math).GetMethod("Exp", new Type[] { typeof(double) });
+    private static MethodInfo log = typeof(Math).GetMethod("Log", new Type[] { typeof(double) });
+    private static MethodInfo power = typeof(Math).GetMethod("Pow", new Type[] { typeof(double), typeof(double) });
+    private static MethodInfo round = typeof(Math).GetMethod("Round", new Type[] { typeof(double) });
+    private static MethodInfo sqrt = typeof(Math).GetMethod("Sqrt", new Type[] { typeof(double) });
+
+    private static MethodInfo airyA = thisType.GetMethod("AiryA", new Type[] { typeof(double) });
+    private static MethodInfo airyB = thisType.GetMethod("AiryB", new Type[] { typeof(double) });
+    private static MethodInfo gamma = thisType.GetMethod("Gamma", new Type[] { typeof(double) });
+    private static MethodInfo psi = thisType.GetMethod("Psi", new Type[] { typeof(double) });
+    private static MethodInfo dawson = thisType.GetMethod("Dawson", new Type[] { typeof(double) });
+    private static MethodInfo expIntegralEi = thisType.GetMethod("ExpIntegralEi", new Type[] { typeof(double) });
+    private static MethodInfo sinIntegral = thisType.GetMethod("SinIntegral", new Type[] { typeof(double) });
+    private static MethodInfo cosIntegral = thisType.GetMethod("CosIntegral", new Type[] { typeof(double) });
+    private static MethodInfo hypSinIntegral = thisType.GetMethod("HypSinIntegral", new Type[] { typeof(double) });
+    private static MethodInfo hypCosIntegral = thisType.GetMethod("HypCosIntegral", new Type[] { typeof(double) });
+    private static MethodInfo fresnelCosIntegral = thisType.GetMethod("FresnelCosIntegral", new Type[] { typeof(double) });
+    private static MethodInfo fresnelSinIntegral = thisType.GetMethod("FresnelSinIntegral", new Type[] { typeof(double) });
+    private static MethodInfo norm = thisType.GetMethod("Norm", new Type[] { typeof(double) });
+    private static MethodInfo erf = thisType.GetMethod("Erf", new Type[] { typeof(double) });
+    private static MethodInfo bessel = thisType.GetMethod("Bessel", new Type[] { typeof(double) });
+    private static MethodInfo string_eq = typeof(string).GetMethod("Equals", new Type[] { typeof(string) });
+    #endregion
+
+    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string CheckExpressionsWithIntervalArithmeticParameterDescription = "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.";
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    #region parameter properties
+    public IFixedValueParameter<BoolValue> CheckExpressionsWithIntervalArithmeticParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; }
+    }
+
+    public IFixedValueParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public bool CheckExpressionsWithIntervalArithmetic {
+      get { return CheckExpressionsWithIntervalArithmeticParameter.Value.Value; }
+      set { CheckExpressionsWithIntervalArithmeticParameter.Value.Value = value; }
+    }
+    public int EvaluatedSolutions {
+      get { return EvaluatedSolutionsParameter.Value.Value; }
+      set { EvaluatedSolutionsParameter.Value.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(bool deserializing) : base(deserializing) { }
+
+    private SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(SymbolicDataAnalysisExpressionTreeILEmittingInterpreter original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(this, cloner);
+    }
+
+    public SymbolicDataAnalysisExpressionTreeILEmittingInterpreter()
+      : base("SymbolicDataAnalysisExpressionTreeILEmittingInterpreter", "Interpreter for symbolic expression trees.") {
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
+        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    public SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(string name, string description)
+      : base(name, description) {
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName,
+        "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      var evaluatedSolutions = new IntValue(0);
+      var checkExpressionsWithIntervalArithmetic = new BoolValue(false);
+      if (Parameters.ContainsKey(EvaluatedSolutionsParameterName)) {
+        var evaluatedSolutionsParameter = (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName];
+        evaluatedSolutions = evaluatedSolutionsParameter.Value;
+        Parameters.Remove(EvaluatedSolutionsParameterName);
+      }
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", evaluatedSolutions));
+      if (Parameters.ContainsKey(CheckExpressionsWithIntervalArithmeticParameterName)) {
+        var checkExpressionsWithIntervalArithmeticParameter = (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName];
+        Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
+        checkExpressionsWithIntervalArithmetic = checkExpressionsWithIntervalArithmeticParameter.Value;
+      }
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, checkExpressionsWithIntervalArithmetic));
+    }
+
+    #region IStatefulItem
+    public void InitializeState() {
+      EvaluatedSolutions = 0;
+    }
+
+    public void ClearState() {
+    }
+    #endregion
+
+    private readonly object syncRoot = new object();
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
+      if (CheckExpressionsWithIntervalArithmetic)
+        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
+
+      lock (syncRoot) {
+        EvaluatedSolutions++; // increment the evaluated solutions counter
+      }
+      var state = PrepareInterpreterState(tree, dataset);
+
+      Type[] methodArgs = { typeof(int), typeof(IList<double>[]) };
+      DynamicMethod testFun = new DynamicMethod("TestFun", typeof(double), methodArgs, typeof(SymbolicDataAnalysisExpressionTreeILEmittingInterpreter).Module);
+
+      ILGenerator il = testFun.GetILGenerator();
+      CompileInstructions(il, state, dataset);
+      il.Emit(System.Reflection.Emit.OpCodes.Conv_R8);
+      il.Emit(System.Reflection.Emit.OpCodes.Ret);
+      var function = (CompiledFunction)testFun.CreateDelegate(typeof(CompiledFunction));
+
+      IList<double>[] columns = dataset.DoubleVariables.Select(v => dataset.GetReadOnlyDoubleValues(v)).ToArray();
+
+      foreach (var row in rows) {
+        yield return function(row, columns);
+      }
+    }
+
+    private InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, IDataset dataset) {
+      Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
+      Dictionary<string, int> doubleVariableNames = dataset.DoubleVariables.Select((x, i) => new { x, i }).ToDictionary(e => e.x, e => e.i);
+      int necessaryArgStackSize = 0;
+      foreach (Instruction instr in code) {
+        if (instr.opCode == OpCodes.Variable) {
+          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
+          instr.data = doubleVariableNames[variableTreeNode.VariableName];
+        } else if (instr.opCode == OpCodes.LagVariable) {
+          var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
+          instr.data = doubleVariableNames[laggedVariableTreeNode.VariableName];
+        } else if (instr.opCode == OpCodes.VariableCondition) {
+          var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
+          instr.data = doubleVariableNames[variableConditionTreeNode.VariableName];
+        } else if (instr.opCode == OpCodes.Call) {
+          necessaryArgStackSize += instr.nArguments + 1;
+        }
+      }
+      return new InterpreterState(code, necessaryArgStackSize);
+    }
+
+    private void CompileInstructions(ILGenerator il, InterpreterState state, IDataset ds) {
+      Instruction currentInstr = state.NextInstruction();
+      int nArgs = currentInstr.nArguments;
+
+      switch (currentInstr.opCode) {
+        case OpCodes.Add: {
+            if (nArgs > 0) {
+              CompileInstructions(il, state, ds);
+            }
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Add);
+            }
+            return;
+          }
+        case OpCodes.Sub: {
+            if (nArgs == 1) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Neg);
+              return;
+            }
+            if (nArgs > 0) {
+              CompileInstructions(il, state, ds);
+            }
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            }
+            return;
+          }
+        case OpCodes.Mul: {
+            if (nArgs > 0) {
+              CompileInstructions(il, state, ds);
+            }
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            }
+            return;
+          }
+        case OpCodes.Div: {
+            if (nArgs == 1) {
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0);
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Div);
+              return;
+            }
+            if (nArgs > 0) {
+              CompileInstructions(il, state, ds);
+            }
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Div);
+            }
+            return;
+          }
+        case OpCodes.Average: {
+            CompileInstructions(il, state, ds);
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Add);
+            }
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, (double)nArgs);
+            il.Emit(System.Reflection.Emit.OpCodes.Div);
+            return;
+          }
+        case OpCodes.Cos: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, cos);
+            return;
+          }
+        case OpCodes.Sin: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, sin);
+            return;
+          }
+        case OpCodes.Tan: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, tan);
+            return;
+          }
+        case OpCodes.Power: {
+            CompileInstructions(il, state, ds);
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, round);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, power);
+            return;
+          }
+        case OpCodes.Root: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1 / round(...)
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, round);
+            il.Emit(System.Reflection.Emit.OpCodes.Div);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, power);
+            return;
+          }
+        case OpCodes.Exp: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, exp);
+            return;
+          }
+        case OpCodes.Log: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, log);
+            return;
+          }
+        case OpCodes.Square: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, power);
+            return;
+          }
+        case OpCodes.SquareRoot: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, sqrt);
+            return;
+          }
+        case OpCodes.AiryA: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, airyA);
+            return;
+          }
+        case OpCodes.AiryB: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, airyB);
+            return;
+          }
+        case OpCodes.Bessel: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, bessel);
+            return;
+          }
+        case OpCodes.CosineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, cosIntegral);
+            return;
+          }
+        case OpCodes.Dawson: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, dawson);
+            return;
+          }
+        case OpCodes.Erf: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, erf);
+            return;
+          }
+        case OpCodes.ExponentialIntegralEi: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, expIntegralEi);
+            return;
+          }
+        case OpCodes.FresnelCosineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, fresnelCosIntegral);
+            return;
+          }
+        case OpCodes.FresnelSineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, fresnelSinIntegral);
+            return;
+          }
+        case OpCodes.Gamma: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, gamma);
+            return;
+          }
+        case OpCodes.HyperbolicCosineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, hypCosIntegral);
+            return;
+          }
+        case OpCodes.HyperbolicSineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, hypSinIntegral);
+            return;
+          }
+        case OpCodes.Norm: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, norm);
+            return;
+          }
+        case OpCodes.Psi: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, psi);
+            return;
+          }
+        case OpCodes.SineIntegral: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, sinIntegral);
+            return;
+          }
+        case OpCodes.IfThenElse: {
+            Label end = il.DefineLabel();
+            Label c1 = il.DefineLabel();
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+            il.Emit(System.Reflection.Emit.OpCodes.Brfalse, c1);
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Br, end);
+            il.MarkLabel(c1);
+            CompileInstructions(il, state, ds);
+            il.MarkLabel(end);
+            return;
+          }
+        case OpCodes.AND: {
+            Label falseBranch = il.DefineLabel();
+            Label end = il.DefineLabel();
+            CompileInstructions(il, state, ds);
+            for (int i = 1; i < nArgs; i++) {
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+              il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+              il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
+              CompileInstructions(il, state, ds);
+            }
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+            il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1
+            il.Emit(System.Reflection.Emit.OpCodes.Br, end);
+            il.MarkLabel(falseBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // -1
+            il.Emit(System.Reflection.Emit.OpCodes.Neg);
+            il.MarkLabel(end);
+            return;
+          }
+        case OpCodes.OR: {
+            Label trueBranch = il.DefineLabel();
+            Label end = il.DefineLabel();
+            Label resultBranch = il.DefineLabel();
+            CompileInstructions(il, state, ds);
+            for (int i = 1; i < nArgs; i++) {
+              Label nextArgBranch = il.DefineLabel();
+              // complex definition because of special properties of NaN  
+              il.Emit(System.Reflection.Emit.OpCodes.Dup);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // <= 0        
+              il.Emit(System.Reflection.Emit.OpCodes.Ble, nextArgBranch);
+              il.Emit(System.Reflection.Emit.OpCodes.Br, resultBranch);
+              il.MarkLabel(nextArgBranch);
+              il.Emit(System.Reflection.Emit.OpCodes.Pop);
+              CompileInstructions(il, state, ds);
+            }
+            il.MarkLabel(resultBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+            il.Emit(System.Reflection.Emit.OpCodes.Brtrue, trueBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // -1
+            il.Emit(System.Reflection.Emit.OpCodes.Neg);
+            il.Emit(System.Reflection.Emit.OpCodes.Br, end);
+            il.MarkLabel(trueBranch);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // 1
+            il.MarkLabel(end);
+            return;
+          }
+        case OpCodes.NOT: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
+            il.Emit(System.Reflection.Emit.OpCodes.Conv_R8); // convert to float64
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            il.Emit(System.Reflection.Emit.OpCodes.Neg); // * -1
+            return;
+          }
+        case OpCodes.XOR: {
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt);// > 0
+
+            for (int i = 1; i < nArgs; i++) {
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
+              il.Emit(System.Reflection.Emit.OpCodes.Cgt);// > 0
+              il.Emit(System.Reflection.Emit.OpCodes.Xor);
+            }
+            il.Emit(System.Reflection.Emit.OpCodes.Conv_R8); // convert to float64
+
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            return;
+          }
+        case OpCodes.GT: {
+            CompileInstructions(il, state, ds);
+            CompileInstructions(il, state, ds);
+
+            il.Emit(System.Reflection.Emit.OpCodes.Cgt); // 1 (>) / 0 (otherwise)
+            il.Emit(System.Reflection.Emit.OpCodes.Conv_R8); // convert to float64
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            return;
+          }
+        case OpCodes.LT: {
+            CompileInstructions(il, state, ds);
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Clt);
+            il.Emit(System.Reflection.Emit.OpCodes.Conv_R8); // convert to float64
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // * 2
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 1.0); // - 1
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            return;
+          }
+        case OpCodes.TimeLag: {
+            LaggedTreeNode laggedTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -= lag
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, laggedTreeNode.Lag);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            var prevLaggedContext = state.InLaggedContext;
+            state.InLaggedContext = true;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row += lag
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, laggedTreeNode.Lag);
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.InLaggedContext = prevLaggedContext;
+            return;
+          }
+        case OpCodes.Integral: {
+            int savedPc = state.ProgramCounter;
+            LaggedTreeNode laggedTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -= lag
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, laggedTreeNode.Lag);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            var prevLaggedContext = state.InLaggedContext;
+            state.InLaggedContext = true;
+            CompileInstructions(il, state, ds);
+            for (int l = laggedTreeNode.Lag; l < 0; l++) {
+              il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row += lag
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_1);
+              il.Emit(System.Reflection.Emit.OpCodes.Add);
+              il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+              state.ProgramCounter = savedPc;
+              CompileInstructions(il, state, ds);
+              il.Emit(System.Reflection.Emit.OpCodes.Add);
+            }
+            state.InLaggedContext = prevLaggedContext;
+            return;
+          }
+
+        //mkommend: derivate calculation taken from: 
+        //http://www.holoborodko.com/pavel/numerical-methods/numerical-derivative/smooth-low-noise-differentiators/
+        //one sided smooth differentiatior, N = 4
+        // y' = 1/8h (f_i + 2f_i-1, -2 f_i-3 - f_i-4)
+        case OpCodes.Derivative: {
+            int savedPc = state.ProgramCounter;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row --
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_M1);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.ProgramCounter = savedPc;
+            var prevLaggedContext = state.InLaggedContext;
+            state.InLaggedContext = true;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // f_0 + 2 * f_1
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row -=2
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_2);
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.ProgramCounter = savedPc;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 2.0); // f_0 + 2 * f_1 - 2 * f_3
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Sub);
+
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row --
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_M1);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.ProgramCounter = savedPc;
+            CompileInstructions(il, state, ds);
+            il.Emit(System.Reflection.Emit.OpCodes.Sub); // f_0 + 2 * f_1 - 2 * f_3 - f_4
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 8.0); // / 8
+            il.Emit(System.Reflection.Emit.OpCodes.Div);
+
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // row +=4
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_4);
+            il.Emit(System.Reflection.Emit.OpCodes.Add);
+            il.Emit(System.Reflection.Emit.OpCodes.Starg, 0);
+            state.InLaggedContext = prevLaggedContext;
+            return;
+          }
+        case OpCodes.Call: {
+            throw new NotSupportedException(
+              "Automatically defined functions are not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter. Either turn of ADFs or change the interpeter.");
+          }
+        case OpCodes.Arg: {
+            throw new NotSupportedException(
+              "Automatically defined functions are not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter. Either turn of ADFs or change the interpeter.");
+          }
+        case OpCodes.Variable: {
+            VariableTreeNode varNode = (VariableTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr.data);
+            // load correct column of the current variable
+            il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // rowIndex
+            if (!state.InLaggedContext) {
+              il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
+              il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            } else {
+              var nanResult = il.DefineLabel();
+              var normalResult = il.DefineLabel();
+              il.Emit(System.Reflection.Emit.OpCodes.Dup);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
+              il.Emit(System.Reflection.Emit.OpCodes.Blt, nanResult);
+              il.Emit(System.Reflection.Emit.OpCodes.Dup);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, ds.Rows);
+              il.Emit(System.Reflection.Emit.OpCodes.Bge, nanResult);
+              il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
+              il.Emit(System.Reflection.Emit.OpCodes.Mul);
+              il.Emit(System.Reflection.Emit.OpCodes.Br, normalResult);
+              il.MarkLabel(nanResult);
+              il.Emit(System.Reflection.Emit.OpCodes.Pop); // rowIndex
+              il.Emit(System.Reflection.Emit.OpCodes.Pop); // column reference
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, double.NaN);
+              il.MarkLabel(normalResult);
+            }
+            return;
+          }
+        case OpCodes.LagVariable: {
+            var nanResult = il.DefineLabel();
+            var normalResult = il.DefineLabel();
+            LaggedVariableTreeNode varNode = (LaggedVariableTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr.data);
+            // load correct column of the current variable
+            il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, varNode.Lag); // lag
+            il.Emit(System.Reflection.Emit.OpCodes.Ldarg_0); // rowIndex
+            il.Emit(System.Reflection.Emit.OpCodes.Add); // actualRowIndex = rowIndex + sampleOffset
+            il.Emit(System.Reflection.Emit.OpCodes.Dup);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
+            il.Emit(System.Reflection.Emit.OpCodes.Blt, nanResult);
+            il.Emit(System.Reflection.Emit.OpCodes.Dup);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, ds.Rows);
+            il.Emit(System.Reflection.Emit.OpCodes.Bge, nanResult);
+            il.Emit(System.Reflection.Emit.OpCodes.Call, listGetValue);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, varNode.Weight); // load weight
+            il.Emit(System.Reflection.Emit.OpCodes.Mul);
+            il.Emit(System.Reflection.Emit.OpCodes.Br, normalResult);
+            il.MarkLabel(nanResult);
+            il.Emit(System.Reflection.Emit.OpCodes.Pop); // sample index
+            il.Emit(System.Reflection.Emit.OpCodes.Pop); // column reference
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, double.NaN);
+            il.MarkLabel(normalResult);
+            return;
+          }
+        case OpCodes.Constant: {
+            ConstantTreeNode constNode = (ConstantTreeNode)currentInstr.dynamicNode;
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, constNode.Value);
+            return;
+          }
+
+        //mkommend: this symbol uses the logistic function f(x) = 1 / (1 + e^(-alpha * x) ) 
+        //to determine the relative amounts of the true and false branch see http://en.wikipedia.org/wiki/Logistic_function
+        case OpCodes.VariableCondition: {
+            throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name +
+                                            " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter");
+          }
+        default:
+          throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name +
+                                          " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter");
+      }
+    }
+
+    public static double AiryA(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double ai, aip, bi, bip;
+      alglib.airy(x, out ai, out aip, out bi, out bip);
+      return ai;
+    }
+
+    public static double AiryB(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double ai, aip, bi, bip;
+      alglib.airy(x, out ai, out aip, out bi, out bip);
+      return bi;
+    }
+    public static double Dawson(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.dawsonintegral(x);
+    }
+
+    public static double Gamma(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.gammafunction(x);
+    }
+
+    public static double Psi(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
+      return alglib.psi(x);
+    }
+
+    public static double ExpIntegralEi(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.exponentialintegralei(x);
+    }
+
+    public static double SinIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double si, ci;
+      alglib.sinecosineintegrals(x, out si, out ci);
+      return si;
+    }
+
+    public static double CosIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double si, ci;
+      alglib.sinecosineintegrals(x, out si, out ci);
+      return ci;
+    }
+
+    public static double HypSinIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double shi, chi;
+      alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+      return shi;
+    }
+
+    public static double HypCosIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double shi, chi;
+      alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+      return chi;
+    }
+
+    public static double FresnelCosIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double c = 0, s = 0;
+      alglib.fresnelintegral(x, ref c, ref s);
+      return c;
+    }
+
+    public static double FresnelSinIntegral(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      double c = 0, s = 0;
+      alglib.fresnelintegral(x, ref c, ref s);
+      return s;
+    }
+
+    public static double Norm(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.normaldistribution(x);
+    }
+
+    public static double Erf(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.errorfunction(x);
+    }
+
+    public static double Bessel(double x) {
+      if (double.IsNaN(x)) return double.NaN;
+      return alglib.besseli0(x);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 16132)
@@ -0,0 +1,517 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.")]
+  public class SymbolicDataAnalysisExpressionTreeInterpreter : ParameterizedNamedItem,
+    ISymbolicDataAnalysisExpressionTreeInterpreter {
+    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string CheckExpressionsWithIntervalArithmeticParameterDescription = "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.";
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    #region parameter properties
+    public IFixedValueParameter<BoolValue> CheckExpressionsWithIntervalArithmeticParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; }
+    }
+
+    public IFixedValueParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public bool CheckExpressionsWithIntervalArithmetic {
+      get { return CheckExpressionsWithIntervalArithmeticParameter.Value.Value; }
+      set { CheckExpressionsWithIntervalArithmeticParameter.Value.Value = value; }
+    }
+
+    public int EvaluatedSolutions {
+      get { return EvaluatedSolutionsParameter.Value.Value; }
+      set { EvaluatedSolutionsParameter.Value.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionTreeInterpreter(bool deserializing) : base(deserializing) { }
+
+    protected SymbolicDataAnalysisExpressionTreeInterpreter(SymbolicDataAnalysisExpressionTreeInterpreter original,
+      Cloner cloner)
+      : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionTreeInterpreter(this, cloner);
+    }
+
+    public SymbolicDataAnalysisExpressionTreeInterpreter()
+      : base("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.") {
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    protected SymbolicDataAnalysisExpressionTreeInterpreter(string name, string description)
+      : base(name, description) {
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      var evaluatedSolutions = new IntValue(0);
+      var checkExpressionsWithIntervalArithmetic = new BoolValue(false);
+      if (Parameters.ContainsKey(EvaluatedSolutionsParameterName)) {
+        var evaluatedSolutionsParameter = (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName];
+        evaluatedSolutions = evaluatedSolutionsParameter.Value;
+        Parameters.Remove(EvaluatedSolutionsParameterName);
+      }
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", evaluatedSolutions));
+      if (Parameters.ContainsKey(CheckExpressionsWithIntervalArithmeticParameterName)) {
+        var checkExpressionsWithIntervalArithmeticParameter = (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName];
+        Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
+        checkExpressionsWithIntervalArithmetic = checkExpressionsWithIntervalArithmeticParameter.Value;
+      }
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, checkExpressionsWithIntervalArithmetic));
+    }
+
+    #region IStatefulItem
+    public void InitializeState() {
+      EvaluatedSolutions = 0;
+    }
+
+    public void ClearState() { }
+    #endregion
+
+    private readonly object syncRoot = new object();
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset,
+      IEnumerable<int> rows) {
+      if (CheckExpressionsWithIntervalArithmetic) {
+        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
+      }
+
+      lock (syncRoot) {
+        EvaluatedSolutions++; // increment the evaluated solutions counter
+      }
+      var state = PrepareInterpreterState(tree, dataset);
+
+      foreach (var rowEnum in rows) {
+        int row = rowEnum;
+        yield return Evaluate(dataset, ref row, state);
+        state.Reset();
+      }
+    }
+
+    private static InterpreterState PrepareInterpreterState(ISymbolicExpressionTree tree, IDataset dataset) {
+      Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
+      int necessaryArgStackSize = 0;
+      foreach (Instruction instr in code) {
+        if (instr.opCode == OpCodes.Variable) {
+          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
+          instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.FactorVariable) {
+          var factorTreeNode = instr.dynamicNode as FactorVariableTreeNode;
+          instr.data = dataset.GetReadOnlyStringValues(factorTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.BinaryFactorVariable) {
+          var factorTreeNode = instr.dynamicNode as BinaryFactorVariableTreeNode;
+          instr.data = dataset.GetReadOnlyStringValues(factorTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.LagVariable) {
+          var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
+          instr.data = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.VariableCondition) {
+          var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
+          instr.data = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);
+        } else if (instr.opCode == OpCodes.Call) {
+          necessaryArgStackSize += instr.nArguments + 1;
+        }
+      }
+      return new InterpreterState(code, necessaryArgStackSize);
+    }
+
+    public virtual double Evaluate(IDataset dataset, ref int row, InterpreterState state) {
+      Instruction currentInstr = state.NextInstruction();
+      switch (currentInstr.opCode) {
+        case OpCodes.Add: {
+            double s = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              s += Evaluate(dataset, ref row, state);
+            }
+            return s;
+          }
+        case OpCodes.Sub: {
+            double s = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              s -= Evaluate(dataset, ref row, state);
+            }
+            if (currentInstr.nArguments == 1) { s = -s; }
+            return s;
+          }
+        case OpCodes.Mul: {
+            double p = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              p *= Evaluate(dataset, ref row, state);
+            }
+            return p;
+          }
+        case OpCodes.Div: {
+            double p = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              p /= Evaluate(dataset, ref row, state);
+            }
+            if (currentInstr.nArguments == 1) { p = 1.0 / p; }
+            return p;
+          }
+        case OpCodes.Average: {
+            double sum = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              sum += Evaluate(dataset, ref row, state);
+            }
+            return sum / currentInstr.nArguments;
+          }
+        case OpCodes.Cos: {
+            return Math.Cos(Evaluate(dataset, ref row, state));
+          }
+        case OpCodes.Sin: {
+            return Math.Sin(Evaluate(dataset, ref row, state));
+          }
+        case OpCodes.Tan: {
+            return Math.Tan(Evaluate(dataset, ref row, state));
+          }
+        case OpCodes.Square: {
+            return Math.Pow(Evaluate(dataset, ref row, state), 2);
+          }
+        case OpCodes.Power: {
+            double x = Evaluate(dataset, ref row, state);
+            double y = Math.Round(Evaluate(dataset, ref row, state));
+            return Math.Pow(x, y);
+          }
+        case OpCodes.SquareRoot: {
+            return Math.Sqrt(Evaluate(dataset, ref row, state));
+          }
+        case OpCodes.Root: {
+            double x = Evaluate(dataset, ref row, state);
+            double y = Math.Round(Evaluate(dataset, ref row, state));
+            return Math.Pow(x, 1 / y);
+          }
+        case OpCodes.Exp: {
+            return Math.Exp(Evaluate(dataset, ref row, state));
+          }
+        case OpCodes.Log: {
+            return Math.Log(Evaluate(dataset, ref row, state));
+          }
+        case OpCodes.Gamma: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) { return double.NaN; } else { return alglib.gammafunction(x); }
+          }
+        case OpCodes.Psi: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) return double.NaN;
+            return alglib.psi(x);
+          }
+        case OpCodes.Dawson: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) { return double.NaN; }
+            return alglib.dawsonintegral(x);
+          }
+        case OpCodes.ExponentialIntegralEi: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) { return double.NaN; }
+            return alglib.exponentialintegralei(x);
+          }
+        case OpCodes.SineIntegral: {
+            double si, ci;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.sinecosineintegrals(x, out si, out ci);
+              return si;
+            }
+          }
+        case OpCodes.CosineIntegral: {
+            double si, ci;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.sinecosineintegrals(x, out si, out ci);
+              return ci;
+            }
+          }
+        case OpCodes.HyperbolicSineIntegral: {
+            double shi, chi;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+              return shi;
+            }
+          }
+        case OpCodes.HyperbolicCosineIntegral: {
+            double shi, chi;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+              return chi;
+            }
+          }
+        case OpCodes.FresnelCosineIntegral: {
+            double c = 0, s = 0;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.fresnelintegral(x, ref c, ref s);
+              return c;
+            }
+          }
+        case OpCodes.FresnelSineIntegral: {
+            double c = 0, s = 0;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.fresnelintegral(x, ref c, ref s);
+              return s;
+            }
+          }
+        case OpCodes.AiryA: {
+            double ai, aip, bi, bip;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.airy(x, out ai, out aip, out bi, out bip);
+              return ai;
+            }
+          }
+        case OpCodes.AiryB: {
+            double ai, aip, bi, bip;
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else {
+              alglib.airy(x, out ai, out aip, out bi, out bip);
+              return bi;
+            }
+          }
+        case OpCodes.Norm: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else return alglib.normaldistribution(x);
+          }
+        case OpCodes.Erf: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else return alglib.errorfunction(x);
+          }
+        case OpCodes.Bessel: {
+            var x = Evaluate(dataset, ref row, state);
+            if (double.IsNaN(x)) return double.NaN;
+            else return alglib.besseli0(x);
+          }
+        case OpCodes.IfThenElse: {
+            double condition = Evaluate(dataset, ref row, state);
+            double result;
+            if (condition > 0.0) {
+              result = Evaluate(dataset, ref row, state); state.SkipInstructions();
+            } else {
+              state.SkipInstructions(); result = Evaluate(dataset, ref row, state);
+            }
+            return result;
+          }
+        case OpCodes.AND: {
+            double result = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              if (result > 0.0) result = Evaluate(dataset, ref row, state);
+              else {
+                state.SkipInstructions();
+              }
+            }
+            return result > 0.0 ? 1.0 : -1.0;
+          }
+        case OpCodes.OR: {
+            double result = Evaluate(dataset, ref row, state);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              if (result <= 0.0) result = Evaluate(dataset, ref row, state);
+              else {
+                state.SkipInstructions();
+              }
+            }
+            return result > 0.0 ? 1.0 : -1.0;
+          }
+        case OpCodes.NOT: {
+            return Evaluate(dataset, ref row, state) > 0.0 ? -1.0 : 1.0;
+          }
+        case OpCodes.XOR: {
+            //mkommend: XOR on multiple inputs is defined as true if the number of positive signals is odd
+            // this is equal to a consecutive execution of binary XOR operations.
+            int positiveSignals = 0;
+            for (int i = 0; i < currentInstr.nArguments; i++) {
+              if (Evaluate(dataset, ref row, state) > 0.0) { positiveSignals++; }
+            }
+            return positiveSignals % 2 != 0 ? 1.0 : -1.0;
+          }
+        case OpCodes.GT: {
+            double x = Evaluate(dataset, ref row, state);
+            double y = Evaluate(dataset, ref row, state);
+            if (x > y) { return 1.0; } else { return -1.0; }
+          }
+        case OpCodes.LT: {
+            double x = Evaluate(dataset, ref row, state);
+            double y = Evaluate(dataset, ref row, state);
+            if (x < y) { return 1.0; } else { return -1.0; }
+          }
+        case OpCodes.TimeLag: {
+            var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
+            row += timeLagTreeNode.Lag;
+            double result = Evaluate(dataset, ref row, state);
+            row -= timeLagTreeNode.Lag;
+            return result;
+          }
+        case OpCodes.Integral: {
+            int savedPc = state.ProgramCounter;
+            var timeLagTreeNode = (LaggedTreeNode)currentInstr.dynamicNode;
+            double sum = 0.0;
+            for (int i = 0; i < Math.Abs(timeLagTreeNode.Lag); i++) {
+              row += Math.Sign(timeLagTreeNode.Lag);
+              sum += Evaluate(dataset, ref row, state);
+              state.ProgramCounter = savedPc;
+            }
+            row -= timeLagTreeNode.Lag;
+            sum += Evaluate(dataset, ref row, state);
+            return sum;
+          }
+
+        //mkommend: derivate calculation taken from: 
+        //http://www.holoborodko.com/pavel/numerical-methods/numerical-derivative/smooth-low-noise-differentiators/
+        //one sided smooth differentiatior, N = 4
+        // y' = 1/8h (f_i + 2f_i-1, -2 f_i-3 - f_i-4)
+        case OpCodes.Derivative: {
+            int savedPc = state.ProgramCounter;
+            double f_0 = Evaluate(dataset, ref row, state); row--;
+            state.ProgramCounter = savedPc;
+            double f_1 = Evaluate(dataset, ref row, state); row -= 2;
+            state.ProgramCounter = savedPc;
+            double f_3 = Evaluate(dataset, ref row, state); row--;
+            state.ProgramCounter = savedPc;
+            double f_4 = Evaluate(dataset, ref row, state);
+            row += 4;
+
+            return (f_0 + 2 * f_1 - 2 * f_3 - f_4) / 8; // h = 1
+          }
+        case OpCodes.Call: {
+            // evaluate sub-trees
+            double[] argValues = new double[currentInstr.nArguments];
+            for (int i = 0; i < currentInstr.nArguments; i++) {
+              argValues[i] = Evaluate(dataset, ref row, state);
+            }
+            // push on argument values on stack 
+            state.CreateStackFrame(argValues);
+
+            // save the pc
+            int savedPc = state.ProgramCounter;
+            // set pc to start of function  
+            state.ProgramCounter = (ushort)currentInstr.data;
+            // evaluate the function
+            double v = Evaluate(dataset, ref row, state);
+
+            // delete the stack frame
+            state.RemoveStackFrame();
+
+            // restore the pc => evaluation will continue at point after my subtrees  
+            state.ProgramCounter = savedPc;
+            return v;
+          }
+        case OpCodes.Arg: {
+            return state.GetStackFrameValue((ushort)currentInstr.data);
+          }
+        case OpCodes.Variable: {
+            if (row < 0 || row >= dataset.Rows) return double.NaN;
+            var variableTreeNode = (VariableTreeNode)currentInstr.dynamicNode;
+            return ((IList<double>)currentInstr.data)[row] * variableTreeNode.Weight;
+          }
+        case OpCodes.BinaryFactorVariable: {
+            if (row < 0 || row >= dataset.Rows) return double.NaN;
+            var factorVarTreeNode = currentInstr.dynamicNode as BinaryFactorVariableTreeNode;
+            return ((IList<string>)currentInstr.data)[row] == factorVarTreeNode.VariableValue ? factorVarTreeNode.Weight : 0;
+          }
+        case OpCodes.FactorVariable: {
+            if (row < 0 || row >= dataset.Rows) return double.NaN;
+            var factorVarTreeNode = currentInstr.dynamicNode as FactorVariableTreeNode;
+            return factorVarTreeNode.GetValue(((IList<string>)currentInstr.data)[row]);
+          }
+        case OpCodes.LagVariable: {
+            var laggedVariableTreeNode = (LaggedVariableTreeNode)currentInstr.dynamicNode;
+            int actualRow = row + laggedVariableTreeNode.Lag;
+            if (actualRow < 0 || actualRow >= dataset.Rows) { return double.NaN; }
+            return ((IList<double>)currentInstr.data)[actualRow] * laggedVariableTreeNode.Weight;
+          }
+        case OpCodes.Constant: {
+            var constTreeNode = (ConstantTreeNode)currentInstr.dynamicNode;
+            return constTreeNode.Value;
+          }
+
+        //mkommend: this symbol uses the logistic function f(x) = 1 / (1 + e^(-alpha * x) ) 
+        //to determine the relative amounts of the true and false branch see http://en.wikipedia.org/wiki/Logistic_function
+        case OpCodes.VariableCondition: {
+            if (row < 0 || row >= dataset.Rows) return double.NaN;
+            var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode;
+            if (!variableConditionTreeNode.Symbol.IgnoreSlope) {
+              double variableValue = ((IList<double>)currentInstr.data)[row];
+              double x = variableValue - variableConditionTreeNode.Threshold;
+              double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
+
+              double trueBranch = Evaluate(dataset, ref row, state);
+              double falseBranch = Evaluate(dataset, ref row, state);
+
+              return trueBranch * p + falseBranch * (1 - p);
+            } else {
+              // strict threshold
+              double variableValue = ((IList<double>)currentInstr.data)[row];
+              if (variableValue <= variableConditionTreeNode.Threshold) {
+                var left = Evaluate(dataset, ref row, state);
+                state.SkipInstructions();
+                return left;
+              } else {
+                state.SkipInstructions();
+                return Evaluate(dataset, ref row, state);
+              }
+            }
+          }
+        default:
+          throw new NotSupportedException();
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs	(revision 16132)
@@ -0,0 +1,459 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionTreeLinearInterpreter", "Fast linear (non-recursive) interpreter for symbolic expression trees. Does not support ADFs.")]
+  public sealed class SymbolicDataAnalysisExpressionTreeLinearInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
+    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
+    private const string CheckExpressionsWithIntervalArithmeticParameterDescription = "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.";
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
+
+    private readonly SymbolicDataAnalysisExpressionTreeInterpreter interpreter;
+
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    #region parameter properties
+    public IFixedValueParameter<BoolValue> CheckExpressionsWithIntervalArithmeticParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; }
+    }
+
+    public IFixedValueParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public bool CheckExpressionsWithIntervalArithmetic {
+      get { return CheckExpressionsWithIntervalArithmeticParameter.Value.Value; }
+      set { CheckExpressionsWithIntervalArithmeticParameter.Value.Value = value; }
+    }
+    public int EvaluatedSolutions {
+      get { return EvaluatedSolutionsParameter.Value.Value; }
+      set { EvaluatedSolutionsParameter.Value.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private SymbolicDataAnalysisExpressionTreeLinearInterpreter(bool deserializing)
+      : base(deserializing) {
+      interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
+    }
+
+    private SymbolicDataAnalysisExpressionTreeLinearInterpreter(SymbolicDataAnalysisExpressionTreeLinearInterpreter original, Cloner cloner)
+      : base(original, cloner) {
+      interpreter = cloner.Clone(original.interpreter);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionTreeLinearInterpreter(this, cloner);
+    }
+
+    public SymbolicDataAnalysisExpressionTreeLinearInterpreter()
+      : base("SymbolicDataAnalysisExpressionTreeLinearInterpreter", "Linear (non-recursive) interpreter for symbolic expression trees (does not support ADFs).") {
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+      interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
+    }
+
+    public SymbolicDataAnalysisExpressionTreeLinearInterpreter(string name, string description)
+      : base(name, description) {
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+      interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      var evaluatedSolutions = new IntValue(0);
+      var checkExpressionsWithIntervalArithmetic = new BoolValue(false);
+      if (Parameters.ContainsKey(EvaluatedSolutionsParameterName)) {
+        var evaluatedSolutionsParameter = (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName];
+        evaluatedSolutions = evaluatedSolutionsParameter.Value;
+        Parameters.Remove(EvaluatedSolutionsParameterName);
+      }
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", evaluatedSolutions));
+      if (Parameters.ContainsKey(CheckExpressionsWithIntervalArithmeticParameterName)) {
+        var checkExpressionsWithIntervalArithmeticParameter = (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName];
+        Parameters.Remove(CheckExpressionsWithIntervalArithmeticParameterName);
+        checkExpressionsWithIntervalArithmetic = checkExpressionsWithIntervalArithmeticParameter.Value;
+      }
+      Parameters.Add(new FixedValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, CheckExpressionsWithIntervalArithmeticParameterDescription, checkExpressionsWithIntervalArithmetic));
+    }
+
+    #region IStatefulItem
+    public void InitializeState() {
+      EvaluatedSolutions = 0;
+    }
+
+    public void ClearState() { }
+    #endregion
+
+    private readonly object syncRoot = new object();
+    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
+      if (!rows.Any()) return Enumerable.Empty<double>();
+      if (CheckExpressionsWithIntervalArithmetic)
+        throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter.");
+
+      lock (syncRoot) {
+        EvaluatedSolutions++; // increment the evaluated solutions counter
+      }
+
+      var code = SymbolicExpressionTreeLinearCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
+      PrepareInstructions(code, dataset);
+      return rows.Select(row => Evaluate(dataset, row, code));
+    }
+
+    // NOTE: do not use this method when evaluating trees. this method is provided as a shortcut for evaluating subtrees ad-hoc
+    public IEnumerable<double> GetValues(ISymbolicExpressionTreeNode node, IDataset dataset, IEnumerable<int> rows) {
+      var code = SymbolicExpressionTreeLinearCompiler.Compile(node, OpCodes.MapSymbolToOpCode);
+      PrepareInstructions(code, dataset);
+      return rows.Select(row => Evaluate(dataset, row, code));
+    }
+
+    private double Evaluate(IDataset dataset, int row, LinearInstruction[] code) {
+      for (int i = code.Length - 1; i >= 0; --i) {
+        if (code[i].skip) continue;
+        #region opcode if
+        var instr = code[i];
+        if (instr.opCode == OpCodes.Variable) {
+          if (row < 0 || row >= dataset.Rows) instr.value = double.NaN;
+          else {
+            var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
+            instr.value = ((IList<double>)instr.data)[row] * variableTreeNode.Weight;
+          }
+        } else if (instr.opCode == OpCodes.BinaryFactorVariable) {
+          if (row < 0 || row >= dataset.Rows) instr.value = double.NaN;
+          else {
+            var factorTreeNode = instr.dynamicNode as BinaryFactorVariableTreeNode;
+            instr.value = ((IList<string>)instr.data)[row] == factorTreeNode.VariableValue ? factorTreeNode.Weight : 0;
+          }
+        } else if (instr.opCode == OpCodes.FactorVariable) {
+          if (row < 0 || row >= dataset.Rows) instr.value = double.NaN;
+          else {
+            var factorTreeNode = instr.dynamicNode as FactorVariableTreeNode;
+            instr.value = factorTreeNode.GetValue(((IList<string>)instr.data)[row]);
+          }
+        } else if (instr.opCode == OpCodes.LagVariable) {
+          var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
+          int actualRow = row + laggedVariableTreeNode.Lag;
+          if (actualRow < 0 || actualRow >= dataset.Rows)
+            instr.value = double.NaN;
+          else
+            instr.value = ((IList<double>)instr.data)[actualRow] * laggedVariableTreeNode.Weight;
+        } else if (instr.opCode == OpCodes.VariableCondition) {
+          if (row < 0 || row >= dataset.Rows) instr.value = double.NaN;
+          var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
+          if (!variableConditionTreeNode.Symbol.IgnoreSlope) {
+            double variableValue = ((IList<double>)instr.data)[row];
+            double x = variableValue - variableConditionTreeNode.Threshold;
+            double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
+
+            double trueBranch = code[instr.childIndex].value;
+            double falseBranch = code[instr.childIndex + 1].value;
+
+            instr.value = trueBranch * p + falseBranch * (1 - p);
+          } else {
+            double variableValue = ((IList<double>)instr.data)[row];
+            if (variableValue <= variableConditionTreeNode.Threshold) {
+              instr.value = code[instr.childIndex].value;
+            } else {
+              instr.value = code[instr.childIndex + 1].value;
+            }
+          }
+        } else if (instr.opCode == OpCodes.Add) {
+          double s = code[instr.childIndex].value;
+          for (int j = 1; j != instr.nArguments; ++j) {
+            s += code[instr.childIndex + j].value;
+          }
+          instr.value = s;
+        } else if (instr.opCode == OpCodes.Sub) {
+          double s = code[instr.childIndex].value;
+          for (int j = 1; j != instr.nArguments; ++j) {
+            s -= code[instr.childIndex + j].value;
+          }
+          if (instr.nArguments == 1) s = -s;
+          instr.value = s;
+        } else if (instr.opCode == OpCodes.Mul) {
+          double p = code[instr.childIndex].value;
+          for (int j = 1; j != instr.nArguments; ++j) {
+            p *= code[instr.childIndex + j].value;
+          }
+          instr.value = p;
+        } else if (instr.opCode == OpCodes.Div) {
+          double p = code[instr.childIndex].value;
+          for (int j = 1; j != instr.nArguments; ++j) {
+            p /= code[instr.childIndex + j].value;
+          }
+          if (instr.nArguments == 1) p = 1.0 / p;
+          instr.value = p;
+        } else if (instr.opCode == OpCodes.Average) {
+          double s = code[instr.childIndex].value;
+          for (int j = 1; j != instr.nArguments; ++j) {
+            s += code[instr.childIndex + j].value;
+          }
+          instr.value = s / instr.nArguments;
+        } else if (instr.opCode == OpCodes.Cos) {
+          instr.value = Math.Cos(code[instr.childIndex].value);
+        } else if (instr.opCode == OpCodes.Sin) {
+          instr.value = Math.Sin(code[instr.childIndex].value);
+        } else if (instr.opCode == OpCodes.Tan) {
+          instr.value = Math.Tan(code[instr.childIndex].value);
+        } else if (instr.opCode == OpCodes.Square) {
+          instr.value = Math.Pow(code[instr.childIndex].value, 2);
+        } else if (instr.opCode == OpCodes.Power) {
+          double x = code[instr.childIndex].value;
+          double y = Math.Round(code[instr.childIndex + 1].value);
+          instr.value = Math.Pow(x, y);
+        } else if (instr.opCode == OpCodes.SquareRoot) {
+          instr.value = Math.Sqrt(code[instr.childIndex].value);
+        } else if (instr.opCode == OpCodes.Root) {
+          double x = code[instr.childIndex].value;
+          double y = Math.Round(code[instr.childIndex + 1].value);
+          instr.value = Math.Pow(x, 1 / y);
+        } else if (instr.opCode == OpCodes.Exp) {
+          instr.value = Math.Exp(code[instr.childIndex].value);
+        } else if (instr.opCode == OpCodes.Log) {
+          instr.value = Math.Log(code[instr.childIndex].value);
+        } else if (instr.opCode == OpCodes.Gamma) {
+          var x = code[instr.childIndex].value;
+          instr.value = double.IsNaN(x) ? double.NaN : alglib.gammafunction(x);
+        } else if (instr.opCode == OpCodes.Psi) {
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else if (x <= 0 && (Math.Floor(x) - x).IsAlmost(0)) instr.value = double.NaN;
+          else instr.value = alglib.psi(x);
+        } else if (instr.opCode == OpCodes.Dawson) {
+          var x = code[instr.childIndex].value;
+          instr.value = double.IsNaN(x) ? double.NaN : alglib.dawsonintegral(x);
+        } else if (instr.opCode == OpCodes.ExponentialIntegralEi) {
+          var x = code[instr.childIndex].value;
+          instr.value = double.IsNaN(x) ? double.NaN : alglib.exponentialintegralei(x);
+        } else if (instr.opCode == OpCodes.SineIntegral) {
+          double si, ci;
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else {
+            alglib.sinecosineintegrals(x, out si, out ci);
+            instr.value = si;
+          }
+        } else if (instr.opCode == OpCodes.CosineIntegral) {
+          double si, ci;
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else {
+            alglib.sinecosineintegrals(x, out si, out ci);
+            instr.value = ci;
+          }
+        } else if (instr.opCode == OpCodes.HyperbolicSineIntegral) {
+          double shi, chi;
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else {
+            alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+            instr.value = shi;
+          }
+        } else if (instr.opCode == OpCodes.HyperbolicCosineIntegral) {
+          double shi, chi;
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else {
+            alglib.hyperbolicsinecosineintegrals(x, out shi, out chi);
+            instr.value = chi;
+          }
+        } else if (instr.opCode == OpCodes.FresnelCosineIntegral) {
+          double c = 0, s = 0;
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else {
+            alglib.fresnelintegral(x, ref c, ref s);
+            instr.value = c;
+          }
+        } else if (instr.opCode == OpCodes.FresnelSineIntegral) {
+          double c = 0, s = 0;
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else {
+            alglib.fresnelintegral(x, ref c, ref s);
+            instr.value = s;
+          }
+        } else if (instr.opCode == OpCodes.AiryA) {
+          double ai, aip, bi, bip;
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else {
+            alglib.airy(x, out ai, out aip, out bi, out bip);
+            instr.value = ai;
+          }
+        } else if (instr.opCode == OpCodes.AiryB) {
+          double ai, aip, bi, bip;
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else {
+            alglib.airy(x, out ai, out aip, out bi, out bip);
+            instr.value = bi;
+          }
+        } else if (instr.opCode == OpCodes.Norm) {
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else instr.value = alglib.normaldistribution(x);
+        } else if (instr.opCode == OpCodes.Erf) {
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else instr.value = alglib.errorfunction(x);
+        } else if (instr.opCode == OpCodes.Bessel) {
+          var x = code[instr.childIndex].value;
+          if (double.IsNaN(x)) instr.value = double.NaN;
+          else instr.value = alglib.besseli0(x);
+        } else if (instr.opCode == OpCodes.IfThenElse) {
+          double condition = code[instr.childIndex].value;
+          double result;
+          if (condition > 0.0) {
+            result = code[instr.childIndex + 1].value;
+          } else {
+            result = code[instr.childIndex + 2].value;
+          }
+          instr.value = result;
+        } else if (instr.opCode == OpCodes.AND) {
+          double result = code[instr.childIndex].value;
+          for (int j = 1; j < instr.nArguments; j++) {
+            if (result > 0.0) result = code[instr.childIndex + j].value;
+            else break;
+          }
+          instr.value = result > 0.0 ? 1.0 : -1.0;
+        } else if (instr.opCode == OpCodes.OR) {
+          double result = code[instr.childIndex].value;
+          for (int j = 1; j < instr.nArguments; j++) {
+            if (result <= 0.0) result = code[instr.childIndex + j].value;
+            else break;
+          }
+          instr.value = result > 0.0 ? 1.0 : -1.0;
+        } else if (instr.opCode == OpCodes.NOT) {
+          instr.value = code[instr.childIndex].value > 0.0 ? -1.0 : 1.0;
+        } else if (instr.opCode == OpCodes.XOR) {
+          int positiveSignals = 0;
+          for (int j = 0; j < instr.nArguments; j++) {
+            if (code[instr.childIndex + j].value > 0.0) positiveSignals++;
+          }
+          instr.value = positiveSignals % 2 != 0 ? 1.0 : -1.0;
+        } else if (instr.opCode == OpCodes.GT) {
+          double x = code[instr.childIndex].value;
+          double y = code[instr.childIndex + 1].value;
+          instr.value = x > y ? 1.0 : -1.0;
+        } else if (instr.opCode == OpCodes.LT) {
+          double x = code[instr.childIndex].value;
+          double y = code[instr.childIndex + 1].value;
+          instr.value = x < y ? 1.0 : -1.0;
+        } else if (instr.opCode == OpCodes.TimeLag || instr.opCode == OpCodes.Derivative || instr.opCode == OpCodes.Integral) {
+          var state = (InterpreterState)instr.data;
+          state.Reset();
+          instr.value = interpreter.Evaluate(dataset, ref row, state);
+        } else {
+          var errorText = string.Format("The {0} symbol is not supported by the linear interpreter. To support this symbol, please use the SymbolicDataAnalysisExpressionTreeInterpreter.", instr.dynamicNode.Symbol.Name);
+          throw new NotSupportedException(errorText);
+        }
+        #endregion
+      }
+      return code[0].value;
+    }
+
+    private static LinearInstruction[] GetPrefixSequence(LinearInstruction[] code, int startIndex) {
+      var s = new Stack<int>();
+      var list = new List<LinearInstruction>();
+      s.Push(startIndex);
+      while (s.Any()) {
+        int i = s.Pop();
+        var instr = code[i];
+        // push instructions in reverse execution order
+        for (int j = instr.nArguments - 1; j >= 0; j--) s.Push(instr.childIndex + j);
+        list.Add(instr);
+      }
+      return list.ToArray();
+    }
+
+    public static void PrepareInstructions(LinearInstruction[] code, IDataset dataset) {
+      for (int i = 0; i != code.Length; ++i) {
+        var instr = code[i];
+        #region opcode switch
+        switch (instr.opCode) {
+          case OpCodes.Constant: {
+              var constTreeNode = (ConstantTreeNode)instr.dynamicNode;
+              instr.value = constTreeNode.Value;
+              instr.skip = true; // the value is already set so this instruction should be skipped in the evaluation phase
+            }
+            break;
+          case OpCodes.Variable: {
+              var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
+              instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
+            }
+            break;
+          case OpCodes.BinaryFactorVariable: {
+              var factorVariableTreeNode = instr.dynamicNode as BinaryFactorVariableTreeNode;
+              instr.data = dataset.GetReadOnlyStringValues(factorVariableTreeNode.VariableName);
+            }
+            break;
+          case OpCodes.FactorVariable: {
+              var factorVariableTreeNode = instr.dynamicNode as FactorVariableTreeNode;
+              instr.data = dataset.GetReadOnlyStringValues(factorVariableTreeNode.VariableName);
+            }
+            break;
+          case OpCodes.LagVariable: {
+              var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
+              instr.data = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName);
+            }
+            break;
+          case OpCodes.VariableCondition: {
+              var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
+              instr.data = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);
+            }
+            break;
+          case OpCodes.TimeLag:
+          case OpCodes.Integral:
+          case OpCodes.Derivative: {
+              var seq = GetPrefixSequence(code, i);
+              var interpreterState = new InterpreterState(seq, 0);
+              instr.data = interpreterState;
+              for (int j = 1; j != seq.Length; ++j)
+                seq[j].skip = true;
+              break;
+            }
+        }
+        #endregion
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame	(revision 16132)
@@ -0,0 +1,50 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+  [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic","Provides base classes for symbolic data analysis tasks.", "3.4.11.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
+  [PluginDependency("HeuristicLab.AutoDiff", "1.0")]
+  [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.EvolutionTracking", "3.4")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
+  [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.4")]
+  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  public class HeuristicLabProblemsDataAnalysisSymbolicPlugin : PluginBase {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Properties/AssemblyInfo.cs.frame	(revision 16132)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic")]
+[assembly: AssemblyDescription("Provides base classes for symbolic data analysis tasks.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 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("ABF1DB5E-5774-48AB-B65A-5CF405C0E2A8")]
+
+// 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.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.11.$WCREV$")]
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs	(revision 16132)
@@ -0,0 +1,214 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicExpressionTreePruningOperator", "An operator that replaces introns with constant values in a symbolic expression tree.")]
+  public abstract class SymbolicDataAnalysisExpressionPruningOperator : SingleSuccessorOperator, ISymbolicExpressionTreeOperator {
+    #region parameter names
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string SymbolicDataAnalysisModelParameterName = "SymbolicDataAnalysisModel";
+    private const string ImpactValuesCalculatorParameterName = "ImpactValuesCalculator";
+    private const string PrunedSubtreesParameterName = "PrunedSubtrees";
+    private const string PrunedTreesParameterName = "PrunedTrees";
+    private const string PrunedNodesParameterName = "PrunedNodes";
+    private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
+    private const string NodeImpactThresholdParameterName = "ImpactThreshold";
+    private const string PruneOnlyZeroImpactNodesParameterName = "PruneOnlyZeroImpactNodes";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; // the tree to be pruned
+    private const string QualityParameterName = "Quality"; // the quality 
+    private const string EstimationLimitsParameterName = "EstimationLimits";
+    private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
+    #endregion
+
+    #region parameter properties
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    public ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public IValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator> ImpactValuesCalculatorParameter {
+      get { return (IValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator>)Parameters[ImpactValuesCalculatorParameterName]; }
+    }
+    public ILookupParameter<IntRange> FitnessCalculationPartitionParameter {
+      get { return (ILookupParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }
+    }
+    public ILookupParameter<IntValue> PrunedSubtreesParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[PrunedSubtreesParameterName]; }
+    }
+    public ILookupParameter<IntValue> PrunedTreesParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[PrunedTreesParameterName]; }
+    }
+    public ILookupParameter<IntValue> PrunedNodesParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[PrunedNodesParameterName]; }
+    }
+    public IFixedValueParameter<DoubleValue> NodeImpactThresholdParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters[NodeImpactThresholdParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> PruneOnlyZeroImpactNodesParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[PruneOnlyZeroImpactNodesParameterName]; }
+    }
+    public ILookupParameter<DoubleLimit> EstimationLimitsParameter {
+      get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
+    }
+    public ILookupParameter<BoolValue> ApplyLinearScalingParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public ISymbolicDataAnalysisSolutionImpactValuesCalculator ImpactValuesCalculator {
+      get { return ImpactValuesCalculatorParameter.Value; }
+      set { ImpactValuesCalculatorParameter.Value = value; }
+    }
+    public bool PruneOnlyZeroImpactNodes {
+      get { return PruneOnlyZeroImpactNodesParameter.Value.Value; }
+      set { PruneOnlyZeroImpactNodesParameter.Value.Value = value; }
+    }
+    public double NodeImpactThreshold {
+      get { return NodeImpactThresholdParameter.Value.Value; }
+      set { NodeImpactThresholdParameter.Value.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionPruningOperator(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionPruningOperator(SymbolicDataAnalysisExpressionPruningOperator original, Cloner cloner)
+      : base(original, cloner) { }
+
+    protected SymbolicDataAnalysisExpressionPruningOperator(ISymbolicDataAnalysisSolutionImpactValuesCalculator impactValuesCalculator) {
+      #region add parameters
+      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisModel>(SymbolicDataAnalysisModelParameterName));
+      Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName));
+      Parameters.Add(new LookupParameter<IntValue>(PrunedNodesParameterName, "A counter of how many nodes were pruned."));
+      Parameters.Add(new LookupParameter<IntValue>(PrunedSubtreesParameterName, "A counter of how many subtrees were replaced."));
+      Parameters.Add(new LookupParameter<IntValue>(PrunedTreesParameterName, "A counter of how many trees were pruned."));
+      Parameters.Add(new FixedValueParameter<BoolValue>(PruneOnlyZeroImpactNodesParameterName, "Specify whether or not only zero impact nodes should be pruned."));
+      Parameters.Add(new FixedValueParameter<DoubleValue>(NodeImpactThresholdParameterName, "Specifies an impact value threshold below which nodes should be pruned."));
+      Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName));
+      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName));
+      Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName));
+      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName, impactValuesCalculator));
+      #endregion
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      if (!Parameters.ContainsKey(PrunedNodesParameterName)) {
+        Parameters.Add(new LookupParameter<IntValue>(PrunedNodesParameterName, "A counter of how many nodes were pruned."));
+      }
+      if (!Parameters.ContainsKey(ApplyLinearScalingParameterName)) {
+        Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName));
+      }
+      if (!Parameters.ContainsKey(ImpactValuesCalculatorParameterName)) {
+        // value must be set by derived operators (regression/classification)
+        Parameters.Add(new ValueParameter<ISymbolicDataAnalysisSolutionImpactValuesCalculator>(ImpactValuesCalculatorParameterName));
+      }
+      #endregion
+    }
+
+    protected abstract ISymbolicDataAnalysisModel CreateModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData, DoubleLimit estimationLimits);
+
+    protected abstract double Evaluate(IDataAnalysisModel model);
+
+    public override IOperation Apply() {
+      var tree = SymbolicExpressionTreeParameter.ActualValue;
+      var problemData = ProblemDataParameter.ActualValue;
+      var fitnessCalculationPartition = FitnessCalculationPartitionParameter.ActualValue;
+      var estimationLimits = EstimationLimitsParameter.ActualValue;
+      var interpreter = InterpreterParameter.ActualValue;
+
+      var model = CreateModel(tree, interpreter, problemData, estimationLimits);
+      var nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();
+      var rows = Enumerable.Range(fitnessCalculationPartition.Start, fitnessCalculationPartition.Size).ToList();
+      var prunedSubtrees = 0;
+      var prunedTrees = 0;
+      var prunedNodes = 0;
+
+      double qualityForImpactsCalculation = double.NaN;
+
+      for (int i = 0; i < nodes.Count; ++i) {
+        var node = nodes[i];
+        if (node is ConstantTreeNode) continue;
+
+        double impactValue, replacementValue;
+        double newQualityForImpacts;
+        ImpactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, out newQualityForImpacts, qualityForImpactsCalculation);
+
+        if (PruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue;
+        if (!PruneOnlyZeroImpactNodes && impactValue > NodeImpactThreshold) continue;
+
+        var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode();
+        constantNode.Value = replacementValue;
+
+        var length = node.GetLength();
+        ReplaceWithConstant(node, constantNode);
+        i += length - 1; // skip subtrees under the node that was folded
+
+        prunedSubtrees++;
+        prunedNodes += length;
+
+        qualityForImpactsCalculation = newQualityForImpacts;
+      }
+
+      if (prunedSubtrees > 0) prunedTrees = 1;
+      PrunedSubtreesParameter.ActualValue = new IntValue(prunedSubtrees);
+      PrunedTreesParameter.ActualValue = new IntValue(prunedTrees);
+      PrunedNodesParameter.ActualValue = new IntValue(prunedNodes);
+
+      if (prunedSubtrees > 0) // if nothing was pruned then there's no need to re-evaluate the tree
+        QualityParameter.ActualValue.Value = Evaluate(model);
+
+      return base.Apply();
+    }
+
+    protected static void ReplaceWithConstant(ISymbolicExpressionTreeNode original, ISymbolicExpressionTreeNode replacement) {
+      var parent = original.Parent;
+      var i = parent.IndexOfSubtree(original);
+      parent.RemoveSubtree(i);
+      parent.InsertSubtree(i, replacement);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplificationOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplificationOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplificationOperator.cs	(revision 16132)
@@ -0,0 +1,60 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SymbolicExpressionTreeSimplificationOperator", "Simplifies symbolic expression trees encoding a mathematical formula.")]
+  [StorableClass]
+  public class SymbolicDataAnalysisExpressionTreeSimplificationOperator : SingleSuccessorOperator, ISymbolicExpressionTreeOperator {
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionTreeSimplificationOperator(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionTreeSimplificationOperator(SymbolicDataAnalysisExpressionTreeSimplificationOperator original, Cloner cloner)
+      : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionTreeSimplificationOperator(this, cloner);
+    }
+
+    public SymbolicDataAnalysisExpressionTreeSimplificationOperator() {
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree to simplify."));
+    }
+
+    public override IOperation Apply() {
+      var tree = SymbolicExpressionTreeParameter.ActualValue;
+      var simplifiedTree = TreeSimplifier.Simplify(tree);
+      simplifiedTree = TreeSimplifier.Simplify(simplifiedTree);
+      SymbolicExpressionTreeParameter.ActualValue = simplifiedTree;
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs	(revision 16132)
@@ -0,0 +1,179 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  /// <summary>
+  /// Abstract base class for symbolic data analysis models
+  /// </summary>
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisModel : NamedItem, ISymbolicDataAnalysisModel {
+    public static new Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; }
+    }
+
+    #region properties
+    [Storable]
+    private double lowerEstimationLimit;
+    public double LowerEstimationLimit { get { return lowerEstimationLimit; } }
+    [Storable]
+    private double upperEstimationLimit;
+    public double UpperEstimationLimit { get { return upperEstimationLimit; } }
+
+    [Storable]
+    private ISymbolicExpressionTree symbolicExpressionTree;
+    public ISymbolicExpressionTree SymbolicExpressionTree {
+      get { return symbolicExpressionTree; }
+    }
+
+    [Storable]
+    private ISymbolicDataAnalysisExpressionTreeInterpreter interpreter;
+    public ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter {
+      get { return interpreter; }
+    }
+
+    public IEnumerable<string> VariablesUsedForPrediction {
+      get {
+        var variables =
+          SymbolicExpressionTree.IterateNodesPrefix()
+            .OfType<IVariableTreeNode>()
+            .Select(x => x.VariableName)
+            .Distinct();
+
+        return variables.OrderBy(x => x);
+      }
+    }
+
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisModel(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisModel(SymbolicDataAnalysisModel original, Cloner cloner)
+      : base(original, cloner) {
+      this.symbolicExpressionTree = cloner.Clone(original.symbolicExpressionTree);
+      this.interpreter = cloner.Clone(original.interpreter);
+      this.lowerEstimationLimit = original.lowerEstimationLimit;
+      this.upperEstimationLimit = original.upperEstimationLimit;
+    }
+    protected SymbolicDataAnalysisModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+       double lowerEstimationLimit, double upperEstimationLimit)
+      : base() {
+      this.name = ItemName;
+      this.description = ItemDescription;
+      this.symbolicExpressionTree = tree;
+      this.interpreter = interpreter;
+      this.lowerEstimationLimit = lowerEstimationLimit;
+      this.upperEstimationLimit = upperEstimationLimit;
+    }
+
+    #region Scaling
+    protected void Scale(IDataAnalysisProblemData problemData, string targetVariable) {
+      var dataset = problemData.Dataset;
+      var rows = problemData.TrainingIndices;
+      var estimatedValues = Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows);
+      var targetValues = dataset.GetDoubleValues(targetVariable, rows);
+
+      var linearScalingCalculator = new OnlineLinearScalingParameterCalculator();
+      var targetValuesEnumerator = targetValues.GetEnumerator();
+      var estimatedValuesEnumerator = estimatedValues.GetEnumerator();
+      while (targetValuesEnumerator.MoveNext() & estimatedValuesEnumerator.MoveNext()) {
+        double target = targetValuesEnumerator.Current;
+        double estimated = estimatedValuesEnumerator.Current;
+        if (!double.IsNaN(estimated) && !double.IsInfinity(estimated))
+          linearScalingCalculator.Add(estimated, target);
+      }
+      if (linearScalingCalculator.ErrorState == OnlineCalculatorError.None && (targetValuesEnumerator.MoveNext() || estimatedValuesEnumerator.MoveNext()))
+        throw new ArgumentException("Number of elements in target and estimated values enumeration do not match.");
+
+      double alpha = linearScalingCalculator.Alpha;
+      double beta = linearScalingCalculator.Beta;
+      if (linearScalingCalculator.ErrorState != OnlineCalculatorError.None) return;
+
+      ConstantTreeNode alphaTreeNode = null;
+      ConstantTreeNode betaTreeNode = null;
+      // check if model has been scaled previously by analyzing the structure of the tree
+      var startNode = SymbolicExpressionTree.Root.GetSubtree(0);
+      if (startNode.GetSubtree(0).Symbol is Addition) {
+        var addNode = startNode.GetSubtree(0);
+        if (addNode.SubtreeCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) {
+          alphaTreeNode = addNode.GetSubtree(1) as ConstantTreeNode;
+          var mulNode = addNode.GetSubtree(0);
+          if (mulNode.SubtreeCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
+            betaTreeNode = mulNode.GetSubtree(1) as ConstantTreeNode;
+          }
+        }
+      }
+      // if tree structure matches the structure necessary for linear scaling then reuse the existing tree nodes
+      if (alphaTreeNode != null && betaTreeNode != null) {
+        betaTreeNode.Value *= beta;
+        alphaTreeNode.Value *= beta;
+        alphaTreeNode.Value += alpha;
+      } else {
+        var mainBranch = startNode.GetSubtree(0);
+        startNode.RemoveSubtree(0);
+        var scaledMainBranch = MakeSum(MakeProduct(mainBranch, beta), alpha);
+        startNode.AddSubtree(scaledMainBranch);
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeSum(ISymbolicExpressionTreeNode treeNode, double alpha) {
+      if (alpha.IsAlmost(0.0)) {
+        return treeNode;
+      } else {
+        var addition = new Addition();
+        var node = addition.CreateTreeNode();
+        var alphaConst = MakeConstant(alpha);
+        node.AddSubtree(treeNode);
+        node.AddSubtree(alphaConst);
+        return node;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeProduct(ISymbolicExpressionTreeNode treeNode, double beta) {
+      if (beta.IsAlmost(1.0)) {
+        return treeNode;
+      } else {
+        var multipliciation = new Multiplication();
+        var node = multipliciation.CreateTreeNode();
+        var betaConst = MakeConstant(beta);
+        node.AddSubtree(treeNode);
+        node.AddSubtree(betaConst);
+        return node;
+      }
+    }
+
+    private static ISymbolicExpressionTreeNode MakeConstant(double c) {
+      var node = (ConstantTreeNode)(new Constant()).CreateTreeNode();
+      node.Value = c;
+      return node;
+    }
+    #endregion
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModelComplexityCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModelComplexityCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModelComplexityCalculator.cs	(revision 16132)
@@ -0,0 +1,99 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public static class SymbolicDataAnalysisModelComplexityCalculator {
+    public static double CalculateComplexity(ISymbolicExpressionTree tree) {
+      return CalculateComplexity(tree.Root);
+    }
+    public static double CalculateComplexity(ISymbolicExpressionTreeNode treeNode) {
+      var node = treeNode;
+      if (node.Symbol is ProgramRootSymbol) node = node.GetSubtree(0);
+      if (node.Symbol is StartSymbol) node = node.GetSubtree(0);
+
+      switch (OpCodes.MapSymbolToOpCode(node)) {
+        case OpCodes.Constant: {
+            return 1;
+          }
+        case OpCodes.Variable:
+        case OpCodes.BinaryFactorVariable:
+        case OpCodes.FactorVariable: {
+            return 2;
+          }
+        case OpCodes.Add:
+        case OpCodes.Sub: {
+            double complexity = 0;
+            for (int i = 0; i < node.SubtreeCount; i++) {
+              complexity += CalculateComplexity(node.GetSubtree(i));
+            }
+            return complexity;
+          }
+        case OpCodes.Mul:
+        case OpCodes.Div: {
+            double complexity = 1;
+            for (int i = 0; i < node.SubtreeCount; i++) {
+              var nodeComplexity = CalculateComplexity(node.GetSubtree(i));
+              complexity *= nodeComplexity + 1;
+            }
+            return complexity;
+          }
+        case OpCodes.Sin:
+        case OpCodes.Cos:
+        case OpCodes.Tan:
+        case OpCodes.Exp:
+        case OpCodes.Log: {
+            double complexity = CalculateComplexity(node.GetSubtree(0));
+            return Math.Pow(2.0, complexity);
+          }
+        case OpCodes.Square: {
+            double complexity = CalculateComplexity(node.GetSubtree(0));
+            return complexity * complexity;
+          }
+        case OpCodes.SquareRoot: {
+            double complexity = CalculateComplexity(node.GetSubtree(0));
+            return complexity * complexity * complexity;
+          }
+        case OpCodes.Power:
+        case OpCodes.Root: {
+            double complexity = CalculateComplexity(node.GetSubtree(0));
+            var exponent = node.GetSubtree(1) as ConstantTreeNode;
+            if (exponent != null) {
+              double expVal = exponent.Value;
+              if (expVal < 0) expVal = Math.Abs(expVal);
+              if (expVal < 1) expVal = 1 / expVal;
+              return Math.Pow(complexity, Math.Round(expVal));
+            }
+
+            double expComplexity = CalculateComplexity(node.GetSubtree(1));
+            return Math.Pow(complexity, 2 * expComplexity);
+          }
+
+        default:
+          throw new NotSupportedException();
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisMultiObjectiveProblem.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisMultiObjectiveProblem.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisMultiObjectiveProblem.cs	(revision 16132)
@@ -0,0 +1,101 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisMultiObjectiveProblem
+    where T : class,IDataAnalysisProblemData
+    where U : class, ISymbolicDataAnalysisMultiObjectiveEvaluator<T>
+    where V : class, ISymbolicDataAnalysisSolutionCreator {
+    private const string MaximizationParameterName = "Maximization";
+    private const string BestKnownQualityParameterName = "BestKnownQuality";
+
+    #region parameter properties
+    public IValueParameter<BoolArray> MaximizationParameter {
+      get { return (IValueParameter<BoolArray>)Parameters[MaximizationParameterName]; }
+    }
+    IParameter IMultiObjectiveHeuristicOptimizationProblem.MaximizationParameter {
+      get { return MaximizationParameter; }
+    }
+    #endregion
+
+    #region properties
+    public BoolArray Maximization {
+      get { return MaximizationParameter.Value; }
+      set { MaximizationParameter.Value = value; }
+    }
+    IMultiObjectiveEvaluator IMultiObjectiveHeuristicOptimizationProblem.Evaluator {
+      get { return Evaluator; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisMultiObjectiveProblem(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisMultiObjectiveProblem(SymbolicDataAnalysisMultiObjectiveProblem<T, U, V> original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterEventHandler();
+    }
+
+    public SymbolicDataAnalysisMultiObjectiveProblem(T problemData, U evaluator, V solutionCreator)
+      : base(problemData, evaluator, solutionCreator) {
+      Parameters.Add(new ValueParameter<BoolArray>(MaximizationParameterName, "Set to false if the problem should be minimized."));
+
+      ParameterizeOperators();
+      RegisterEventHandler();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEventHandler();
+    }
+
+    private void RegisterEventHandler() {
+      Evaluator.QualitiesParameter.ActualNameChanged += new System.EventHandler(QualitiesParameter_ActualNameChanged);
+    }
+
+    protected override void OnEvaluatorChanged() {
+      base.OnEvaluatorChanged();
+      Evaluator.QualitiesParameter.ActualNameChanged += new System.EventHandler(QualitiesParameter_ActualNameChanged);
+      Maximization = new BoolArray(Evaluator.Maximization.ToArray());
+      ParameterizeOperators();
+    }
+
+    private void QualitiesParameter_ActualNameChanged(object sender, System.EventArgs e) {
+      ParameterizeOperators();
+    }
+
+    protected override void ParameterizeOperators() {
+      base.ParameterizeOperators();
+      foreach (var op in Operators.OfType<ISymbolicDataAnalysisMultiObjectiveAnalyzer>()) {
+        op.QualitiesParameter.ActualName = Evaluator.QualitiesParameter.ActualName;
+        op.MaximizationParameter.ActualName = MaximizationParameterName;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 16132)
@@ -0,0 +1,422 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Common.Resources;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Problems.Instances;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisProblem<T, U, V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>, ISymbolicDataAnalysisProblem, IStorableContent,
+    IProblemInstanceConsumer<T>, IProblemInstanceExporter<T>
+    where T : class, IDataAnalysisProblemData
+    where U : class, ISymbolicDataAnalysisEvaluator<T>
+    where V : class, ISymbolicDataAnalysisSolutionCreator {
+
+    #region parameter names & descriptions
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string SymbolicExpressionTreeGrammarParameterName = "SymbolicExpressionTreeGrammar";
+    private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string MaximumFunctionDefinitionsParameterName = "MaximumFunctionDefinitions";
+    private const string MaximumFunctionArgumentsParameterName = "MaximumFunctionArguments";
+    private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+    private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
+    private const string ValidationPartitionParameterName = "ValidationPartition";
+    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
+
+    private const string ProblemDataParameterDescription = "";
+    private const string SymbolicExpressionTreeGrammarParameterDescription = "The grammar that should be used for symbolic expression tree.";
+    private const string SymoblicExpressionTreeInterpreterParameterDescription = "The interpreter that should be used to evaluate the symbolic expression tree.";
+    private const string MaximumSymbolicExpressionTreeDepthParameterDescription = "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.";
+    private const string MaximumSymbolicExpressionTreeLengthParameterDescription = "Maximal length of the symbolic expression.";
+    private const string MaximumFunctionDefinitionsParameterDescription = "Maximal number of automatically defined functions";
+    private const string MaximumFunctionArgumentsParameterDescription = "Maximal number of arguments of automatically defined functions.";
+    private const string RelativeNumberOfEvaluatedSamplesParameterDescription = "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation.";
+    private const string FitnessCalculationPartitionParameterDescription = "The partition of the problem data training partition, that should be used to calculate the fitness of an individual.";
+    private const string ValidationPartitionParameterDescription = "The partition of the problem data training partition, that should be used to select the best model from (optional).";
+    private const string ApplyLinearScalingParameterDescription = "Flag that indicates if the individual should be linearly scaled before evaluating.";
+    #endregion
+
+    #region parameter properties
+    IParameter IDataAnalysisProblem.ProblemDataParameter {
+      get { return ProblemDataParameter; }
+    }
+    public IValueParameter<T> ProblemDataParameter {
+      get { return (IValueParameter<T>)Parameters[ProblemDataParameterName]; }
+    }
+    public IValueParameter<ISymbolicDataAnalysisGrammar> SymbolicExpressionTreeGrammarParameter {
+      get { return (IValueParameter<ISymbolicDataAnalysisGrammar>)Parameters[SymbolicExpressionTreeGrammarParameterName]; }
+    }
+    public IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
+      get { return (IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> MaximumFunctionDefinitionsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionDefinitionsParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> MaximumFunctionArgumentsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumFunctionArgumentsParameterName]; }
+    }
+    public IFixedValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+      get { return (IFixedValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+    }
+    public IFixedValueParameter<IntRange> FitnessCalculationPartitionParameter {
+      get { return (IFixedValueParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }
+    }
+    public IFixedValueParameter<IntRange> ValidationPartitionParameter {
+      get { return (IFixedValueParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> ApplyLinearScalingParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
+    }
+    #endregion
+
+    #region properties
+    public string Filename { get; set; }
+    public static new Image StaticItemImage { get { return VSImageLibrary.Type; } }
+
+    IDataAnalysisProblemData IDataAnalysisProblem.ProblemData {
+      get { return ProblemData; }
+    }
+    public T ProblemData {
+      get { return ProblemDataParameter.Value; }
+      set { ProblemDataParameter.Value = value; }
+    }
+
+    public ISymbolicDataAnalysisGrammar SymbolicExpressionTreeGrammar {
+      get { return SymbolicExpressionTreeGrammarParameter.Value; }
+      set { SymbolicExpressionTreeGrammarParameter.Value = value; }
+    }
+    public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
+      get { return SymbolicExpressionTreeInterpreterParameter.Value; }
+      set { SymbolicExpressionTreeInterpreterParameter.Value = value; }
+    }
+
+    public IntValue MaximumSymbolicExpressionTreeDepth {
+      get { return MaximumSymbolicExpressionTreeDepthParameter.Value; }
+    }
+    public IntValue MaximumSymbolicExpressionTreeLength {
+      get { return MaximumSymbolicExpressionTreeLengthParameter.Value; }
+    }
+    public IntValue MaximumFunctionDefinitions {
+      get { return MaximumFunctionDefinitionsParameter.Value; }
+    }
+    public IntValue MaximumFunctionArguments {
+      get { return MaximumFunctionArgumentsParameter.Value; }
+    }
+    public PercentValue RelativeNumberOfEvaluatedSamples {
+      get { return RelativeNumberOfEvaluatedSamplesParameter.Value; }
+    }
+
+    public IntRange FitnessCalculationPartition {
+      get { return FitnessCalculationPartitionParameter.Value; }
+    }
+    public IntRange ValidationPartition {
+      get { return ValidationPartitionParameter.Value; }
+    }
+    public BoolValue ApplyLinearScaling {
+      get { return ApplyLinearScalingParameter.Value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisProblem(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(ApplyLinearScalingParameterName)) {
+        Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, ApplyLinearScalingParameterDescription, new BoolValue(false)));
+        ApplyLinearScalingParameter.Hidden = true;
+
+        //it is assumed that for all symbolic regression algorithms linear scaling was set to true
+        //there is no possibility to determine the previous value of the parameter as it was stored in the evaluator
+        if (GetType().Name.Contains("SymbolicRegression"))
+          ApplyLinearScaling.Value = true;
+      }
+
+      RegisterEventHandlers();
+    }
+    protected SymbolicDataAnalysisProblem(SymbolicDataAnalysisProblem<T, U, V> original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterEventHandlers();
+    }
+
+    protected SymbolicDataAnalysisProblem(T problemData, U evaluator, V solutionCreator)
+      : base(evaluator, solutionCreator) {
+      Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription, problemData));
+      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(SymbolicExpressionTreeGrammarParameterName, SymbolicExpressionTreeGrammarParameterDescription));
+      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, SymoblicExpressionTreeInterpreterParameterDescription));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, MaximumSymbolicExpressionTreeDepthParameterDescription));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, MaximumSymbolicExpressionTreeLengthParameterDescription));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionDefinitionsParameterName, MaximumFunctionDefinitionsParameterDescription));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumFunctionArgumentsParameterName, MaximumFunctionArgumentsParameterDescription));
+      Parameters.Add(new FixedValueParameter<IntRange>(FitnessCalculationPartitionParameterName, FitnessCalculationPartitionParameterDescription));
+      Parameters.Add(new FixedValueParameter<IntRange>(ValidationPartitionParameterName, ValidationPartitionParameterDescription));
+      Parameters.Add(new FixedValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, RelativeNumberOfEvaluatedSamplesParameterDescription, new PercentValue(1)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, ApplyLinearScalingParameterDescription, new BoolValue(false)));
+
+      SymbolicExpressionTreeInterpreterParameter.Hidden = true;
+      MaximumFunctionArgumentsParameter.Hidden = true;
+      MaximumFunctionDefinitionsParameter.Hidden = true;
+      ApplyLinearScalingParameter.Hidden = true;
+
+      SymbolicExpressionTreeGrammar = new TypeCoherentExpressionGrammar();
+      SymbolicExpressionTreeInterpreter = new SymbolicDataAnalysisExpressionTreeLinearInterpreter();
+
+      FitnessCalculationPartition.Start = ProblemData.TrainingPartition.Start;
+      FitnessCalculationPartition.End = ProblemData.TrainingPartition.End;
+
+      InitializeOperators();
+
+      UpdateGrammar();
+      RegisterEventHandlers();
+    }
+
+    protected virtual void UpdateGrammar() {
+      var problemData = ProblemData;
+      var ds = problemData.Dataset;
+      var grammar = SymbolicExpressionTreeGrammar;
+      grammar.MaximumFunctionArguments = MaximumFunctionArguments.Value;
+      grammar.MaximumFunctionDefinitions = MaximumFunctionDefinitions.Value;
+      foreach (var varSymbol in grammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.VariableBase>()) {
+        if (!varSymbol.Fixed) {
+          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => ds.VariableHasType<double>(x));
+          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => ds.VariableHasType<double>(x));
+        }
+      }
+      foreach (var factorSymbol in grammar.Symbols.OfType<BinaryFactorVariable>()) {
+        if (!factorSymbol.Fixed) {
+          factorSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => ds.VariableHasType<string>(x));
+          factorSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => ds.VariableHasType<string>(x));
+          factorSymbol.VariableValues = factorSymbol.VariableNames
+            .ToDictionary(varName => varName, varName => ds.GetStringValues(varName).Distinct().ToList());
+        }
+      }
+      foreach (var factorSymbol in grammar.Symbols.OfType<FactorVariable>()) {
+        if (!factorSymbol.Fixed) {
+          factorSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => ds.VariableHasType<string>(x));
+          factorSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => ds.VariableHasType<string>(x));
+          factorSymbol.VariableValues = factorSymbol.VariableNames
+            .ToDictionary(varName => varName,
+            varName => ds.GetStringValues(varName).Distinct()
+            .Select((n, i) => Tuple.Create(n, i))
+            .ToDictionary(tup => tup.Item1, tup => tup.Item2));
+        }
+      }
+    }
+
+    private void InitializeOperators() {
+      var operators = new HashSet<IItem>(new TypeEqualityComparer<IItem>());
+      operators.Add(new SubtreeCrossover());
+      operators.Add(new MultiSymbolicExpressionTreeManipulator());
+
+      foreach (var op in ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>())
+        operators.Add(op);
+      foreach (var op in ApplicationManager.Manager.GetInstances<ISymbolicDataAnalysisExpressionCrossover<T>>())
+        operators.Add(op);
+
+      operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer());
+      operators.Add(new SymbolicDataAnalysisVariableFrequencyAnalyzer());
+      operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
+      operators.Add(new SymbolicExpressionTreeLengthAnalyzer());
+      operators.Add(new SymbolicExpressionTreeBottomUpSimilarityCalculator());
+      operators.Add(new SymbolicDataAnalysisBottomUpDiversityAnalyzer(operators.OfType<SymbolicExpressionTreeBottomUpSimilarityCalculator>().First()));
+
+      Operators.AddRange(operators);
+      Operators.Add(new SymbolicDataAnalysisGenealogyAnalyzer());
+      ParameterizeOperators();
+    }
+
+    #region events
+    private void RegisterEventHandlers() {
+      ProblemDataParameter.ValueChanged += new EventHandler(ProblemDataParameter_ValueChanged);
+      ProblemDataParameter.Value.Changed += (object sender, EventArgs e) => OnProblemDataChanged();
+
+      SymbolicExpressionTreeGrammarParameter.ValueChanged += new EventHandler(SymbolicExpressionTreeGrammarParameter_ValueChanged);
+
+      MaximumFunctionArguments.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
+      MaximumFunctionDefinitions.ValueChanged += new EventHandler(ArchitectureParameterValue_ValueChanged);
+      MaximumSymbolicExpressionTreeDepth.ValueChanged += new EventHandler(MaximumSymbolicExpressionTreeDepth_ValueChanged);
+    }
+
+    private void ProblemDataParameter_ValueChanged(object sender, EventArgs e) {
+      ValidationPartition.Start = 0;
+      ValidationPartition.End = 0;
+      ProblemDataParameter.Value.Changed += (object s, EventArgs args) => OnProblemDataChanged();
+      OnProblemDataChanged();
+    }
+
+    private void SymbolicExpressionTreeGrammarParameter_ValueChanged(object sender, EventArgs e) {
+      UpdateGrammar();
+    }
+
+    private void ArchitectureParameterValue_ValueChanged(object sender, EventArgs e) {
+      UpdateGrammar();
+    }
+
+    private void MaximumSymbolicExpressionTreeDepth_ValueChanged(object sender, EventArgs e) {
+      if (MaximumSymbolicExpressionTreeDepth != null && MaximumSymbolicExpressionTreeDepth.Value < 3)
+        MaximumSymbolicExpressionTreeDepth.Value = 3;
+    }
+
+    protected override void OnSolutionCreatorChanged() {
+      base.OnSolutionCreatorChanged();
+      SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);
+      ParameterizeOperators();
+    }
+
+    private void SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeOperators();
+    }
+
+    protected override void OnEvaluatorChanged() {
+      base.OnEvaluatorChanged();
+      ParameterizeOperators();
+    }
+
+    public event EventHandler ProblemDataChanged;
+    protected virtual void OnProblemDataChanged() {
+      FitnessCalculationPartition.Start = ProblemData.TrainingPartition.Start;
+      FitnessCalculationPartition.End = ProblemData.TrainingPartition.End;
+
+      UpdateGrammar();
+      ParameterizeOperators();
+
+      var handler = ProblemDataChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+
+      OnReset();
+    }
+    #endregion
+
+    protected virtual void ParameterizeOperators() {
+      var operators =
+        Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators).ToList();
+
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>()) {
+        op.SymbolicExpressionTreeGrammarParameter.ActualName = SymbolicExpressionTreeGrammarParameter.Name;
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) {
+        op.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaximumSymbolicExpressionTreeDepthParameter.Name;
+        op.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaximumSymbolicExpressionTreeLengthParameter.Name;
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeArchitectureAlteringOperator>()) {
+        op.MaximumFunctionArgumentsParameter.ActualName = MaximumFunctionArgumentsParameter.Name;
+        op.MaximumFunctionDefinitionsParameter.ActualName = MaximumFunctionDefinitionsParameter.Name;
+      }
+      foreach (var op in operators.OfType<ISymbolicDataAnalysisEvaluator<T>>()) {
+        op.ProblemDataParameter.ActualName = ProblemDataParameterName;
+        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+        op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
+        op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
+        op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name;
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeCrossover>()) {
+        op.ParentsParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeManipulator>()) {
+        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+      foreach (var op in operators.OfType<ISymbolicExpressionTreeAnalyzer>()) {
+        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+      foreach (var op in operators.OfType<ISymbolicDataAnalysisSingleObjectiveAnalyzer>()) {
+        op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name;
+      }
+      foreach (var op in operators.OfType<ISymbolicDataAnalysisMultiObjectiveAnalyzer>()) {
+        op.ApplyLinearScalingParameter.ActualName = ApplyLinearScalingParameter.Name;
+      }
+      foreach (var op in operators.OfType<ISymbolicDataAnalysisAnalyzer>()) {
+        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+      foreach (var op in operators.OfType<ISymbolicDataAnalysisValidationAnalyzer<U, T>>()) {
+        op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
+        op.ValidationPartitionParameter.ActualName = ValidationPartitionParameter.Name;
+      }
+      foreach (var op in operators.OfType<ISymbolicDataAnalysisInterpreterOperator>()) {
+        op.SymbolicDataAnalysisTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;
+      }
+      foreach (var op in operators.OfType<ISymbolicDataAnalysisExpressionCrossover<T>>()) {
+        op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
+        op.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
+        op.EvaluationPartitionParameter.ActualName = FitnessCalculationPartitionParameter.Name;
+        op.RelativeNumberOfEvaluatedSamplesParameter.ActualName = RelativeNumberOfEvaluatedSamplesParameter.Name;
+        op.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
+      }
+      // add tracking analyzer
+      foreach (var op in operators.OfType<SymbolicDataAnalysisGenealogyAnalyzer>()) {
+        op.BeforeCrossoverOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionBeforeCrossoverOperator();
+        op.AfterCrossoverOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionAfterCrossoverOperator();
+        op.BeforeManipulatorOperatorParameter.ActualValue =
+          new SymbolicDataAnalysisExpressionBeforeManipulatorOperator();
+        op.AfterManipulatorOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionAfterManipulatorOperator();
+        // get crossover parameter names
+        var crossover = operators.OfType<ISymbolicExpressionTreeCrossover>().FirstOrDefault();
+        if (crossover != null) {
+          op.BeforeCrossoverOperator.ParentsParameter.ActualName = crossover.ParentsParameter.Name;
+          op.AfterCrossoverOperator.ParentsParameter.ActualName = crossover.ParentsParameter.Name;
+          op.BeforeCrossoverOperator.ChildParameter.ActualName = crossover.SymbolicExpressionTreeParameter.Name;
+          op.AfterCrossoverOperator.ChildParameter.ActualName = crossover.SymbolicExpressionTreeParameter.Name;
+          // get manipulator parameter names
+          var manipulator = operators.OfType<ISymbolicExpressionTreeManipulator>().FirstOrDefault();
+          if (manipulator != null) {
+            op.BeforeManipulatorOperator.ChildParameter.ActualName = manipulator.SymbolicExpressionTreeParameter.Name;
+            op.AfterManipulatorOperator.ChildParameter.ActualName = manipulator.SymbolicExpressionTreeParameter.Name;
+          }
+          var creator = operators.OfType<ISymbolicExpressionTreeCreator>().FirstOrDefault();
+          if (creator != null) {
+            op.PopulationParameter.ActualName = creator.SymbolicExpressionTreeParameter.ActualName;
+          }
+        }
+      }
+    }
+
+    #region Import & Export
+    public virtual void Load(T data) {
+      Name = data.Name;
+      Description = data.Description;
+      ProblemData = data;
+    }
+
+    public virtual T Export() {
+      return ProblemData;
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSingleObjectiveProblem.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSingleObjectiveProblem.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSingleObjectiveProblem.cs	(revision 16132)
@@ -0,0 +1,124 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisSingleObjectiveProblem<T, U, V> : SymbolicDataAnalysisProblem<T, U, V>, ISymbolicDataAnalysisSingleObjectiveProblem
+    where T : class, IDataAnalysisProblemData
+    where U : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<T>
+    where V : class, ISymbolicDataAnalysisSolutionCreator {
+    private const string MaximizationParameterName = "Maximization";
+    private const string BestKnownQualityParameterName = "BestKnownQuality";
+
+    #region parameter properties
+    public IFixedValueParameter<BoolValue> MaximizationParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[MaximizationParameterName]; }
+    }
+    IParameter ISingleObjectiveHeuristicOptimizationProblem.MaximizationParameter {
+      get { return MaximizationParameter; }
+    }
+    public IFixedValueParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters[BestKnownQualityParameterName]; }
+    }
+    IParameter ISingleObjectiveHeuristicOptimizationProblem.BestKnownQualityParameter {
+      get { return BestKnownQualityParameter; }
+    }
+    #endregion
+
+    #region properties
+    public BoolValue Maximization {
+      get { return MaximizationParameter.Value; }
+    }
+    public DoubleValue BestKnownQuality {
+      get { return BestKnownQualityParameter.Value; }
+    }
+    ISingleObjectiveEvaluator ISingleObjectiveHeuristicOptimizationProblem.Evaluator {
+      get { return Evaluator; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSingleObjectiveProblem(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisSingleObjectiveProblem(SymbolicDataAnalysisSingleObjectiveProblem<T, U, V> original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterEventHandler();
+      MaximizationParameter.Hidden = true;
+    }
+
+    protected SymbolicDataAnalysisSingleObjectiveProblem(T problemData, U evaluator, V solutionCreator)
+      : base(problemData, evaluator, solutionCreator) {
+      Parameters.Add(new FixedValueParameter<BoolValue>(MaximizationParameterName, "Set to false if the problem should be minimized."));
+      Parameters.Add(new FixedValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem."));
+
+      MaximizationParameter.Hidden = true;
+      InitializeOperators();
+      RegisterEventHandler();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEventHandler();
+    }
+
+    private void InitializeOperators() {
+      Operators.Add(new SymbolicDataAnalysisAlleleFrequencyAnalyzer());
+      ParameterizeOperators();
+    }
+
+    private void RegisterEventHandler() {
+      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(QualityParameter_ActualNameChanged);
+    }
+
+    protected override void OnEvaluatorChanged() {
+      base.OnEvaluatorChanged();
+      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(QualityParameter_ActualNameChanged);
+      Maximization.Value = base.Evaluator.Maximization;
+      ParameterizeOperators();
+    }
+
+    private void QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeOperators();
+    }
+
+    protected override void ParameterizeOperators() {
+      base.ParameterizeOperators();
+
+      foreach (var op in Operators.OfType<ISymbolicDataAnalysisSingleObjectiveAnalyzer>()) {
+        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        op.MaximizationParameter.ActualName = MaximizationParameterName;
+      }
+
+      foreach (var op in Operators.OfType<SymbolicDataAnalysisGenealogyAnalyzer>()) {
+        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        op.PopulationParameter.ActualName = Evaluator.SymbolicExpressionTreeParameter.ActualName;
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs	(revision 16132)
@@ -0,0 +1,112 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisSolutionImpactValuesCalculator", "Calculates the impact values and replacements values for symbolic expression tree nodes.")]
+  public abstract class SymbolicDataAnalysisSolutionImpactValuesCalculator : Item, ISymbolicDataAnalysisSolutionImpactValuesCalculator {
+    protected SymbolicDataAnalysisSolutionImpactValuesCalculator() { }
+    protected SymbolicDataAnalysisSolutionImpactValuesCalculator(SymbolicDataAnalysisSolutionImpactValuesCalculator original, Cloner cloner)
+      : base(original, cloner) { }
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSolutionImpactValuesCalculator(bool deserializing) : base(deserializing) { }
+
+    public virtual void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows,
+        out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation,
+        double qualityForImpactsCalculation = double.NaN) {
+
+      var cloner = new Cloner();
+      var tempModel = cloner.Clone(model);
+
+      if (double.IsNaN(qualityForImpactsCalculation)) {
+        qualityForImpactsCalculation = CalculateQualityForImpacts(tempModel, problemData, rows);
+      }
+
+      var tempModelNode = (ISymbolicExpressionTreeNode)cloner.GetClone(node);
+      var tempModelParentNode = tempModelNode.Parent;
+      int i = tempModelParentNode.IndexOfSubtree(tempModelNode);
+
+      double bestReplacementValue = 0.0;
+      double bestImpactValue = double.PositiveInfinity;
+      newQualityForImpactsCalculation = qualityForImpactsCalculation; // initialize
+      // try the potentially reasonable replacement values and use the best one
+      foreach (var repValue in CalculateReplacementValues(node, model.SymbolicExpressionTree, model.Interpreter, problemData.Dataset, rows)) {
+        tempModelParentNode.RemoveSubtree(i);
+
+        var constantNode = new ConstantTreeNode(new Constant()) { Value = repValue };
+        tempModelParentNode.InsertSubtree(i, constantNode);
+
+        newQualityForImpactsCalculation = CalculateQualityForImpacts(tempModel, problemData, rows);
+
+        impactValue = qualityForImpactsCalculation - newQualityForImpactsCalculation;
+        if (impactValue < bestImpactValue) {
+          bestImpactValue = impactValue;
+          bestReplacementValue = repValue;
+        }
+      }
+
+      replacementValue = bestReplacementValue;
+      impactValue = bestImpactValue;
+    }
+
+    protected abstract double CalculateQualityForImpacts(ISymbolicDataAnalysisModel model, IDataAnalysisProblemData problemData, IEnumerable<int> rows);
+
+    protected IEnumerable<double> CalculateReplacementValues(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+      IDataset dataset, IEnumerable<int> rows) {
+      //optimization: constant nodes return always the same value
+      ConstantTreeNode constantNode = node as ConstantTreeNode;
+      BinaryFactorVariableTreeNode binaryFactorNode = node as BinaryFactorVariableTreeNode;
+      FactorVariableTreeNode factorNode = node as FactorVariableTreeNode;
+      if (constantNode != null) {
+        yield return constantNode.Value;
+      } else if (binaryFactorNode != null) {
+        // valid replacements are either all off or all on
+        yield return 0;
+        yield return 1;
+      } else if (factorNode != null) {
+        foreach (var w in factorNode.Weights) yield return w;
+        yield return 0.0;
+      } else {
+        var rootSymbol = new ProgramRootSymbol().CreateTreeNode();
+        var startSymbol = new StartSymbol().CreateTreeNode();
+        rootSymbol.AddSubtree(startSymbol);
+        startSymbol.AddSubtree((ISymbolicExpressionTreeNode)node.Clone());
+
+        var tempTree = new SymbolicExpressionTree(rootSymbol);
+        // clone ADFs of source tree
+        for (int i = 1; i < sourceTree.Root.SubtreeCount; i++) {
+          tempTree.Root.AddSubtree((ISymbolicExpressionTreeNode)sourceTree.Root.GetSubtree(i).Clone());
+        }
+        yield return interpreter.GetSymbolicExpressionTreeValues(tempTree, dataset, rows).Median();
+        yield return interpreter.GetSymbolicExpressionTreeValues(tempTree, dataset, rows).Average(); // TODO perf
+      }
+    }
+
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionPruningOptimizer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionPruningOptimizer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionPruningOptimizer.cs	(revision 16132)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SymbolicDataAnalysisSolutionPruningOptimizer", "An operator which automatically removes nodes that have a negative impact from the tree model, optimizing the remaining constants.")]
+  [StorableClass]
+  public abstract class SymbolicDataAnalysisSolutionPruningOptimizer {
+    public abstract ISymbolicDataAnalysisSolution PruneAndOptimizeSolution(ISymbolicDataAnalysisSolution solution);
+
+    protected ConstantTreeNode MakeConstantTreeNode(double value) {
+      var constant = new Constant { MinValue = value - 1, MaxValue = value + 1 };
+      var constantTreeNode = (ConstantTreeNode)constant.CreateTreeNode();
+      constantTreeNode.Value = value;
+      return constantTreeNode;
+    }
+
+    protected void ReplaceWithConstantNode(ISymbolicExpressionTreeNode originalNode, ISymbolicExpressionTreeNode constantNode) {
+      var parent = originalNode.Parent;
+      var index = parent.IndexOfSubtree(originalNode);
+      parent.RemoveSubtree(index);
+      parent.InsertSubtree(index, constantNode);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Addition.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Addition.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Addition.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Addition", "Symbol that represents the + operator.")]
+  public sealed class Addition : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/AiryA.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/AiryA.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/AiryA.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("AiryA", "Symbol that represents the Airy A function.")]
+  public sealed class AiryA : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private AiryA(bool deserializing) : base(deserializing) { }
+    private AiryA(AiryA original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AiryA(this, cloner);
+    }
+    public AiryA() : base("AiryA", "Symbol that represents the Airy A function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/AiryB.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/AiryB.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/AiryB.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("AiryB", "Symbol that represents the Airy B function.")]
+  public sealed class AiryB : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private AiryB(bool deserializing) : base(deserializing) { }
+    private AiryB(AiryB original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AiryB(this, cloner);
+    }
+    public AiryB() : base("AiryB", "Symbol that represents the Airy B function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/And.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/And.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/And.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("And", "Symbol that represents the boolean AND operator.")]
+  public sealed class And : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/AutoregressiveVariable.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/AutoregressiveVariable.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/AutoregressiveVariable.cs	(revision 16132)
@@ -0,0 +1,39 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("AutoregressiveTargetVariable", "Represents a variable value with a time offset.")]
+  public sealed class AutoregressiveTargetVariable : LaggedVariable {
+    [StorableConstructor]
+    private AutoregressiveTargetVariable(bool deserializing) : base(deserializing) { }
+    private AutoregressiveTargetVariable(AutoregressiveTargetVariable original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public AutoregressiveTargetVariable() : base("Autoregressive Target Variable", "Represents the target variable with a time offset.") { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AutoregressiveTargetVariable(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Average.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Average.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Average.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Average", "Symbol that represents the average (arithmetic mean) function.")]
+  public sealed class Average : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Bessel.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Bessel.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Bessel.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Bessel", "Symbol that represents the Bessel function.")]
+  public sealed class Bessel : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Bessel(bool deserializing) : base(deserializing) { }
+    private Bessel(Bessel original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Bessel(this, cloner);
+    }
+    public Bessel() : base("Bessel", "Symbol that represents the Bessel function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/BinaryFactorVariable.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/BinaryFactorVariable.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/BinaryFactorVariable.cs	(revision 16132)
@@ -0,0 +1,76 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("BinaryFactorVariable", "Represents a categorical variable (comparable to factors as in R) and it's value.")]
+  public sealed class BinaryFactorVariable : VariableBase {
+
+    private readonly Dictionary<string, List<string>> variableValues;
+
+    [Storable]
+    public IEnumerable<KeyValuePair<string, List<string>>> VariableValues {
+      get { return variableValues; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        variableValues.Clear();
+        foreach (var kvp in value) {
+          variableValues.Add(kvp.Key, new List<string>(kvp.Value));
+        }
+      }
+    }
+
+    [StorableConstructor]
+    private BinaryFactorVariable(bool deserializing)
+      : base(deserializing) {
+      variableValues = new Dictionary<string, List<string>>();
+    }
+    private BinaryFactorVariable(BinaryFactorVariable original, Cloner cloner)
+      : base(original, cloner) {
+      variableValues =
+        original.variableValues.ToDictionary(kvp => kvp.Key, kvp => new List<string>(kvp.Value));
+    }
+    public BinaryFactorVariable() : this("BinaryFactorVariable", "Represents a categorical variable (comparable to factors as in R) and it's value.") { }
+    public BinaryFactorVariable(string name, string description)
+      : base(name, description) {
+      variableValues = new Dictionary<string, List<string>>();
+    }
+
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new BinaryFactorVariableTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BinaryFactorVariable(this, cloner);
+    }
+
+    public IEnumerable<string> GetVariableValues(string variableName) {
+      return variableValues[variableName];
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/BinaryFactorVariableTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/BinaryFactorVariableTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/BinaryFactorVariableTreeNode.cs	(revision 16132)
@@ -0,0 +1,84 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Random;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public sealed class BinaryFactorVariableTreeNode : VariableTreeNodeBase {
+    public new BinaryFactorVariable Symbol {
+      get { return (BinaryFactorVariable)base.Symbol; }
+    }
+
+    [Storable]
+    private string variableValue;
+    public string VariableValue {
+      get { return variableValue; }
+      set { variableValue = value; }
+    }
+
+    [StorableConstructor]
+    private BinaryFactorVariableTreeNode(bool deserializing) : base(deserializing) { }
+    private BinaryFactorVariableTreeNode(BinaryFactorVariableTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      variableValue = original.variableValue;
+    }
+    public BinaryFactorVariableTreeNode(BinaryFactorVariable variableSymbol) : base(variableSymbol) { }
+
+    public override bool HasLocalParameters {
+      get { return true; }
+    }
+
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      variableValue = Symbol.GetVariableValues(VariableName).SampleRandom(random);
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      // 50% additive & 50% multiplicative (override of functionality of base class because of a BUG)
+      if (random.NextDouble() < 0.5) {
+        double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma);
+        Weight = Weight + x * shakingFactor;
+      } else {
+        double x = NormalDistributedRandom.NextDouble(random, 1.0, Symbol.MultiplicativeWeightManipulatorSigma);
+        Weight = Weight * x;
+      }
+      if (random.NextDouble() < Symbol.VariableChangeProbability) {
+        var oldName = VariableName;
+        VariableName = Symbol.VariableNames.SampleRandom(random);
+        // reinitialize weights if variable has changed (similar to FactorVariableTreeNode)
+        if (oldName != VariableName)
+          Weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma);
+      }
+      variableValue = Symbol.GetVariableValues(VariableName).SampleRandom(random);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BinaryFactorVariableTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      return base.ToString() + " = " + variableValue;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Constant.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Constant.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Constant.cs	(revision 16132)
@@ -0,0 +1,128 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Constant", "Represents a constant value.")]
+  public sealed class Constant : Symbol {
+    #region Properties
+    [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);
+        }
+      }
+    }
+    [Storable(DefaultValue = 0.0)]
+    private double multiplicativeManipulatorSigma;
+    public double MultiplicativeManipulatorSigma {
+      get { return multiplicativeManipulatorSigma; }
+      set {
+        if (value < 0) throw new ArgumentException();
+        if (value != multiplicativeManipulatorSigma) {
+          multiplicativeManipulatorSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+    #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;
+      multiplicativeManipulatorSigma = original.multiplicativeManipulatorSigma;
+    }
+    public Constant()
+      : base("Constant", "Represents a constant value.") {
+      manipulatorMu = 0.0;
+      manipulatorSigma = 1.0;
+      multiplicativeManipulatorSigma = 0.03;
+      minValue = -20.0;
+      maxValue = 20.0;
+    }
+
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new ConstantTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Constant(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ConstantTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ConstantTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ConstantTreeNode.cs	(revision 16132)
@@ -0,0 +1,83 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [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);
+      // 50% additive & 50% multiplicative
+      if (random.NextDouble() < 0.5) {
+        double x = NormalDistributedRandom.NextDouble(random, Symbol.ManipulatorMu, Symbol.ManipulatorSigma);
+        Value = Value + x * shakingFactor;
+      } else {
+        double x = NormalDistributedRandom.NextDouble(random, 1.0, Symbol.MultiplicativeManipulatorSigma);
+        Value = Value * x;
+      }
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ConstantTreeNode(this, cloner);
+    }
+
+    public override string ToString() {
+      return constantValue.ToString("E4");
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Cosine.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Cosine.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Cosine.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Cosine", "Symbol that represents the cosine function.")]
+  public sealed class Cosine : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/CosineIntegral.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/CosineIntegral.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/CosineIntegral.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("CosineIntegral", "Symbol that represents the cosine integral.")]
+  public sealed class CosineIntegral : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private CosineIntegral(bool deserializing) : base(deserializing) { }
+    private CosineIntegral(CosineIntegral original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CosineIntegral(this, cloner);
+    }
+    public CosineIntegral() : base("CosineIntegral", "Symbol that represents the cosine integral.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Dawson.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Dawson.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Dawson.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Dawson", "Symbol that represents dawsons integral.")]
+  public sealed class Dawson : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Dawson(bool deserializing) : base(deserializing) { }
+    private Dawson(Dawson original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Dawson(this, cloner);
+    }
+    public Dawson() : base("Dawson", "Symbol that represents dawsons integral.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Derivative.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Derivative.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Derivative.cs	(revision 16132)
@@ -0,0 +1,47 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Derivative", "Represents the derivative over the specified subtree.")]
+  public sealed class Derivative : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Derivative(bool deserializing) : base(deserializing) { }
+    private Derivative(Derivative original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new Derivative(this, cloner); }
+
+    public Derivative() : base("Derivative", "Represents the derivative over the specified subtree.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Division.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Division.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Division.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Division", "Symbol that represents the / operator.")]
+  public sealed class Division : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Erf.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Erf.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Erf.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Erf", "Symbol that represents the error function.")]
+  public sealed class Erf : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Erf(bool deserializing) : base(deserializing) { }
+    private Erf(Erf original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Erf(this, cloner);
+    }
+    public Erf() : base("Erf", "Symbol that represents the error function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Exponential.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Exponential.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Exponential.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Exponential", "Symbol that represents the exponential function.")]
+  public sealed class Exponential : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ExponentialIntegralEi.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ExponentialIntegralEi.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ExponentialIntegralEi.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("ExponentialIntegralEi", "Symbol that represents the exponential integral (e_i).")]
+  public sealed class ExponentialIntegralEi : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private ExponentialIntegralEi(bool deserializing) : base(deserializing) { }
+    private ExponentialIntegralEi(ExponentialIntegralEi original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ExponentialIntegralEi(this, cloner);
+    }
+    public ExponentialIntegralEi() : base("ExponentialIntegralEi", "Symbol that represents the exponential integral (e_i).") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariable.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariable.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariable.cs	(revision 16132)
@@ -0,0 +1,78 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("FactorVariable", "Represents a categorical variable (comparable to factors as in R).")]
+  public sealed class FactorVariable : VariableBase {
+    private readonly Dictionary<string, Dictionary<string, int>> variableValues; // for each variable value also store a zero-based index
+    [Storable]
+    public IEnumerable<KeyValuePair<string, Dictionary<string, int>>> VariableValues {
+      get { return variableValues; }
+      set {
+        if(value == null) throw new ArgumentNullException();
+        variableValues.Clear();
+        foreach(var kvp in value) {
+          variableValues.Add(kvp.Key, new Dictionary<string, int>(kvp.Value));
+        }
+      }
+    }
+
+    [StorableConstructor]
+    private FactorVariable(bool deserializing)
+      : base(deserializing) {
+      variableValues = new Dictionary<string, Dictionary<string, int>>();
+    }
+    private FactorVariable(FactorVariable original, Cloner cloner)
+      : base(original, cloner) {
+      variableValues =
+        original.variableValues.ToDictionary(kvp => kvp.Key, kvp => new Dictionary<string, int>(kvp.Value));
+    }
+    public FactorVariable() : this("FactorVariable", "Represents a categorical variable (comparable to factors as in R).") { }
+    public FactorVariable(string name, string description)
+      : base(name, description) {
+      variableValues = new Dictionary<string, Dictionary<string,int>>();
+    }
+
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new FactorVariableTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FactorVariable(this, cloner);
+    }
+
+    public IEnumerable<string> GetVariableValues(string variableName) {
+      return variableValues[variableName].Keys;
+    }
+
+    public int GetIndexForValue(string variableName, string variableValue) {
+      return variableValues[variableName][variableValue];
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariableTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariableTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FactorVariableTreeNode.cs	(revision 16132)
@@ -0,0 +1,116 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public sealed class FactorVariableTreeNode : SymbolicExpressionTreeTerminalNode, IVariableTreeNode {
+    public new FactorVariable Symbol {
+      get { return (FactorVariable)base.Symbol; }
+    }
+    [Storable]
+    private double[] weights;
+    public double[] Weights {
+      get { return weights; }
+      set { weights = value; }
+    }
+    [Storable]
+    private string variableName;
+    public string VariableName {
+      get { return variableName; }
+      set { variableName = value; }
+    }
+
+    [StorableConstructor]
+    private FactorVariableTreeNode(bool deserializing) : base(deserializing) { }
+    private FactorVariableTreeNode(FactorVariableTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      variableName = original.variableName;
+      if (original.weights != null) {
+        this.weights = new double[original.Weights.Length];
+        Array.Copy(original.Weights, weights, weights.Length);
+      }
+    }
+
+    public FactorVariableTreeNode(FactorVariable variableSymbol)
+      : base(variableSymbol) {
+    }
+
+    public override bool HasLocalParameters {
+      get { return true; }
+    }
+
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      variableName = Symbol.VariableNames.SampleRandom(random);
+      weights =
+        Symbol.GetVariableValues(variableName)
+        .Select(_ => NormalDistributedRandom.NextDouble(random, 0, 1)).ToArray();
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      // mutate only one randomly selected weight
+      var idx = random.Next(weights.Length);
+      // 50% additive & 50% multiplicative
+      if (random.NextDouble() < 0.5) {
+        double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu,
+          Symbol.WeightManipulatorSigma);
+        weights[idx] = weights[idx] + x * shakingFactor;
+      } else {
+        double x = NormalDistributedRandom.NextDouble(random, 1.0, Symbol.MultiplicativeWeightManipulatorSigma);
+        weights[idx] = weights[idx] * x;
+      }
+      if (random.NextDouble() < Symbol.VariableChangeProbability) {
+        VariableName = Symbol.VariableNames.SampleRandom(random);
+        if (weights.Length != Symbol.GetVariableValues(VariableName).Count()) {
+          // if the length of the weight array does not match => re-initialize weights
+          weights =
+            Symbol.GetVariableValues(variableName)
+              .Select(_ => NormalDistributedRandom.NextDouble(random, 0, 1))
+              .ToArray();
+        }
+      }
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FactorVariableTreeNode(this, cloner);
+    }
+
+    public double GetValue(string cat) {
+      return weights[Symbol.GetIndexForValue(VariableName, cat)];
+    }
+
+    public override string ToString() {
+      var weightStr = string.Join("; ",
+        Symbol.GetVariableValues(VariableName).Select(value => value + ": " + GetValue(value).ToString("E4")));
+      return VariableName + " (factor) "
+        + "[" + weightStr + "]";
+    }
+  }
+}
+
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FresnelCosineIntegral.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FresnelCosineIntegral.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FresnelCosineIntegral.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("FresnelCosineIntegral", "Symbol that represents the Fresnel cosine integral.")]
+  public sealed class FresnelCosineIntegral : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private FresnelCosineIntegral(bool deserializing) : base(deserializing) { }
+    private FresnelCosineIntegral(FresnelCosineIntegral original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FresnelCosineIntegral(this, cloner);
+    }
+    public FresnelCosineIntegral() : base("FresnelCosineIntegral", "Symbol that represents the Fresnel cosine integral.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FresnelSineIntegral.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FresnelSineIntegral.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FresnelSineIntegral.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("FresnelSineIntegral", "Symbol that represents the Fresnel sine integral.")]
+  public sealed class FresnelSineIntegral : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private FresnelSineIntegral(bool deserializing) : base(deserializing) { }
+    private FresnelSineIntegral(FresnelSineIntegral original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FresnelSineIntegral(this, cloner);
+    }
+    public FresnelSineIntegral() : base("FresnelSineIntegral", "Symbol that represents the Fresnel sine integral.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Gamma.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Gamma.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Gamma.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Gamma", "Symbol that represents the gamma function.")]
+  public sealed class Gamma : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Gamma(bool deserializing) : base(deserializing) { }
+    private Gamma(Gamma original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Gamma(this, cloner);
+    }
+    public Gamma() : base("Gamma", "Symbol that represents the gamma function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/GreaterThan.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/GreaterThan.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/GreaterThan.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("GreaterThan", "Symbol that represents a greater than relation.")]
+  public sealed class GreaterThan : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/HyperbolicCosineIntegral.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/HyperbolicCosineIntegral.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/HyperbolicCosineIntegral.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("HyperbolicCosineIntegral", "Symbol that represents the hyperbolic cosine integral.")]
+  public sealed class HyperbolicCosineIntegral : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private HyperbolicCosineIntegral(bool deserializing) : base(deserializing) { }
+    private HyperbolicCosineIntegral(HyperbolicCosineIntegral original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new HyperbolicCosineIntegral(this, cloner);
+    }
+    public HyperbolicCosineIntegral() : base("HyperbolicCosineIntegral", "Symbol that represents the hyperbolic cosine integral.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/HyperbolicSineIntegral.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/HyperbolicSineIntegral.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/HyperbolicSineIntegral.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("HyperbolicSineIntegral", "Symbol that represents the hyperbolic sine integral.")]
+  public sealed class HyperbolicSineIntegral : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private HyperbolicSineIntegral(bool deserializing) : base(deserializing) { }
+    private HyperbolicSineIntegral(HyperbolicSineIntegral original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new HyperbolicSineIntegral(this, cloner);
+    }
+    public HyperbolicSineIntegral() : base("HyperbolicSineIntegral", "Symbol that represents the hyperbolic sine integral.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ILaggedTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ILaggedTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ILaggedTreeNode.cs	(revision 16132)
@@ -0,0 +1,28 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Symbolic {
+  public interface ILaggedTreeNode : ISymbolicExpressionTreeNode {
+    int Lag { get; set; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/IfThenElse.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/IfThenElse.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/IfThenElse.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("IfThenElse", "Symbol that represents a conditional operator.")]
+  public sealed class IfThenElse : Symbol {
+    private const int minimumArity = 3;
+    private const int maximumArity = 3;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Integral.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Integral.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Integral.cs	(revision 16132)
@@ -0,0 +1,46 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Integral", "Represents the integral over the specified subtree.")]
+  public sealed class Integral : LaggedSymbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Integral(bool deserializing) : base(deserializing) { }
+    private Integral(Integral original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new Integral(this, cloner); }
+
+    public Integral() : base("Integral", "Represents the integral over the specified subtree.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedSymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedSymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedSymbol.cs	(revision 16132)
@@ -0,0 +1,64 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [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 ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new LaggedTreeNode(this);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedTreeNode.cs	(revision 16132)
@@ -0,0 +1,70 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedVariable.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedVariable.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedVariable.cs	(revision 16132)
@@ -0,0 +1,64 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("LaggedVariable", "Represents a variable value with a time offset.")]
+  public class LaggedVariable : VariableBase {
+    [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]
+    protected LaggedVariable(bool deserializing) : base(deserializing) { }
+    protected LaggedVariable(LaggedVariable original, Cloner cloner)
+      : base(original, cloner) {
+      minLag = original.minLag;
+      maxLag = original.maxLag;
+    }
+    public LaggedVariable() : this("LaggedVariable", "Represents a variable value with a time offset.") { }
+    protected LaggedVariable(string name, string description)
+      : base(name, description) {
+      MinLag = -1;
+      MaxLag = -1;
+    }
+
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new LaggedVariableTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LaggedVariable(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedVariableTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedVariableTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LaggedVariableTreeNode.cs	(revision 16132)
@@ -0,0 +1,72 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  public sealed class LaggedVariableTreeNode : VariableTreeNodeBase, ILaggedTreeNode {
+    public new LaggedVariable Symbol {
+      get { return (LaggedVariable)base.Symbol; }
+    }
+    [Storable]
+    private int lag;
+    public int Lag {
+      get { return lag; }
+      set { lag = value; }
+    }
+
+    public override bool HasLocalParameters {
+      get { return true; }
+    }
+
+    [StorableConstructor]
+    private LaggedVariableTreeNode(bool deserializing) : base(deserializing) { }
+    private LaggedVariableTreeNode(LaggedVariableTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      lag = original.lag;
+    }
+
+    public LaggedVariableTreeNode(LaggedVariable variableSymbol) : base(variableSymbol) { }
+
+
+    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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LessThan.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LessThan.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/LessThan.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("LessThan", "Symbol that represents a less than relation.")]
+  public sealed class LessThan : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Logarithm.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Logarithm.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Logarithm.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Logarithm", "Symbol that represents the logarithm function.")]
+  public sealed class Logarithm : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Multiplication.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Multiplication.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Multiplication.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Multiplication", "Symbol that represents the * operator.")]
+  public sealed class Multiplication : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Norm.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Norm.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Norm.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Norm", "Symbol that represents the normal distribution function.")]
+  public sealed class Norm : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Norm(bool deserializing) : base(deserializing) { }
+    private Norm(Norm original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Norm(this, cloner);
+    }
+    public Norm() : base("Norm", "Symbol that represents the normal distribution function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Not.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Not.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Not.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Not", "Symbol that represents the boolean NOT operator.")]
+  public sealed class Not : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Or.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Or.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Or.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Or", "Symbol that represents the boolean OR operator.")]
+  public sealed class Or : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Passthrough.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Passthrough.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Passthrough.cs	(revision 16132)
@@ -0,0 +1,49 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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("Passthrough", "A symbol that does not perform any operation (just passes the input). Useful for tweaking tree shape and crossover probabilities (serves as placeholder)")]
+  public sealed class Passthrough : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity { get { return minimumArity; } }
+
+    public override int MaximumArity { get { return maximumArity; } }
+
+    [StorableConstructor]
+    private Passthrough(bool deserializing) : base(deserializing) { }
+    private Passthrough(Passthrough original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Passthrough(this, cloner);
+    }
+
+    public Passthrough()
+      : base("Passthrough", "A symbol that does not perform any operation (just passes the input). Useful for tweaking tree shape and crossover probabilities (serves as placeholder)") {
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Power.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Power.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Power.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Power", "Symbol that represents the power function.")]
+  public sealed class Power : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Power(bool deserializing) : base(deserializing) { }
+    private Power(Power original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Power(this, cloner);
+    }
+    public Power() : base("Power", "Symbol that represents the power function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Psi.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Psi.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Psi.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Psi", "Symbol that represents the psi function.")]
+  public sealed class Psi : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Psi(bool deserializing) : base(deserializing) { }
+    private Psi(Psi original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Psi(this, cloner);
+    }
+    public Psi() : base("Psi", "Symbol that represents the psi function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Root.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Root.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Root.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Root", "Symbol that represents the n-th root function.")]
+  public sealed class Root : Symbol {
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Root(bool deserializing) : base(deserializing) { }
+    private Root(Root original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Root(this, cloner);
+    }
+    public Root() : base("Root", "Symbol that represents the n-th root function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sine.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sine.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sine.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Sine", "Symbol that represents the sine function.")]
+  public sealed class Sine : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SineIntegral.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SineIntegral.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SineIntegral.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("SineIntegral", "Symbol that represents the sine integral.")]
+  public sealed class SineIntegral : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private SineIntegral(bool deserializing) : base(deserializing) { }
+    private SineIntegral(SineIntegral original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SineIntegral(this, cloner);
+    }
+    public SineIntegral() : base("SineIntegral", "Symbol that represents the sine integral.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Square.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Square.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Square.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Square", "Symbol that represents the square function.")]
+  public sealed class Square : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Square(bool deserializing) : base(deserializing) { }
+    private Square(Square original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Square(this, cloner);
+    }
+    public Square() : base("Square", "Symbol that represents the square function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SquareRoot.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SquareRoot.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/SquareRoot.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("SquareRoot", "Symbol that represents the square root function.")]
+  public sealed class SquareRoot : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private SquareRoot(bool deserializing) : base(deserializing) { }
+    private SquareRoot(SquareRoot original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SquareRoot(this, cloner);
+    }
+    public SquareRoot() : base("SquareRoot", "Symbol that represents the square root function.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Subtraction.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Subtraction.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Subtraction.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Subtraction", "Symbol that represents the - operator.")]
+  public sealed class Subtraction : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Tangent.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Tangent.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Tangent.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Tangent", "Symbol that represents the tangent trigonometric function.")]
+  public sealed class Tangent : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/TimeLag.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/TimeLag.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/TimeLag.cs	(revision 16132)
@@ -0,0 +1,47 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("TimeLag", "Represents a symblol whose evaluation is shifted.")]
+  public sealed class TimeLag : LaggedSymbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = 1;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [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 symbol whose evaluation is shifted.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Variable.cs	(revision 16132)
@@ -0,0 +1,49 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Variable", "Represents a variable value.")]
+  public sealed class Variable : VariableBase {
+
+    [StorableConstructor]
+    private Variable(bool deserializing)
+      : base(deserializing) {
+    }
+    private Variable(Variable original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public Variable() : base("Variable", "Represents a variable value.") { }
+    public Variable(string name, string description) : base(name, description) { }
+
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new VariableTreeNode(this);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Variable(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs	(revision 16132)
@@ -0,0 +1,182 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public abstract class VariableBase : Symbol, IVariableSymbol {
+    #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);
+        }
+      }
+    }
+    [Storable(DefaultValue = 0.0)]
+    private double multiplicativeWeightManipulatorSigma;
+    public double MultiplicativeWeightManipulatorSigma {
+      get { return multiplicativeWeightManipulatorSigma; }
+      set {
+        if (multiplicativeWeightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
+        if (value != multiplicativeWeightManipulatorSigma) {
+          multiplicativeWeightManipulatorSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    [Storable(DefaultValue = 1.0)]
+    private double variableChangeProbability;
+
+    public double VariableChangeProbability {
+      get { return variableChangeProbability; }
+      set {
+        if (value < 0 || value > 1.0) throw new ArgumentException("Variable change probability must lie in the interval [0..1]");
+        variableChangeProbability = value;
+      }
+    }
+
+    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);
+      }
+    }
+
+    private List<string> allVariableNames;
+    [Storable]
+    public IEnumerable<string> AllVariableNames {
+      get { return allVariableNames; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        allVariableNames.Clear();
+        allVariableNames.AddRange(value);
+      }
+    }
+
+    public override bool Enabled {
+      get {
+        if (variableNames.Count == 0) return false;
+        return base.Enabled;
+      }
+      set {
+        if (variableNames.Count == 0) base.Enabled = false;
+        else base.Enabled = value;
+      }
+    }
+
+    private const int minimumArity = 0;
+    private const int maximumArity = 0;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+    #endregion
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) {
+        allVariableNames = variableNames;
+      }
+    }
+
+    [StorableConstructor]
+    protected VariableBase(bool deserializing)
+      : base(deserializing) {
+      variableNames = new List<string>();
+      allVariableNames = new List<string>();
+    }
+    protected VariableBase(VariableBase original, Cloner cloner)
+      : base(original, cloner) {
+      weightMu = original.weightMu;
+      weightSigma = original.weightSigma;
+      variableNames = new List<string>(original.variableNames);
+      allVariableNames = new List<string>(original.allVariableNames);
+      weightManipulatorMu = original.weightManipulatorMu;
+      weightManipulatorSigma = original.weightManipulatorSigma;
+      multiplicativeWeightManipulatorSigma = original.multiplicativeWeightManipulatorSigma;
+      variableChangeProbability = original.variableChangeProbability;
+    }
+    protected VariableBase(string name, string description)
+      : base(name, description) {
+      weightMu = 1.0;
+      weightSigma = 1.0;
+      weightManipulatorMu = 0.0;
+      weightManipulatorSigma = 0.05;
+      multiplicativeWeightManipulatorSigma = 0.03;
+      variableChangeProbability = 0.2;
+      variableNames = new List<string>();
+      allVariableNames = new List<string>();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableCondition.cs	(revision 16132)
@@ -0,0 +1,240 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("Variable Condition", "Represents a condition that tests a given variable against a specified threshold.")]
+  public sealed class VariableCondition : Symbol, IVariableSymbol {
+    #region properties
+    [Storable]
+    private double thresholdInitializerMu;
+    public double ThresholdInitializerMu {
+      get { return thresholdInitializerMu; }
+      set {
+        if (value != thresholdInitializerMu) {
+          thresholdInitializerMu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double thresholdInitializerSigma;
+    public double ThresholdInitializerSigma {
+      get { return thresholdInitializerSigma; }
+      set {
+        if (thresholdInitializerSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
+        if (value != thresholdInitializerSigma) {
+          thresholdInitializerSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    [Storable]
+    private double thresholdManipulatorMu;
+    public double ThresholdManipulatorMu {
+      get { return thresholdManipulatorMu; }
+      set {
+        if (value != thresholdManipulatorMu) {
+          thresholdManipulatorMu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double thresholdManipulatorSigma;
+    public double ThresholdManipulatorSigma {
+      get { return thresholdManipulatorSigma; }
+      set {
+        if (thresholdManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
+        if (value != thresholdManipulatorSigma) {
+          thresholdManipulatorSigma = 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);
+      }
+    }
+
+    private List<string> allVariableNames;
+    [Storable]
+    public IEnumerable<string> AllVariableNames {
+      get { return allVariableNames; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        allVariableNames.Clear();
+        allVariableNames.AddRange(value);
+      }
+    }
+
+    [Storable]
+    private double slopeInitializerMu;
+    public double SlopeInitializerMu {
+      get { return slopeInitializerMu; }
+      set {
+        if (value != slopeInitializerMu) {
+          slopeInitializerMu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double slopeInitializerSigma;
+    public double SlopeInitializerSigma {
+      get { return slopeInitializerSigma; }
+      set {
+        if (slopeInitializerSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
+        if (value != slopeInitializerSigma) {
+          slopeInitializerSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    [Storable]
+    private double slopeManipulatorMu;
+    public double SlopeManipulatorMu {
+      get { return slopeManipulatorMu; }
+      set {
+        if (value != slopeManipulatorMu) {
+          slopeManipulatorMu = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+    [Storable]
+    private double slopeManipulatorSigma;
+    public double SlopeManipulatorSigma {
+      get { return slopeManipulatorSigma; }
+      set {
+        if (slopeManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
+        if (value != slopeManipulatorSigma) {
+          slopeManipulatorSigma = value;
+          OnChanged(EventArgs.Empty);
+        }
+      }
+    }
+
+    /// <summary>
+    /// Flag to indicate if the interpreter should ignore the slope parameter (introduced for representation of expression trees)
+    /// </summary>
+    [Storable]
+    private bool ignoreSlope;
+    public bool IgnoreSlope {
+      get { return ignoreSlope; }
+      set { ignoreSlope = value; }
+    }
+
+    public override bool Enabled {
+      get {
+        if (variableNames.Count == 0) return false;
+        return base.Enabled;
+      }
+      set {
+        if (variableNames.Count == 0) base.Enabled = false;
+        else base.Enabled = value;
+      }
+    }
+
+    private const int minimumArity = 2;
+    private const int maximumArity = 2;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+    #endregion
+
+    #region persistence and cloning
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) {
+        allVariableNames = variableNames;
+      }
+    }
+
+    [StorableConstructor]
+    private VariableCondition(bool deserializing)
+      : base(deserializing) {
+      variableNames = new List<string>();
+      allVariableNames = new List<string>();
+    }
+    private VariableCondition(VariableCondition original, Cloner cloner)
+      : base(original, cloner) {
+      thresholdInitializerMu = original.thresholdInitializerMu;
+      thresholdInitializerSigma = original.thresholdInitializerSigma;
+      thresholdManipulatorMu = original.thresholdManipulatorMu;
+      thresholdManipulatorSigma = original.thresholdManipulatorSigma;
+
+      variableNames = new List<string>(original.variableNames);
+      allVariableNames = new List<string>(original.allVariableNames);
+
+      slopeInitializerMu = original.slopeInitializerMu;
+      slopeInitializerSigma = original.slopeInitializerSigma;
+      slopeManipulatorMu = original.slopeManipulatorMu;
+      slopeManipulatorSigma = original.slopeManipulatorSigma;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new VariableCondition(this, cloner);
+    }
+    #endregion
+
+    public VariableCondition() : this("Variable Condition", "Represents a condition that tests a given variable.") { }
+    public VariableCondition(string name, string description)
+      : base(name, description) {
+      thresholdInitializerMu = 0.0;
+      thresholdInitializerSigma = 0.1;
+      thresholdManipulatorMu = 0.0;
+      thresholdManipulatorSigma = 0.1;
+
+      variableNames = new List<string>();
+      allVariableNames = new List<string>();
+
+      slopeInitializerMu = 0.0;
+      slopeInitializerSigma = 0.0;
+      slopeManipulatorMu = 0.0;
+      slopeManipulatorSigma = 0.0;
+    }
+
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new VariableConditionTreeNode(this);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableConditionTreeNode.cs	(revision 16132)
@@ -0,0 +1,106 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public sealed class VariableConditionTreeNode : SymbolicExpressionTreeNode, IVariableTreeNode {
+    #region properties
+    public new VariableCondition Symbol {
+      get { return (VariableCondition)base.Symbol; }
+    }
+    [Storable]
+    private double threshold;
+    public double Threshold {
+      get { return threshold; }
+      set { threshold = value; }
+    }
+    [Storable]
+    private string variableName;
+    public string VariableName {
+      get { return variableName; }
+      set { variableName = value; }
+    }
+    [Storable]
+    private double slope;
+    public double Slope {
+      get { return slope; }
+      set { slope = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private VariableConditionTreeNode(bool deserializing) : base(deserializing) { }
+    private VariableConditionTreeNode(VariableConditionTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+      threshold = original.threshold;
+      variableName = original.variableName;
+      slope = original.slope;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new VariableConditionTreeNode(this, cloner);
+    }
+
+    public VariableConditionTreeNode(VariableCondition variableConditionSymbol) : base(variableConditionSymbol) { }
+    public override bool HasLocalParameters {
+      get { return true; }
+    }
+
+    public override void ResetLocalParameters(IRandom random) {
+      base.ResetLocalParameters(random);
+      threshold = NormalDistributedRandom.NextDouble(random, Symbol.ThresholdInitializerMu, Symbol.ThresholdInitializerSigma);
+
+#pragma warning disable 612, 618
+      variableName = Symbol.VariableNames.SelectRandom(random);
+#pragma warning restore 612, 618
+
+      slope = NormalDistributedRandom.NextDouble(random, Symbol.SlopeInitializerMu, Symbol.SlopeInitializerSigma);
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+      double x = NormalDistributedRandom.NextDouble(random, Symbol.ThresholdManipulatorMu, Symbol.ThresholdManipulatorSigma);
+      threshold = threshold + x * shakingFactor;
+
+#pragma warning disable 612, 618
+      variableName = Symbol.VariableNames.SelectRandom(random);
+#pragma warning restore 612, 618
+
+      x = NormalDistributedRandom.NextDouble(random, Symbol.SlopeManipulatorMu, Symbol.SlopeManipulatorSigma);
+      slope = slope + x * shakingFactor;
+    }
+
+    public override string ToString() {
+      if (slope.IsAlmost(0.0) || Symbol.IgnoreSlope) {
+        return variableName + " < " + threshold.ToString("E4");
+      } else {
+        return variableName + " > " + threshold.ToString("E4") + Environment.NewLine +
+               "slope: " + slope.ToString("E4");
+      }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNode.cs	(revision 16132)
@@ -0,0 +1,42 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public sealed class VariableTreeNode : VariableTreeNodeBase {
+    public new Variable Symbol {
+      get { return (Variable)base.Symbol; }
+    }
+    [StorableConstructor]
+    private VariableTreeNode(bool deserializing) : base(deserializing) { }
+    private VariableTreeNode(VariableTreeNode original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    private VariableTreeNode() { }
+    public VariableTreeNode(Variable variableSymbol) : base(variableSymbol) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new VariableTreeNode(this, cloner);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs	(revision 16132)
@@ -0,0 +1,103 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  public abstract class VariableTreeNodeBase : SymbolicExpressionTreeTerminalNode, IVariableTreeNode {
+    public new VariableBase Symbol {
+      get { return (VariableBase)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 VariableTreeNodeBase(bool deserializing) : base(deserializing) { }
+    protected VariableTreeNodeBase(VariableTreeNodeBase original, Cloner cloner)
+      : base(original, cloner) {
+      weight = original.weight;
+      variableName = original.variableName;
+    }
+    protected VariableTreeNodeBase() { }
+    protected VariableTreeNodeBase(VariableBase 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);
+
+#pragma warning disable 612, 618
+      variableName = Symbol.VariableNames.SelectRandom(random);
+#pragma warning restore 612, 618
+    }
+
+    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
+      base.ShakeLocalParameters(random, shakingFactor);
+
+      // 50% additive & 50% multiplicative (TODO: BUG in if statement below -> fix in HL 4.0!)
+      if (random.NextDouble() < 0) {
+        double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma);
+        weight = weight + x * shakingFactor;
+      } else {
+        double x = NormalDistributedRandom.NextDouble(random, 1.0, Symbol.MultiplicativeWeightManipulatorSigma);
+        weight = weight * x;
+      }
+
+      if (Symbol.VariableChangeProbability >= 1.0) {
+        // old behaviour for backwards compatibility
+        #region Backwards compatible code, remove with 3.4
+#pragma warning disable 612, 618
+        variableName = Symbol.VariableNames.SelectRandom(random);
+#pragma warning restore 612, 618
+        #endregion
+      } else if (random.NextDouble() < Symbol.VariableChangeProbability) {
+        var oldName = variableName;
+        variableName = Symbol.VariableNames.SampleRandom(random);
+        if (oldName != variableName) {
+          // re-initialize weight if the variable is changed
+          weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma);
+        }
+      }
+    }
+
+    public override string ToString() {
+      if (weight.IsAlmost(1.0)) return variableName;
+      else return weight.ToString("E4") + " " + variableName;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnyNode.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnyNode.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnyNode.cs	(revision 16132)
@@ -0,0 +1,40 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public class AnyNode : SymbolicExpressionTreeNode {
+    [StorableConstructor]
+    protected AnyNode(bool deserializing) : base(deserializing) { }
+
+    protected AnyNode(AnyNode original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AnyNode(this, cloner);
+    }
+
+    public AnyNode(AnyNodeSymbol symbol) : base(symbol) { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnyNodeSymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnyNodeSymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnyNodeSymbol.cs	(revision 16132)
@@ -0,0 +1,58 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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 {
+  [StorableClass]
+  [Item("AnyNodeSymbol", "A symbol that represents a '=' wildcard that can match any node of the same type (function or leaf)")]
+  public class AnyNodeSymbol : Symbol {
+    public AnyNodeSymbol(bool deserializing) : base(deserializing) { }
+
+    public AnyNodeSymbol(Symbol original, Cloner cloner) : base(original, cloner) { }
+
+    public AnyNodeSymbol(string name, string description) : base(name, description) { }
+
+    protected AnyNodeSymbol(AnyNodeSymbol original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AnyNodeSymbol(this, cloner);
+    }
+
+    public AnyNodeSymbol() : base("=", "A wildcard symbol that can match any node of the same type (function or leaf node)") { }
+
+    public AnyNodeSymbol(int minimumArity, int maximumArity)
+      : base("=", "A wildcard symbol that can match any node of the same type (function or leaf node)") {
+      this.MinimumArity = minimumArity;
+      this.MaximumArity = maximumArity;
+    }
+
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new AnyNode(this);
+    }
+
+    public override int MinimumArity { get; }
+    public override int MaximumArity { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnySubtree.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnySubtree.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnySubtree.cs	(revision 16132)
@@ -0,0 +1,43 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  public class AnySubtree : SymbolicExpressionTreeNode {
+    [StorableConstructor]
+    protected AnySubtree(bool deserializing) : base(deserializing) {
+    }
+
+    protected AnySubtree(AnySubtree original, Cloner cloner) : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AnySubtree(this, cloner);
+    }
+
+    public AnySubtree(AnySubtreeSymbol symbol) : base(symbol) {
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnySubtreeSymbol.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnySubtreeSymbol.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Wildcards/AnySubtreeSymbol.cs	(revision 16132)
@@ -0,0 +1,52 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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 {
+  [StorableClass]
+  [Item("AnyNodeSymbol", "A symbol that represents a '=' wildcard that can match any node of the same type (function or leaf)")]
+  public class AnySubtreeSymbol : Symbol {
+    public AnySubtreeSymbol(bool deserializing) : base(deserializing) { }
+
+    public AnySubtreeSymbol(Symbol original, Cloner cloner) : base(original, cloner) { }
+
+    public AnySubtreeSymbol(string name, string description) : base(name, description) { }
+
+    protected AnySubtreeSymbol(AnySubtreeSymbol original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AnySubtreeSymbol(this, cloner);
+    }
+
+    public AnySubtreeSymbol() : base("#", "A wildcard symbol that can match any valid subtree") { }
+
+    public override ISymbolicExpressionTreeNode CreateTreeNode() {
+      return new AnySubtree(this);
+    }
+
+    public override int MinimumArity { get; }
+    public override int MaximumArity { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Xor.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Xor.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Xor.cs	(revision 16132)
@@ -0,0 +1,48 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [StorableClass]
+  [Item("Xor", "Symbol that represents the boolean XOR operator.")]
+  public sealed class Xor : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    [StorableConstructor]
+    private Xor(bool deserializing) : base(deserializing) { }
+    private Xor(Xor original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Xor(this, cloner);
+    }
+    public Xor() : base("Xor", "Symbol that represents the boolean XOR operator.") { }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisFragmentLengthAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisFragmentLengthAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisFragmentLengthAnalyzer.cs	(revision 16132)
@@ -0,0 +1,180 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.EvolutionTracking;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tracking.Analyzers {
+  [Item("SymbolicDataAnalysisFragmentLengthAnalyzer", "An analyzer for fragment length.")]
+  [StorableClass]
+  public class SymbolicDataAnalysisFragmentLengthAnalyzer : EvolutionTrackingAnalyzer<ISymbolicExpressionTree> {
+    private const string StoreHistoryParameterName = "StoryHistory";
+
+    public IFixedValueParameter<BoolValue> StoreHistoryParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[StoreHistoryParameterName]; }
+    }
+
+    public bool StoreHistory {
+      get { return StoreHistoryParameter.Value.Value; }
+      set { StoreHistoryParameter.Value.Value = value; }
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisFragmentLengthAnalyzer(bool deserializing) : base(deserializing) { }
+
+    public SymbolicDataAnalysisFragmentLengthAnalyzer() {
+      UpdateCounterParameter.ActualName = "FragmentLengthAnalyzerUpdateCounter";
+
+      Parameters.Add(new FixedValueParameter<BoolValue>(StoreHistoryParameterName, new BoolValue(false)));
+    }
+
+    protected SymbolicDataAnalysisFragmentLengthAnalyzer(SymbolicDataAnalysisFragmentLengthAnalyzer original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicDataAnalysisFragmentLengthAnalyzer(this, cloner); }
+
+    public override IOperation Apply() {
+      int updateInterval = UpdateIntervalParameter.Value.Value;
+      IntValue updateCounter = UpdateCounterParameter.ActualValue;
+      // if counter does not yet exist then initialize it with update interval
+      // to make sure the solutions are analyzed on the first application of this operator
+      if (updateCounter == null) {
+        updateCounter = new IntValue(updateInterval);
+        UpdateCounterParameter.ActualValue = updateCounter;
+      }
+      //analyze solutions only every 'updateInterval' times
+      if (updateCounter.Value != updateInterval) {
+        updateCounter.Value++;
+        return base.Apply();
+      }
+      updateCounter.Value = 1;
+
+      if (PopulationGraph == null || Generation.Value == 0)
+        return base.Apply();
+
+      // consider all fragments (including those of the intermediate crossover children)
+      var vertices = PopulationGraph.Vertices.Where(x => x.Rank > Generation.Value - 1);
+      var crossoverFragmentLengthDistribution = new List<double>();
+      var replacedCrossoverFragmentLengthDistribution = new List<double>();
+      var mutationFragmentLengthDistribution = new List<double>();
+      var replacedMutationFragmentLengthDistribution = new List<double>();
+      foreach (var v in vertices) {
+        if (!v.InArcs.Any() || v.InArcs.Last().Data == null)
+          continue;
+        var fragment = (IFragment<ISymbolicExpressionTreeNode>)v.InArcs.Last().Data;
+        if (v.InDegree == 2) {
+          crossoverFragmentLengthDistribution.Add(fragment.Root.GetLength());
+          int index = 0;
+          foreach (var s in v.Parents.First().Data.IterateNodesPrefix()) {
+            if (index == fragment.Index1) {
+              replacedCrossoverFragmentLengthDistribution.Add(s.GetLength());
+              break;
+            }
+            index++;
+          }
+        } else {
+          mutationFragmentLengthDistribution.Add(fragment.Root.GetLength());
+          int index = 0;
+          foreach (var s in v.Parents.First().Data.IterateNodesPrefix()) {
+            if (index == fragment.Index1) {
+              replacedMutationFragmentLengthDistribution.Add(s.GetLength());
+              break;
+            }
+            index++;
+          }
+        }
+      }
+      var avgCXFragmentLength = crossoverFragmentLengthDistribution.Any() ? crossoverFragmentLengthDistribution.Average() : 0;
+      var avgReplacedCXFragmentLength = replacedCrossoverFragmentLengthDistribution.Any() ? replacedCrossoverFragmentLengthDistribution.Average() : 0;
+      var avgMutFragmentLength = mutationFragmentLengthDistribution.Any() ? mutationFragmentLengthDistribution.Average() : 0;
+      var avgReplacedMutFragmentLength = replacedMutationFragmentLengthDistribution.Any() ? replacedMutationFragmentLengthDistribution.Average() : 0;
+      var avgFragmentLength = (avgCXFragmentLength + avgMutFragmentLength) / 2d;
+      DataTable table;
+      if (!Results.ContainsKey("AverageFragmentLength")) {
+        table = new DataTable("Average fragment length");
+        var row = new DataRow("Average fragment length") { VisualProperties = { StartIndexZero = true } };
+        row.Values.Add(avgFragmentLength);
+        table.Rows.Add(row);
+        row = new DataRow("Average crossover fragment length") { VisualProperties = { StartIndexZero = true } };
+        row.Values.Add(avgCXFragmentLength);
+        table.Rows.Add(row);
+        row = new DataRow("Average replaced crossover fragment length") { VisualProperties = { StartIndexZero = true } };
+        row.Values.Add(avgReplacedCXFragmentLength);
+        table.Rows.Add(row);
+        row = new DataRow("Average mutation fragment length") { VisualProperties = { StartIndexZero = true } };
+        row.Values.Add(avgMutFragmentLength);
+        table.Rows.Add(row);
+        row = new DataRow("Average replaced mutation fragment length") { VisualProperties = { StartIndexZero = true } };
+        row.Values.Add(avgReplacedMutFragmentLength);
+        table.Rows.Add(row);
+        Results.Add(new Result("AverageFragmentLength", table));
+      } else {
+        table = (DataTable)Results["AverageFragmentLength"].Value;
+        table.Rows["Average fragment length"].Values.Add(avgFragmentLength);
+        table.Rows["Average crossover fragment length"].Values.Add(avgCXFragmentLength);
+        table.Rows["Average replaced crossover fragment length"].Values.Add(avgReplacedCXFragmentLength);
+        table.Rows["Average mutation fragment length"].Values.Add(avgMutFragmentLength);
+        table.Rows["Average replaced mutation fragment length"].Values.Add(avgReplacedMutFragmentLength);
+      }
+      if (!Results.ContainsKey("FragmentLengthDistribution")) {
+        table = new DataTable("Table length distribution");
+        var row = new DataRow("Crossover fragment length distribution") { VisualProperties = { StartIndexZero = true, ChartType = DataRowVisualProperties.DataRowChartType.Histogram } };
+        row.Values.Replace(crossoverFragmentLengthDistribution);
+        table.Rows.Add(row);
+        row = new DataRow("Replaced crossover fragment length distribution") { VisualProperties = { StartIndexZero = true, ChartType = DataRowVisualProperties.DataRowChartType.Histogram } };
+        row.Values.Replace(replacedCrossoverFragmentLengthDistribution);
+        table.Rows.Add(row);
+        row = new DataRow("Mutation fragment length distribution") { VisualProperties = { StartIndexZero = true, ChartType = DataRowVisualProperties.DataRowChartType.Histogram } };
+        row.Values.Replace(mutationFragmentLengthDistribution);
+        table.Rows.Add(row);
+        row = new DataRow("Replaced mutation fragment length distribution") { VisualProperties = { StartIndexZero = true, ChartType = DataRowVisualProperties.DataRowChartType.Histogram } };
+        row.Values.Replace(replacedMutationFragmentLengthDistribution);
+        table.Rows.Add(row);
+        Results.Add(new Result("FragmentLengthDistribution", table));
+      } else {
+        table = (DataTable)Results["FragmentLengthDistribution"].Value;
+        table.Rows["Crossover fragment length distribution"].Values.Replace(crossoverFragmentLengthDistribution);
+        table.Rows["Mutation fragment length distribution"].Values.Replace(mutationFragmentLengthDistribution);
+        table.Rows["Replaced crossover fragment length distribution"].Values.Replace(replacedCrossoverFragmentLengthDistribution);
+        table.Rows["Replaced mutation fragment length distribution"].Values.Replace(replacedMutationFragmentLengthDistribution);
+      }
+      if (StoreHistory) {
+        if (!Results.ContainsKey("FragmentLengthDistributionHistory")) {
+          var history = new DataTableHistory();
+          history.Add((DataTable)table.Clone());
+          Results.Add(new Result("FragmentLengthDistributionHistory", history));
+        } else {
+          var history = (DataTableHistory)Results["FragmentLengthDistributionHistory"].Value;
+          history.Add((DataTable)table.Clone());
+        }
+      }
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSchemaFrequencyAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSchemaFrequencyAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSchemaFrequencyAnalyzer.cs	(revision 16132)
@@ -0,0 +1,352 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Threading.Tasks;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SymbolicDataAnalysisSchemaFrequencyAnalyzer", "An analyzer which counts schema frequencies in the population.")]
+  [StorableClass]
+  public class SymbolicDataAnalysisSchemaFrequencyAnalyzer : EvolutionTrackingAnalyzer<ISymbolicExpressionTree> {
+    private const string MinimumSchemaLengthParameterName = "MinimumSchemaLength";
+    private const string StrictSchemaMatchingParameterName = "StrictSchemaMatching";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string ExecuteInParallelParameterName = "ExecuteInParallel";
+    private const string MaximumDegreeOfParallelismParameterName = "MaximumDegreeOfParallelism";
+    private const string SchemaDefinitionParameterName = "SchemaDefinition";
+
+    private static readonly Dictionary<string, string> ShortNames = new Dictionary<string, string> {
+      { "Addition", "+" },
+      { "Subtraction", "-" },
+      { "Multiplication", "*" },
+      { "Division", "/" },
+      { "Exponential", "exp" },
+      { "Logarithm", "log" }
+    };
+
+    [Storable]
+    private readonly SymbolicExpressionTreePhenotypicSimilarityCalculator phenotypicSimilarityCalculator;
+
+    [Storable]
+    private readonly SymbolicExpressionTreeBottomUpSimilarityCalculator genotypicSimilarityCalculator;
+
+    [Storable]
+    private readonly ISymbolicExpressionTreeNodeEqualityComparer comparer;
+    private QueryMatch qm;
+
+
+    public IConstrainedValueParameter<StringValue> SchemaDefinitionParameter {
+      get { return (IConstrainedValueParameter<StringValue>)Parameters[SchemaDefinitionParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> ExecuteInParallelParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[ExecuteInParallelParameterName]; }
+    }
+
+    public IFixedValueParameter<IntValue> MaximumDegreeOfParallelismParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumDegreeOfParallelismParameterName]; }
+    }
+
+    public IFixedValueParameter<IntValue> MinimumSchemaLengthParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MinimumSchemaLengthParameterName]; }
+    }
+
+    public IFixedValueParameter<BoolValue> StrictSchemaMatchingParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[StrictSchemaMatchingParameterName]; }
+    }
+
+    public ILookupParameter<IRegressionProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<IRegressionProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
+    }
+
+    public bool ExecuteInParallel {
+      get { return ExecuteInParallelParameter.Value.Value; }
+      set { ExecuteInParallelParameter.Value.Value = value; }
+    }
+
+    public int MaximumDegreeOfParallelism {
+      get { return MaximumDegreeOfParallelismParameter.Value.Value; }
+      set { MaximumDegreeOfParallelismParameter.Value.Value = value; }
+    }
+
+    public int MinimumSchemaLength {
+      get { return MinimumSchemaLengthParameter.Value.Value; }
+      set { MinimumSchemaLengthParameter.Value.Value = value; }
+    }
+
+    public bool StrictSchemaMatching {
+      get { return StrictSchemaMatchingParameter.Value.Value; }
+      set { StrictSchemaMatchingParameter.Value.Value = value; }
+    }
+
+    public SymbolicDataAnalysisSchemaFrequencyAnalyzer() {
+      comparer = new SymbolicExpressionTreeNodeEqualityComparer {
+        MatchConstantValues = false,
+        MatchVariableNames = true,
+        MatchVariableWeights = false
+      };
+      qm = new QueryMatch(comparer) { MatchParents = true };
+      phenotypicSimilarityCalculator = new SymbolicExpressionTreePhenotypicSimilarityCalculator();
+      genotypicSimilarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };
+      Parameters.Add(new FixedValueParameter<IntValue>(MinimumSchemaLengthParameterName, new IntValue(10)));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumDegreeOfParallelismParameterName, new IntValue(4)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(StrictSchemaMatchingParameterName, new BoolValue(true)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(ExecuteInParallelParameterName, new BoolValue(true)));
+      Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));
+
+      var schemaDefinitions = new ItemSet<StringValue>(new[] {
+         new StringValue("="),
+         new StringValue("#"),
+         new StringValue("=,#")
+      });
+      var schemaDefinitionParameter = new ConstrainedValueParameter<StringValue>(SchemaDefinitionParameterName, schemaDefinitions);
+      schemaDefinitionParameter.Value = schemaDefinitions.First();
+      Parameters.Add(schemaDefinitionParameter);
+    }
+
+    protected SymbolicDataAnalysisSchemaFrequencyAnalyzer(SymbolicDataAnalysisSchemaFrequencyAnalyzer original,
+      Cloner cloner) : base(original, cloner) {
+      comparer = cloner.Clone(original.comparer);
+      phenotypicSimilarityCalculator = cloner.Clone(original.phenotypicSimilarityCalculator);
+      genotypicSimilarityCalculator = cloner.Clone(original.genotypicSimilarityCalculator);
+      MinimumSchemaLength = original.MinimumSchemaLength;
+      StrictSchemaMatching = original.StrictSchemaMatching;
+      qm = new QueryMatch(comparer) { MatchParents = true };
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisSchemaFrequencyAnalyzer(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSchemaFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      qm = new QueryMatch(comparer) { MatchParents = true };
+    }
+
+    public override IOperation Apply() {
+      if (PopulationGraph == null || Generation.Value == 0 ||
+          (Generation.Value > 1 && Generation.Value % UpdateInterval.Value != 0))
+        return base.Apply();
+
+      comparer.MatchVariableWeights = comparer.MatchConstantValues = StrictSchemaMatching;
+      phenotypicSimilarityCalculator.Interpreter = InterpreterParameter.ActualValue;
+      phenotypicSimilarityCalculator.ProblemData = ProblemDataParameter.ActualValue;
+      var generation = Generation.Value;
+
+      // use all offspring produced by crossover (including those in the intermediate rank)
+      var vertices = PopulationGraph.Vertices.Where(x => x.InDegree == 2 && x.Rank > generation - 1).OrderByDescending(x => x.Quality).ToList();
+
+      ResultCollection resultCollection;
+      if (Results.ContainsKey("Schema Frequencies")) {
+        resultCollection = (ResultCollection)Results["Schema Frequencies"].Value;
+      } else {
+        resultCollection = new ResultCollection();
+        var result = new Result("Schema Frequencies", resultCollection);
+        Results.Add(result);
+      }
+
+      var mostFrequentPerGeneration = new List<Tuple<string, double[]>>();
+
+      // match the obtained schemas against the whole population
+      var population = PopulationGraph.Vertices.Where(x => x.Rank.IsAlmost(generation)).ToList();
+      var trees = population.Select(x => x.Data).ToList();
+      var qualities = population.Select(x => x.Quality).ToList();
+      // cache similarity measures to speed up calculations
+      var genSimMatrix = new double[trees.Count, trees.Count];
+      var phenSimMatrix = new double[trees.Count, trees.Count];
+
+      for (int i = 0; i < trees.Count - 1; ++i) {
+        for (int j = i + 1; j < trees.Count; ++j) {
+          genSimMatrix[i, j] = double.NaN;
+          phenSimMatrix[i, j] = double.NaN;
+        }
+      }
+
+      List<ISymbolicExpressionTree> schemas;
+      var def = SchemaDefinitionParameter.Value.Value;
+      switch (def) {
+        case "=":
+          schemas = SchemaCreator.GenerateAnyNodeSchemas(vertices, MinimumSchemaLength, 0, StrictSchemaMatching).ToList();
+          break;
+        case "#":
+          schemas = SchemaCreator.GenerateAnySubtreeSchemas(vertices, MinimumSchemaLength, 0, StrictSchemaMatching).ToList();
+          break;
+        case "=,#":
+          schemas = SchemaCreator.GenerateCombinedSchemas(vertices, MinimumSchemaLength, 0, StrictSchemaMatching).ToList();
+          break;
+        default:
+          return base.Apply();
+      }
+      var schemaStrings = schemas.Select(x => x.Root.GetSubtree(0).GetSubtree(0).FormatToString(StrictSchemaMatching)).ToList();
+      int[][] matchingIndices = new int[schemas.Count][];
+
+      var tNodes = trees.Select(x => QueryMatch.InitializePostOrder(x.Root.GetSubtree(0).GetSubtree(0))).ToList();
+      if (ExecuteInParallel) {
+        Parallel.For(0, schemas.Count, new ParallelOptions { MaxDegreeOfParallelism = MaximumDegreeOfParallelism }, i => {
+          var schema = schemas[i];
+          var sNodes = QueryMatch.InitializePostOrder(schema.Root.GetSubtree(0).GetSubtree(0));
+          matchingIndices[i] = Enumerable.Range(0, trees.Count).Where(idx => qm.Match(tNodes[idx], sNodes)).ToArray();
+        });
+      } else {
+        for (int i = 0; i < schemas.Count; ++i) {
+          var schema = schemas[i];
+          var sNodes = QueryMatch.InitializePostOrder(schema.Root.GetSubtree(0).GetSubtree(0));
+          matchingIndices[i] = Enumerable.Range(0, trees.Count).Where(idx => qm.Match(tNodes[idx], sNodes)).ToArray();
+        }
+      }
+
+      var schemaStatistics = new List<Tuple<string, double[]>>();
+      var avgPopQuality = qualities.Average();
+
+      if (ExecuteInParallel) {
+        var locker = new object();
+        Parallel.For(0, schemas.Count, new ParallelOptions {
+          MaxDegreeOfParallelism = MaximumDegreeOfParallelism
+        }, i => {
+          var indices = matchingIndices[i];
+          if (indices.Length > 1) {
+            var avgSchemaQuality = indices.Average(x => qualities[x]);
+            var avgLength = indices.Average(x => trees[x].Length);
+            var avgGenSim = AverageSimilarity(indices, trees, genSimMatrix, genotypicSimilarityCalculator.CalculateSimilarity);
+            var avgPhenSim = AverageSimilarity(indices, trees, phenSimMatrix, phenotypicSimilarityCalculator.CalculateSimilarity);
+            var array = new[] { indices.Length, avgSchemaQuality, avgLength, avgGenSim, avgPhenSim, avgPopQuality };
+            var t = new Tuple<string, double[]>(schemaStrings[i], array);
+            lock (locker) {
+              schemaStatistics.Add(t);
+            }
+          }
+        });
+      } else {
+        for (int i = 0; i < schemas.Count; ++i) {
+          var indices = matchingIndices[i];
+          if (indices.Length > 1) {
+            var avgSchemaQuality = indices.Average(x => qualities[x]);
+            var avgLength = indices.Average(x => trees[x].Length);
+            var avgGenSim = AverageSimilarity(indices, trees, genSimMatrix, genotypicSimilarityCalculator.CalculateSimilarity);
+            var avgPhenSim = AverageSimilarity(indices, trees, phenSimMatrix, phenotypicSimilarityCalculator.CalculateSimilarity);
+            var array = new[] { indices.Length, avgSchemaQuality, avgLength, avgGenSim, avgPhenSim, avgPopQuality };
+            var t = new Tuple<string, double[]>(schemaStrings[i], array);
+            schemaStatistics.Add(t);
+          }
+        }
+      }
+
+      if (!schemaStatistics.Any()) return base.Apply(); // shouldn't ever happen
+      var columnNames = new[] { "Count", "Avg Quality", "Avg Length", "Avg Genotype Similarity", "Avg Phenotype Similarity", "Avg Population Quality" };
+      var mostFrequent = new DoubleMatrix(schemaStatistics.Count, schemaStatistics[0].Item2.Length) {
+        SortableView = true
+      };
+      schemaStatistics.Sort((a, b) => { if (a.Item2[0].Equals(b.Item2[0])) return b.Item2[1].CompareTo(a.Item2[1]); return b.Item2[0].CompareTo(a.Item2[0]); });
+      mostFrequentPerGeneration.Add(Tuple.Create(schemaStatistics[0].Item1, new[] { (double)generation }.Concat(schemaStatistics[0].Item2).ToArray()));
+      mostFrequent.RowNames = schemaStatistics.Select(x => x.Item1);
+      mostFrequent.ColumnNames = columnNames;
+      for (int i = 0; i < schemaStatistics.Count; ++i) {
+        var values = schemaStatistics[i].Item2;
+        for (int j = 0; j < values.Length; ++j) {
+          mostFrequent[i, j] = values[j];
+        }
+      }
+      resultCollection.Add(new Result("Generation " + generation + " Most Frequent Schemas", mostFrequent));
+
+      columnNames = new[] { "Generation", "Count", "Avg Quality", "Avg Length", "Avg Genotype Similarity", "Avg Phenotype Similarity", "Avg Population Quality" };
+      // sort according to quality, then count
+      schemaStatistics.Sort((a, b) => { if (a.Item2[1].Equals(b.Item2[1])) return b.Item2[0].CompareTo(a.Item2[0]); return b.Item2[1].CompareTo(a.Item2[1]); });
+      DoubleMatrix bestSchemasMatrix;
+      if (!resultCollection.ContainsKey("Best Schemas")) {
+        bestSchemasMatrix = new DoubleMatrix(1, 7);
+        bestSchemasMatrix.RowNames = new[] { schemaStatistics[0].Item1 };
+        bestSchemasMatrix.ColumnNames = columnNames;
+        var values = new[] { (double)generation }.Concat(schemaStatistics[0].Item2).ToArray();
+        for (int i = 0; i < values.Length; ++i)
+          bestSchemasMatrix[0, i] = values[i];
+        resultCollection.Add(new Result("Best Schemas", bestSchemasMatrix));
+      } else {
+        bestSchemasMatrix = (DoubleMatrix)resultCollection["Best Schemas"].Value;
+        resultCollection["Best Schemas"].Value = AddRow(bestSchemasMatrix, new[] { (double)generation }.Concat(schemaStatistics[0].Item2).ToArray(), schemaStatistics[0].Item1);
+      }
+
+      // sort according to count, then quality
+      schemaStatistics.Sort((a, b) => { if (a.Item2[0].Equals(b.Item2[0])) return b.Item2[1].CompareTo(a.Item2[1]); return b.Item2[0].CompareTo(a.Item2[0]); });
+      DoubleMatrix frequentSchemasMatrix;
+      if (!resultCollection.ContainsKey("Most Frequent Schemas")) {
+        frequentSchemasMatrix = new DoubleMatrix(1, 7);
+        frequentSchemasMatrix.RowNames = new[] { schemaStatistics[0].Item1 };
+        frequentSchemasMatrix.ColumnNames = columnNames;
+        var values = new[] { (double)generation }.Concat(schemaStatistics[0].Item2).ToArray();
+        for (int i = 0; i < values.Length; ++i)
+          frequentSchemasMatrix[0, i] = values[i];
+        resultCollection.Add(new Result("Most Frequent Schemas", frequentSchemasMatrix));
+      } else {
+        frequentSchemasMatrix = (DoubleMatrix)resultCollection["Most Frequent Schemas"].Value;
+        resultCollection["Most Frequent Schemas"].Value = AddRow(frequentSchemasMatrix, new[] { (double)generation }.Concat(schemaStatistics[0].Item2).ToArray(), schemaStatistics[0].Item1);
+      }
+      return base.Apply();
+    }
+
+    private static DoubleMatrix AddRow(DoubleMatrix m, double[] row, string rowName) {
+      if (row.Length != m.Columns)
+        throw new Exception("Row value count must match matrix column count.");
+      var x = new DoubleMatrix(m.Rows + 1, m.Columns);
+      x.RowNames = m.RowNames.Concat(new[] { rowName });
+      x.ColumnNames = m.ColumnNames;
+      for (int i = 0; i < m.Rows; ++i)
+        for (int j = 0; j < m.Columns; ++j)
+          x[i, j] = m[i, j];
+      for (int j = 0; j < m.Columns; ++j)
+        x[m.Rows, j] = row[j];
+      return x;
+    }
+
+    private static double AverageSimilarity(int[] indices, List<ISymbolicExpressionTree> trees, double[,] similarityMatrix, Func<ISymbolicExpressionTree, ISymbolicExpressionTree, double> similarityFunction) {
+      var agg = 0d;
+      int len = indices.Length;
+      var count = len * (len - 1) / 2d;
+      for (int i = 0; i < indices.Length - 1; ++i) {
+        var a = indices[i];
+        for (int j = i + 1; j < indices.Length; ++j) {
+          var b = indices[j];
+          if (double.IsNaN(similarityMatrix[a, b]))
+            similarityMatrix[a, b] = similarityFunction(trees[a], trees[b]);
+          agg += similarityMatrix[a, b];
+        }
+      }
+      return agg / count;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs	(revision 16132)
@@ -0,0 +1,111 @@
+﻿#region License information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tracking.Analyzers {
+  [Item("SymbolicDataAnalysisSubtreeSampleCountAnalyzer", "An analyzer for trace graph overlap.")]
+  [StorableClass]
+  public class SymbolicDataAnalysisSubtreeSampleCountAnalyzer : EvolutionTrackingAnalyzer<ISymbolicExpressionTree> {
+    private const string CacheTraceNodesParameterName = "CacheTraceNodes";
+    private readonly TraceCalculator traceCalculator = new TraceCalculator { UpdateVertexWeights = true, UpdateSubtreeWeights = true, CacheTraceNodes = true };
+
+    #region parameters
+    public IFixedValueParameter<BoolValue> CacheTraceNodesParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[CacheTraceNodesParameterName]; }
+    }
+    #endregion
+
+    #region parameter properties
+    public bool CacheTraceNodes {
+      get { return CacheTraceNodesParameter.Value.Value; }
+      set { CacheTraceNodesParameter.Value.Value = value; }
+    }
+    #endregion
+
+    public SymbolicDataAnalysisSubtreeSampleCountAnalyzer() {
+      UpdateCounterParameter.ActualName = "SubtreeSampleCountAnalyzerUpdateCounter";
+
+      Parameters.Add(new FixedValueParameter<BoolValue>(CacheTraceNodesParameterName, new BoolValue(true)));
+    }
+
+    protected SymbolicDataAnalysisSubtreeSampleCountAnalyzer(SymbolicDataAnalysisSubtreeSampleCountAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisSubtreeSampleCountAnalyzer(this, cloner);
+    }
+
+    public override void ClearState() {
+      base.ClearState();
+      traceCalculator.ResetState();
+    }
+
+    public override void InitializeState() {
+      traceCalculator.ResetState();
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisSubtreeSampleCountAnalyzer(bool deserializing) : base(deserializing) { }
+
+    public override IOperation Apply() {
+      int updateInterval = UpdateIntervalParameter.Value.Value;
+      IntValue updateCounter = UpdateCounterParameter.ActualValue;
+      // if counter does not yet exist then initialize it with update interval
+      // to make sure the solutions are analyzed on the first application of this operator
+      if (updateCounter == null) {
+        updateCounter = new IntValue(updateInterval);
+        UpdateCounterParameter.ActualValue = updateCounter;
+      }
+      //analyze solutions only every 'updateInterval' times
+      if (updateCounter.Value != updateInterval) {
+        updateCounter.Value++;
+        return base.Apply();
+      }
+      updateCounter.Value = 1;
+
+      if (PopulationGraph == null)
+        return base.Apply();
+
+      traceCalculator.CacheTraceNodes = CacheTraceNodes;
+      if (Generation.Value > 0) {
+        var rank = PopulationGraph.GetByRank(Generation.Value).Cast<IGenealogyGraphNode<ISymbolicExpressionTree>>().ToList();
+        foreach (var n in rank)
+          traceCalculator.Trace(n, 2, false); // during this call weights will be updated
+
+        foreach (var v in traceCalculator.TraceGraph.Vertices) {
+          var g = PopulationGraph.GetByContent(v.Data);
+          g.Weight = v.Weight;
+        }
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisTraceOverlapAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisTraceOverlapAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisTraceOverlapAnalyzer.cs	(revision 16132)
@@ -0,0 +1,104 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tracking.Analyzers {
+  [Item("SymbolicDataAnalysisTraceOverlapAnalyzer", "An analyzer for trace graph overlap.")]
+  [StorableClass]
+  public class SymbolicDataAnalysisTraceOverlapAnalyzer : EvolutionTrackingAnalyzer<ISymbolicExpressionTree> {
+    private const string PercentageOfBestSolutionsParameterName = "PercentageOfBestSolutions";
+
+    #region parameters
+    public IFixedValueParameter<DoubleValue> PercentageOfBestSolutionsParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters[PercentageOfBestSolutionsParameterName]; }
+    }
+    #endregion
+
+    public SymbolicDataAnalysisTraceOverlapAnalyzer() {
+      UpdateCounterParameter.ActualName = "TraceOverlapAnalyzerUpdateCounter";
+      Parameters.Add(new FixedValueParameter<DoubleValue>(PercentageOfBestSolutionsParameterName, new DoubleValue(1.0)));
+    }
+
+    protected SymbolicDataAnalysisTraceOverlapAnalyzer(SymbolicDataAnalysisTraceOverlapAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisTraceOverlapAnalyzer(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisTraceOverlapAnalyzer(bool deserializing) : base(deserializing) { }
+
+    public override IOperation Apply() {
+      int updateInterval = UpdateIntervalParameter.Value.Value;
+      IntValue updateCounter = UpdateCounterParameter.ActualValue;
+      // if counter does not yet exist then initialize it with update interval
+      // to make sure the solutions are analyzed on the first application of this operator
+      if (updateCounter == null) {
+        updateCounter = new IntValue(updateInterval);
+        UpdateCounterParameter.ActualValue = updateCounter;
+      }
+      //analyze solutions only every 'updateInterval' times
+      if (updateCounter.Value != updateInterval) {
+        updateCounter.Value++;
+        return base.Apply();
+      }
+      updateCounter.Value = 1;
+
+      if (PopulationGraph == null)
+        return base.Apply();
+
+      var bestSolutionsPercentage = PercentageOfBestSolutionsParameter.Value.Value;
+      int n = (int)Math.Round(bestSolutionsPercentage * PopulationSize.Value);
+      double avgTraceOverlap = 0;
+
+      if (Generation.Value > 0) {
+        var nodes = PopulationGraph.GetByRank(Generation.Value).Cast<IGenealogyGraphNode<ISymbolicExpressionTree>>().OrderByDescending(x => x.Quality).Take(n);
+        avgTraceOverlap = nodes.Average(x => TraceCalculator.TraceSubtree(x, 2).Vertices.Count());
+      }
+
+      DataTable table;
+      if (!Results.ContainsKey("AverageTraceOverlap")) {
+        table = new DataTable("Average trace overlap");
+        var row = new DataRow("Average trace overlap") { VisualProperties = { StartIndexZero = true } };
+        row.Values.Add(avgTraceOverlap);
+        table.Rows.Add(row);
+        Results.Add(new Result("AverageTraceOverlap", table));
+      } else {
+        table = (DataTable)Results["AverageTraceOverlap"].Value;
+        table.Rows["Average trace overlap"].Values.Add(avgTraceOverlap);
+      }
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/DiversificationStatisticsOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/DiversificationStatisticsOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/DiversificationStatisticsOperator.cs	(revision 16132)
@@ -0,0 +1,132 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SchemaCleanupOperator", "Operator which removes the schemas from the global scope after they have been evaluated.")]
+  [StorableClass]
+  public class DiversificationStatisticsOperator : SingleSuccessorOperator {
+    private const string NumberOfChangedTreesParameterName = "NumberOfChangedTrees";
+    private const string NumberOfSchemasParameterName = "NumberOfSchemas";
+    private const string AverageSchemaLengthParameterName = "AverageSchemaLength";
+    private const string ResultCollectionParameterName = "Results";
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
+
+    private readonly object locker = new object();
+
+    public ILookupParameter<IntValue> NumberOfChangedTreesParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[NumberOfChangedTreesParameterName]; }
+    }
+    public ILookupParameter<IntValue> NumberOfSchemasParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[NumberOfSchemasParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> AverageSchemaLengthParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[AverageSchemaLengthParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultCollectionParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultCollectionParameterName]; }
+    }
+    public ILookupParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
+    }
+
+    private int evaluatedSolutionsTracker;
+
+    public DiversificationStatisticsOperator() {
+      Parameters.Add(new LookupParameter<IntValue>(NumberOfChangedTreesParameterName));
+      Parameters.Add(new LookupParameter<IntValue>(NumberOfSchemasParameterName));
+      Parameters.Add(new LookupParameter<DoubleValue>(AverageSchemaLengthParameterName));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultCollectionParameterName));
+      Parameters.Add(new LookupParameter<IntValue>(EvaluatedSolutionsParameterName));
+    }
+
+    public override void InitializeState() {
+      base.InitializeState();
+      evaluatedSolutionsTracker = 0;
+    }
+
+    public override void ClearState() {
+      base.ClearState();
+      evaluatedSolutionsTracker = 0;
+    }
+
+    protected DiversificationStatisticsOperator(DiversificationStatisticsOperator original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) { return new DiversificationStatisticsOperator(this, cloner); }
+
+    [StorableConstructor]
+    protected DiversificationStatisticsOperator(bool deserializing) : base(deserializing) { }
+
+    public override IOperation Apply() {
+      var results = ResultCollectionParameter.ActualValue;
+      DataTable table;
+      if (!results.ContainsKey("NumberOfChangedTrees")) {
+        table = new DataTable();
+        results.Add(new Result("NumberOfChangedTrees", table));
+        var row = new DataRow("Changed trees") { VisualProperties = { StartIndexZero = true } };
+        table.Rows.Add(row);
+      }
+      if (!results.ContainsKey("AverageSchemaLength")) {
+        table = new DataTable();
+        results.Add(new Result("AverageSchemaLength", table));
+        var row = new DataRow("Average schema length") { VisualProperties = { StartIndexZero = true } };
+        table.Rows.Add(row);
+      }
+      if (!results.ContainsKey("NumberOfSchemas")) {
+        table = new DataTable();
+        results.Add(new Result("NumberOfSchemas", table));
+        var row = new DataRow("Number of schemas") { VisualProperties = { StartIndexZero = true } };
+        table.Rows.Add(row);
+      }
+      if (!results.ContainsKey("EvaluatedSolutionsPerGeneration")) {
+        table = new DataTable();
+        results.Add(new Result("EvaluatedSolutionsPerGeneration", table));
+        var row = new DataRow("Evaluated solutions") { VisualProperties = { StartIndexZero = true } };
+        table.Rows.Add(row);
+        row.Values.Add(0);
+      }
+
+      lock (locker) {
+        // count the extra evaluations performed after diversification
+        EvaluatedSolutionsParameter.ActualValue.Value += NumberOfChangedTreesParameter.ActualValue.Value;
+      }
+
+      var evaluatedSolutions = EvaluatedSolutionsParameter.ActualValue.Value;
+      if (evaluatedSolutions > 0)
+        evaluatedSolutions -= evaluatedSolutionsTracker;
+      ((DataTable)results["NumberOfChangedTrees"].Value).Rows["Changed trees"].Values.Add(NumberOfChangedTreesParameter.ActualValue.Value);
+      ((DataTable)results["AverageSchemaLength"].Value).Rows["Average schema length"].Values.Add(AverageSchemaLengthParameter.ActualValue.Value);
+      ((DataTable)results["NumberOfSchemas"].Value).Rows["Number of schemas"].Values.Add(NumberOfSchemasParameter.ActualValue.Value);
+      ((DataTable)results["EvaluatedSolutionsPerGeneration"].Value).Rows["Evaluated solutions"].Values.Add(evaluatedSolutions);
+      evaluatedSolutionsTracker += evaluatedSolutions;
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs	(revision 16132)
@@ -0,0 +1,387 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.EvolutionTracking;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  using Vertices = IEnumerable<IGenealogyGraphNode<ISymbolicExpressionTree>>;
+
+  [Item("SchemaCreator", "An operator that builds schemas based on the heredity relationship in the genealogy graph.")]
+  [StorableClass]
+  public class SchemaCreator : EvolutionTrackingOperator<ISymbolicExpressionTree> {
+    #region parameter names
+    // criteria to trigger schema-based diversification
+    private const string MinimumSchemaLengthParameterName = "MinimumSchemaLength";
+    private const string MinimumSchemaFrequencyParameterName = "MinimumSchemaFrequency";
+    private const string MinimumPhenotypicSimilarityParameterName = "MinimumPhenotypicSimilarity";
+    // parameters controlling the diversification strategy
+    private const string UseAdaptiveMutationRateParameterName = "UseAdaptiveMutationRate"; // dynamically control mutation rate
+    private const string MutationRateUpdateRuleParameterName = "ReplacementRatioUpdateRule";
+    private const string MutationRateParameterName = "MutationRate"; // fixed mutation rate when not using adaptive update
+    private const string ExclusiveMatchingParameterName = "ExclusiveMatching"; // an individual can belong to only 1 schema 
+    private const string ParentsRatio = "ParentsRatio"; // use best % parents to generate schemas from
+    private const string StrictSchemaMatchingParameterName = "StrictSchemaMatching"; // use strict node comparison (for constant values and variable weights)
+    private const string SchemaDefinitionParameterName = "SchemaDefinition"; // which schema definition to use: {=}, {#} or {=,#}
+    private const string SchemaManipulatorParameterName = "SchemaManipulator"; // mutation operator to apply within schemas
+
+    // control parallel behaviour
+    private const string ExecuteInParallelParameterName = "ExecuteInParallel";
+    private const string MaxDegreeOfParalellismParameterName = "MaxDegreeOfParallelism";
+    private const string ScaleEstimatedValuesParameterName = "ScaleEstimatedValues";
+
+    private const string UpdateCounterParameterName = "UpdateCounter";
+    private const string UpdateIntervalParameterName = "UpdateInterval";
+
+    #region information parameters 
+    private const string NumberOfChangedTreesParameterName = "NumberOfChangedTrees";
+    private const string NumberOfSchemasParameterName = "NumberOfSchemas";
+    private const string AverageSchemaLengthParameterName = "AverageSchemaLength";
+    #endregion
+    #endregion
+
+    #region parameters
+    public IConstrainedValueParameter<ISymbolicExpressionTreeManipulator> SchemaManipulatorParameter {
+      get { return (IConstrainedValueParameter<ISymbolicExpressionTreeManipulator>)Parameters[SchemaManipulatorParameterName]; }
+    }
+    public IConstrainedValueParameter<StringValue> SchemaDefinitionParameter {
+      get { return (IConstrainedValueParameter<StringValue>)Parameters[SchemaDefinitionParameterName]; }
+    }
+    public IConstrainedValueParameter<StringValue> MutationRateUpdateRuleParameter {
+      get { return (IConstrainedValueParameter<StringValue>)Parameters[MutationRateUpdateRuleParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> UseAdaptiveMutationRateParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[UseAdaptiveMutationRateParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> StrictSchemaMatchingParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[StrictSchemaMatchingParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> ExclusiveMatchingParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[ExclusiveMatchingParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> ScaleEstimatedValuesParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[ScaleEstimatedValuesParameterName]; }
+    }
+    public IFixedValueParameter<PercentValue> ParentsRatioParameter {
+      get { return (IFixedValueParameter<PercentValue>)Parameters[ParentsRatio]; }
+    }
+    public IFixedValueParameter<IntValue> MinimumSchemaLengthParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MinimumSchemaLengthParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> ExecuteInParallelParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[ExecuteInParallelParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> MaxDegreeOfParallelismParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaxDegreeOfParalellismParameterName]; }
+    }
+    public IFixedValueParameter<PercentValue> MinimumSchemaFrequencyParameter {
+      get { return (IFixedValueParameter<PercentValue>)Parameters[MinimumSchemaFrequencyParameterName]; }
+    }
+    public IFixedValueParameter<PercentValue> MinimumPhenotypicSimilarityParameter {
+      get { return (IFixedValueParameter<PercentValue>)Parameters[MinimumPhenotypicSimilarityParameterName]; }
+    }
+    public IFixedValueParameter<PercentValue> MutationRateParameter {
+      get { return (IFixedValueParameter<PercentValue>)Parameters[MutationRateParameterName]; }
+    }
+    public IValueParameter<IntValue> NumberOfSchemasParameter {
+      get { return (IValueParameter<IntValue>)Parameters[NumberOfSchemasParameterName]; }
+    }
+    public IValueParameter<DoubleValue> AverageSchemaLengthParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters[AverageSchemaLengthParameterName]; }
+    }
+    public IValueParameter<IntValue> NumberOfChangedTreesParameter {
+      get { return (IValueParameter<IntValue>)Parameters[NumberOfChangedTreesParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> UpdateCounterParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[UpdateCounterParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> UpdateIntervalParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[UpdateIntervalParameterName]; }
+    }
+    #endregion
+
+    #region parameter properties
+    public int MinimumSchemaLength { get { return MinimumSchemaLengthParameter.Value.Value; } }
+    public int MaxDegreeOfParallelism { get { return MaxDegreeOfParallelismParameter.Value.Value; } }
+    public bool ExecuteInParallel { get { return ExecuteInParallelParameter.Value.Value; } }
+    public double PercentageOfPopulation { get { return ParentsRatioParameter.Value.Value; } }
+    public bool StrictSchemaMatching { get { return StrictSchemaMatchingParameter.Value.Value; } }
+    public IntValue UpdateCounter { get { return UpdateCounterParameter.Value; } }
+    public IntValue UpdateInterval { get { return UpdateIntervalParameter.Value; } }
+
+    #endregion
+
+    private UpdateQualityOperator updateQualityOperator;
+    private DiversificationStatisticsOperator diversificationStatisticsOperator;
+
+    public override void InitializeState() {
+      base.InitializeState();
+      NumberOfChangedTreesParameter.Value.Value = 0;
+      NumberOfChangedTreesParameter.Value.Value = 0;
+      AverageSchemaLengthParameter.Value.Value = 0;
+      UpdateCounter.Value = 0;
+    }
+
+    public override void ClearState() {
+      NumberOfChangedTreesParameter.Value.Value = 0;
+      NumberOfChangedTreesParameter.Value.Value = 0;
+      AverageSchemaLengthParameter.Value.Value = 0;
+      UpdateCounter.Value = 0;
+      base.ClearState();
+    }
+
+    public SchemaCreator() {
+      #region add parameters
+      Parameters.Add(new FixedValueParameter<IntValue>(MinimumSchemaLengthParameterName, new IntValue(10)));
+      Parameters.Add(new FixedValueParameter<PercentValue>(MinimumSchemaFrequencyParameterName, new PercentValue(0.01)));
+      Parameters.Add(new FixedValueParameter<PercentValue>(MinimumPhenotypicSimilarityParameterName, new PercentValue(0.9)));
+      Parameters.Add(new FixedValueParameter<PercentValue>(MutationRateParameterName, new PercentValue(0.9)));
+      Parameters.Add(new FixedValueParameter<PercentValue>(ParentsRatio, new PercentValue(1)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(ExecuteInParallelParameterName, new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaxDegreeOfParalellismParameterName, new IntValue(-1)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(ScaleEstimatedValuesParameterName, new BoolValue(true)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(ExclusiveMatchingParameterName, new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(StrictSchemaMatchingParameterName, new BoolValue(false)));
+      Parameters.Add(new ValueParameter<IntValue>(NumberOfChangedTreesParameterName, new IntValue(0)));
+      Parameters.Add(new ValueParameter<IntValue>(NumberOfSchemasParameterName, new IntValue(0)));
+      Parameters.Add(new ValueParameter<DoubleValue>(AverageSchemaLengthParameterName, new DoubleValue(0)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(UseAdaptiveMutationRateParameterName, new BoolValue(true)));
+      Parameters.Add(new FixedValueParameter<IntValue>(UpdateCounterParameterName, new IntValue(0)));
+      Parameters.Add(new FixedValueParameter<IntValue>(UpdateIntervalParameterName, new IntValue(1)));
+
+      // add update rules
+      var mutationRateUpdateRules = new ItemSet<StringValue>(new[] {
+        new StringValue("f(x) = x"),
+        new StringValue("f(x) = tanh(x)"),
+        new StringValue("f(x) = tanh(2x)"),
+        new StringValue("f(x) = tanh(3x)"),
+        new StringValue("f(x) = tanh(4x)"),
+        new StringValue("f(x) = 1-sqrt(1-x)")
+      });
+      var mutationRateUpdateRuleParameter = new ConstrainedValueParameter<StringValue>(MutationRateUpdateRuleParameterName, mutationRateUpdateRules);
+      mutationRateUpdateRuleParameter.Value = mutationRateUpdateRules.First();
+      Parameters.Add(mutationRateUpdateRuleParameter);
+
+      // add schema definitions
+      var schemaDefinitions = new ItemSet<StringValue>(new[] { "=", "#", "=,#" }.Select(x => new StringValue(x)));
+      var schemaDefinitionParameter = new ConstrainedValueParameter<StringValue>(SchemaDefinitionParameterName, schemaDefinitions);
+      schemaDefinitionParameter.Value = schemaDefinitions.First();
+      Parameters.Add(schemaDefinitionParameter);
+
+      // use a separate set of manipulators in order to allow the user to specify different mutations for schemas
+      // and not be limited to the manipulator parameter for the whole algorithm
+      var manipulators = ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator))
+                                           .Where(x => !typeof(IMultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(x)
+                                                       && !typeof(ISymbolicExpressionTreeArchitectureAlteringOperator).IsAssignableFrom(x))
+                                           .Select(x => (ISymbolicExpressionTreeManipulator)Activator.CreateInstance(x)).ToList();
+      manipulators.Add(new MultiSymbolicExpressionTreeManipulator());
+
+      // add individual manipulators
+      var manipulatorParameter = new ConstrainedValueParameter<ISymbolicExpressionTreeManipulator>(SchemaManipulatorParameterName, new ItemSet<ISymbolicExpressionTreeManipulator>(manipulators));
+      // add a multi manipulator as well
+      manipulatorParameter.Value = manipulators.First();
+      Parameters.Add(manipulatorParameter);
+      #endregion
+
+      NumberOfChangedTreesParameter.Hidden = true;
+      NumberOfSchemasParameter.Hidden = true;
+      AverageSchemaLengthParameter.Hidden = true;
+
+      ExecuteInParallelParameter.Hidden = true;
+      MaxDegreeOfParallelismParameter.Hidden = true;
+    }
+
+    protected SchemaCreator(SchemaCreator original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SchemaCreator(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected SchemaCreator(bool deserializing) : base(deserializing) { }
+
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(StrictSchemaMatchingParameterName))
+        Parameters.Add(new FixedValueParameter<BoolValue>(StrictSchemaMatchingParameterName, new BoolValue(false)));
+    }
+
+    public override IOperation Apply() {
+      UpdateCounter.Value++;
+      if (UpdateCounter.Value != UpdateInterval.Value)
+        return base.Apply();
+      UpdateCounter.Value = 0;
+
+      // apply only when at least one generation has passed
+      var gen = Generations.Value;
+      if (gen < 1 || GenealogyGraph == null)
+        return base.Apply();
+
+
+      var updateEstimatedValues = new OperationCollection { Parallel = true };
+      if (updateQualityOperator == null)
+        updateQualityOperator = new UpdateQualityOperator();
+
+      var scope = ExecutionContext.Scope;
+
+      foreach (var s in scope.SubScopes.Where(s => !s.Variables.ContainsKey("EstimatedValues"))) {
+        updateEstimatedValues.Add(ExecutionContext.CreateChildOperation(updateQualityOperator, s));
+      }
+
+      var updateRule = MutationRateUpdateRuleParameter.Value.Value;
+      var schemaManipulator = SchemaManipulatorParameter.Value;
+
+      var evaluateSchemas = new OperationCollection();
+
+      Func<IScope, double> getQuality = s => ((DoubleValue)s.Variables["Quality"].Value).Value;
+
+      var bestN = (int)Math.Round(scope.SubScopes.Count * PercentageOfPopulation);
+      var scopes = new ScopeList(scope.SubScopes.OrderByDescending(getQuality).Take(bestN));
+      // for now, only consider crossover offspring
+      var vertices = from s in scopes
+                     let t = (ISymbolicExpressionTree)s.Variables["SymbolicExpressionTree"].Value
+                     let v = GenealogyGraph.GetByContent(t)
+                     where v.InDegree == 2
+                     select v;
+
+      IEnumerable<ISymbolicExpressionTree> schemas;
+      switch (SchemaDefinitionParameter.Value.Value) {
+        case "=":
+          schemas = GenerateAnyNodeSchemas(vertices, MinimumSchemaLength, 0, StrictSchemaMatching);
+          break;
+        case "#":
+          schemas = GenerateAnySubtreeSchemas(vertices, MinimumSchemaLength, 0, StrictSchemaMatching);
+          break;
+        case "=,#":
+          schemas = GenerateCombinedSchemas(vertices, MinimumSchemaLength, 0, StrictSchemaMatching);
+          break;
+        default:
+          return base.Apply();
+      }
+
+      if (!schemas.Any())
+        return base.Apply();
+
+      #region create schemas and add subscopes representing the individuals
+      double avgLength = 0;
+      int count = 0;
+      foreach (var schema in schemas) {
+        avgLength += schema.Length;
+        ++count;
+        evaluateSchemas.Add(ExecutionContext.CreateChildOperation(new SchemaEvaluator { Schema = schema, MutationRateUpdateRule = updateRule, SchemaManipulator = schemaManipulator }, scope));
+      }
+      avgLength /= count;
+      #endregion
+
+      // set parameters for statistics
+      AverageSchemaLengthParameter.Value = new DoubleValue(avgLength);
+      NumberOfSchemasParameter.Value = new IntValue(count);
+      NumberOfChangedTreesParameter.Value = new IntValue(0);
+
+      if (diversificationStatisticsOperator == null)
+        diversificationStatisticsOperator = new DiversificationStatisticsOperator();
+
+      var calculateStatistics = ExecutionContext.CreateChildOperation(diversificationStatisticsOperator);
+
+      // return an operation collection containing all the scope operations + base.Apply()
+      return new OperationCollection { updateEstimatedValues, evaluateSchemas, calculateStatistics, base.Apply() };
+    }
+
+    #region schema generation
+    public static IEnumerable<ISymbolicExpressionTree> GenerateAnyNodeSchemas(Vertices vertices, int minimumSchemaLength, int minOffspringCount = 1, bool strict = true) {
+      return GenerateSchemas(vertices, ReplaceAnyNode, minimumSchemaLength, minOffspringCount, strict);
+    }
+
+    public static IEnumerable<ISymbolicExpressionTree> GenerateAnySubtreeSchemas(Vertices vertices, int minimumSchemaLength, int minOffspringCount = 1, bool strict = true) {
+      return GenerateSchemas(vertices, ReplaceAnySubtree, minimumSchemaLength, minOffspringCount, strict);
+    }
+
+    public static IEnumerable<ISymbolicExpressionTree> GenerateCombinedSchemas(Vertices vertices, int minimumSchemaLength, int minOffspringCount = 1, bool strict = true) {
+      return GenerateSchemas(vertices, ReplaceCombined, minimumSchemaLength, minOffspringCount, strict);
+    }
+
+    public static IEnumerable<ISymbolicExpressionTree> GenerateSchemas(Vertices vertices, Func<ISymbolicExpressionTree, ISymbolicExpressionTreeNode, int, bool> replaceFunc, int minimumSchemaLength, int minOffspringCount, bool strict = true) {
+      var anySubtreeSymbol = new AnySubtreeSymbol();
+      var groups = vertices.GroupBy(x => x.Parents.First()).Where(g => g.Skip(minOffspringCount - 1).Any()).OrderByDescending(g => g.Count());
+      var hash = new HashSet<string>();
+      foreach (var g in groups) {
+        var parent = g.Key;
+        if (parent.Data.Length < minimumSchemaLength)
+          continue;
+        bool replaced = false;
+        var schema = (ISymbolicExpressionTree)parent.Data.Clone();
+        var nodes = schema.IterateNodesPrefix().ToList();
+        var fragments = g.Select(x => x.InArcs.Last().Data).Where(x => x != null).Cast<IFragment<ISymbolicExpressionTreeNode>>();
+        var indices = fragments.Select(x => x.Index1).Distinct().OrderByDescending(x => schema.Root.GetBranchLevel(nodes[x]));
+        foreach (var i in indices) {
+          replaced |= replaceFunc(schema, nodes[i], minimumSchemaLength);
+        }
+        if (replaced) {
+          var str = schema.Root.GetSubtree(0).GetSubtree(0).FormatToString(strict);
+          if (hash.Add(str))
+            yield return schema;
+        }
+      }
+    }
+
+    // node replacement rules
+    private static bool ReplaceAnyNode(ISymbolicExpressionTree schema, ISymbolicExpressionTreeNode node, int minSchemaLength) {
+      var anyNodeSymbol = new AnyNodeSymbol(node.Symbol.MinimumArity, node.Symbol.MaximumArity);
+      var replacement = anyNodeSymbol.CreateTreeNode();
+      SchemaUtil.ReplaceSubtree(node, replacement, true);
+
+      return true;
+    }
+
+    private static bool ReplaceAnySubtree(ISymbolicExpressionTree schema, ISymbolicExpressionTreeNode node, int minSchemaLength) {
+      if (schema.Length - node.GetLength() + 1 < minSchemaLength)
+        return false;
+
+      var anySubtreeSymbol = new AnySubtreeSymbol();
+      var replacement = anySubtreeSymbol.CreateTreeNode();
+
+      SchemaUtil.ReplaceSubtree(node, replacement, false);
+      return true;
+    }
+
+    private static bool ReplaceCombined(ISymbolicExpressionTree schema, ISymbolicExpressionTreeNode node, int minSchemaLength) {
+      ISymbol wildcard;
+      if (node.SubtreeCount > 0)
+        wildcard = new AnyNodeSymbol(node.Symbol.MinimumArity, node.Symbol.MaximumArity);
+      else
+        wildcard = new AnySubtreeSymbol();
+
+      SchemaUtil.ReplaceSubtree(node, wildcard.CreateTreeNode(), node.SubtreeCount > 0);
+      return true;
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs	(revision 16132)
@@ -0,0 +1,386 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SchemaEvaluator", "An operator that builds schemas based on the heredity relationship in the genealogy graph.")]
+  [StorableClass]
+  public class SchemaEvaluator : EvolutionTrackingOperator<ISymbolicExpressionTree> {
+    #region parameter names
+    private const string MinimumSchemaFrequencyParameterName = "MinimumSchemaFrequency";
+    private const string MinimumPhenotypicSimilarityParameterName = "MinimumPhenotypicSimilarity";
+    private const string MutationRateParameterName = "MutationRate";
+    private const string SchemaParameterName = "Schema";
+    private const string PopulationSizeParameterName = "PopulationSize";
+    private const string RandomParameterName = "Random";
+    private const string EvaluatorParameterName = "Evaluator";
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string EstimationLimitsParameterName = "EstimationLimits";
+    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
+    private const string MutatorParameterName = "Mutator";
+    private const string CrossoverParameterName = "Crossover";
+    private const string NumberOfChangedTreesParameterName = "NumberOfChangedTrees";
+    private const string ExecuteInParallelParameterName = "ExecuteInParallel";
+    private const string MaxDegreeOfParalellismParameterName = "MaxDegreeOfParallelism";
+    private const string ExclusiveMatchingParameterName = "ExclusiveMatching";
+    private const string UseAdaptiveMutationRateParameterName = "UseAdaptiveMutationRate";
+    private const string StrictSchemaMatchingParameterName = "StrictSchemaMatching";
+    #endregion
+
+    #region parameters
+    public ILookupParameter<BoolValue> UseAdaptiveMutationRateParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[UseAdaptiveMutationRateParameterName]; }
+    }
+    public ILookupParameter<BoolValue> ExclusiveMatchingParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ExclusiveMatchingParameterName]; }
+    }
+    public ILookupParameter<BoolValue> ExecuteInParallelParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ExecuteInParallelParameterName]; }
+    }
+    public ILookupParameter<IntValue> MaxDegreeOfParallelismParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[MaxDegreeOfParalellismParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<IRegressionProblemData>> EvaluatorParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<IRegressionProblemData>>)Parameters[EvaluatorParameterName]; }
+    }
+    public ILookupParameter<IRegressionProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<IRegressionProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
+    }
+    public ILookupParameter<DoubleLimit> EstimationLimitsParameter {
+      get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+    }
+    public ILookupParameter<BoolValue> ApplyLinearScalingParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionTreeCrossover> CrossoverParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTreeCrossover>)Parameters[CrossoverParameterName]; }
+    }
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    public ILookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[PopulationSizeParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionTree> SchemaParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SchemaParameterName]; }
+    }
+    public ILookupParameter<PercentValue> MinimumSchemaFrequencyParameter {
+      get { return (ILookupParameter<PercentValue>)Parameters[MinimumSchemaFrequencyParameterName]; }
+    }
+    public ILookupParameter<PercentValue> MutationRateParameter {
+      get { return (ILookupParameter<PercentValue>)Parameters[MutationRateParameterName]; }
+    }
+    public ILookupParameter<PercentValue> MinimumPhenotypicSimilarityParameter {
+      get { return (ILookupParameter<PercentValue>)Parameters[MinimumPhenotypicSimilarityParameterName]; }
+    }
+    public LookupParameter<IntValue> NumberOfChangedTreesParameter {
+      get { return (LookupParameter<IntValue>)Parameters[NumberOfChangedTreesParameterName]; }
+    }
+    public LookupParameter<BoolValue> StrictSchemaMatchingParameter {
+      get { return (LookupParameter<BoolValue>)Parameters[StrictSchemaMatchingParameterName]; }
+    }
+    #endregion
+
+    #region parameter properties
+    public PercentValue MinimumSchemaFrequency { get { return MinimumSchemaFrequencyParameter.ActualValue; } }
+    public PercentValue MutationRate { get { return MutationRateParameter.ActualValue; } }
+    public PercentValue MinimumPhenotypicSimilarity { get { return MinimumPhenotypicSimilarityParameter.ActualValue; } }
+    public IntValue NumberOfChangedTrees { get { return NumberOfChangedTreesParameter.ActualValue; } }
+    #endregion
+
+    private QueryMatch qm;
+
+    [Storable]
+    private SymbolicExpressionTreePhenotypicSimilarityCalculator calculator;
+
+    [Storable]
+    public string MutationRateUpdateRule { get; set; }
+
+    [Storable]
+    private ISymbolicExpressionTreeNodeEqualityComparer comparer;
+
+    [Storable]
+    public ISymbolicExpressionTree Schema { get; set; }
+
+    [Storable]
+    private readonly UpdateQualityOperator updateQualityOperator;
+
+    [Storable]
+    public ISymbolicExpressionTreeManipulator SchemaManipulator { get; set; }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(StrictSchemaMatchingParameterName))
+        Parameters.Add(new LookupParameter<BoolValue>(StrictSchemaMatchingParameterName));
+
+      if (calculator == null)
+        calculator = new SymbolicExpressionTreePhenotypicSimilarityCalculator();
+
+      if (comparer == null)
+        comparer = new SymbolicExpressionTreeNodeEqualityComparer { MatchVariableNames = true, MatchVariableWeights = true, MatchConstantValues = false };
+
+      qm = new QueryMatch(comparer) { MatchParents = true };
+    }
+
+    public SchemaEvaluator() {
+      calculator = new SymbolicExpressionTreePhenotypicSimilarityCalculator();
+      comparer = new SymbolicExpressionTreeNodeEqualityComparer { MatchVariableNames = true, MatchVariableWeights = true, MatchConstantValues = false };
+      qm = new QueryMatch(comparer) { MatchParents = true };
+      updateQualityOperator = new UpdateQualityOperator();
+      #region add parameters
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SchemaParameterName, "The current schema to be evaluated"));
+      Parameters.Add(new LookupParameter<PercentValue>(MinimumSchemaFrequencyParameterName));
+      Parameters.Add(new LookupParameter<PercentValue>(MutationRateParameterName));
+      Parameters.Add(new LookupParameter<PercentValue>(MinimumPhenotypicSimilarityParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(PopulationSizeParameterName));
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisSingleObjectiveEvaluator<IRegressionProblemData>>(EvaluatorParameterName));
+      Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));
+      Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));
+      Parameters.Add(new LookupParameter<BoolValue>(ApplyLinearScalingParameterName));
+      Parameters.Add(new LookupParameter<BoolValue>(StrictSchemaMatchingParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTreeManipulator>(MutatorParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTreeCrossover>(CrossoverParameterName));
+      Parameters.Add(new LookupParameter<IntValue>(NumberOfChangedTreesParameterName));
+      Parameters.Add(new LookupParameter<BoolValue>(ExecuteInParallelParameterName));
+      Parameters.Add(new LookupParameter<IntValue>(MaxDegreeOfParalellismParameterName));
+      Parameters.Add(new LookupParameter<BoolValue>(ExclusiveMatchingParameterName));
+      Parameters.Add(new LookupParameter<BoolValue>(UseAdaptiveMutationRateParameterName));
+      #endregion
+    }
+
+    [StorableConstructor]
+    protected SchemaEvaluator(bool deserializing) : base(deserializing) { }
+
+    protected SchemaEvaluator(SchemaEvaluator original, Cloner cloner) : base(original, cloner) {
+      calculator = cloner.Clone(original.calculator);
+      comparer = cloner.Clone(original.comparer);
+      qm = new QueryMatch(comparer) { MatchParents = true };
+      updateQualityOperator = new UpdateQualityOperator();
+      Schema = original.Schema;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SchemaEvaluator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var strictSchemaMatching = StrictSchemaMatchingParameter.ActualValue.Value;
+      if (strictSchemaMatching) {
+        comparer.MatchVariableWeights = true;
+        comparer.MatchConstantValues = true;
+      } else {
+        comparer.MatchVariableWeights = false;
+        comparer.MatchConstantValues = false;
+      }
+
+      var individuals = ExecutionContext.Scope.SubScopes; // the scopes represent the individuals
+      var trees = new ISymbolicExpressionTree[individuals.Count];
+      var qualities = new double[individuals.Count];
+
+      for (int i = 0; i < individuals.Count; ++i) {
+        trees[i] = (ISymbolicExpressionTree)individuals[i].Variables["SymbolicExpressionTree"].Value;
+        qualities[i] = ((DoubleValue)individuals[i].Variables["Quality"].Value).Value;
+      }
+
+      var random = RandomParameter.ActualValue;
+      var sRoot = Schema.Root.GetSubtree(0).GetSubtree(0);
+
+      // first apply the length and root equality checks in order to filter the individuals
+      var exclusiveMatching = ExclusiveMatchingParameter.ActualValue.Value;
+      var filtered = new List<int>();
+
+      for (int i = 0; i < trees.Length; ++i) {
+        if (exclusiveMatching && individuals[i].Variables.ContainsKey("AlreadyMatched")) continue;
+        var t = trees[i];
+        var tRoot = t.Root.GetSubtree(0).GetSubtree(0);
+        if (t.Length < Schema.Length || !qm.EqualityComparer.Equals(tRoot, sRoot)) continue;
+        filtered.Add(i);
+      }
+
+      // if we don't have enough filtered individuals, then we are done
+      // if the schema exceeds the minimum frequency, it gets processed further
+      int countThreshold = (int)Math.Max(2, Math.Round(MinimumSchemaFrequency.Value * individuals.Count));
+      if (filtered.Count < countThreshold) {
+        return base.Apply();
+      }
+
+      // check if the filtered individuals match the schema
+      var matching = new List<int>();
+      var sNodes = QueryMatch.InitializePostOrder(sRoot);
+
+      bool executeInParallel = ExecuteInParallelParameter.ActualValue.Value;
+      int maxDegreeOfParallelism = MaxDegreeOfParallelismParameter.ActualValue.Value;
+
+      if (executeInParallel) {
+        var partitioner = Partitioner.Create(0, filtered.Count);
+        var po = new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism };
+
+        Parallel.ForEach(partitioner, po, (range, loop) => {
+          var partial = new List<int>();
+          for (int i = range.Item1; i < range.Item2; ++i) {
+            var idx = filtered[i];
+            var tRoot = trees[idx].Root.GetSubtree(0).GetSubtree(0);
+            var tNodes = QueryMatch.InitializePostOrder(tRoot);
+
+            if (qm.Match(tNodes, sNodes)) { partial.Add(idx); }
+          }
+          lock (matching) { matching.AddRange(partial); }
+        });
+      } else {
+        for (int i = 0; i < filtered.Count; ++i) {
+          var index = filtered[i];
+          var tRoot = trees[index].Root.GetSubtree(0).GetSubtree(0);
+          var tNodes = QueryMatch.InitializePostOrder(tRoot);
+          if (qm.Match(tNodes, sNodes)) {
+            matching.Add(index);
+          }
+        }
+      }
+      if (matching.Count < countThreshold) {
+        return base.Apply();
+      }
+
+      matching.Sort((a, b) => qualities[a].CompareTo(qualities[b])); // sort by ascending quality
+      var matchingIndividuals = matching.Select(x => individuals[x]).ToArray(); // fittest individual will be last in the array
+      var similarity = CalculateSimilarity(matchingIndividuals, calculator, executeInParallel, maxDegreeOfParallelism);
+      if (similarity < MinimumPhenotypicSimilarity.Value) {
+        return base.Apply();
+      }
+
+      double mutationRate;
+      var useAdaptiveMutationRate = UseAdaptiveMutationRateParameter.ActualValue.Value;
+
+      if (useAdaptiveMutationRate) {
+        var r = (double)matchingIndividuals.Length / individuals.Count;
+        mutationRate = CalculateMutationRate(r);
+      } else {
+        mutationRate = MutationRate.Value;
+      }
+
+      var mutations = new OperationCollection { Parallel = false }; // cannot be parallel due to the before/after operators which insert vertices in the genealogy graph
+      var updates = new OperationCollection { Parallel = true }; // evaluation should be done in parallel when possible
+
+      // use length - 1 because we don't want to mutate the best individual in each schema group (which could also be the overall elite)
+      for (int i = 0; i < matchingIndividuals.Length - 1; ++i) {
+        if (random.NextDouble() > mutationRate) continue;
+
+        var ind = matchingIndividuals[i];
+
+        var mutate = ExecutionContext.CreateChildOperation(SchemaManipulator, ind);
+        var update = ExecutionContext.CreateChildOperation(updateQualityOperator, ind);
+
+        mutations.Add(mutate);
+        updates.Add(update);
+
+        if (exclusiveMatching)
+          ind.Variables.Add(new Core.Variable("AlreadyMatched"));
+      }
+      NumberOfChangedTrees.Value += mutations.Count;
+
+      return new OperationCollection(mutations, updates, base.Apply());
+    }
+
+    private double CalculateMutationRate(double r) {
+      switch (MutationRateUpdateRule) {
+        case "f(x) = x": {
+            return r;
+          }
+        case "f(x) = tanh(x)": {
+            return Math.Tanh(r);
+          }
+        case "f(x) = tanh(2x)": {
+            return Math.Tanh(2 * r);
+          }
+        case "f(x) = tanh(3x)": {
+            return Math.Tanh(3 * r);
+          }
+        case "f(x) = tanh(4x)": {
+            return Math.Tanh(4 * r);
+          }
+        case "f(x) = 1-sqrt(1-x)": {
+            return 1 - Math.Sqrt(1 - r);
+          }
+        default:
+          throw new ArgumentException("Unknown replacement rule");
+      }
+    }
+
+    public static double CalculateSimilarity(IScope[] individuals, ISolutionSimilarityCalculator calculator, bool parallel = false, int nThreads = -1) {
+      if (individuals.Length < 2)
+        return double.NaN;
+
+      double similarity = 0;
+      int count = individuals.Length;
+      int n = count * (count - 1) / 2;
+
+      if (parallel) {
+        var ii = new int[n];
+        var jj = new int[n];
+        int k = 0;
+        for (int i = 0; i < count - 1; ++i)
+          for (int j = i + 1; j < count; ++j) {
+            ii[k] = i;
+            jj[k] = j;
+            ++k;
+          }
+        var po = new ParallelOptions { MaxDegreeOfParallelism = nThreads };
+        var partitioner = Partitioner.Create(0, n);
+        var locker = new object();
+        Parallel.ForEach(partitioner, new ParallelOptions { MaxDegreeOfParallelism = 4 }, (range, loop) => {
+          var partial = 0d;
+          for (int idx = range.Item1; idx < range.Item2; ++idx) {
+            int i = ii[idx];
+            int j = jj[idx];
+            partial += calculator.CalculateSolutionSimilarity(individuals[i], individuals[j]);
+          }
+          lock (locker) { similarity += partial; }
+        });
+      } else {
+        for (int i = 0; i < count - 1; ++i) {
+          for (int j = i + 1; j < count; ++j) {
+            similarity += calculator.CalculateSolutionSimilarity(individuals[i], individuals[j]);
+          }
+        }
+      }
+      return similarity / n;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaUtil.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaUtil.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaUtil.cs	(revision 16132)
@@ -0,0 +1,103 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public static class SchemaUtil {
+    private static readonly Dictionary<string, string> ShortNames = new Dictionary<string, string> {
+      { "Addition", "+" },
+      { "Subtraction", "-" },
+      { "Multiplication", "*" },
+      { "Division", "/" },
+      { "Logarithm", "Log" },
+      { "Exponential", "Exp" }
+    };
+
+    public static void ReplaceSubtree(ISymbolicExpressionTreeNode original, ISymbolicExpressionTreeNode replacement, bool preserveChildren = true) {
+      var parent = original.Parent;
+      if (parent == null)
+        throw new ArgumentException("Parent cannot be null for node " + original);
+      var index = parent.IndexOfSubtree(original);
+      parent.RemoveSubtree(index);
+      parent.InsertSubtree(index, replacement);
+
+      if (preserveChildren) {
+        var subtrees = original.Subtrees.ToList();
+
+        for (int i = subtrees.Count - 1; i >= 0; --i)
+          original.RemoveSubtree(i);
+
+        for (int i = 0; i < subtrees.Count; ++i) {
+          replacement.AddSubtree(subtrees[i]);
+        }
+      }
+    }
+
+    public static string FormatToString(this ISymbolicExpressionTreeNode node, bool strict = false) {
+      StringBuilder strBuilder = new StringBuilder();
+      // internal nodes or leaf nodes?
+      if (node is AnySubtree)
+        return "# ";
+
+      if (node.SubtreeCount > 0) {
+        strBuilder.Append("(");
+        // symbol on same line as '('
+        string label = string.Empty;
+        if (node is AnyNode)
+          label = "=";
+        else {
+          string shortName;
+          ShortNames.TryGetValue(node.Symbol.Name, out shortName);
+          label = string.IsNullOrEmpty(shortName) ? node.Symbol.Name : shortName;
+        }
+        strBuilder.Append(label + " ");
+        // each subtree expression on a new line
+        // and closing ')' also on new line
+        foreach (var subtree in node.Subtrees) {
+          strBuilder.Append(subtree.FormatToString(strict));
+        }
+        strBuilder.Append(") ");
+      } else {
+        // symbol in the same line with as '(' and ')'
+        var v = node as VariableTreeNode;
+        var c = node as ConstantTreeNode;
+        var w = node as AnyNode; // wildcard
+        string label = string.Empty;
+        if (w != null)
+          label = "=";
+        else if (v != null)
+          label = strict ? string.Format("{0:0.00}_{1}", v.Weight, v.VariableName) : string.Format("{0}", v.VariableName);
+        else if (c != null)
+          label = strict ? string.Format("{0:0.00}", c.Value) : "C";
+        strBuilder.Append(label);
+        if (node.Parent != null && node != node.Parent.Subtrees.Last())
+          strBuilder.Append(" ");
+        //strBuilder.Append(")");
+      }
+      return strBuilder.ToString();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateQualityOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateQualityOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateQualityOperator.cs	(revision 16132)
@@ -0,0 +1,139 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("UpdateQualityOperator", "Put the estimated values of the tree in the scope to be used by the phenotypic similarity calculator")]
+  [StorableClass]
+  public class UpdateQualityOperator : EvolutionTrackingOperator<ISymbolicExpressionTree> {
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string EstimationLimitsParameterName = "EstimationLimits";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ScaleEstimatedValuesParameterName = "ScaleEstimatedValues";
+
+    #region parameters
+    public ILookupParameter<IRegressionProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<IRegressionProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
+    }
+    public ILookupParameter<DoubleLimit> EstimationLimitsParameter {
+      get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<BoolValue> ScaleEstimatedValuesParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ScaleEstimatedValuesParameterName]; }
+    }
+    #endregion
+
+    public UpdateQualityOperator() {
+      Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));
+      Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName));
+      Parameters.Add(new LookupParameter<BoolValue>(ScaleEstimatedValuesParameterName));
+    }
+
+    [StorableConstructor]
+    protected UpdateQualityOperator(bool deserializing) : base(deserializing) { }
+
+    protected UpdateQualityOperator(UpdateQualityOperator original, Cloner cloner) : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new UpdateQualityOperator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var tree = SymbolicExpressionTreeParameter.ActualValue;
+      var problemData = ProblemDataParameter.ActualValue;
+      var estimationLimits = EstimationLimitsParameter.ActualValue;
+      var interpreter = InterpreterParameter.ActualValue;
+
+      var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, problemData.TrainingIndices);
+      var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices);
+
+      var scaleEstimatedValues = ScaleEstimatedValuesParameter.ActualValue.Value;
+
+      IEnumerable<double> scaled;
+      if (scaleEstimatedValues) {
+        var linearScalingCalculator = new OnlineLinearScalingParameterCalculator();
+
+        var e1 = estimatedValues.GetEnumerator();
+        var e2 = targetValues.GetEnumerator();
+
+        int count = 0;
+        while (e1.MoveNext() && e2.MoveNext()) {
+          var estimated = e1.Current;
+          var target = e2.Current;
+          if (!double.IsNaN(estimated) && !double.IsInfinity(estimated))
+            linearScalingCalculator.Add(estimated, target);
+          ++count;
+        }
+        if (e1.MoveNext() || e2.MoveNext())
+          throw new ArgumentException("Number of elements in target and estimated values enumeration do not match.");
+
+        double alpha = linearScalingCalculator.Alpha;
+        double beta = linearScalingCalculator.Beta;
+        if (linearScalingCalculator.ErrorState != OnlineCalculatorError.None) {
+          alpha = 0.0;
+          beta = 1.0;
+        }
+        scaled = estimatedValues.Select(x => x * beta + alpha).LimitToRange(estimationLimits.Lower, estimationLimits.Upper);
+      } else {
+        scaled = estimatedValues.LimitToRange(estimationLimits.Lower, estimationLimits.Upper);
+      }
+
+      OnlineCalculatorError error;
+      var r = OnlinePearsonsRCalculator.Calculate(targetValues, scaled, out error);
+      if (error != OnlineCalculatorError.None) r = double.NaN;
+
+      var r2 = r * r;
+
+      var variables = ExecutionContext.Scope.Variables;
+
+      ((DoubleValue)variables["Quality"].Value).Value = r2;
+      //GenealogyGraph.GetByContent(tree).Quality = r2;
+
+      if (variables.ContainsKey("EstimatedValues")) {
+        variables["EstimatedValues"].Value = new DoubleArray(scaled.ToArray());
+      } else {
+        variables.Add(new Core.Variable("EstimatedValues", new DoubleArray(scaled.ToArray())));
+      }
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs	(revision 16132)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionAfterCrossoverOperator", "An operator that compares the crossover child with the parent and saves the swapped fragment.")]
+  public class SymbolicDataAnalysisExpressionAfterCrossoverOperator : AfterCrossoverOperator<ISymbolicExpressionTree> {
+    public SymbolicDataAnalysisExpressionAfterCrossoverOperator() { }
+
+    protected SymbolicDataAnalysisExpressionAfterCrossoverOperator(SymbolicDataAnalysisExpressionAfterCrossoverOperator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionAfterCrossoverOperator(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionAfterCrossoverOperator(bool deserializing) : base(deserializing) { }
+
+    public override IOperation Apply() {
+      var childVertex = GenealogyGraph.GetByContent(ChildParameter.ActualValue);
+      var arcs = childVertex.InArcs.ToList();
+      var nodes0 = (List<ISymbolicExpressionTreeNode>)arcs[0].Data;
+      var nodes1 = (List<ISymbolicExpressionTreeNode>)arcs[1].Data;
+      var childNodes = childVertex.Data.IterateNodesPrefix().ToList();
+      IFragment<ISymbolicExpressionTreeNode> fragment = null;
+      for (int i = 0; i < Math.Min(nodes0.Count, childNodes.Count); ++i) {
+        if (nodes0[i] == childNodes[i]) continue;
+        fragment = new Fragment<ISymbolicExpressionTreeNode> {
+          Root = childNodes[i],
+          Index1 = i,
+        };
+        fragment.Index2 = nodes1.IndexOf(fragment.Root);
+        break;
+      }
+
+      // if the fragment is null it means that nodes0 is identical with childNodes (in other words crossover did nothing)
+      arcs[0].Data = null;
+      arcs[1].Data = fragment;
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs	(revision 16132)
@@ -0,0 +1,60 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionAfterManipulatorOperator", "An operator that compares the mutation child with the parent and saves the modified fragment.")]
+  public class SymbolicDataAnalysisExpressionAfterManipulatorOperator : AfterManipulatorOperator<ISymbolicExpressionTree> {
+    public SymbolicDataAnalysisExpressionAfterManipulatorOperator() { }
+
+    protected SymbolicDataAnalysisExpressionAfterManipulatorOperator(SymbolicDataAnalysisExpressionAfterManipulatorOperator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionAfterManipulatorOperator(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionAfterManipulatorOperator(bool deserializing) : base(deserializing) { }
+
+    public override IOperation Apply() {
+      var child = ChildParameter.ActualValue;
+      var childVertex = GenealogyGraph.GetByContent(child);
+      var parent = childVertex.Parents.First().Data;
+      var subtree = child.Difference(parent);
+      Fragment<ISymbolicExpressionTreeNode> fragment = null;
+      if (subtree != null) {
+        int index = child.IterateNodesPrefix().TakeWhile(node => node != subtree).Count();
+        fragment = new Fragment<ISymbolicExpressionTreeNode> { Root = subtree, Index1 = index, Index2 = index };
+      }
+      childVertex.InArcs.Last().Data = fragment;
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs	(revision 16132)
@@ -0,0 +1,59 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionBeforeCrossoverOperator", "An operator which runs before crossover and enables the tracking of genetic fragments.")]
+  public class SymbolicDataAnalysisExpressionBeforeCrossoverOperator : BeforeCrossoverOperator<ISymbolicExpressionTree> {
+    public SymbolicDataAnalysisExpressionBeforeCrossoverOperator() { }
+
+    protected SymbolicDataAnalysisExpressionBeforeCrossoverOperator(SymbolicDataAnalysisExpressionBeforeCrossoverOperator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionBeforeCrossoverOperator(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionBeforeCrossoverOperator(bool deserializing) : base(deserializing) { }
+
+    public override IOperation Apply() {
+      var result = base.Apply(); // the base operator will add the child to the graph before the actual crossover operation takes place
+      var parents = ParentsParameter.ActualValue.ToList();
+      var childVertex = GenealogyGraph.GetByContent(parents[0]); // use the parent since it is actually the child before crossover (and the ChildParameter doesn't have a value yet)
+      var arcs = childVertex.InArcs.ToList();
+
+      for (int i = 0; i < parents.Count; ++i) {
+        arcs[i].Data = parents[i].IterateNodesPrefix().ToCloneableCollection();
+      }
+
+      return result;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs	(revision 16132)
@@ -0,0 +1,66 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicDataAnalysisExpressionBeforeManipulatorOperator", "An operator which sets up tracking for mutation fragments.")]
+  public class SymbolicDataAnalysisExpressionBeforeManipulatorOperator : BeforeManipulatorOperator<ISymbolicExpressionTree> {
+    public SymbolicDataAnalysisExpressionBeforeManipulatorOperator() { }
+
+    protected SymbolicDataAnalysisExpressionBeforeManipulatorOperator(SymbolicDataAnalysisExpressionBeforeManipulatorOperator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDataAnalysisExpressionBeforeManipulatorOperator(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionBeforeManipulatorOperator(bool deserializing) : base(deserializing) { }
+
+    public override IOperation Apply() {
+      // the call below does the following things:
+      // 1) creates a clone of the individual to be manipulated, and adds it in the genealogy graph with rank = currentRank - 0.5.
+      //    the cloning will also clone the vertex data object, therefore reference comparison of node lists will not work
+      // 2) replaces the parent of the current individual with the clone, and alters graph connections accordingly
+      //    so that vChild vertex will represent the child, and vClone will represent the cloned parent
+      var result = base.Apply();
+      var vChild = GenealogyGraph.GetByContent(ChildParameter.ActualValue);
+      var vClone = vChild.Parents.Last();
+
+      var fragment = (IFragment<ISymbolicExpressionTreeNode>)vClone.InArcs.Last().Data;
+      if (fragment != null) {
+        // this step must be performed because the fragment root actually references the original child (not the clone). 
+        // when mutation occurs the fragment root would point to the mutated subtree in the child instead of the original one in the clone
+        fragment.Root = vClone.Data.IterateNodesPrefix().ElementAt(fragment.Index1);
+      }
+
+      return result;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs	(revision 16132)
@@ -0,0 +1,320 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("TraceCalculator", "Walks a genealogy graph and produces a trace of the specified subtree")]
+  [StorableClass]
+  public class TraceCalculator : Item {
+    private Dictionary<ISymbolicExpressionTree, List<ISymbolicExpressionTreeNode>> nodeListCache;
+    // the trace cache consits of tuples of the current and last vertices, the subtree index to be traced in the current vertex, and the last subtree and fragment indexes
+    private HashSet<Tuple<IGenealogyGraphNode<ISymbolicExpressionTree>, int, IGenealogyGraphNode<ISymbolicExpressionTree>, int, int>> traceCache;
+    public IGenealogyGraph<ISymbolicExpressionTree> TraceGraph { get; private set; }
+
+    public bool UpdateVertexWeights { get; set; }
+    public bool UpdateSubtreeWeights { get; set; }
+    public bool CacheTraceNodes { get; set; }
+
+    public int TraceCacheHits { get; set; }
+
+    public TraceCalculator() {
+      ResetState();
+    }
+
+    [StorableConstructor]
+    protected TraceCalculator(bool deserializing) : base(deserializing) { }
+
+    protected TraceCalculator(TraceCalculator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TraceCalculator(this, cloner);
+    }
+
+    public void ResetState() {
+      TraceGraph = new GenealogyGraph<ISymbolicExpressionTree>();
+      nodeListCache = new Dictionary<ISymbolicExpressionTree, List<ISymbolicExpressionTreeNode>>();
+      traceCache = new HashSet<Tuple<IGenealogyGraphNode<ISymbolicExpressionTree>, int, IGenealogyGraphNode<ISymbolicExpressionTree>, int, int>>();
+    }
+
+    public static IGenealogyGraph<ISymbolicExpressionTree> TraceSubtree(IGenealogyGraphNode<ISymbolicExpressionTree> node, int subtreeIndex, bool updateVertexWeights = false, bool updateSubtreeWeights = false, bool cacheTraceNodes = true) {
+      var tc = new TraceCalculator {
+        UpdateVertexWeights = updateSubtreeWeights,
+        UpdateSubtreeWeights = updateSubtreeWeights,
+        CacheTraceNodes = cacheTraceNodes
+      };
+      tc.Trace(node, subtreeIndex);
+      return tc.TraceGraph;
+    }
+
+    public IGenealogyGraph<ISymbolicExpressionTree> Trace(IGenealogyGraphNode<ISymbolicExpressionTree> node, int subtreeIndex, bool resetState = true) {
+      if (resetState) ResetState();
+      TraceRecursive(node, subtreeIndex);
+      return TraceGraph;
+    }
+
+    /// <summary>
+    /// This method starts from a given vertex in the genealogy graph and works its way 
+    /// up the ancestry trying to track the structure of the subtree given by subtreeIndex.
+    /// This method will skip genealogy graph nodes that did not have an influence on the 
+    /// structure of the tracked subtree. 
+    /// 
+    /// Only genealogy nodes which did have an influence are added (as copies) to the trace 
+    /// and are consequently called 'trace nodes'. 
+    /// 
+    /// The arcs connecting trace nodes hold information about the locations of the subtrees
+    /// and fragments that have been swapped in the form of a tuple (si, fi, lastSi, lastFi),
+    /// where:
+    /// - si is the subtree index in the current trace node
+    /// - fi is the fragment index in the current trace node
+    /// - lastSi is the subtree index in the previous trace node
+    /// - lastFi is the subtree index in the previous trace node
+    /// </summary>
+    /// <param name="node">The current node in the genealogy graph</param>
+    /// <param name="subtreeIndex">The index of the traced subtree</param>
+    /// <param name="last">The last added node in the trace graph</param>
+    /// <param name="lastSi">The subtree index in the last added individual</param>
+    /// <param name="lastFi">The fragment index in the last added individual</param>
+    private void TraceRecursive(IGenealogyGraphNode<ISymbolicExpressionTree> node, int subtreeIndex, IGenealogyGraphNode<ISymbolicExpressionTree> last = null, int lastSi = -1, int lastFi = -1) {
+      var g = node;
+      var si = subtreeIndex; // subtree index
+      var fi = 0; // fragment index
+      while (((List<IArc>)((IVertex)g).InArcs).Count > 0) {
+        if (!(si < g.Data.Length)) throw new ArgumentOutOfRangeException("The subtree index exceeds the size of the tree.");
+        var inArcs = (List<IArc>)((IVertex)g).InArcs;
+        var fragment = (IFragment<ISymbolicExpressionTreeNode>)((IGenealogyGraphArc)inArcs.Last()).Data;
+        if (fragment == null) {
+          // TODO: think about what the correct behavior should be here (seems good so far)
+          // the node is either an elite node or (in rare cases) no fragment was transferred
+          g = (IGenealogyGraphNode<ISymbolicExpressionTree>)inArcs[0].Source;
+          continue;
+        }
+
+        fi = fragment.Index1; // fragment index
+        int fl = fragment.Root.GetLength(); // fragment length
+        int sl = NodeAt(g.Data, si).GetLength(); // subtree length
+
+        #region trace crossover
+        if (inArcs.Count == 2) {
+          var parent0 = (IGenealogyGraphNode<ISymbolicExpressionTree>)inArcs[0].Source;
+          var parent1 = (IGenealogyGraphNode<ISymbolicExpressionTree>)inArcs[1].Source;
+          if (fi == si) {
+            g = parent1;
+            si = fragment.Index2;
+            continue;
+          }
+          if (fi < si) {
+            if (fi + fl > si) {
+              // fragment contains subtree
+              g = parent1;
+              si += fragment.Index2 - fi;
+            } else {
+              // fragment distinct from subtree
+              g = parent0;
+              si += NodeAt(g.Data, fi).GetLength() - fl;
+            }
+            continue;
+          }
+          if (fi > si) {
+            if (fi < si + sl) {
+              // subtree contains fragment => branching point in the fragment graph
+              var n = AddTraceNode(g); // current node becomes "last" as we restart tracing from the parent
+              if (CacheTraceNodes) {
+                var t0 = Tuple.Create(parent0, si, n, si, fi);
+                var t1 = Tuple.Create(parent1, fragment.Index2, n, si, fi);
+                // trace subtree
+                if (traceCache.Add(t0))
+                  TraceRecursive(parent0, si, n, si, fi);
+                else
+                  TraceCacheHits++;
+                // trace fragment
+                if (traceCache.Add(t1))
+                  TraceRecursive(parent1, fragment.Index2, n, si, fi);
+                else
+                  TraceCacheHits++;
+              } else {
+                TraceRecursive(parent0, si, n, si, fi);
+                TraceRecursive(parent1, fragment.Index2, n, si, fi);
+              }
+              break;
+            } else {
+              // subtree and fragment are distinct. 
+              g = parent0;
+              continue;
+            }
+          }
+        }
+        #endregion
+        #region trace mutation
+        // mutation is handled in a simple way: we branch every time there is an overlap between the subtree and the fragment
+        // (since mutation effects can be quite unpredictable: replace branch, change node, shake tree, etc)
+        if (inArcs.Count == 1) {
+          var parent0 = (IGenealogyGraphNode<ISymbolicExpressionTree>)inArcs[0].Source;
+          Debug.Assert(fragment.Index1 == fragment.Index2);
+          // check if the subtree and the fragment overlap => branch out
+          // optionally we could ignore the case when the fragment contains the subtree:
+          // ((si == fi) || fi < si && si < fi + fl) 
+          if ((si == fi) || (si < fi && fi < si + sl) || (fi < si && si < fi + fl)) {
+            var n = AddTraceNode(g); // current node becomes "last" as we restart tracing from the parent
+            int i = si < fi ? si : fi;
+            var t = Tuple.Create(parent0, i, n, si, fi);
+            if (CacheTraceNodes) {
+              if (traceCache.Add(t))
+                TraceRecursive(parent0, i, n, si, fi);
+              else
+                TraceCacheHits++;
+            } else {
+              TraceRecursive(parent0, i, n, si, fi);
+            }
+            break;
+          } else {
+            // if they don't overlap, go up
+            g = parent0;
+            if (fi < si)
+              si += NodeAt(g.Data, fi).GetLength() - fl;
+            continue;
+          }
+
+        }
+        #endregion
+        throw new InvalidOperationException("A node cannot have more than two parents");
+      }
+      // when we are out of the while the last vertex must be connected with the current one
+      // if there is no last vertex, it means the tracing reached the top of the genealogy graph
+      if (last != null) {
+        var current = AddTraceNode(g);
+        if (current.Rank.IsAlmost(0)) fi = -1; // if current is part of the initial population there will be no fragment
+        var td = new TraceData(si, fi, lastSi, lastFi);
+#if DEBUG
+        var currentLength = current.Data.Length;
+        var lastLength = last.Data.Length;
+
+        if (!(si < currentLength))
+          throw new ArgumentOutOfRangeException(string.Format("Subtree index {0} exceeds tree length ({1}", si, currentLength));
+
+        if (!(fi < currentLength))
+          throw new ArgumentOutOfRangeException(string.Format("Fragment index {0} exceeds tree length ({1}", fi, currentLength));
+
+        if (!(lastSi < lastLength))
+          throw new ArgumentOutOfRangeException(string.Format("Last subtree index {0} exceeds tree length ({1}", lastSi, lastLength));
+
+        if (!(lastFi < lastLength))
+          throw new ArgumentOutOfRangeException(string.Format("Last fragment index {0} exceeds tree length ({1}", lastFi, lastLength));
+#endif
+        ConnectLast(current, last, td);
+      }
+    }
+
+    /// <summary>
+    /// Get the trace node from the trace graph which corresponds to node g from the genealogy graph.
+    /// If the trace graph does not contain such a node, one is created by performing a shallow copy of g, then inserted into the trace graph.
+    /// </summary>
+    /// <param name="g">The genealogy graph node</param>
+    /// <returns></returns>
+    private IGenealogyGraphNode<ISymbolicExpressionTree> AddTraceNode(IGenealogyGraphNode<ISymbolicExpressionTree> g) {
+      var n = TraceGraph.GetByContent(g.Data);
+      if (n == null) {
+        n = g.Copy();
+        TraceGraph.AddVertex(n);
+      }
+      return n;
+    }
+
+    // caching node lists brings ~2.5-2.7x speed improvement (since graph nodes are visited multiple times)
+    // this caching will be even more effective with larger tree sizes
+    private ISymbolicExpressionTreeNode NodeAt(ISymbolicExpressionTree tree, int index) {
+      List<ISymbolicExpressionTreeNode> list;
+      nodeListCache.TryGetValue(tree, out list);
+      if (list == null) {
+        list = tree.IterateNodesPrefix().ToList();
+        nodeListCache[tree] = list;
+      }
+      return list[index];
+    }
+
+    /// <summary>
+    /// Connect the current node of the trace graph with the node that was previously added (@last). The current node of the trace graph is determined by the content
+    /// of the genealogy graph node @g.  
+    /// </summary>
+    /// <param name="current">The current node in the genealogy graph</param>
+    /// <param name="last">The last added node in the trace graph</param>
+    /// <param name="td">The trace data specifying the preorder indices of the subtree and fragment in the @current and @last vertices</param>   
+    private void ConnectLast(IGenealogyGraphNode<ISymbolicExpressionTree> current, IGenealogyGraphNode<ISymbolicExpressionTree> last, TraceData td) {
+      // TODO: more testing
+      var inArcs = (List<IArc>)((IVertex)last).InArcs; // using the InArcs seems to be slightly more efficient than using the OutArcs
+      var arc = inArcs.FirstOrDefault(a => a.Source == current && ((IArc<IDeepCloneable>)a).Data.Equals(td));
+      if (arc == null) {
+        arc = new GenealogyGraphArc(current, last) { Data = td };
+        TraceGraph.AddArc(arc);
+      }
+      if (UpdateVertexWeights) {
+        arc.Weight++;
+        current.Weight++;
+      }
+      if (UpdateSubtreeWeights) {
+        var subtree = NodeAt(current.Data, td.SubtreeIndex);
+        foreach (var s in subtree.IterateNodesPrefix())
+          s.NodeWeight++;
+      }
+    }
+  }
+
+  public class TraceData : Tuple<int, int, int, int>, IDeepCloneable {
+    public TraceData(int currentSubtreeIndex, int currentFragmentIndex, int lastSubtreeIndex, int lastFragmentIndex)
+      : base(currentSubtreeIndex, currentFragmentIndex, lastSubtreeIndex, lastFragmentIndex) {
+    }
+
+    public int SubtreeIndex { get { return Item1; } }
+    public int FragmentIndex { get { return Item2; } }
+    public int LastSubtreeIndex { get { return Item3; } }
+    public int LastFragmentIndex { get { return Item4; } }
+    public object Clone() {
+      return new TraceData(SubtreeIndex, FragmentIndex, LastSubtreeIndex, LastFragmentIndex);
+    }
+
+    protected TraceData(TraceData original, Cloner cloner) :
+      base(original.SubtreeIndex, original.FragmentIndex, original.LastFragmentIndex, original.LastFragmentIndex) {
+    }
+
+    public IDeepCloneable Clone(Cloner cloner) {
+      return cloner.Clone(this);
+    }
+  }
+
+  internal static class Util {
+    // shallow node copy (does not clone the data or the arcs)
+    #region some helper methods for shortening the tracing code
+    public static IGenealogyGraphNode<ISymbolicExpressionTree> Copy(this IGenealogyGraphNode<ISymbolicExpressionTree> node) {
+      return new GenealogyGraphNode<ISymbolicExpressionTree>(node.Data) { Rank = node.Rank, Quality = node.Quality };
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Transformations/SymbolicExpressionTreeBacktransformator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Transformations/SymbolicExpressionTreeBacktransformator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Transformations/SymbolicExpressionTreeBacktransformator.cs	(revision 16132)
@@ -0,0 +1,97 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public class SymbolicExpressionTreeBacktransformator : IModelBacktransformator {
+    private readonly ITransformationMapper<ISymbolicExpressionTreeNode> transformationMapper;
+
+    public SymbolicExpressionTreeBacktransformator(ITransformationMapper<ISymbolicExpressionTreeNode> transformationMapper) {
+      this.transformationMapper = transformationMapper;
+    }
+
+    public ISymbolicDataAnalysisModel Backtransform(ISymbolicDataAnalysisModel model, IEnumerable<ITransformation> transformations, string targetVariable) {
+      var symbolicModel = (ISymbolicDataAnalysisModel)model.Clone();
+
+      foreach (var transformation in transformations.Reverse()) {
+        ApplyBacktransformation(transformation, symbolicModel.SymbolicExpressionTree, targetVariable);
+      }
+
+      return symbolicModel;
+    }
+
+    private void ApplyBacktransformation(ITransformation transformation, ISymbolicExpressionTree symbolicExpressionTree, string targetVariable) {
+      if (transformation.Column != targetVariable) {
+        var variableNodes = symbolicExpressionTree.IterateNodesBreadth()
+          .OfType<VariableTreeNode>()
+          .Where(n => n.VariableName == transformation.Column);
+        ApplyRegularBacktransformation(transformation, variableNodes);
+      } else if (!(transformation is CopyColumnTransformation)) {
+        ApplyInverseBacktransformation(transformation, symbolicExpressionTree);
+      }
+    }
+
+    private void ApplyRegularBacktransformation(ITransformation transformation, IEnumerable<VariableTreeNode> variableNodes) {
+      foreach (var variableNode in variableNodes) {
+        // generate new subtrees because same subtree cannot be added more than once
+        var transformationTree = transformationMapper.GenerateModel(transformation);
+        SwapVariableWithTree(variableNode, transformationTree);
+      }
+    }
+
+    private void ApplyInverseBacktransformation(ITransformation transformation, ISymbolicExpressionTree symbolicExpressionTree) {
+      var startSymbol = symbolicExpressionTree.Root.GetSubtree(0);
+      var modelTree = startSymbol.GetSubtree(0);
+      startSymbol.RemoveSubtree(0);
+
+      var transformationTree = transformationMapper.GenerateInverseModel(transformation);
+      var variableNode = transformationTree.IterateNodesBreadth()
+        .OfType<VariableTreeNode>()
+        .Single(n => n.VariableName == transformation.Column);
+
+      SwapVariableWithTree(variableNode, modelTree);
+
+      startSymbol.AddSubtree(transformationTree);
+    }
+
+    private void SwapVariableWithTree(VariableTreeNode variableNode, ISymbolicExpressionTreeNode treeNode) {
+      var parent = variableNode.Parent;
+      int index = parent.IndexOfSubtree(variableNode);
+      parent.RemoveSubtree(index);
+
+      if (!variableNode.Weight.IsAlmost(1.0))
+        treeNode = CreateNodeFromWeight(treeNode, variableNode);
+
+      parent.InsertSubtree(index, treeNode);
+    }
+
+    private ISymbolicExpressionTreeNode CreateNodeFromWeight(ISymbolicExpressionTreeNode transformationTree, VariableTreeNode variableNode) {
+      var multiplicationNode = new SymbolicExpressionTreeNode(new Multiplication());
+      multiplicationNode.AddSubtree(new ConstantTreeNode(new Constant()) { Value = variableNode.Weight });
+      multiplicationNode.AddSubtree(transformationTree);
+      return multiplicationNode;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Transformations/TransformationToSymbolicTreeMapper.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Transformations/TransformationToSymbolicTreeMapper.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Transformations/TransformationToSymbolicTreeMapper.cs	(revision 16132)
@@ -0,0 +1,294 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public class TransformationToSymbolicTreeMapper : ITransformationMapper<ISymbolicExpressionTreeNode> {
+    private ITransformation transformation;
+    private string column;
+
+    #region ITransformationMapper<ISymbolicExpressionTree> Members
+
+    public ISymbolicExpressionTreeNode GenerateModel(ITransformation transformation) {
+      InitComponents(transformation);
+
+      if (transformation is LinearTransformation) {
+        return GenerateModelForLinearTransformation();
+      } else if (transformation is ExponentialTransformation) {
+        return GenerateModelForExponentialTransformation();
+      } else if (transformation is LogarithmicTransformation) {
+        return GenerateModelForLogarithmicTransformation();
+      } else if (transformation is PowerTransformation) {
+        return GenerateModelForPowerTransformation();
+      } else if (transformation is ReciprocalTransformation) {
+        return GenerateModelForReciprocalTransformation();
+      } else if (transformation is ShiftStandardDistributionTransformation) {
+        return GenerateModelForShiftStandardDistributionTransformation();
+      } else if (transformation is CopyColumnTransformation) {
+        return GenerateTreeNodeForCopyColumnTransformation();
+      }
+      throw new NotImplementedException();
+    }
+
+    public ISymbolicExpressionTreeNode GenerateInverseModel(ITransformation transformation) {
+      InitComponents(transformation);
+
+      if (transformation is LinearTransformation) {
+        return GenerateInverseModelForLinearTransformation();
+      } else if (transformation is ExponentialTransformation) {
+        return GenerateInverseModelForExponentialTransformation();
+      } else if (transformation is LogarithmicTransformation) {
+        return GenerateInverseModelForLogarithmicTransformation();
+      } else if (transformation is PowerTransformation) {
+        return GenerateInverseModelForPowerTransformation();
+      } else if (transformation is ReciprocalTransformation) {
+        return GenerateInverseModelForReciprocalTransformation();
+      } else if (transformation is ShiftStandardDistributionTransformation) {
+        GenerateInverseModelForShiftStandardDistributionTransformation();
+      } else if (transformation is CopyColumnTransformation) {
+        return GenerateTreeNodeForCopyColumnTransformation();
+      }
+
+      throw new NotImplementedException();
+    }
+
+    #endregion
+
+    // helper
+
+    private ISymbolicExpressionTreeNode GenerateModelForLinearTransformation() {
+      var linearTransformation = (LinearTransformation)transformation;
+      var kValue = linearTransformation.Multiplier;
+      var dValue = linearTransformation.Addend;
+
+      // k * x
+      var multiplicationNode = new Multiplication().CreateTreeNode();
+      var kNode = CreateConstantTreeNode("k", kValue);
+      var xNode = CreateVariableTreeNode(column, "x");
+      multiplicationNode.AddSubtree(kNode);
+      multiplicationNode.AddSubtree(xNode);
+
+      // ( k * x ) + d
+      var additionNode = new Addition().CreateTreeNode();
+      var dNode = CreateConstantTreeNode("d", dValue);
+      additionNode.AddSubtree(multiplicationNode);
+      additionNode.AddSubtree(dNode);
+
+      return additionNode;
+    }
+
+    private ISymbolicExpressionTreeNode GenerateInverseModelForLinearTransformation() {
+      var linearTransformation = (LinearTransformation)transformation;
+      var kValue = linearTransformation.Multiplier;
+      var dValue = linearTransformation.Addend;
+
+      // x - d
+      var substractionNode = new Subtraction().CreateTreeNode();
+      var dNode = CreateConstantTreeNode("d", dValue);
+      var xNode = CreateVariableTreeNode(column, "x");
+      substractionNode.AddSubtree(xNode);
+      substractionNode.AddSubtree(dNode);
+
+      // ( x - d ) / k
+      var divisionNode = new Division().CreateTreeNode();
+      var kNode = CreateConstantTreeNode("k", kValue);
+      divisionNode.AddSubtree(substractionNode);
+      divisionNode.AddSubtree(kNode);
+
+      return divisionNode;
+    }
+
+
+    private ISymbolicExpressionTreeNode GenerateModelForExponentialTransformation() {
+      var exponentialTransformation = (ExponentialTransformation)transformation;
+      var bValue = exponentialTransformation.Base;
+
+      return GenTreePow_b_x(bValue);
+    }
+
+    private ISymbolicExpressionTreeNode GenerateInverseModelForExponentialTransformation() {
+      var exponentialTransformation = (ExponentialTransformation)transformation;
+      var bValue = exponentialTransformation.Base;
+
+      return GenTreeLog_x_b(bValue);
+    }
+
+
+    private ISymbolicExpressionTreeNode GenerateModelForLogarithmicTransformation() {
+      var logarithmicTransformation = (LogarithmicTransformation)transformation;
+      var bValue = logarithmicTransformation.Base;
+
+      return GenTreeLog_x_b(bValue);
+    }
+
+    private ISymbolicExpressionTreeNode GenerateInverseModelForLogarithmicTransformation() {
+      var logarithmicTransformation = (LogarithmicTransformation)transformation;
+      var bValue = logarithmicTransformation.Base;
+
+      return GenTreePow_b_x(bValue);
+    }
+
+
+    private ISymbolicExpressionTreeNode GenerateModelForPowerTransformation() {
+      var powerTransformation = (PowerTransformation)transformation;
+      var expValue = powerTransformation.Exponent;
+
+      // x ^ exp
+      var powerNode = new Power().CreateTreeNode();
+      var xNode = CreateVariableTreeNode(column, "x");
+      var expNode = CreateConstantTreeNode("exp", expValue);
+      powerNode.AddSubtree(xNode);
+      powerNode.AddSubtree(expNode);
+
+      return powerNode;
+    }
+
+    private ISymbolicExpressionTreeNode GenerateInverseModelForPowerTransformation() {
+      var powerTransformation = (PowerTransformation)transformation;
+      var expValue = powerTransformation.Exponent;
+
+      // rt(x, b)
+      var rootNode = new Root().CreateTreeNode();
+      var xNode = CreateVariableTreeNode(column, "x");
+      var bNode = CreateConstantTreeNode("b", expValue);
+      rootNode.AddSubtree(xNode);
+      rootNode.AddSubtree(bNode);
+
+      return rootNode;
+    }
+
+
+    private ISymbolicExpressionTreeNode GenerateModelForReciprocalTransformation() {
+      return GenTreeDiv_1_x();
+    }
+
+    private ISymbolicExpressionTreeNode GenerateInverseModelForReciprocalTransformation() {
+      return GenTreeDiv_1_x();
+    }
+
+
+    private ISymbolicExpressionTreeNode GenerateModelForShiftStandardDistributionTransformation() {
+      var shiftStandardDistributionTransformation = (ShiftStandardDistributionTransformation)transformation;
+      var m_orgValue = shiftStandardDistributionTransformation.OriginalMean;
+      var s_orgValue = shiftStandardDistributionTransformation.OriginalStandardDeviation;
+      var m_tarValue = shiftStandardDistributionTransformation.Mean;
+      var s_tarValue = shiftStandardDistributionTransformation.StandardDeviation;
+
+      return GenTreeShiftStdDist(column, m_orgValue, s_orgValue, m_tarValue, s_tarValue);
+    }
+
+    private ISymbolicExpressionTreeNode GenerateInverseModelForShiftStandardDistributionTransformation() {
+      var shiftStandardDistributionTransformation = (ShiftStandardDistributionTransformation)transformation;
+      var m_orgValue = shiftStandardDistributionTransformation.OriginalMean;
+      var s_orgValue = shiftStandardDistributionTransformation.OriginalStandardDeviation;
+      var m_tarValue = shiftStandardDistributionTransformation.Mean;
+      var s_tarValue = shiftStandardDistributionTransformation.StandardDeviation;
+
+      return GenTreeShiftStdDist(column, m_tarValue, s_tarValue, m_orgValue, s_orgValue);
+    }
+
+    private ISymbolicExpressionTreeNode GenerateTreeNodeForCopyColumnTransformation() {
+      var copyColumnTransformation = (CopyColumnTransformation)transformation;
+      var copiedColumnName = copyColumnTransformation.CopiedColumnName;
+
+      return CreateVariableTreeNode(copiedColumnName, copiedColumnName + "(original)");
+    }
+
+    // helper's helper:
+
+    private ISymbolicExpressionTreeNode GenTreeLog_x_b(double b) {
+      // log(x, b)
+      var logNode = new Logarithm().CreateTreeNode();
+      var bNode = CreateConstantTreeNode("b", b);
+      var xNode = CreateVariableTreeNode(column, "x");
+      logNode.AddSubtree(xNode);
+      logNode.AddSubtree(bNode);
+
+      return logNode;
+    }
+
+    private ISymbolicExpressionTreeNode GenTreePow_b_x(double b) {
+      // b ^ x
+      var powerNode = new Power().CreateTreeNode();
+      var bNode = CreateConstantTreeNode("b", b);
+      var xNode = CreateVariableTreeNode(column, "x");
+      powerNode.AddSubtree(bNode);
+      powerNode.AddSubtree(xNode);
+
+      return powerNode;
+    }
+
+    private ISymbolicExpressionTreeNode GenTreeDiv_1_x() {
+      // 1 / x
+      var divNode = new Division().CreateTreeNode();
+      var oneNode = CreateConstantTreeNode("1", 1.0);
+      var xNode = CreateVariableTreeNode(column, "x");
+      divNode.AddSubtree(oneNode);
+      divNode.AddSubtree(xNode);
+
+      return divNode;
+    }
+
+    private ISymbolicExpressionTreeNode GenTreeShiftStdDist(string variable, double m_org, double s_org, double m_tar, double s_tar) {
+      // x - m_org
+      var substractionNode = new Subtraction().CreateTreeNode();
+      var xNode = CreateVariableTreeNode(variable, "x");
+      var m_orgNode = CreateConstantTreeNode("m_org", m_org);
+      substractionNode.AddSubtree(xNode);
+      substractionNode.AddSubtree(m_orgNode);
+
+      // (x - m_org) / s_org
+      var divisionNode = new Division().CreateTreeNode();
+      var s_orgNode = CreateConstantTreeNode("s_org", s_org);
+      divisionNode.AddSubtree(substractionNode);
+      divisionNode.AddSubtree(s_orgNode);
+
+      // ((x - m_org) / s_org ) * s_tar
+      var multiplicationNode = new Multiplication().CreateTreeNode();
+      var s_tarNode = CreateConstantTreeNode("s_tar", s_tar);
+      multiplicationNode.AddSubtree(divisionNode);
+      multiplicationNode.AddSubtree(s_tarNode);
+
+      // ((x - m_org) / s_org ) * s_tar + m_tar
+      var additionNode = new Addition().CreateTreeNode();
+      var m_tarNode = CreateConstantTreeNode("m_tar", m_tar);
+      additionNode.AddSubtree(multiplicationNode);
+      additionNode.AddSubtree(m_tarNode);
+
+      return additionNode;
+    }
+
+    private ConstantTreeNode CreateConstantTreeNode(string description, double value) {
+      return new ConstantTreeNode(new Constant()) { Value = value };
+    }
+
+    private VariableTreeNode CreateVariableTreeNode(string name, string description) {
+      return new VariableTreeNode(new Variable(name, description)) { VariableName = name, Weight = 1.0 };
+    }
+
+    private void InitComponents(ITransformation transformation) {
+      this.transformation = transformation;
+      column = transformation.Column;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/QueryMatch.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/QueryMatch.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/QueryMatch.cs	(revision 16132)
@@ -0,0 +1,294 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 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;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  // this class implements the decision version of the tree pattern query matching algorithm 
+  // by M. Götz, C. Koch and W. Martens in http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.182.5440
+  public class QueryMatch {
+    public ISymbolicExpressionTreeNodeEqualityComparer EqualityComparer { get; private set; }
+    private readonly NodeInfo Inf = new NodeInfo { Index = int.MaxValue };
+    private readonly NodeInfo Nil = new NodeInfo { Index = -1 };
+    private readonly HashSet<string> commutativeSymbols = new HashSet<string> { "Addition", "Multiplication", "Average", "And", "Or", "Xor" };
+    private readonly ISymbolicExpressionTreeNodeComparer nodeComparer = new SymbolicExpressionTreeNodeComparer();
+
+    private readonly Dictionary<ISymbolicExpressionTreeNode, List<NodeInfo>> cache = new Dictionary<ISymbolicExpressionTreeNode, List<NodeInfo>>();
+
+    public void ClearCache() {
+      cache.Clear();
+    }
+
+    private QueryMatch() { }
+
+    // whether matching nodes should also have matching parents
+    // in theory, this restricts the matching so that parent-child
+    // pairs in the query tree are matched by parent-child pairs in 
+    // the data tree (and not ancestor-descendant pairs)
+    public bool MatchParents { get; set; }
+
+    public QueryMatch(ISymbolicExpressionTreeNodeEqualityComparer equalityComparer) {
+      EqualityComparer = equalityComparer;
+    }
+
+    internal bool Match(List<NodeInfo> data, List<NodeInfo> query) {
+      var dRoot = data.Last();
+      var qRoot = query.Last();
+
+      var result = Tmatch(dRoot, query.First(), qRoot);
+      return result == qRoot;
+    }
+
+    public bool Match(ISymbolicExpressionTree data, ISymbolicExpressionTree query) {
+      return Match(data.Root.GetSubtree(0).GetSubtree(0), query.Root.GetSubtree(0).GetSubtree(0));
+    }
+
+    public bool Match(ISymbolicExpressionTreeNode data, ISymbolicExpressionTreeNode query) {
+      if (!EqualityComparer.Equals(data, query))
+        return false;
+
+      List<NodeInfo> dNodes, qNodes;
+
+      if (!cache.TryGetValue(data, out dNodes)) {
+        dNodes = InitializePostOrder(data);
+        cache[data] = dNodes;
+      }
+
+      if (!cache.TryGetValue(query, out qNodes)) {
+        qNodes = InitializePostOrder(query);
+        cache[query] = qNodes;
+      }
+
+      var dRoot = dNodes.Last();
+      var qRoot = qNodes.Last();
+      var result = Tmatch(dRoot, qNodes.First(), qRoot);
+      return result == qRoot;
+    }
+
+    public IEnumerable<ISymbolicExpressionTree> GetMatchingTrees(IEnumerable<ISymbolicExpressionTree> data, ISymbolicExpressionTree query) {
+      var qRoot = query.Root.GetSubtree(0).GetSubtree(0);
+      var filtered = data.Where(x => x.Length >= query.Length && EqualityComparer.Equals(x.Root.GetSubtree(0).GetSubtree(0), qRoot));
+      var qNodes = InitializePostOrder(query.Root.GetSubtree(0).GetSubtree(0));
+      return from d in filtered let dNodes = InitializePostOrder(d.Root.GetSubtree(0).GetSubtree(0)) where Match(dNodes, qNodes) select d;
+    }
+
+    private bool AreMatching(NodeInfo d, NodeInfo q) {
+      // force the nodes to be on the same level
+      if (d.Level != q.Level)
+        return false;
+
+      // compare nodes
+      bool equals = EqualityComparer.Equals(d.Node, q.Node);
+
+      if (!equals)
+        return false;
+
+      // compare node parents
+      if (MatchParents && !EqualityComparer.Equals(d.Node.Parent, q.Node.Parent))
+        return false;
+
+      // compare children to make sure they are the same
+      if (d.Node.SubtreeCount > 0 && q.Node.SubtreeCount > 0) {
+        var dSubtrees = d.Node.Subtrees.ToList();
+
+        if (commutativeSymbols.Contains(d.Node.Symbol.Name)) {
+          var qSubtrees = q.Node.Subtrees.Where(x => !(x is AnyNode || x is AnySubtree)).ToList();
+
+          dSubtrees.Sort(nodeComparer);
+          qSubtrees.Sort(nodeComparer);
+
+          var nw = q.Node.SubtreeCount - qSubtrees.Count; // number of wildcards 
+          if (nw == 0)
+            return dSubtrees.SequenceEqual(qSubtrees, EqualityComparer);
+
+          for (int i = 0, j = 0; i < dSubtrees.Count && j < qSubtrees.Count;) {
+            if (EqualityComparer.Equals(dSubtrees[i], qSubtrees[j])) {
+              ++i;
+              ++j;
+            } else {
+              if (nw == 0)
+                return false;
+              ++i;
+              --nw;
+            }
+          }
+        } else {
+          var qSubtrees = q.Node.Subtrees;
+          return dSubtrees.SequenceEqual(qSubtrees, EqualityComparer);
+        }
+      }
+      return true;
+    }
+
+    private NodeInfo Tmatch(NodeInfo d, NodeInfo qFrom, NodeInfo qUntil) {
+      var qBest = d.IsLeaf ? qFrom.Previous : Hmatch(d.LastChild, qFrom, qUntil);
+      var next = qBest.Next;
+      if (next <= qUntil && AreMatching(d, next)) {
+        qBest = next;
+        next = qBest.Next;
+        var lastSibling = qBest.LastSibling;
+        return next <= lastSibling ? Tmatch(d, next, lastSibling) : qBest;
+      }
+      return qBest;
+    }
+
+    private NodeInfo Hmatch(NodeInfo d, NodeInfo qFrom, NodeInfo qUntil) {
+      if (d.IsFirstSibling)
+        return Tmatch(d, qFrom, qUntil);
+
+      var qHedge = Hmatch(d.PreviousSibling, qFrom, qUntil);
+      var qTree = Tmatch(d, qFrom, qUntil);
+
+      for (;;) {
+        if (qHedge == qTree)
+          return qHedge;
+        if (qTree < qHedge) {
+          var rtop = Rtop(qTree.Next, qHedge);
+          while (rtop < Inf && qHedge < rtop.LastSibling) {
+            qTree = Tmatch(d, rtop.Next, rtop.LastSibling);
+            rtop = Rtop(qTree.Next, qHedge);
+          }
+          if (qTree <= qHedge)
+            return qHedge;
+        } else {
+          var rtop = Rtop(qHedge.Next, qTree);
+          while (rtop < Inf && qTree < rtop.LastSibling) {
+            qHedge = Hmatch(d.PreviousSibling, rtop.Next, rtop.LastSibling);
+            rtop = Rtop(qHedge.Next, qTree);
+          }
+          if (qHedge <= qTree)
+            return qTree;
+        }
+      }
+    }
+
+    /// <summary>
+    /// Description from Götz et al. - Efficient Algorithms for Descendant-only Tree Pattern Queries, 2009:
+    /// Given two nodes hFrom and hUntil, returns the rightmost node among the topmost nodes in the interval [hFrom, hUntil]
+    /// More formally, Rtop(hFrom,hUntil) is the node u such that depth(u) is minimal and u is larger than every other node v 
+    /// in [hFrom, hUntil] with depth(u)==depth(v).
+    /// </summary>
+    /// <param name="hFrom">The interval start</param>
+    /// <param name="hUntil">The interval end</param>
+    /// <returns>The rightmost node from the topmost nodes in the interval [hFrom, hUntil]</returns>
+    private NodeInfo Rtop(NodeInfo hFrom, NodeInfo hUntil) {
+      if (hFrom == hUntil)
+        return hUntil;
+      if (hFrom.Index > hUntil.Index)
+        return Inf;
+      // let u be the highest ancestor of hUntil that has a previous sibling s such that s >= hFrom
+      // if no such u exists, then Rtop(hFrom, hUntil) = hUntil. Otherwise, rtop(hFrom, hUntil) = s
+      var rtop = hUntil.Ancestors.OrderBy(x => x.Level).Select(x => x.PreviousSibling).FirstOrDefault(x => x != null && x >= hFrom);
+      return rtop ?? hUntil;
+    }
+
+    internal static List<NodeInfo> InitializePostOrder(ISymbolicExpressionTreeNode node) {
+      // levels will be computed below
+      var nodes = node.IterateNodesPostfix().Select((x, i) => new NodeInfo { Node = x, Index = i, Level = 0 }).ToList();
+      var map = nodes.ToDictionary(x => x.Node, x => x);
+      nodes.First().Previous = new NodeInfo { Node = null, Index = -1, Next = nodes.First() };
+      nodes.Last().Next = new NodeInfo { Node = null, Index = int.MaxValue, Previous = nodes.Last() };
+      for (int i = nodes.Count - 1; i >= 0; --i) {
+        var n = nodes[i];
+        if (n != nodes.Last()) n.Next = nodes[n.Index + 1];
+        if (n != nodes.First()) n.Previous = nodes[n.Index - 1];
+        NodeInfo parentInfo = null;
+        if (n.Node.Parent != null)
+          map.TryGetValue(n.Node.Parent, out parentInfo);
+        n.Parent = parentInfo;
+        if (n.Parent == null) {
+          n.PreviousSibling = n.NextSibling = n.LastSibling = null;
+        } else {
+          var parent = n.Parent.Node;
+          int si = parent.IndexOfSubtree(n.Node);
+          n.PreviousSibling = n.IsFirstSibling ? null : map[parent.GetSubtree(si - 1)];
+          n.NextSibling = n.IsLastSibling ? null : map[parent.GetSubtree(si + 1)];
+          n.LastSibling = map[parent.Subtrees.Last()];
+          n.Level = n.Parent.Level + 1;
+        }
+        n.LastChild = n.IsLeaf ? null : n.Previous;
+      }
+      return nodes;
+    }
+  }
+
+  /// <summary>
+  /// NodeInfo objects are useful for keeping sibling, parent, index and depth information for tree nodes
+  /// </summary>
+  internal class NodeInfo : IComparable<NodeInfo> {
+    public ISymbolicExpressionTreeNode Node { get; set; }
+    public int Index { get; set; }
+    public int Level { get; set; }
+    public NodeInfo Parent { get; set; }
+    public NodeInfo Previous { get; set; }
+    public NodeInfo PreviousSibling { get; set; }
+    public NodeInfo Next { get; set; }
+    public NodeInfo NextSibling { get; set; }
+    public NodeInfo LastSibling { get; set; }
+    public NodeInfo LastChild { get; set; }
+
+    public bool IsLeaf {
+      get { return Node.SubtreeCount == 0; }
+    }
+
+    public bool IsFirstSibling {
+      get { return Parent != null && Node == Node.Parent.Subtrees.First(); }
+    }
+
+    public bool IsLastSibling {
+      get { return Parent != null && Node == Node.Parent.Subtrees.Last(); }
+    }
+
+    public IEnumerable<NodeInfo> Ancestors {
+      get {
+        var p = Parent;
+        while (p != null) {
+          yield return p;
+          p = p.Parent;
+        }
+      }
+    }
+
+    public int CompareTo(NodeInfo other) {
+      return other == null ? 1 : Index.CompareTo(other.Index);
+    }
+
+    public static bool operator <(NodeInfo lsh, NodeInfo rhs) {
+      return lsh.CompareTo(rhs) == -1;
+    }
+
+    public static bool operator >(NodeInfo lhs, NodeInfo rhs) {
+      return lhs.CompareTo(rhs) == 1;
+    }
+
+    public static bool operator <=(NodeInfo lhs, NodeInfo rhs) {
+      return lhs.CompareTo(rhs) <= 0;
+    }
+
+    public static bool operator >=(NodeInfo lhs, NodeInfo rhs) {
+      return lhs.CompareTo(rhs) >= 0;
+    }
+  }
+}
+
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs	(revision 16132)
@@ -0,0 +1,248 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 License Information
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+
+  [StorableClass]
+  [Item("SymbolicExpressionTreeBottomUpSimilarityCalculator", "A similarity calculator which uses the tree bottom-up distance as a similarity metric.")]
+  public class SymbolicExpressionTreeBottomUpSimilarityCalculator : SolutionSimilarityCalculator {
+    private readonly HashSet<string> commutativeSymbols = new HashSet<string> { "Addition", "Multiplication", "Average", "And", "Or", "Xor" };
+
+    public SymbolicExpressionTreeBottomUpSimilarityCalculator() {
+    }
+
+    protected override bool IsCommutative { get { return true; } }
+
+    public bool MatchVariableWeights { get; set; }
+    public bool MatchConstantValues { get; set; }
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeBottomUpSimilarityCalculator(bool deserializing)
+      : base(deserializing) {
+    }
+
+    protected SymbolicExpressionTreeBottomUpSimilarityCalculator(SymbolicExpressionTreeBottomUpSimilarityCalculator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeBottomUpSimilarityCalculator(this, cloner);
+    }
+
+    public double CalculateSimilarity(ISymbolicExpressionTree t1, ISymbolicExpressionTree t2) {
+      if (t1 == t2)
+        return 1;
+
+      var map = ComputeBottomUpMapping(t1.Root, t2.Root);
+      return 2.0 * map.Count / (t1.Length + t2.Length);
+    }
+
+    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
+      if (leftSolution == rightSolution)
+        return 1.0;
+
+      var t1 = leftSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree;
+      var t2 = rightSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree;
+
+      if (t1 == null || t2 == null)
+        throw new ArgumentException("Cannot calculate similarity when one of the arguments is null.");
+
+      var similarity = CalculateSimilarity(t1, t2);
+      if (similarity > 1.0)
+        throw new Exception("Similarity value cannot be greater than 1");
+
+      return similarity;
+    }
+
+    public Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> ComputeBottomUpMapping(ISymbolicExpressionTreeNode n1, ISymbolicExpressionTreeNode n2) {
+      var comparer = new SymbolicExpressionTreeNodeComparer(); // use a node comparer because it's faster than calling node.ToString() (strings are expensive) and comparing strings
+      var compactedGraph = Compact(n1, n2);
+
+      var forwardMap = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(); // nodes of t1 => nodes of t2
+      var reverseMap = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(); // nodes of t2 => nodes of t1
+
+      // visit nodes in order of decreasing height to ensure correct mapping
+      var nodes1 = n1.IterateNodesPrefix().OrderByDescending(x => x.GetDepth()).ToList();
+      var nodes2 = n2.IterateNodesPrefix().ToList();
+      for (int i = 0; i < nodes1.Count; ++i) {
+        var v = nodes1[i];
+        if (forwardMap.ContainsKey(v))
+          continue;
+        var kv = compactedGraph[v];
+        ISymbolicExpressionTreeNode w = null;
+        for (int j = 0; j < nodes2.Count; ++j) {
+          var t = nodes2[j];
+          if (reverseMap.ContainsKey(t) || compactedGraph[t] != kv)
+            continue;
+          w = t;
+          break;
+        }
+        if (w == null) continue;
+
+        // at this point we know that v and w are isomorphic, however, the mapping cannot be done directly
+        // (as in the paper) because the trees are unordered (subtree order might differ). the solution is
+        // to sort subtrees from under commutative labels (this will work because the subtrees are isomorphic!)
+        // while iterating over the two subtrees
+        var vv = IterateBreadthOrdered(v, comparer).ToList();
+        var ww = IterateBreadthOrdered(w, comparer).ToList();
+        int len = Math.Min(vv.Count, ww.Count);
+        for (int j = 0; j < len; ++j) {
+          var s = vv[j];
+          var t = ww[j];
+          Debug.Assert(!reverseMap.ContainsKey(t));
+
+          forwardMap[s] = t;
+          reverseMap[t] = s;
+        }
+      }
+
+      return forwardMap;
+    }
+
+    /// <summary>
+    /// Creates a compact representation of the two trees as a directed acyclic graph
+    /// </summary>
+    /// <param name="n1">The root of the first tree</param>
+    /// <param name="n2">The root of the second tree</param>
+    /// <returns>The compacted DAG representing the two trees</returns>
+    private Dictionary<ISymbolicExpressionTreeNode, GraphNode> Compact(ISymbolicExpressionTreeNode n1, ISymbolicExpressionTreeNode n2) {
+      var nodeMap = new Dictionary<ISymbolicExpressionTreeNode, GraphNode>(); // K
+      var labelMap = new Dictionary<string, GraphNode>(); // L
+      var childrenCount = new Dictionary<ISymbolicExpressionTreeNode, int>(); // Children
+
+      var nodes = n1.IterateNodesPostfix().Concat(n2.IterateNodesPostfix()); // the disjoint union F
+      var list = new List<GraphNode>();
+      var queue = new Queue<ISymbolicExpressionTreeNode>();
+
+      foreach (var n in nodes) {
+        if (n.SubtreeCount == 0) {
+          var label = GetLabel(n);
+          if (!labelMap.ContainsKey(label)) {
+            var z = new GraphNode { SymbolicExpressionTreeNode = n, Label = label };
+            labelMap[z.Label] = z;
+          }
+          nodeMap[n] = labelMap[label];
+          queue.Enqueue(n);
+        } else {
+          childrenCount[n] = n.SubtreeCount;
+        }
+      }
+      while (queue.Any()) {
+        var n = queue.Dequeue();
+        if (n.SubtreeCount > 0) {
+          bool found = false;
+          var label = n.Symbol.Name;
+          var depth = n.GetDepth();
+
+          bool sort = n.SubtreeCount > 1 && commutativeSymbols.Contains(label);
+          var nSubtrees = n.Subtrees.Select(x => nodeMap[x]).ToList();
+          if (sort) nSubtrees.Sort((a, b) => string.CompareOrdinal(a.Label, b.Label));
+
+          for (int i = list.Count - 1; i >= 0; --i) {
+            var w = list[i];
+            if (!(n.SubtreeCount == w.SubtreeCount && label == w.Label && depth == w.Depth))
+              continue;
+
+            // sort V and W when the symbol is commutative because we are dealing with unordered trees
+            var m = w.SymbolicExpressionTreeNode;
+            var mSubtrees = m.Subtrees.Select(x => nodeMap[x]).ToList();
+            if (sort) mSubtrees.Sort((a, b) => string.CompareOrdinal(a.Label, b.Label));
+
+            found = nSubtrees.SequenceEqual(mSubtrees);
+            if (found) {
+              nodeMap[n] = w;
+              break;
+            }
+          }
+
+          if (!found) {
+            var w = new GraphNode { SymbolicExpressionTreeNode = n, Label = label, Depth = depth };
+            list.Add(w);
+            nodeMap[n] = w;
+          }
+        }
+
+        if (n == n1 || n == n2)
+          continue;
+
+        var p = n.Parent;
+        if (p == null)
+          continue;
+
+        childrenCount[p]--;
+
+        if (childrenCount[p] == 0)
+          queue.Enqueue(p);
+      }
+
+      return nodeMap;
+    }
+
+    private IEnumerable<ISymbolicExpressionTreeNode> IterateBreadthOrdered(ISymbolicExpressionTreeNode node, ISymbolicExpressionTreeNodeComparer comparer) {
+      var list = new List<ISymbolicExpressionTreeNode> { node };
+      int i = 0;
+      while (i < list.Count) {
+        var n = list[i];
+        if (n.SubtreeCount > 0) {
+          var subtrees = commutativeSymbols.Contains(node.Symbol.Name) ? n.Subtrees.OrderBy(x => x, comparer) : n.Subtrees;
+          list.AddRange(subtrees);
+        }
+        i++;
+      }
+      return list;
+    }
+
+    private string GetLabel(ISymbolicExpressionTreeNode node) {
+      if (node.SubtreeCount > 0)
+        return node.Symbol.Name;
+
+      var constant = node as ConstantTreeNode;
+      if (constant != null)
+        return MatchConstantValues ? constant.Value.ToString(CultureInfo.InvariantCulture) : node.Symbol.Name;
+
+      var variable = node as VariableTreeNode;
+      if (variable != null)
+        return MatchVariableWeights ? variable.Weight + variable.VariableName : variable.VariableName;
+
+      return node.ToString();
+    }
+
+    private class GraphNode {
+      public ISymbolicExpressionTreeNode SymbolicExpressionTreeNode;
+      public string Label;
+      public int Depth;
+      public int SubtreeCount { get { return SymbolicExpressionTreeNode.SubtreeCount; } }
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeCanonicalSorter.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeCanonicalSorter.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeCanonicalSorter.cs	(revision 16132)
@@ -0,0 +1,30 @@
+﻿
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public class SymbolicExpressionTreeCanonicalSorter {
+    private readonly HashSet<Type> nonSymmetricSymbols = new HashSet<Type> { typeof(Subtraction), typeof(Division) };
+
+    public void SortSubtrees(ISymbolicExpressionTree tree) {
+      SortSubtrees(tree.Root);
+    }
+
+    public void SortSubtrees(ISymbolicExpressionTreeNode node) {
+      if (node.SubtreeCount == 0) return;
+      var subtrees = node.Subtrees as List<ISymbolicExpressionTreeNode> ?? node.Subtrees.ToList();
+      if (IsSymmetric(node.Symbol)) {
+        var comparer = new SymbolicExpressionTreeNodeComparer();
+        subtrees.Sort(comparer);
+      }
+      foreach (var s in subtrees)
+        SortSubtrees(s);
+    }
+
+    private bool IsSymmetric(ISymbol s) {
+      return !nonSymmetricSymbols.Contains(s.GetType());
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeEqualityComparer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeEqualityComparer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeEqualityComparer.cs	(revision 16132)
@@ -0,0 +1,18 @@
+﻿using System;
+using System.Collections.Generic;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public class SymbolicExpressionTreeEqualityComparer : IEqualityComparer<ISymbolicExpressionTree> {
+    public SymbolicExpressionTreeNodeEqualityComparer SimilarityComparer { get; set; }
+
+    public bool Equals(ISymbolicExpressionTree a, ISymbolicExpressionTree b) {
+      if (SimilarityComparer == null) throw new Exception("SimilarityComparer needs to be initialized first.");
+      return a.Length == b.Length && SymbolicExpressionTreeMatching.Match(a.Root, b.Root, SimilarityComparer) == Math.Min(a.Length, b.Length);
+    }
+
+    public int GetHashCode(ISymbolicExpressionTree tree) {
+      return (tree.Length << 8) % 12345;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMatching.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMatching.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMatching.cs	(revision 16132)
@@ -0,0 +1,131 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+//using HeuristicLab.EvolutionTracking;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  public static class SymbolicExpressionTreeMatching {
+    public static bool ContainsSubtree(this ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, ISymbolicExpressionTreeNodeEqualityComparer comparer) {
+      return FindMatches(root, subtree, comparer).Any();
+    }
+    public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTree tree, ISymbolicExpressionTreeNode subtree, ISymbolicExpressionTreeNodeEqualityComparer comparer) {
+      return FindMatches(tree.Root, subtree, comparer);
+    }
+
+    public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, ISymbolicExpressionTreeNodeEqualityComparer comp) {
+      var fragmentLength = subtree.GetLength();
+      // below, we use ">=" for Match(n, subtree, comp) >= fragmentLength because in case of relaxed conditions, 
+      // we can have multiple matches of the same node
+
+      return root.IterateNodesBreadth().Where(n => n.GetLength() >= fragmentLength && Match(n, subtree, comp) >= fragmentLength);
+    }
+
+    ///<summary>
+    /// Finds the longest common subsequence in quadratic time and linear space
+    /// Variant of:
+    /// D. S. Hirschberg. A linear space algorithm for or computing maximal common subsequences. 1975.
+    /// http://dl.acm.org/citation.cfm?id=360861
+    /// </summary>
+    /// <returns>Number of pairs that were matched</returns>
+    public static int Match(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b, ISymbolicExpressionTreeNodeEqualityComparer comp) {
+      if (!comp.Equals(a, b)) return 0;
+      // AnySubtree wildcards mach everything
+      if (a is AnySubtree)
+        return 1;
+      if (b is AnySubtree)
+        return 1;
+
+      int m = a.SubtreeCount;
+      int n = b.SubtreeCount;
+      if (m == 0 || n == 0) return 1;
+      var matrix = new int[m + 1, n + 1];
+      for (int i = 1; i <= m; ++i) {
+        var ai = a.GetSubtree(i - 1);
+        for (int j = 1; j <= n; ++j) {
+          var bj = b.GetSubtree(j - 1);
+          int match = Match(ai, bj, comp);
+          matrix[i, j] = Math.Max(Math.Max(matrix[i, j - 1], matrix[i - 1, j]), matrix[i - 1, j - 1] + match);
+        }
+      }
+      return matrix[m, n] + 1;
+    }
+
+    /// <summary>
+    /// Calculates the difference between two symbolic expression trees.
+    /// </summary>
+    /// <param name="tree">The first symbolic expression tree</param>
+    /// <param name="other">The second symbolic expression tree</param>
+    /// <returns>Returns the root of the subtree (from T1) by which T1 differs from T2, or null if no difference is found.</returns>
+    public static ISymbolicExpressionTreeNode Difference(this ISymbolicExpressionTree tree, ISymbolicExpressionTree other) {
+      return Difference(tree.Root, other.Root);
+    }
+
+    public static ISymbolicExpressionTreeNode Difference(this ISymbolicExpressionTreeNode node, ISymbolicExpressionTreeNode other) {
+      var a = node.IterateNodesPrefix().ToList();
+      var b = other.IterateNodesPrefix().ToList();
+      var list = new List<ISymbolicExpressionTreeNode>();
+      for (int i = 0, j = 0; i < a.Count && j < b.Count; ++i, ++j) {
+        var s1 = a[i].ToString();
+        var s2 = b[j].ToString();
+        if (s1 == s2) continue;
+        list.Add(a[i]);
+        // skip subtrees since the parents are already different
+        i += a[i].SubtreeCount;
+        j += b[j].SubtreeCount;
+      }
+      ISymbolicExpressionTreeNode result = list.Count > 0 ? LowestCommonAncestor(node, list) : null;
+      return result;
+    }
+
+    private static ISymbolicExpressionTreeNode LowestCommonAncestor(ISymbolicExpressionTreeNode root, List<ISymbolicExpressionTreeNode> nodes) {
+      if (nodes.Count == 0)
+        throw new ArgumentException("The nodes list should contain at least one element.");
+
+      if (nodes.Count == 1)
+        return nodes[0];
+
+      int minLevel = nodes.Min(root.GetBranchLevel);
+
+      // bring the nodes in the nodes to the same level (relative to the root)
+      for (int i = 0; i < nodes.Count; ++i) {
+        var node = nodes[i];
+        var level = root.GetBranchLevel(node);
+        for (int j = minLevel; j < level; ++j)
+          node = node.Parent;
+        nodes[i] = node;
+      }
+
+      // while not all the elements in the nodes are equal, go one level up
+      while (nodes.Any(x => x != nodes[0])) {
+        for (int i = 0; i < nodes.Count; ++i)
+          nodes[i] = nodes[i].Parent;
+      }
+
+      return nodes[0];
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs	(revision 16132)
@@ -0,0 +1,107 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization.Operators;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableClass]
+  [Item("SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator", "A similarity calculator based on the size of the maximum common subtree between two trees")]
+  public class SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator : SolutionSimilarityCalculator {
+    [Storable]
+    private readonly SymbolicExpressionTreeNodeEqualityComparer comparer;
+    public bool MatchVariableWeights {
+      get { return comparer.MatchVariableWeights; }
+      set { comparer.MatchVariableWeights = value; }
+    }
+
+    public bool MatchConstantValues {
+      get { return comparer.MatchConstantValues; }
+      set { comparer.MatchConstantValues = value; }
+    }
+
+    protected override bool IsCommutative { get { return true; } }
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator(bool deserializing) : base(deserializing) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator(this, cloner);
+    }
+
+    protected SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator(SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator original, Cloner cloner)
+      : base(original, cloner) {
+      comparer = cloner.Clone(original.comparer);
+    }
+
+    public SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator() {
+      comparer = new SymbolicExpressionTreeNodeEqualityComparer {
+        MatchConstantValues = true,
+        MatchVariableNames = true,
+        MatchVariableWeights = true
+      };
+    }
+
+    public SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator(bool matchVariableWeights, bool matchConstantValues) {
+      comparer = new SymbolicExpressionTreeNodeEqualityComparer {
+        MatchConstantValues = matchConstantValues,
+        MatchVariableNames = true,
+        MatchVariableWeights = matchVariableWeights
+      };
+    }
+
+    public double CalculateSimilarity(ISymbolicExpressionTree t1, ISymbolicExpressionTree t2) {
+      return MaxCommonSubtreeSimilarity(t1, t2, comparer);
+    }
+
+    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
+      var t1 = leftSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree;
+      var t2 = rightSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree;
+
+      if (t1 == null || t2 == null)
+        throw new ArgumentException("Cannot calculate similarity when one of the arguments is null.");
+
+      return MaxCommonSubtreeSimilarity(t1, t2, comparer);
+    }
+
+    public static double MaxCommonSubtreeSimilarity(ISymbolicExpressionTree a, ISymbolicExpressionTree b, ISymbolicExpressionTreeNodeEqualityComparer comparer) {
+      int max = 0;
+      var rootA = a.Root.GetSubtree(0).GetSubtree(0);
+      var rootB = b.Root.GetSubtree(0).GetSubtree(0);
+      foreach (var aa in rootA.IterateNodesBreadth()) {
+        int lenA = aa.GetLength();
+        if (lenA <= max) continue;
+        foreach (var bb in rootB.IterateNodesBreadth()) {
+          int lenB = bb.GetLength();
+          if (lenB <= max) continue;
+          int matches = SymbolicExpressionTreeMatching.Match(aa, bb, comparer);
+          if (max < matches)
+            max = matches;
+        }
+      }
+      return 2.0 * max / (rootA.GetLength() + rootB.GetLength());
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeComparer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeComparer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeComparer.cs	(revision 16132)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 License Information
+
+using System;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  // this comparer considers that a < b if the type of a is "greater" than the type of b, for example:
+  // - A function node is "greater" than a terminal node
+  // - A variable terminal is "greater" than a constant terminal
+  // - used for bringing subtrees to a "canonical" form when the operation allows reordering of arguments
+  public class SymbolicExpressionTreeNodeComparer : ISymbolicExpressionTreeNodeComparer {
+
+    public static int CompareNodes(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+      var ta = a as SymbolicExpressionTreeTerminalNode;
+      var tb = b as SymbolicExpressionTreeTerminalNode;
+
+      if (ta == null)
+        return tb == null ? String.CompareOrdinal(a.Symbol.Name, b.Symbol.Name) : -1;
+
+      if (tb == null)
+        return 1;
+
+      // at this point we know a and b are both terminals
+      var va = a as VariableTreeNode;
+      var vb = b as VariableTreeNode;
+
+      if (va != null)
+        return vb == null ? -1 : CompareVariables(va, vb);
+
+      if (vb != null)
+        return 1;
+
+      // at this point we know a and b are not variables
+      var ca = a as ConstantTreeNode;
+      var cb = b as ConstantTreeNode;
+
+      if (ca != null && cb != null)
+        return ca.Value.CompareTo(cb.Value);
+
+      // for other unknown terminal types, compare strings
+      return string.CompareOrdinal(a.ToString(), b.ToString());
+    }
+
+    private static int CompareVariables(VariableTreeNode a, VariableTreeNode b) {
+      int result = string.CompareOrdinal(a.VariableName, b.VariableName);
+      return result == 0 ? a.Weight.CompareTo(b.Weight) : result;
+    }
+
+    public int Compare(ISymbolicExpressionTreeNode x, ISymbolicExpressionTreeNode y) {
+      return CompareNodes(x, y);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeEqualityComparer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeEqualityComparer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeEqualityComparer.cs	(revision 16132)
@@ -0,0 +1,119 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 {
+  [Item("SymbolicExpressionTreeNodeEqualityComparer", "An operator that checks node equality based on different similarity measures.")]
+  [StorableClass]
+  public class SymbolicExpressionTreeNodeEqualityComparer : Item, ISymbolicExpressionTreeNodeEqualityComparer {
+    [StorableConstructor]
+    protected SymbolicExpressionTreeNodeEqualityComparer(bool deserializing) : base(deserializing) { }
+    protected SymbolicExpressionTreeNodeEqualityComparer(SymbolicExpressionTreeNodeEqualityComparer original, Cloner cloner)
+      : base(original, cloner) {
+      matchConstantValues = original.matchConstantValues;
+      matchVariableNames = original.matchVariableNames;
+      matchVariableWeights = original.matchVariableWeights;
+    }
+    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicExpressionTreeNodeEqualityComparer(this, cloner); }
+
+    // more flexible matching criteria 
+    [Storable]
+    private bool matchConstantValues;
+    public bool MatchConstantValues {
+      get { return matchConstantValues; }
+      set { matchConstantValues = value; }
+    }
+
+    [Storable]
+    private bool matchVariableNames;
+    public bool MatchVariableNames {
+      get { return matchVariableNames; }
+      set { matchVariableNames = value; }
+    }
+
+    [Storable]
+    private bool matchVariableWeights;
+    public bool MatchVariableWeights {
+      get { return matchVariableWeights; }
+      set { matchVariableWeights = value; }
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+    }
+
+    public SymbolicExpressionTreeNodeEqualityComparer() {
+      matchConstantValues = true;
+      matchVariableNames = true;
+      matchVariableWeights = true;
+    }
+
+    public int GetHashCode(ISymbolicExpressionTreeNode n) {
+      return n.ToString().ToLower().GetHashCode();
+    }
+
+    public bool Equals(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b) {
+      var sa = a as AnySubtree;
+      var sb = b as AnySubtree;
+
+      if (sa != null || sb != null)
+        return true;
+
+      if (a.SubtreeCount != b.SubtreeCount)
+        return false;
+
+      var na = a as AnyNode;
+      var nb = b as AnyNode;
+      if (na != null || nb != null)
+        return true;
+
+      var ta = a as SymbolicExpressionTreeTerminalNode;
+      var tb = b as SymbolicExpressionTreeTerminalNode;
+      if (ta != null && tb != null) {
+        var ca = a as ConstantTreeNode;
+        var cb = b as ConstantTreeNode;
+        if (ca != null && cb != null)
+          // both a and b are constants
+          return !MatchConstantValues || ca.Value.Equals(cb.Value);
+
+        var va = a as VariableTreeNode;
+        var vb = b as VariableTreeNode;
+        if (va != null && vb != null) {
+          // both a and b are variables
+          bool m1 = !MatchVariableNames || va.VariableName.Equals(vb.VariableName);
+          bool m2 = !MatchVariableWeights || va.Weight.IsAlmost(vb.Weight);
+          return m1 && m2;
+        }
+      }
+      if (ta == null && tb == null) {
+        // both a and b are non-terminal (function) nodes
+        return a.Symbol.Name.Equals(b.Symbol.Name);
+      }
+
+      // return false in all other cases
+      return false;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs	(revision 16132)
@@ -0,0 +1,101 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization.Operators;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("SymbolicExpressionTreePhenotypicSimilarityCalculator", "An operator that calculates the similarity betweeon two trees based on the correlation of their outputs.")]
+  [StorableClass]
+  public class SymbolicExpressionTreePhenotypicSimilarityCalculator : SolutionSimilarityCalculator {
+    [Storable]
+    public IDataAnalysisProblemData ProblemData { get; set; }
+    [Storable]
+    public ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get; set; }
+
+    protected override bool IsCommutative { get { return true; } }
+
+    [StorableConstructor]
+    protected SymbolicExpressionTreePhenotypicSimilarityCalculator(bool deserializing) : base(deserializing) { }
+
+    public SymbolicExpressionTreePhenotypicSimilarityCalculator(SymbolicExpressionTreePhenotypicSimilarityCalculator original, Cloner cloner)
+      : base(original, cloner) {
+      this.ProblemData = cloner.Clone(original.ProblemData);
+      this.Interpreter = cloner.Clone(original.Interpreter);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicExpressionTreePhenotypicSimilarityCalculator(this, cloner);
+    }
+
+    public SymbolicExpressionTreePhenotypicSimilarityCalculator() { }
+
+    public double CalculateSimilarity(ISymbolicExpressionTree t1, ISymbolicExpressionTree t2) {
+      if (Interpreter == null || ProblemData == null)
+        throw new InvalidOperationException("Cannot calculate phenotypic similarity when no interpreter or problem data were set.");
+
+      var v1 = Interpreter.GetSymbolicExpressionTreeValues(t1, ProblemData.Dataset, ProblemData.TrainingIndices);
+      var v2 = Interpreter.GetSymbolicExpressionTreeValues(t2, ProblemData.Dataset, ProblemData.TrainingIndices);
+
+      if (v1.Variance().IsAlmost(0) && v2.Variance().IsAlmost(0))
+        return 1.0;
+
+      OnlineCalculatorError error;
+      var r = OnlinePearsonsRCalculator.Calculate(v1, v2, out error);
+
+      var r2 = error == OnlineCalculatorError.None ? r * r : 0;
+
+      if (r2 > 1.0)
+        r2 = 1.0;
+
+      return r2;
+    }
+
+    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
+      if (leftSolution == rightSolution)
+        return 1.0;
+
+      if (!leftSolution.Variables.ContainsKey("EstimatedValues") || !rightSolution.Variables.ContainsKey("EstimatedValues"))
+        throw new ArgumentException("No estimated values are present in the subscopes.");
+
+      var leftValues = (DoubleArray)leftSolution.Variables["EstimatedValues"].Value;
+      var rightValues = (DoubleArray)rightSolution.Variables["EstimatedValues"].Value;
+
+      if (leftValues.Variance().IsAlmost(0) && rightValues.Variance().IsAlmost(0))
+        return 1.0;
+
+      OnlineCalculatorError error;
+      var r = OnlinePearsonsRCalculator.Calculate(leftValues, rightValues, out error);
+
+      var r2 = error == OnlineCalculatorError.None ? r * r : 0;
+
+      if (r2 > 1.0)
+        r2 = 1.0;
+
+      return r2;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/HeuristicLab.Problems.TravelingSalesman.Views-3.3.csproj
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/HeuristicLab.Problems.TravelingSalesman.Views-3.3.csproj	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/HeuristicLab.Problems.TravelingSalesman.Views-3.3.csproj	(revision 16132)
@@ -0,0 +1,256 @@
+﻿<?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>{CDA28124-ACD0-4231-8EB0-C510B361F84E}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.TravelingSalesman.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.TravelingSalesman.Views-3.3</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <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>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>
+    </DocumentationFile>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.PermutationEncoding-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.PermutationEncoding-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Views-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization-3.3, Version=3.3.0.9491, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization-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="PathTSPTourView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="PathTSPTourView.Designer.cs">
+      <DependentUpon>PathTSPTourView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Plugin.cs" />
+    <Compile Include="TravelingSalesmanProblemView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="TravelingSalesmanProblemView.Designer.cs">
+      <DependentUpon>TravelingSalesmanProblemView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.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>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.EvolutionTracking.Views\3.4\HeuristicLab.EvolutionTracking.Views-3.4.csproj">
+      <Project>{318dfe8c-ca23-4f1b-a4ac-62b425060241}</Project>
+      <Name>HeuristicLab.EvolutionTracking.Views-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.EvolutionTracking\3.4\HeuristicLab.EvolutionTracking-3.4.csproj">
+      <Project>{1f75cea3-464f-4a6f-b2f0-04b9841ebc16}</Project>
+      <Name>HeuristicLab.EvolutionTracking-3.4</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.TravelingSalesman\3.3\HeuristicLab.Problems.TravelingSalesman-3.3.csproj">
+      <Project>{d767c38d-8014-46b0-9a32-03a3aecce34a}</Project>
+      <Name>HeuristicLab.Problems.TravelingSalesman-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+  </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 Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/PathTSPTourView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/PathTSPTourView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/PathTSPTourView.Designer.cs	(revision 16132)
@@ -0,0 +1,220 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman.Views {
+  partial class PathTSPTourView {
+    /// <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) {
+        if (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.pictureBox = new System.Windows.Forms.PictureBox();
+      this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
+      this.visualizationTabPage = new System.Windows.Forms.TabPage();
+      this.valueTabPage = new System.Windows.Forms.TabPage();
+      this.tourGroupBox = new System.Windows.Forms.GroupBox();
+      this.tourViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.qualityGroupBox = new System.Windows.Forms.GroupBox();
+      this.qualityViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
+      this.tabControl.SuspendLayout();
+      this.visualizationTabPage.SuspendLayout();
+      this.valueTabPage.SuspendLayout();
+      this.tourGroupBox.SuspendLayout();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.qualityGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // pictureBox
+      // 
+      this.pictureBox.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.pictureBox.BackColor = System.Drawing.Color.White;
+      this.pictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+      this.pictureBox.Location = new System.Drawing.Point(6, 6);
+      this.pictureBox.Name = "pictureBox";
+      this.pictureBox.Size = new System.Drawing.Size(403, 288);
+      this.pictureBox.TabIndex = 0;
+      this.pictureBox.TabStop = false;
+      this.pictureBox.SizeChanged += new System.EventHandler(this.pictureBox_SizeChanged);
+      // 
+      // 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.visualizationTabPage);
+      this.tabControl.Controls.Add(this.valueTabPage);
+      this.tabControl.Location = new System.Drawing.Point(0, 3);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(423, 326);
+      this.tabControl.TabIndex = 0;
+      // 
+      // visualizationTabPage
+      // 
+      this.visualizationTabPage.Controls.Add(this.pictureBox);
+      this.visualizationTabPage.Location = new System.Drawing.Point(4, 22);
+      this.visualizationTabPage.Name = "visualizationTabPage";
+      this.visualizationTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.visualizationTabPage.Size = new System.Drawing.Size(415, 300);
+      this.visualizationTabPage.TabIndex = 0;
+      this.visualizationTabPage.Text = "Visualization";
+      this.visualizationTabPage.UseVisualStyleBackColor = true;
+      // 
+      // valueTabPage
+      // 
+      this.valueTabPage.Controls.Add(this.tourGroupBox);
+      this.valueTabPage.Location = new System.Drawing.Point(4, 22);
+      this.valueTabPage.Name = "valueTabPage";
+      this.valueTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.valueTabPage.Size = new System.Drawing.Size(415, 300);
+      this.valueTabPage.TabIndex = 1;
+      this.valueTabPage.Text = "Value";
+      this.valueTabPage.UseVisualStyleBackColor = true;
+      // 
+      // tourGroupBox
+      // 
+      this.tourGroupBox.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.tourGroupBox.Controls.Add(this.tourViewHost);
+      this.tourGroupBox.Location = new System.Drawing.Point(6, 6);
+      this.tourGroupBox.Name = "tourGroupBox";
+      this.tourGroupBox.Size = new System.Drawing.Size(403, 288);
+      this.tourGroupBox.TabIndex = 0;
+      this.tourGroupBox.TabStop = false;
+      this.tourGroupBox.Text = "Tour";
+      // 
+      // tourViewHost
+      // 
+      this.tourViewHost.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.tourViewHost.Content = null;
+      this.tourViewHost.Location = new System.Drawing.Point(6, 19);
+      this.tourViewHost.Name = "tourViewHost";
+      this.tourViewHost.ReadOnly = false;
+      this.tourViewHost.Size = new System.Drawing.Size(391, 263);
+      this.tourViewHost.TabIndex = 0;
+      this.tourViewHost.ViewType = null;
+      // 
+      // splitContainer
+      // 
+      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer.Location = new System.Drawing.Point(0, 0);
+      this.splitContainer.Name = "splitContainer";
+      this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
+      // 
+      // splitContainer.Panel1
+      // 
+      this.splitContainer.Panel1.Controls.Add(this.qualityGroupBox);
+      // 
+      // splitContainer.Panel2
+      // 
+      this.splitContainer.Panel2.Controls.Add(this.tabControl);
+      this.splitContainer.Size = new System.Drawing.Size(423, 402);
+      this.splitContainer.SplitterDistance = 69;
+      this.splitContainer.TabIndex = 0;
+      // 
+      // qualityGroupBox
+      // 
+      this.qualityGroupBox.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.qualityGroupBox.Controls.Add(this.qualityViewHost);
+      this.qualityGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.qualityGroupBox.Name = "qualityGroupBox";
+      this.qualityGroupBox.Size = new System.Drawing.Size(423, 66);
+      this.qualityGroupBox.TabIndex = 0;
+      this.qualityGroupBox.TabStop = false;
+      this.qualityGroupBox.Text = "Quality";
+      // 
+      // qualityViewHost
+      // 
+      this.qualityViewHost.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.qualityViewHost.Content = null;
+      this.qualityViewHost.Location = new System.Drawing.Point(6, 19);
+      this.qualityViewHost.Name = "qualityViewHost";
+      this.qualityViewHost.ReadOnly = false;
+      this.qualityViewHost.Size = new System.Drawing.Size(411, 41);
+      this.qualityViewHost.TabIndex = 0;
+      this.qualityViewHost.ViewType = null;
+      // 
+      // PathTSPTourView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.splitContainer);
+      this.Name = "PathTSPTourView";
+      this.Size = new System.Drawing.Size(423, 402);
+      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
+      this.tabControl.ResumeLayout(false);
+      this.visualizationTabPage.ResumeLayout(false);
+      this.valueTabPage.ResumeLayout(false);
+      this.tourGroupBox.ResumeLayout(false);
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel2.ResumeLayout(false);
+      this.splitContainer.ResumeLayout(false);
+      this.qualityGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.PictureBox pictureBox;
+    private HeuristicLab.MainForm.WindowsForms.DragOverTabControl tabControl;
+    private System.Windows.Forms.TabPage visualizationTabPage;
+    private System.Windows.Forms.TabPage valueTabPage;
+    private System.Windows.Forms.GroupBox tourGroupBox;
+    private HeuristicLab.MainForm.WindowsForms.ViewHost tourViewHost;
+    private System.Windows.Forms.SplitContainer splitContainer;
+    private System.Windows.Forms.GroupBox qualityGroupBox;
+    private HeuristicLab.MainForm.WindowsForms.ViewHost qualityViewHost;
+
+
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/PathTSPTourView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/PathTSPTourView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/PathTSPTourView.cs	(revision 16132)
@@ -0,0 +1,160 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Problems.TravelingSalesman.Views {
+  /// <summary>
+  /// The base class for visual representations of a path tour for a TSP.
+  /// </summary>
+  [View("PathTSPTour View")]
+  [Content(typeof(PathTSPTour), true)]
+  public sealed partial class PathTSPTourView : ItemView {
+    public new PathTSPTour Content {
+      get { return (PathTSPTour)base.Content; }
+      set { base.Content = value; }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="PathTSPTourView"/>.
+    /// </summary>
+    public PathTSPTourView() {
+      InitializeComponent();
+    }
+
+    protected override void DeregisterContentEvents() {
+      Content.QualityChanged -= new EventHandler(Content_QualityChanged);
+      Content.CoordinatesChanged -= new EventHandler(Content_CoordinatesChanged);
+      Content.PermutationChanged -= new EventHandler(Content_PermutationChanged);
+      base.DeregisterContentEvents();
+    }
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.QualityChanged += new EventHandler(Content_QualityChanged);
+      Content.CoordinatesChanged += new EventHandler(Content_CoordinatesChanged);
+      Content.PermutationChanged += new EventHandler(Content_PermutationChanged);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        qualityViewHost.Content = null;
+        pictureBox.Image = null;
+        tourViewHost.Content = null;
+      } else {
+        qualityViewHost.Content = Content.Quality;
+        GenerateImage();
+        tourViewHost.Content = Content.Permutation;
+      }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      qualityGroupBox.Enabled = Content != null;
+      pictureBox.Enabled = Content != null;
+      tourGroupBox.Enabled = Content != null;
+    }
+
+    private void GenerateImage() {
+      if ((pictureBox.Width > 0) && (pictureBox.Height > 0)) {
+        if (Content == null) {
+          pictureBox.Image = null;
+        } else {
+          DoubleMatrix coordinates = Content.Coordinates;
+          Permutation permutation = Content.Permutation;
+          Bitmap bitmap = new Bitmap(pictureBox.Width, pictureBox.Height);
+
+          if ((coordinates != null) && (coordinates.Rows > 0) && (coordinates.Columns == 2)) {
+            double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
+            for (int i = 0; i < coordinates.Rows; i++) {
+              if (xMin > coordinates[i, 0]) xMin = coordinates[i, 0];
+              if (yMin > coordinates[i, 1]) yMin = coordinates[i, 1];
+              if (xMax < coordinates[i, 0]) xMax = coordinates[i, 0];
+              if (yMax < coordinates[i, 1]) yMax = coordinates[i, 1];
+            }
+
+            int border = 20;
+            double xStep = xMax != xMin ? (pictureBox.Width - 2 * border) / (xMax - xMin) : 1;
+            double yStep = yMax != yMin ? (pictureBox.Height - 2 * border) / (yMax - yMin) : 1;
+
+            Point[] points = new Point[coordinates.Rows];
+            for (int i = 0; i < coordinates.Rows; i++)
+              points[i] = new Point(border + ((int)((coordinates[i, 0] - xMin) * xStep)),
+                                    bitmap.Height - (border + ((int)((coordinates[i, 1] - yMin) * yStep))));
+
+            using (Graphics graphics = Graphics.FromImage(bitmap)) {
+              if (permutation != null && permutation.Length > 1) {
+                Point[] tour = new Point[permutation.Length];
+                for (int i = 0; i < permutation.Length; i++) {
+                  if (permutation[i] >= 0 && permutation[i] < points.Length)
+                    tour[i] = points[permutation[i]];
+                }
+                graphics.DrawPolygon(Pens.Black, tour);
+              }
+              for (int i = 0; i < points.Length; i++)
+                graphics.FillRectangle(Brushes.Red, points[i].X - 2, points[i].Y - 2, 6, 6);
+            }
+          } else {
+            using (Graphics graphics = Graphics.FromImage(bitmap)) {
+              graphics.Clear(Color.White);
+              Font font = new Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular);
+              string text = "No coordinates defined or in wrong format.";
+              SizeF strSize = graphics.MeasureString(text, font);
+              graphics.DrawString(text, font, Brushes.Black, (float)(pictureBox.Width - strSize.Width) / 2.0f, (float)(pictureBox.Height - strSize.Height) / 2.0f);
+            }
+          }
+          pictureBox.Image = bitmap;
+        }
+      }
+    }
+
+    private void Content_QualityChanged(object sender, EventArgs e) {
+      if (InvokeRequired)
+        Invoke(new EventHandler(Content_QualityChanged), sender, e);
+      else
+        qualityViewHost.Content = Content.Quality;
+    }
+    private void Content_CoordinatesChanged(object sender, EventArgs e) {
+      if (InvokeRequired)
+        Invoke(new EventHandler(Content_CoordinatesChanged), sender, e);
+      else
+        GenerateImage();
+    }
+    private void Content_PermutationChanged(object sender, EventArgs e) {
+      if (InvokeRequired)
+        Invoke(new EventHandler(Content_PermutationChanged), sender, e);
+      else {
+        GenerateImage();
+        tourViewHost.Content = Content.Permutation;
+      }
+    }
+
+    private void pictureBox_SizeChanged(object sender, EventArgs e) {
+      GenerateImage();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/Plugin.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/Plugin.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/Plugin.cs.frame	(revision 16132)
@@ -0,0 +1,43 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.TravelingSalesman.Views {
+  /// <summary>
+  /// Plugin class for HeuristicLab.Problems.TravelingSalesman.Views plugin
+  /// </summary>
+  [Plugin("HeuristicLab.Problems.TravelingSalesman.Views", "3.3.15.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.TravelingSalesman.Views-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.TravelingSalesman", "3.3")]
+  public class HeuristicLabProblemsTravelingSalesmanViewsPlugin : PluginBase {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/Properties/AssemblyInfo.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/Properties/AssemblyInfo.cs.frame	(revision 16132)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman.Views")]
+[assembly: AssemblyDescription("Views of the HeuristicLab Traveling Salesman Problem classes")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 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("30a47401-50c8-4ddf-a4b6-73deb16e2aa3")]
+
+// 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.15.$WCREV$")]
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.Designer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.Designer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.Designer.cs	(revision 16132)
@@ -0,0 +1,151 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman.Views {
+  partial class TravelingSalesmanProblemView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (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.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
+      this.parametersTabPage = new System.Windows.Forms.TabPage();
+      this.visualizationTabPage = new System.Windows.Forms.TabPage();
+      this.pathTSPTourView = new HeuristicLab.Problems.TravelingSalesman.Views.PathTSPTourView();
+      ((System.ComponentModel.ISupportInitialize)(this.problemInstanceSplitContainer)).BeginInit();
+      this.problemInstanceSplitContainer.Panel1.SuspendLayout();
+      this.problemInstanceSplitContainer.Panel2.SuspendLayout();
+      this.problemInstanceSplitContainer.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.tabControl.SuspendLayout();
+      this.parametersTabPage.SuspendLayout();
+      this.visualizationTabPage.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // problemInstanceSplitContainer
+      // 
+      // 
+      // problemInstanceSplitContainer.Panel2
+      // 
+      this.problemInstanceSplitContainer.Panel2.Controls.Add(this.tabControl);
+      // 
+      // parameterCollectionView
+      // 
+      this.parameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
+      this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.parameterCollectionView.Location = new System.Drawing.Point(3, 3);
+      this.parameterCollectionView.Size = new System.Drawing.Size(497, 274);
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      // 
+      // tabControl
+      // 
+      this.tabControl.AllowDrop = true;
+      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.parametersTabPage);
+      this.tabControl.Controls.Add(this.visualizationTabPage);
+      this.tabControl.Location = new System.Drawing.Point(0, 27);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(511, 306);
+      this.tabControl.TabIndex = 4;
+      // 
+      // parametersTabPage
+      // 
+      this.parametersTabPage.Controls.Add(this.parameterCollectionView);
+      this.parametersTabPage.Location = new System.Drawing.Point(4, 22);
+      this.parametersTabPage.Name = "parametersTabPage";
+      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.parametersTabPage.Size = new System.Drawing.Size(503, 280);
+      this.parametersTabPage.TabIndex = 0;
+      this.parametersTabPage.Text = "Parameters";
+      this.parametersTabPage.UseVisualStyleBackColor = true;
+      // 
+      // visualizationTabPage
+      // 
+      this.visualizationTabPage.Controls.Add(this.pathTSPTourView);
+      this.visualizationTabPage.Location = new System.Drawing.Point(4, 22);
+      this.visualizationTabPage.Name = "visualizationTabPage";
+      this.visualizationTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.visualizationTabPage.Size = new System.Drawing.Size(503, 280);
+      this.visualizationTabPage.TabIndex = 1;
+      this.visualizationTabPage.Text = "Visualization";
+      this.visualizationTabPage.UseVisualStyleBackColor = true;
+      // 
+      // pathTSPTourView
+      // 
+      this.pathTSPTourView.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.pathTSPTourView.Caption = "PathTSPTour View";
+      this.pathTSPTourView.Content = null;
+      this.pathTSPTourView.Location = new System.Drawing.Point(6, 6);
+      this.pathTSPTourView.Name = "pathTSPTourView";
+      this.pathTSPTourView.ReadOnly = false;
+      this.pathTSPTourView.Size = new System.Drawing.Size(491, 268);
+      this.pathTSPTourView.TabIndex = 0;
+      // 
+      // TravelingSalesmanProblemView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Name = "TravelingSalesmanProblemView";
+      this.problemInstanceSplitContainer.Panel1.ResumeLayout(false);
+      this.problemInstanceSplitContainer.Panel1.PerformLayout();
+      this.problemInstanceSplitContainer.Panel2.ResumeLayout(false);
+      this.problemInstanceSplitContainer.Panel2.PerformLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.problemInstanceSplitContainer)).EndInit();
+      this.problemInstanceSplitContainer.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.tabControl.ResumeLayout(false);
+      this.parametersTabPage.ResumeLayout(false);
+      this.visualizationTabPage.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private HeuristicLab.MainForm.WindowsForms.DragOverTabControl tabControl;
+    private System.Windows.Forms.TabPage parametersTabPage;
+    private System.Windows.Forms.TabPage visualizationTabPage;
+    private PathTSPTourView pathTSPTourView;
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs	(revision 16132)
@@ -0,0 +1,83 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization.Views;
+
+namespace HeuristicLab.Problems.TravelingSalesman.Views {
+  /// <summary>
+  /// A view for a Traveling Salesman Problem instance.
+  /// </summary>
+  [View("Traveling Salesman Problem View")]
+  [Content(typeof(TravelingSalesmanProblem), true)]
+  public sealed partial class TravelingSalesmanProblemView : ProblemView {
+    public new TravelingSalesmanProblem Content {
+      get { return (TravelingSalesmanProblem)base.Content; }
+      set { base.Content = value; }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="TravelingSalesmanProblemView"/>.
+    /// </summary>
+    public TravelingSalesmanProblemView() {
+      InitializeComponent();
+    }
+
+    protected override void DeregisterContentEvents() {
+      Content.CoordinatesParameter.ValueChanged -= new EventHandler(CoordinatesParameter_ValueChanged);
+      Content.BestKnownQualityParameter.ValueChanged -= new EventHandler(BestKnownQualityParameter_ValueChanged);
+      Content.BestKnownSolutionParameter.ValueChanged -= new EventHandler(BestKnownSolutionParameter_ValueChanged);
+      base.DeregisterContentEvents();
+    }
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged);
+      Content.BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged);
+      Content.BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        pathTSPTourView.Content = null;
+      } else {
+        pathTSPTourView.Content = new PathTSPTour(Content.Coordinates, Content.BestKnownSolution, Content.BestKnownQuality);
+      }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      pathTSPTourView.Enabled = Content != null;
+    }
+
+    private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) {
+      pathTSPTourView.Content.Coordinates = Content.Coordinates;
+    }
+    private void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) {
+      pathTSPTourView.Content.Quality = Content.BestKnownQuality;
+    }
+    private void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) {
+      pathTSPTourView.Content.Permutation = Content.BestKnownSolution;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs	(revision 16132)
@@ -0,0 +1,132 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates.
+  /// </summary>
+  [Item("BestTSPSolutionAnalyzer", "An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates.")]
+  [StorableClass]
+  public sealed class BestTSPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator {
+    public bool EnabledByDefault {
+      get { return true; }
+    }
+
+    public LookupParameter<BoolValue> MaximizationParameter {
+      get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    public LookupParameter<DoubleMatrix> CoordinatesParameter {
+      get { return (LookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    }
+    public ScopeTreeLookupParameter<Permutation> PermutationParameter {
+      get { return (ScopeTreeLookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public LookupParameter<PathTSPTour> BestSolutionParameter {
+      get { return (LookupParameter<PathTSPTour>)Parameters["BestSolution"]; }
+    }
+    public ValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
+    }
+    public LookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
+    public LookupParameter<Permutation> BestKnownSolutionParameter {
+      get { return (LookupParameter<Permutation>)Parameters["BestKnownSolution"]; }
+    }
+
+    [StorableConstructor]
+    private BestTSPSolutionAnalyzer(bool deserializing) : base(deserializing) { }
+    private BestTSPSolutionAnalyzer(BestTSPSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BestTSPSolutionAnalyzer(this, cloner);
+    }
+    public BestTSPSolutionAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
+      Parameters.Add(new ScopeTreeLookupParameter<Permutation>("Permutation", "The TSP solutions given in path representation from which the best solution should be analyzed."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the TSP solutions which should be analyzed."));
+      Parameters.Add(new LookupParameter<PathTSPTour>("BestSolution", "The best TSP solution."));
+      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best TSP solution should be stored."));
+      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this TSP instance."));
+      Parameters.Add(new LookupParameter<Permutation>("BestKnownSolution", "The best known solution of this TSP instance."));
+
+      MaximizationParameter.Hidden = true;
+      CoordinatesParameter.Hidden = true;
+      PermutationParameter.Hidden = true;
+      QualityParameter.Hidden = true;
+      BestSolutionParameter.Hidden = true;
+      ResultsParameter.Hidden = true;
+      BestKnownQualityParameter.Hidden = true;
+      BestKnownSolutionParameter.Hidden = true;
+    }
+
+    public override IOperation Apply() {
+      DoubleMatrix coordinates = CoordinatesParameter.ActualValue;
+      ItemArray<Permutation> permutations = PermutationParameter.ActualValue;
+      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
+      ResultCollection results = ResultsParameter.ActualValue;
+      bool max = MaximizationParameter.ActualValue.Value;
+      DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
+
+      int i = -1;
+      if (!max)
+        i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+      else i = qualities.Select((x, index) => new { index, x.Value }).OrderByDescending(x => x.Value).First().index;
+
+      if (bestKnownQuality == null ||
+          max && qualities[i].Value > bestKnownQuality.Value ||
+          !max && qualities[i].Value < bestKnownQuality.Value) {
+        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
+        BestKnownSolutionParameter.ActualValue = (Permutation)permutations[i].Clone();
+      }
+
+      PathTSPTour tour = BestSolutionParameter.ActualValue;
+      if (tour == null) {
+        tour = new PathTSPTour(coordinates, (Permutation)permutations[i].Clone(), new DoubleValue(qualities[i].Value));
+        BestSolutionParameter.ActualValue = tour;
+        results.Add(new Result("Best TSP Solution", tour));
+      } else {
+        if (max && tour.Quality.Value < qualities[i].Value ||
+          !max && tour.Quality.Value > qualities[i].Value) {
+          tour.Coordinates = coordinates;
+          tour.Permutation = (Permutation)permutations[i].Clone();
+          tour.Quality.Value = qualities[i].Value;
+        }
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPAlleleFrequencyAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPAlleleFrequencyAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPAlleleFrequencyAnalyzer.cs	(revision 16132)
@@ -0,0 +1,86 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator for analyzing the frequency of alleles in solutions of Traveling Salesman Problems given in path representation.
+  /// </summary>
+  [Item("TSPAlleleFrequencyAnalyzer", "An operator for analyzing the frequency of alleles in solutions of Traveling Salesman Problems given in path representation.")]
+  [StorableClass]
+  public sealed class TSPAlleleFrequencyAnalyzer : AlleleFrequencyAnalyzer<Permutation> {
+    public LookupParameter<DoubleMatrix> CoordinatesParameter {
+      get { return (LookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    }
+    public LookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (LookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+
+    [StorableConstructor]
+    private TSPAlleleFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
+    private TSPAlleleFrequencyAnalyzer(TSPAlleleFrequencyAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public TSPAlleleFrequencyAnalyzer()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The x- and y-coordinates of the cities."));
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPAlleleFrequencyAnalyzer(this, cloner);
+    }
+
+    protected override Allele[] CalculateAlleles(Permutation solution) {
+      Allele[] alleles = new Allele[solution.Length];
+      DoubleMatrix coords = CoordinatesParameter.ActualValue;
+      DistanceMatrix dm = DistanceMatrixParameter.ActualValue;
+      if (dm == null && coords == null) throw new InvalidOperationException("Neither a distance matrix nor coordinates were given.");
+      int source, target, h;
+      double impact;
+
+      for (int i = 0; i < solution.Length - 1; i++) {
+        source = solution[i];
+        target = solution[i + 1];
+        if (source > target) { h = source; source = target; target = h; }
+        impact = dm != null ? dm[source, target] : CalculateLength(coords[source, 0], coords[source, 1], coords[target, 0], coords[target, 1]);
+        alleles[i] = new Allele(source.ToString() + "-" + target.ToString(), impact);
+      }
+      source = solution[solution.Length - 1];
+      target = solution[0];
+      if (source > target) { h = source; source = target; target = h; }
+      impact = dm != null ? dm[source, target] : CalculateLength(coords[source, 0], coords[source, 1], coords[target, 0], coords[target, 1]);
+      alleles[alleles.Length - 1] = new Allele(source.ToString() + "-" + target.ToString(), impact);
+
+      return alleles;
+    }
+
+    private double CalculateLength(double x1, double y1, double x2, double y2) {
+      return Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPGenealogyAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPGenealogyAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPGenealogyAnalyzer.cs	(revision 16132)
@@ -0,0 +1,27 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman.Analyzers {
+  [StorableClass]
+  [Item("TSPGenealogyAnalyzer", "A genealogy analyzer for permutation encodings.")]
+  public class TSPGenealogyAnalyzer : GenealogyAnalyzer<Permutation> {
+    public TSPGenealogyAnalyzer() { }
+
+    [StorableConstructor]
+    protected TSPGenealogyAnalyzer(bool deserializing) : base(deserializing) { }
+
+    public TSPGenealogyAnalyzer(TSPGenealogyAnalyzer original, Cloner cloner) : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPGenealogyAnalyzer(this, cloner);
+    }
+
+    protected override void EvaluateIntermediateChildren() {
+      throw new System.NotImplementedException();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPPopulationDiversityAnalyzer.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPPopulationDiversityAnalyzer.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPPopulationDiversityAnalyzer.cs	(revision 16132)
@@ -0,0 +1,88 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.PermutationEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  // BackwardsCompatibility3.3
+  #region Backwards compatible code, remove with 3.4
+  /// <summary>
+  /// An operator for analyzing the diversity of solutions of Traveling Salesman Problems given in path representation.
+  /// </summary>
+  [Obsolete]
+  [NonDiscoverableType]
+  [Item("TSPPopulationDiversityAnalyzer", "An operator for analyzing the diversity of solutions of Traveling Salesman Problems given in path representation.")]
+  [StorableClass]
+  public sealed class TSPPopulationDiversityAnalyzer : PopulationDiversityAnalyzer<Permutation> {
+    [StorableConstructor]
+    private TSPPopulationDiversityAnalyzer(bool deserializing) : base(deserializing) { }
+    private TSPPopulationDiversityAnalyzer(TSPPopulationDiversityAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public TSPPopulationDiversityAnalyzer() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPPopulationDiversityAnalyzer(this, cloner);
+    }
+
+    protected override double[,] CalculateSimilarities(Permutation[] solutions) {
+      int count = solutions.Length;
+      double[,] similarities = new double[count, count];
+      int[][] edges = new int[count][];
+
+      for (int i = 0; i < count; i++)
+        edges[i] = CalculateEdgesVector(solutions[i]);
+
+      for (int i = 0; i < count; i++) {
+        similarities[i, i] = 1;
+        for (int j = i + 1; j < count; j++) {
+          similarities[i, j] = CalculateSimilarity(edges[i], edges[j]);
+          similarities[j, i] = similarities[i, j];
+        }
+      }
+      return similarities;
+    }
+
+    private int[] CalculateEdgesVector(Permutation permutation) {
+      // transform path representation into adjacency representation
+      int[] edgesVector = new int[permutation.Length];
+      for (int i = 0; i < permutation.Length - 1; i++)
+        edgesVector[permutation[i]] = permutation[i + 1];
+      edgesVector[permutation[permutation.Length - 1]] = permutation[0];
+      return edgesVector;
+    }
+
+    private double CalculateSimilarity(int[] edgesA, int[] edgesB) {
+      // calculate relative number of identical edges
+      int identicalEdges = 0;
+      for (int i = 0; i < edgesA.Length; i++) {
+        if ((edgesA[i] == edgesB[i]) || (edgesA[edgesB[i]] == i))
+          identicalEdges++;
+      }
+      return ((double)identicalEdges) / edgesA.Length;
+    }
+  }
+  #endregion
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/DistanceMatrix.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/DistanceMatrix.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/DistanceMatrix.cs	(revision 16132)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// Represents a distance matrix of a Traveling Salesman Problem.
+  /// </summary>
+  [Item("DistanceMatrix", "Represents a distance matrix of a Traveling Salesman Problem.")]
+  [StorableClass]
+  public sealed class DistanceMatrix : DoubleMatrix {
+    [StorableConstructor]
+    private DistanceMatrix(bool deserializing) : base(deserializing) { }
+    private DistanceMatrix(DistanceMatrix original, Cloner cloner) {
+      throw new NotSupportedException("Distance matrices cannot be cloned.");
+    }
+    public DistanceMatrix() : base() { }
+    public DistanceMatrix(int rows, int columns) : base(rows, columns) { }
+    public DistanceMatrix(int rows, int columns, IEnumerable<string> columnNames) : base(rows, columns, columnNames) { }
+    public DistanceMatrix(int rows, int columns, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(rows, columns, columnNames, rowNames) { }
+    public DistanceMatrix(double[,] elements) : base(elements) { }
+    public DistanceMatrix(double[,] elements, IEnumerable<string> columnNames) : base(elements, columnNames) { }
+    public DistanceMatrix(double[,] elements, IEnumerable<string> columnNames, IEnumerable<string> rowNames) : base(elements, columnNames, rowNames) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      // distance matrices are not cloned for performance reasons
+      cloner.RegisterClonedObject(this, this);
+      return this;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPCoordinatesPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPCoordinatesPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPCoordinatesPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,135 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// A base class for operators which evaluate TSP solutions given in path representation using city coordinates.
+  /// </summary>
+  [Item("TSPCoordinatesPathEvaluator", "A base class for operators which evaluate TSP solutions given in path representation using city coordinates.")]
+  [StorableClass]
+  public abstract class TSPCoordinatesPathEvaluator : TSPEvaluator, ITSPCoordinatesPathEvaluator {
+    private object locker = new object();
+
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ILookupParameter<DoubleMatrix> CoordinatesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    }
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+    public ILookupParameter<BoolValue> UseDistanceMatrixParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
+    }
+
+    [StorableConstructor]
+    protected TSPCoordinatesPathEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPCoordinatesPathEvaluator(TSPCoordinatesPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    protected TSPCoordinatesPathEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The TSP solution given in path representation which should be evaluated."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+      Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated and used for evaluation, otherwise false."));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code (remove with 3.4)
+      LookupParameter<DoubleMatrix> oldDistanceMatrixParameter = Parameters["DistanceMatrix"] as LookupParameter<DoubleMatrix>;
+      if (oldDistanceMatrixParameter != null) {
+        Parameters.Remove(oldDistanceMatrixParameter);
+        Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+        DistanceMatrixParameter.ActualName = oldDistanceMatrixParameter.ActualName;
+      }
+      #endregion
+    }
+
+    public static double Apply(TSPCoordinatesPathEvaluator evaluator, DoubleMatrix coordinates, Permutation tour) {
+      DoubleMatrix c = coordinates;
+      Permutation p = tour;
+      double length = 0;
+      for (int i = 0; i < p.Length - 1; i++)
+        length += evaluator.CalculateDistance(c[p[i], 0], c[p[i], 1], c[p[i + 1], 0], c[p[i + 1], 1]);
+      length += evaluator.CalculateDistance(c[p[p.Length - 1], 0], c[p[p.Length - 1], 1], c[p[0], 0], c[p[0], 1]);
+      return length;
+    }
+
+    public sealed override IOperation InstrumentedApply() {
+      if (UseDistanceMatrixParameter.ActualValue.Value) {
+        Permutation p = PermutationParameter.ActualValue;
+        DistanceMatrix dm = DistanceMatrixParameter.ActualValue;
+
+        if (dm == null) {  // calculate distance matrix
+          lock (locker) {
+            dm = DistanceMatrixParameter.ActualValue;
+            if (dm == null) {  // check again to avoid race condition
+              DoubleMatrix c = CoordinatesParameter.ActualValue;
+              if (c == null) throw new InvalidOperationException("Neither a distance matrix nor coordinates were given.");
+              dm = new DistanceMatrix(c.Rows, c.Rows);
+              for (int i = 0; i < dm.Rows; i++) {
+                for (int j = 0; j < dm.Columns; j++)
+                  dm[i, j] = CalculateDistance(c[i, 0], c[i, 1], c[j, 0], c[j, 1]);
+              }
+              DistanceMatrixParameter.ActualValue = (DistanceMatrix)dm.AsReadOnly();
+            }
+          }
+        }
+
+        double length = 0;
+        for (int i = 0; i < p.Length - 1; i++)
+          length += dm[p[i], p[i + 1]];
+        length += dm[p[p.Length - 1], p[0]];
+        QualityParameter.ActualValue = new DoubleValue(length);
+      } else {
+        Permutation p = PermutationParameter.ActualValue;
+        DoubleMatrix c = CoordinatesParameter.ActualValue;
+        if (c == null) throw new InvalidOperationException("No coordinates were given.");
+        double length = 0;
+        for (int i = 0; i < p.Length - 1; i++)
+          length += CalculateDistance(c[p[i], 0], c[p[i], 1], c[p[i + 1], 0], c[p[i + 1], 1]);
+        length += CalculateDistance(c[p[p.Length - 1], 0], c[p[p.Length - 1], 1], c[p[0], 0], c[p[0], 1]);
+        QualityParameter.ActualValue = new DoubleValue(length);
+      }
+      return base.InstrumentedApply();
+    }
+
+    /// <summary>
+    /// Calculates the distance between two points.
+    /// </summary>
+    /// <param name="x1">The x-coordinate of point 1.</param>
+    /// <param name="y1">The y-coordinate of point 1.</param>
+    /// <param name="x2">The x-coordinate of point 2.</param>
+    /// <param name="y2">The y-coordinate of point 2.</param>
+    /// <returns>The calculated distance.</returns>
+    protected abstract double CalculateDistance(double x1, double y1, double x2, double y2);
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPDistanceMatrixEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPDistanceMatrixEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPDistanceMatrixEvaluator.cs	(revision 16132)
@@ -0,0 +1,79 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// A base class for operators which evaluate TSP solutions given in path representation using a distance matrix.
+  /// </summary>
+  [Item("TSPDistanceMatrixEvaluator", "Evaluate TSP solutions given in path representation using the distance matrix.")]
+  [StorableClass]
+  public sealed class TSPDistanceMatrixEvaluator : TSPEvaluator, ITSPDistanceMatrixEvaluator {
+
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+
+    [StorableConstructor]
+    private TSPDistanceMatrixEvaluator(bool deserializing) : base(deserializing) { }
+    private TSPDistanceMatrixEvaluator(TSPDistanceMatrixEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPDistanceMatrixEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The TSP solution given in path representation which should be evaluated."));
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPDistanceMatrixEvaluator(this, cloner);
+    }
+
+    public static double Apply(DistanceMatrix distances, Permutation tour) {
+      if (distances == null || distances.Rows == 0 || distances.Columns == 0
+        || distances.Rows != distances.Columns)
+        throw new InvalidOperationException("TSPDistanceMatrixEvaluator: The distance matrix is empty or not square");
+      if (tour == null) throw new ArgumentNullException("tour", "TSPDistanceMatrixEvaluator: No tour is given.");
+      Permutation p = tour;
+      double length = 0;
+      for (int i = 0; i < p.Length - 1; i++)
+        length += distances[p[i], p[i + 1]];
+      length += distances[p[p.Length - 1], p[0]];
+      return length;
+    }
+
+    public override IOperation InstrumentedApply() {
+      Permutation p = PermutationParameter.ActualValue;
+      DistanceMatrix dm = DistanceMatrixParameter.ActualValue;
+
+      QualityParameter.ActualValue = new DoubleValue(Apply(dm, p));
+      return base.InstrumentedApply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPEuclideanPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPEuclideanPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPEuclideanPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator which evaluates TSP solutions given in path representation using the Euclidean distance metric.
+  /// </summary>
+  [Item("TSPEuclideanPathEvaluator", "An operator which evaluates TSP solutions given in path representation using the Euclidean distance metric.")]
+  [StorableClass]
+  public sealed class TSPEuclideanPathEvaluator : TSPCoordinatesPathEvaluator {
+    [StorableConstructor]
+    private TSPEuclideanPathEvaluator(bool deserializing) : base(deserializing) { }
+    private TSPEuclideanPathEvaluator(TSPEuclideanPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPEuclideanPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPEuclideanPathEvaluator(this, cloner);
+    }
+    
+    /// <summary>
+    /// Calculates the distance between two points using the Euclidean distance metric.
+    /// </summary>
+    /// <param name="x1">The x-coordinate of point 1.</param>
+    /// <param name="y1">The y-coordinate of point 1.</param>
+    /// <param name="x2">The x-coordinate of point 2.</param>
+    /// <param name="y2">The y-coordinate of point 2.</param>
+    /// <returns>The calculated distance.</returns>
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPEvaluator.cs	(revision 16132)
@@ -0,0 +1,52 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// A base class for operators which evaluate TSP solutions.
+  /// </summary>
+  [Item("TSPEvaluator", "A base class for operators which evaluate TSP solutions.")]
+  [StorableClass]
+  public abstract class TSPEvaluator : InstrumentedOperator, ITSPEvaluator {
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+
+    [StorableConstructor]
+    protected TSPEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPEvaluator(TSPEvaluator original, Cloner cloner) : base(original, cloner) { }
+    protected TSPEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The evaluated quality of the TSP solution."));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPGeoPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPGeoPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPGeoPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,77 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator which evaluates TSP solutions given in path representation using the GEO distance metric (globe coordinates).
+  /// </summary>
+  [Item("TSPGeoPathEvaluator", "An operator which evaluates TSP solutions given in path representation using the GEO distance metric (globe coordinates).")]
+  [StorableClass]
+  public sealed class TSPGeoPathEvaluator : TSPCoordinatesPathEvaluator {
+    private const double PI = 3.141592;
+    private const double RADIUS = 6378.388;
+
+    [StorableConstructor]
+    private TSPGeoPathEvaluator(bool deserializing) : base(deserializing) { }
+    private TSPGeoPathEvaluator(TSPGeoPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPGeoPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPGeoPathEvaluator(this, cloner);
+    }
+    
+
+    /// <summary>
+    /// Calculates the distance between two points using the GEO distance metric (globe coordinates).
+    /// </summary>
+    /// <param name="x1">The x-coordinate of point 1.</param>
+    /// <param name="y1">The y-coordinate of point 1.</param>
+    /// <param name="x2">The x-coordinate of point 2.</param>
+    /// <param name="y2">The y-coordinate of point 2.</param>
+    /// <returns>The calculated distance.</returns>
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      double latitude1, longitude1, latitude2, longitude2;
+      double q1, q2, q3;
+      double length;
+
+      latitude1 = ConvertToRadian(x1);
+      longitude1 = ConvertToRadian(y1);
+      latitude2 = ConvertToRadian(x2);
+      longitude2 = ConvertToRadian(y2);
+
+      q1 = Math.Cos(longitude1 - longitude2);
+      q2 = Math.Cos(latitude1 - latitude2);
+      q3 = Math.Cos(latitude1 + latitude2);
+
+      length = (int)(RADIUS * Math.Acos(0.5 * ((1.0 + q1) * q2 - (1.0 - q1) * q3)) + 1.0);
+      return (length);
+    }
+
+    private double ConvertToRadian(double x) {
+      return PI * (Math.Truncate(x) + 5.0 * (x - Math.Truncate(x)) / 3.0) / 180.0;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPRoundedEuclideanPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPRoundedEuclideanPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPRoundedEuclideanPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator which evaluates TSP solutions given in path representation using the rounded Euclidean distance metric.
+  /// </summary>
+  [Item("TSPRoundedEuclideanPathEvaluator", "An operator which evaluates TSP solutions given in path representation using the rounded Euclidean distance metric.")]
+  [StorableClass]
+  public sealed class TSPRoundedEuclideanPathEvaluator : TSPCoordinatesPathEvaluator {
+    [StorableConstructor]
+    private TSPRoundedEuclideanPathEvaluator(bool deserializing) : base(deserializing) { }
+    private TSPRoundedEuclideanPathEvaluator(TSPRoundedEuclideanPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPRoundedEuclideanPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPRoundedEuclideanPathEvaluator(this, cloner);
+    }
+    
+    /// <summary>
+    /// Calculates the distance between two points using the rounded Euclidean distance metric.
+    /// </summary>
+    /// <param name="x1">The x-coordinate of point 1.</param>
+    /// <param name="y1">The y-coordinate of point 1.</param>
+    /// <param name="x2">The x-coordinate of point 2.</param>
+    /// <param name="y2">The y-coordinate of point 2.</param>
+    /// <returns>The calculated distance.</returns>
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Round(Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPUpperEuclideanPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPUpperEuclideanPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPUpperEuclideanPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator which evaluates TSP solutions given in path representation using the rounded up Euclidean distance metric.
+  /// </summary>
+  [Item("TSPUpperEuclideanPathEvaluator", "An operator which evaluates TSP solutions given in path representation using the rounded up Euclidean distance metric.")]
+  [StorableClass]
+  public sealed class TSPUpperEuclideanPathEvaluator : TSPCoordinatesPathEvaluator {
+    [StorableConstructor]
+    private TSPUpperEuclideanPathEvaluator(bool deserializing) : base(deserializing) { }
+    private TSPUpperEuclideanPathEvaluator(TSPUpperEuclideanPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPUpperEuclideanPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPUpperEuclideanPathEvaluator(this, cloner);
+    }
+
+    /// <summary>
+    /// Calculates the distance between two points using the rounded up Euclidean distance metric.
+    /// </summary>
+    /// <param name="x1">The x-coordinate of point 1.</param>
+    /// <param name="y1">The y-coordinate of point 1.</param>
+    /// <param name="x2">The x-coordinate of point 2.</param>
+    /// <param name="y2">The y-coordinate of point 2.</param>
+    /// <returns>The calculated distance.</returns>
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Ceiling(Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/HeuristicLab.Problems.TravelingSalesman-3.3.csproj
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/HeuristicLab.Problems.TravelingSalesman-3.3.csproj	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/HeuristicLab.Problems.TravelingSalesman-3.3.csproj	(revision 16132)
@@ -0,0 +1,269 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{D767C38D-8014-46B0-9A32-03A3AECCE34A}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.TravelingSalesman</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.TravelingSalesman-3.3</AssemblyName>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <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>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>
+    </DocumentationFile>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>
+    </DocumentationFile>
+    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.PermutationEncoding-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.PermutationEncoding-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Analyzers\BestTSPSolutionAnalyzer.cs" />
+    <Compile Include="Analyzers\TSPGenealogyAnalyzer.cs" />
+    <Compile Include="Analyzers\TSPPopulationDiversityAnalyzer.cs" />
+    <Compile Include="Analyzers\TSPAlleleFrequencyAnalyzer.cs" />
+    <Compile Include="DistanceMatrix.cs" />
+    <Compile Include="Evaluators\TSPDistanceMatrixEvaluator.cs" />
+    <Compile Include="Evaluators\TSPEuclideanPathEvaluator.cs" />
+    <Compile Include="Evaluators\TSPGeoPathEvaluator.cs" />
+    <Compile Include="Evaluators\TSPUpperEuclideanPathEvaluator.cs" />
+    <Compile Include="Improvers\TSPImprovementOperator.cs" />
+    <Compile Include="Interfaces\ITSPDistanceMatrixEvaluator.cs" />
+    <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMoveDistanceMatrixEvaluator.cs" />
+    <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMoveEuclideanPathEvaluator.cs" />
+    <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMoveGeoPathEvaluator.cs" />
+    <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMovePathEvaluator.cs" />
+    <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMoveRoundedEuclideanPathEvaluator.cs" />
+    <Compile Include="MoveEvaluators\TwoOpt\TSPInversionMoveEuclideanPathEvaluator.cs" />
+    <Compile Include="MoveEvaluators\TwoOpt\TSPInversionMoveGeoPathEvaluator.cs" />
+    <Compile Include="MoveEvaluators\TwoOpt\TSPInversionMoveDistanceMatrixEvaluator.cs" />
+    <Compile Include="MoveEvaluators\TwoOpt\TSPInversionMovePathEvaluator.cs" />
+    <Compile Include="MoveEvaluators\TwoOpt\TSPInversionMoveRoundedEuclideanPathEvaluator.cs" />
+    <Compile Include="PathRelinkers\TSPMultipleGuidesPathRelinker.cs" />
+    <Compile Include="PathRelinkers\TSPPathRelinker.cs" />
+    <Compile Include="PathRelinkers\TSPSimultaneousPathRelinker.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="SimilarityCalculators\TSPSimilarityCalculator.cs" />
+    <Compile Include="TravelingSalesmanProblem.cs" />
+    <Compile Include="PathTSPTour.cs" />
+    <Compile Include="Evaluators\TSPCoordinatesPathEvaluator.cs" />
+    <Compile Include="Evaluators\TSPEvaluator.cs" />
+    <Compile Include="Evaluators\TSPRoundedEuclideanPathEvaluator.cs" />
+    <Compile Include="Interfaces\ITSPCoordinatesPathEvaluator.cs" />
+    <Compile Include="Interfaces\ITSPEvaluator.cs" />
+    <Compile Include="Interfaces\ITSPMoveEvaluator.cs" />
+    <Compile Include="Interfaces\ITSPPathEvaluator.cs" />
+    <Compile Include="Interfaces\ITSPPathMoveEvaluator.cs" />
+    <Compile Include="MoveEvaluators\TSPPathMoveEvaluator.cs" />
+    <Compile Include="MoveEvaluators\TSPMoveEvaluator.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.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>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.EvolutionTracking\3.4\HeuristicLab.EvolutionTracking-3.4.csproj">
+      <Project>{1f75cea3-464f-4a6f-b2f0-04b9841ebc16}</Project>
+      <Name>HeuristicLab.EvolutionTracking-3.4</Name>
+    </ProjectReference>
+  </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>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Improvers/TSPImprovementOperator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Improvers/TSPImprovementOperator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Improvers/TSPImprovementOperator.cs	(revision 16132)
@@ -0,0 +1,115 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator that improves traveling salesman solutions.
+  /// </summary>
+  /// <remarks>
+  /// The operator tries to improve the traveling salesman solution by swapping two randomly chosen edges for a certain number of times.
+  /// </remarks>
+  [Item("TSPImprovementOperator", "An operator that improves traveling salesman solutions. The operator tries to improve the traveling salesman solution by swapping two randomly chosen edges for a certain number of times.")]
+  [StorableClass]
+  public sealed class TSPImprovementOperator : SingleSuccessorOperator, ISingleObjectiveImprovementOperator {
+    #region Parameter properties
+    public ScopeParameter CurrentScopeParameter {
+      get { return (ScopeParameter)Parameters["CurrentScope"]; }
+    }
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+    public IValueParameter<IntValue> ImprovementAttemptsParameter {
+      get { return (IValueParameter<IntValue>)Parameters["ImprovementAttempts"]; }
+    }
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    public IValueLookupParameter<IItem> SolutionParameter {
+      get { return (IValueLookupParameter<IItem>)Parameters["Solution"]; }
+    }
+    #endregion
+
+    #region Properties
+    public IScope CurrentScope {
+      get { return CurrentScopeParameter.ActualValue; }
+    }
+    public DistanceMatrix DistanceMatrix {
+      get { return DistanceMatrixParameter.ActualValue; }
+      set { DistanceMatrixParameter.ActualValue = value; }
+    }
+    public IntValue ImprovementAttempts {
+      get { return ImprovementAttemptsParameter.Value; }
+      set { ImprovementAttemptsParameter.Value = value; }
+    }
+    public IRandom Random {
+      get { return RandomParameter.ActualValue; }
+      set { RandomParameter.ActualValue = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private TSPImprovementOperator(bool deserializing) : base(deserializing) { }
+    private TSPImprovementOperator(TSPImprovementOperator original, Cloner cloner) : base(original, cloner) { }
+    public TSPImprovementOperator()
+      : base() {
+      #region Create parameters
+      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope that contains the solution to be improved."));
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+      Parameters.Add(new ValueParameter<IntValue>("ImprovementAttempts", "The number of improvement attempts the operator should perform.", new IntValue(100)));
+      Parameters.Add(new LookupParameter<IRandom>("Random", "A pseudo random number generator."));
+      Parameters.Add(new ValueLookupParameter<IItem>("Solution", "The solution to be improved. This parameter is used for name translation only."));
+      #endregion
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPImprovementOperator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var solution = CurrentScope.Variables[SolutionParameter.ActualName].Value as Permutation;
+      if (solution == null)
+        throw new ArgumentException("Cannot improve solution because it has the wrong type.");
+      if (solution.PermutationType != PermutationTypes.RelativeUndirected)
+        throw new ArgumentException("Cannot improve solution because the permutation type is not supported.");
+
+      for (int i = 0; i < ImprovementAttempts.Value; i++) {
+        var move = StochasticInversionSingleMoveGenerator.Apply(solution, Random);
+        double moveQualtiy = TSPInversionMovePathEvaluator.EvaluateByDistanceMatrix(solution, move, DistanceMatrix);
+        if (moveQualtiy < 0)
+          InversionManipulator.Apply(solution, move.Index1, move.Index2);
+      }
+
+      CurrentScope.Variables.Add(new Variable("LocalEvaluatedSolutions", ImprovementAttempts));
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPCoordinatesPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPCoordinatesPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPCoordinatesPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,34 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Problems.TravelingSalesman {
+  /// <summary>
+  /// An interface which represents an evaluation operator which evaluates TSP solutions given in path representation using city coordinates.
+  /// </summary>
+  public interface ITSPCoordinatesPathEvaluator : ITSPPathEvaluator {
+    ILookupParameter<DoubleMatrix> CoordinatesParameter { get; }
+    ILookupParameter<DistanceMatrix> DistanceMatrixParameter { get; }
+    ILookupParameter<BoolValue> UseDistanceMatrixParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPDistanceMatrixEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPDistanceMatrixEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPDistanceMatrixEvaluator.cs	(revision 16132)
@@ -0,0 +1,31 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An interface which represents an evaluation operator which evaluates TSP solutions given in path representation using a distance matrix.
+  /// </summary>
+  public interface ITSPDistanceMatrixEvaluator : ITSPPathEvaluator {
+    ILookupParameter<DistanceMatrix> DistanceMatrixParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPEvaluator.cs	(revision 16132)
@@ -0,0 +1,29 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An interface which represents an evaluation operator for Traveling Salesman Problems.
+  /// </summary>
+  public interface ITSPEvaluator : ISingleObjectiveEvaluator { }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPMoveEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPMoveEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPMoveEvaluator.cs	(revision 16132)
@@ -0,0 +1,29 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Optimization;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  public interface ITSPMoveEvaluator : ISingleObjectiveMoveEvaluator, IMoveOperator {
+    Type EvaluatorType { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,32 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An interface which represents an evaluation operator which evaluates TSP solutions given in path representation.
+  /// </summary>
+  public interface ITSPPathEvaluator : ITSPEvaluator {
+    ILookupParameter<Permutation> PermutationParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPPathMoveEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPPathMoveEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Interfaces/ITSPPathMoveEvaluator.cs	(revision 16132)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  public interface ITSPPathMoveEvaluator : ITSPMoveEvaluator, IPermutationMoveOperator {
+    ILookupParameter<DoubleMatrix> CoordinatesParameter { get; }
+    ILookupParameter<DistanceMatrix> DistanceMatrixParameter { get; }
+    ILookupParameter<BoolValue> UseDistanceMatrixParameter { get; }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPMoveEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPMoveEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPMoveEvaluator.cs	(revision 16132)
@@ -0,0 +1,60 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// A base class for operators which evaluate TSP solutions.
+  /// </summary>
+  [Item("TSPMoveEvaluator", "A base class for operators which evaluate TSP moves.")]
+  [StorableClass]
+  public abstract class TSPMoveEvaluator : SingleSuccessorOperator, ITSPMoveEvaluator, IMoveOperator {
+
+    public abstract Type EvaluatorType { get; }
+    public override bool CanChangeName {
+      get { return false; }
+    }
+
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public ILookupParameter<DoubleValue> MoveQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
+    }
+
+    [StorableConstructor]
+    protected TSPMoveEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPMoveEvaluator(TSPMoveEvaluator original, Cloner cloner) : base(original, cloner) { }
+    protected TSPMoveEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of a TSP solution."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The evaluated quality of a move on a TSP solution."));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPPathMoveEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPPathMoveEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPPathMoveEvaluator.cs	(revision 16132)
@@ -0,0 +1,109 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// A base class for operators which evaluate TSP solutions.
+  /// </summary>
+  [Item("TSPMoveEvaluator", "A base class for operators which evaluate TSP moves.")]
+  [StorableClass]
+  public abstract class TSPPathMoveEvaluator : TSPMoveEvaluator, ITSPPathMoveEvaluator {
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ILookupParameter<DoubleMatrix> CoordinatesParameter {
+      get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    }
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+    public ILookupParameter<BoolValue> UseDistanceMatrixParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
+    }
+
+    [StorableConstructor]
+    protected TSPPathMoveEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPPathMoveEvaluator(TSPPathMoveEvaluator original, Cloner cloner) : base(original, cloner) { }
+    protected TSPPathMoveEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The city's coordinates."));
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+      Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated (if it does not exist already) and used for evaluation, otherwise false."));
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code (remove with 3.4)
+      LookupParameter<DoubleMatrix> oldDistanceMatrixParameter = Parameters["DistanceMatrix"] as LookupParameter<DoubleMatrix>;
+      if (oldDistanceMatrixParameter != null) {
+        Parameters.Remove(oldDistanceMatrixParameter);
+        Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+        DistanceMatrixParameter.ActualName = oldDistanceMatrixParameter.ActualName;
+      }
+      #endregion
+    }
+
+    public override IOperation Apply() {
+      Permutation permutation = PermutationParameter.ActualValue;
+      DoubleMatrix coordinates = CoordinatesParameter.ActualValue;
+      double relativeQualityDifference = 0;
+      if (UseDistanceMatrixParameter.ActualValue.Value) {
+        DistanceMatrix distanceMatrix = DistanceMatrixParameter.ActualValue;
+        if (distanceMatrix == null) {
+          if (coordinates == null) throw new InvalidOperationException("Neither a distance matrix nor coordinates were given.");
+          distanceMatrix = CalculateDistanceMatrix(coordinates);
+          DistanceMatrixParameter.ActualValue = distanceMatrix;
+        }
+        relativeQualityDifference = EvaluateByDistanceMatrix(permutation, distanceMatrix);
+      } else {
+        if (coordinates == null) throw new InvalidOperationException("No coordinates were given.");
+        relativeQualityDifference = EvaluateByCoordinates(permutation, coordinates);
+      }
+      DoubleValue moveQuality = MoveQualityParameter.ActualValue;
+      if (moveQuality == null) MoveQualityParameter.ActualValue = new DoubleValue(QualityParameter.ActualValue.Value + relativeQualityDifference);
+      else moveQuality.Value = QualityParameter.ActualValue.Value + relativeQualityDifference;
+      return base.Apply();
+    }
+
+    protected abstract double CalculateDistance(double x1, double y1, double x2, double y2);
+    protected abstract double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix);
+    protected abstract double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates);
+
+    private DistanceMatrix CalculateDistanceMatrix(DoubleMatrix c) {
+      DistanceMatrix distanceMatrix = new DistanceMatrix(c.Rows, c.Rows);
+      for (int i = 0; i < distanceMatrix.Rows; i++) {
+        for (int j = 0; j < distanceMatrix.Columns; j++)
+          distanceMatrix[i, j] = CalculateDistance(c[i, 0], c[i, 1], c[j, 0], c[j, 1]);
+      }
+      return (DistanceMatrix)distanceMatrix.AsReadOnly();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveDistanceMatrixEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveDistanceMatrixEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveDistanceMatrixEvaluator.cs	(revision 16132)
@@ -0,0 +1,79 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate inversion moves (2-opt).
+  /// </summary>
+  [Item("TSPTranslocationMoveDistanceMatrixEvaluator", "Evaluates a translocation or insertion move (3-opt).")]
+  [StorableClass]
+  public class TSPTranslocationMoveDistanceMatrixEvaluator : TSPMoveEvaluator, IPermutationTranslocationMoveOperator {
+    public override Type EvaluatorType {
+      get { return typeof(TSPDistanceMatrixEvaluator); }
+    }
+
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
+      get { return (ILookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
+    }
+
+    [StorableConstructor]
+    protected TSPTranslocationMoveDistanceMatrixEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPTranslocationMoveDistanceMatrixEvaluator(TSPTranslocationMoveDistanceMatrixEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPTranslocationMoveDistanceMatrixEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPTranslocationMoveDistanceMatrixEvaluator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var permutation = PermutationParameter.ActualValue;
+      double relativeQualityDifference = 0;
+      var distanceMatrix = DistanceMatrixParameter.ActualValue;
+      if (distanceMatrix == null) throw new InvalidOperationException("The distance matrix is not given.");
+      var move = TranslocationMoveParameter.ActualValue;
+      relativeQualityDifference = TSPTranslocationMovePathEvaluator.EvaluateByDistanceMatrix(permutation, move, distanceMatrix);
+
+      var moveQuality = MoveQualityParameter.ActualValue;
+      if (moveQuality == null) MoveQualityParameter.ActualValue = new DoubleValue(QualityParameter.ActualValue.Value + relativeQualityDifference);
+      else moveQuality.Value = QualityParameter.ActualValue.Value + relativeQualityDifference;
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveEuclideanPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveEuclideanPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveEuclideanPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,51 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate translocation or insertion moves (3-opt).
+  /// </summary>
+  [Item("TSPTranslocationMoveEuclideanPathEvaluator", "Operator for evaluating a translocation or insertion move (3-opt) based on euclidean distances.")]
+  [StorableClass]
+  public class TSPTranslocationMoveEuclideanPathEvaluator : TSPTranslocationMovePathEvaluator {
+    [StorableConstructor]
+    protected TSPTranslocationMoveEuclideanPathEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPTranslocationMoveEuclideanPathEvaluator(TSPTranslocationMoveEuclideanPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPTranslocationMoveEuclideanPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPTranslocationMoveEuclideanPathEvaluator(this, cloner);
+    }
+    
+    public override Type EvaluatorType {
+      get { return typeof(TSPEuclideanPathEvaluator); }
+    }
+
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveGeoPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveGeoPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveGeoPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,81 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate translocation or insertion moves (3-opt).
+  /// </summary>
+  [Item("TSPTranslocationMoveGeoPathEvaluator", "Operator for evaluating a translocation or insertion move (3-opt) based on geo (world) distances.")]
+  [StorableClass]
+  public class TSPTranslocationMoveGeoPathEvaluator : TSPTranslocationMovePathEvaluator {
+    public override Type EvaluatorType {
+      get { return typeof(TSPGeoPathEvaluator); }
+    }
+
+    private const double PI = 3.141592;
+    private const double RADIUS = 6378.388;
+
+    [StorableConstructor]
+    protected TSPTranslocationMoveGeoPathEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPTranslocationMoveGeoPathEvaluator(TSPTranslocationMoveGeoPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPTranslocationMoveGeoPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPTranslocationMoveGeoPathEvaluator(this, cloner);
+    }
+    
+
+    /// <summary>
+    /// Calculates the distance between two points using the GEO distance metric (globe coordinates).
+    /// </summary>
+    /// <param name="x1">The x-coordinate of point 1.</param>
+    /// <param name="y1">The y-coordinate of point 1.</param>
+    /// <param name="x2">The x-coordinate of point 2.</param>
+    /// <param name="y2">The y-coordinate of point 2.</param>
+    /// <returns>The calculated distance.</returns>
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      double latitude1, longitude1, latitude2, longitude2;
+      double q1, q2, q3;
+      double length;
+
+      latitude1 = ConvertToRadian(x1);
+      longitude1 = ConvertToRadian(y1);
+      latitude2 = ConvertToRadian(x2);
+      longitude2 = ConvertToRadian(y2);
+
+      q1 = Math.Cos(longitude1 - longitude2);
+      q2 = Math.Cos(latitude1 - latitude2);
+      q3 = Math.Cos(latitude1 + latitude2);
+
+      length = (int)(RADIUS * Math.Acos(0.5 * ((1.0 + q1) * q2 - (1.0 - q1) * q3)) + 1.0);
+      return (length);
+    }
+
+    private double ConvertToRadian(double x) {
+      return PI * (Math.Truncate(x) + 5.0 * (x - Math.Truncate(x)) / 3.0) / 180.0;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMovePathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMovePathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMovePathEvaluator.cs	(revision 16132)
@@ -0,0 +1,120 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate a translocation or insertion move.
+  /// </summary>
+  [Item("TSPTranslocationMovePathEvaluator", "Evaluates a translocation or insertion move (3-opt) by summing up the length of all added edges and subtracting the length of all deleted edges.")]
+  [StorableClass]
+  public abstract class TSPTranslocationMovePathEvaluator : TSPPathMoveEvaluator, IPermutationTranslocationMoveOperator {
+    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
+      get { return (ILookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
+    }
+
+    [StorableConstructor]
+    protected TSPTranslocationMovePathEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPTranslocationMovePathEvaluator(TSPTranslocationMovePathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPTranslocationMovePathEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate."));
+    }
+
+    public static double EvaluateByCoordinates(Permutation permutation, TranslocationMove move, DoubleMatrix coordinates, TSPTranslocationMovePathEvaluator evaluator) {
+      if (move.Index1 == move.Index3
+        || move.Index2 == permutation.Length - 1 && move.Index3 == 0
+        || move.Index1 == 0 && move.Index3 == permutation.Length - 1 - move.Index2) return 0;
+
+      int edge1source = permutation.GetCircular(move.Index1 - 1);
+      int edge1target = permutation[move.Index1];
+      int edge2source = permutation[move.Index2];
+      int edge2target = permutation.GetCircular(move.Index2 + 1);
+      int edge3source, edge3target;
+      if (move.Index3 > move.Index1) {
+        edge3source = permutation.GetCircular(move.Index3 + move.Index2 - move.Index1);
+        edge3target = permutation.GetCircular(move.Index3 + move.Index2 - move.Index1 + 1);
+      } else {
+        edge3source = permutation.GetCircular(move.Index3 - 1);
+        edge3target = permutation[move.Index3];
+      }
+      double moveQuality = 0;
+      // remove three edges
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+        coordinates[edge1target, 0], coordinates[edge1target, 1]);
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge2source, 0], coordinates[edge2source, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge3source, 0], coordinates[edge3source, 1],
+        coordinates[edge3target, 0], coordinates[edge3target, 1]);
+      // add three edges
+      moveQuality += evaluator.CalculateDistance(coordinates[edge3source, 0], coordinates[edge3source, 1],
+        coordinates[edge1target, 0], coordinates[edge1target, 1]);
+      moveQuality += evaluator.CalculateDistance(coordinates[edge2source, 0], coordinates[edge2source, 1],
+        coordinates[edge3target, 0], coordinates[edge3target, 1]);
+      moveQuality += evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      return moveQuality;
+    }
+
+    public static double EvaluateByDistanceMatrix(Permutation permutation, TranslocationMove move, DistanceMatrix distanceMatrix) {
+      if (move.Index1 == move.Index3
+        || move.Index2 == permutation.Length - 1 && move.Index3 == 0
+        || move.Index1 == 0 && move.Index3 == permutation.Length - 1 - move.Index2) return 0;
+
+      int edge1source = permutation.GetCircular(move.Index1 - 1);
+      int edge1target = permutation[move.Index1];
+      int edge2source = permutation[move.Index2];
+      int edge2target = permutation.GetCircular(move.Index2 + 1);
+      int edge3source, edge3target;
+      if (move.Index3 > move.Index1) {
+        edge3source = permutation.GetCircular(move.Index3 + move.Index2 - move.Index1);
+        edge3target = permutation.GetCircular(move.Index3 + move.Index2 - move.Index1 + 1);
+      } else {
+        edge3source = permutation.GetCircular(move.Index3 - 1);
+        edge3target = permutation[move.Index3];
+      }
+      double moveQuality = 0;
+      // remove three edges
+      moveQuality -= distanceMatrix[edge1source, edge1target];
+      moveQuality -= distanceMatrix[edge2source, edge2target];
+      moveQuality -= distanceMatrix[edge3source, edge3target];
+      // add three edges
+      moveQuality += distanceMatrix[edge3source, edge1target];
+      moveQuality += distanceMatrix[edge2source, edge3target];
+      moveQuality += distanceMatrix[edge1source, edge2target];
+      return moveQuality;
+    }
+
+    protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates) {
+      return EvaluateByCoordinates(permutation, TranslocationMoveParameter.ActualValue, coordinates, this);
+    }
+
+    protected override double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix) {
+      return EvaluateByDistanceMatrix(permutation, TranslocationMoveParameter.ActualValue, distanceMatrix);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveRoundedEuclideanPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveRoundedEuclideanPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPTranslocationMoveRoundedEuclideanPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,51 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate translocation or insertion moves (3-opt).
+  /// </summary>
+  [Item("TSPTranslocationMoveRoundedEuclideanPathEvaluator", "Operator for evaluating a translocation or insertion move (3-opt) based on rounded euclidean distances.")]
+  [StorableClass]
+  public class TSPTranslocationMoveRoundedEuclideanPathEvaluator : TSPTranslocationMovePathEvaluator {
+    [StorableConstructor]
+    protected TSPTranslocationMoveRoundedEuclideanPathEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPTranslocationMoveRoundedEuclideanPathEvaluator(TSPTranslocationMoveRoundedEuclideanPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPTranslocationMoveRoundedEuclideanPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPTranslocationMoveRoundedEuclideanPathEvaluator(this, cloner);
+    }
+    
+    public override Type EvaluatorType {
+      get { return typeof(TSPRoundedEuclideanPathEvaluator); }
+    }
+
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Round(Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveDistanceMatrixEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveDistanceMatrixEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveDistanceMatrixEvaluator.cs	(revision 16132)
@@ -0,0 +1,79 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate inversion moves (2-opt).
+  /// </summary>
+  [Item("TSPInversionMoveDistanceMatrixEvaluator", "Evaluates an inversion move (2-opt) by summing up the length of all added edges and subtracting the length of all deleted edges.")]
+  [StorableClass]
+  public class TSPInversionMoveDistanceMatrixEvaluator : TSPMoveEvaluator, IPermutationInversionMoveOperator {
+    public override Type EvaluatorType {
+      get { return typeof(TSPDistanceMatrixEvaluator); }
+    }
+
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+    public ILookupParameter<InversionMove> InversionMoveParameter {
+      get { return (ILookupParameter<InversionMove>)Parameters["InversionMove"]; }
+    }
+
+    [StorableConstructor]
+    protected TSPInversionMoveDistanceMatrixEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPInversionMoveDistanceMatrixEvaluator(TSPInversionMoveDistanceMatrixEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPInversionMoveDistanceMatrixEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+      Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPInversionMoveDistanceMatrixEvaluator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var permutation = PermutationParameter.ActualValue;
+      double relativeQualityDifference = 0;
+      var distanceMatrix = DistanceMatrixParameter.ActualValue;
+      if (distanceMatrix == null) throw new InvalidOperationException("The distance matrix is not given.");
+      var move = InversionMoveParameter.ActualValue;
+      relativeQualityDifference = TSPInversionMovePathEvaluator.EvaluateByDistanceMatrix(permutation, move, distanceMatrix);
+
+      var moveQuality = MoveQualityParameter.ActualValue;
+      if (moveQuality == null) MoveQualityParameter.ActualValue = new DoubleValue(QualityParameter.ActualValue.Value + relativeQualityDifference);
+      else moveQuality.Value = QualityParameter.ActualValue.Value + relativeQualityDifference;
+      return base.Apply();
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveEuclideanPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveEuclideanPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveEuclideanPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,51 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate 2-opt moves.
+  /// </summary>
+  [Item("TSPInversionMoveEuclideanPathEvaluator", "Operator for evaluating an inversion move (2-opt) based on euclidean distances.")]
+  [StorableClass]
+  public class TSPInversionMoveEuclideanPathEvaluator : TSPInversionMovePathEvaluator {
+    [StorableConstructor]
+    protected TSPInversionMoveEuclideanPathEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPInversionMoveEuclideanPathEvaluator(TSPInversionMoveEuclideanPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPInversionMoveEuclideanPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPInversionMoveEuclideanPathEvaluator(this, cloner);
+    }
+    
+    public override Type EvaluatorType {
+      get { return typeof(TSPEuclideanPathEvaluator); }
+    }
+
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveGeoPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveGeoPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveGeoPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,80 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate inversion moves (2-opt).
+  /// </summary>
+  [Item("TSPInversionMoveGeoPathEvaluator", "Operator for evaluating an inversion move (2-opt) based on geo (world) distances.")]
+  [StorableClass]
+  public class TSPInversionMoveGeoPathEvaluator : TSPInversionMovePathEvaluator {
+    public override Type EvaluatorType {
+      get { return typeof(TSPGeoPathEvaluator); }
+    }
+
+    private const double PI = 3.141592;
+    private const double RADIUS = 6378.388;
+
+    [StorableConstructor]
+    protected TSPInversionMoveGeoPathEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPInversionMoveGeoPathEvaluator(TSPInversionMoveGeoPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPInversionMoveGeoPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPInversionMoveGeoPathEvaluator(this, cloner);
+    }
+    
+    /// <summary>
+    /// Calculates the distance between two points using the GEO distance metric (globe coordinates).
+    /// </summary>
+    /// <param name="x1">The x-coordinate of point 1.</param>
+    /// <param name="y1">The y-coordinate of point 1.</param>
+    /// <param name="x2">The x-coordinate of point 2.</param>
+    /// <param name="y2">The y-coordinate of point 2.</param>
+    /// <returns>The calculated distance.</returns>
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      double latitude1, longitude1, latitude2, longitude2;
+      double q1, q2, q3;
+      double length;
+
+      latitude1 = ConvertToRadian(x1);
+      longitude1 = ConvertToRadian(y1);
+      latitude2 = ConvertToRadian(x2);
+      longitude2 = ConvertToRadian(y2);
+
+      q1 = Math.Cos(longitude1 - longitude2);
+      q2 = Math.Cos(latitude1 - latitude2);
+      q3 = Math.Cos(latitude1 + latitude2);
+
+      length = (int)(RADIUS * Math.Acos(0.5 * ((1.0 + q1) * q2 - (1.0 - q1) * q3)) + 1.0);
+      return (length);
+    }
+
+    private double ConvertToRadian(double x) {
+      return PI * (Math.Truncate(x) + 5.0 * (x - Math.Truncate(x)) / 3.0) / 180.0;
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMovePathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMovePathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMovePathEvaluator.cs	(revision 16132)
@@ -0,0 +1,92 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate inversion moves (2-opt).
+  /// </summary>
+  [Item("TSPInversionMovePathEvaluator", "Evaluates an inversion move (2-opt) by summing up the length of all added edges and subtracting the length of all deleted edges.")]
+  [StorableClass]
+  public abstract class TSPInversionMovePathEvaluator : TSPPathMoveEvaluator, IPermutationInversionMoveOperator {
+    public ILookupParameter<InversionMove> InversionMoveParameter {
+      get { return (ILookupParameter<InversionMove>)Parameters["InversionMove"]; }
+    }
+
+    [StorableConstructor]
+    protected TSPInversionMovePathEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPInversionMovePathEvaluator(TSPInversionMovePathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPInversionMovePathEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate."));
+    }
+
+    public static double EvaluateByCoordinates(Permutation permutation, InversionMove move, DoubleMatrix coordinates, TSPInversionMovePathEvaluator evaluator) {
+      int edge1source = permutation.GetCircular(move.Index1 - 1);
+      int edge1target = permutation[move.Index1];
+      int edge2source = permutation[move.Index2];
+      int edge2target = permutation.GetCircular(move.Index2 + 1);
+      if (move.Index2 - move.Index1 >= permutation.Length - 2) return 0;
+      double moveQuality = 0;
+      // remove two edges
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+            coordinates[edge1target, 0], coordinates[edge1target, 1]);
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge2source, 0], coordinates[edge2source, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      // add two edges
+      moveQuality += evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+        coordinates[edge2source, 0], coordinates[edge2source, 1]);
+      moveQuality += evaluator.CalculateDistance(coordinates[edge1target, 0], coordinates[edge1target, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      return moveQuality;
+    }
+
+    public static double EvaluateByDistanceMatrix(Permutation permutation, InversionMove move, DistanceMatrix distanceMatrix) {
+      int edge1source = permutation.GetCircular(move.Index1 - 1);
+      int edge1target = permutation[move.Index1];
+      int edge2source = permutation[move.Index2];
+      int edge2target = permutation.GetCircular(move.Index2 + 1);
+      if (move.Index2 - move.Index1 >= permutation.Length - 2) return 0;
+      double moveQuality = 0;
+      // remove two edges
+      moveQuality -= distanceMatrix[edge1source, edge1target];
+      moveQuality -= distanceMatrix[edge2source, edge2target];
+      // add two edges
+      moveQuality += distanceMatrix[edge1source, edge2source];
+      moveQuality += distanceMatrix[edge1target, edge2target];
+      return moveQuality;
+    }
+
+    protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates) {
+      return EvaluateByCoordinates(permutation, InversionMoveParameter.ActualValue, coordinates, this);
+    }
+
+    protected override double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix) {
+      return EvaluateByDistanceMatrix(permutation, InversionMoveParameter.ActualValue, distanceMatrix);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveRoundedEuclideanPathEvaluator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveRoundedEuclideanPathEvaluator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TwoOpt/TSPInversionMoveRoundedEuclideanPathEvaluator.cs	(revision 16132)
@@ -0,0 +1,51 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman {
+  /// <summary>
+  /// An operator to evaluate inversion moves (2-opt).
+  /// </summary>
+  [Item("TSPInversionMoveRoundedEuclideanPathEvaluator", "Operator for evaluating an inversion move (2-opt) based on rounded euclidean distances.")]
+  [StorableClass]
+  public class TSPInversionMoveRoundedEuclideanPathEvaluator : TSPInversionMovePathEvaluator {
+    [StorableConstructor]
+    protected TSPInversionMoveRoundedEuclideanPathEvaluator(bool deserializing) : base(deserializing) { }
+    protected TSPInversionMoveRoundedEuclideanPathEvaluator(TSPInversionMoveRoundedEuclideanPathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public TSPInversionMoveRoundedEuclideanPathEvaluator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPInversionMoveRoundedEuclideanPathEvaluator(this, cloner);
+    }
+    
+    public override Type EvaluatorType {
+      get { return typeof(TSPRoundedEuclideanPathEvaluator); }
+    }
+
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Round(Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathRelinkers/TSPMultipleGuidesPathRelinker.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathRelinkers/TSPMultipleGuidesPathRelinker.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathRelinkers/TSPMultipleGuidesPathRelinker.cs	(revision 16132)
@@ -0,0 +1,134 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator that relinks paths between traveling salesman solutions using a multiple guiding strategy.
+  /// </summary>
+  /// <remarks>
+  /// The operator incrementally changes the initiating solution towards the guiding solution by correcting edges as needed. For each city it choses the best edge from all guiding solutions.
+  /// </remarks>
+  [Item("TSPMultipleGuidesPathRelinker", "An operator that relinks paths between traveling salesman solutions using a multiple guiding strategy. The operator incrementally changes the initiating solution towards the guiding solution by correcting edges as needed. For each city it choses the best edge from all guiding solutions.")]
+  [StorableClass]
+  public sealed class TSPMultipleGuidesPathRelinker : SingleObjectivePathRelinker {
+    #region Parameter properties
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+    #endregion
+
+    #region Properties
+    public DistanceMatrix DistanceMatrix {
+      get { return DistanceMatrixParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private TSPMultipleGuidesPathRelinker(bool deserializing) : base(deserializing) { }
+    private TSPMultipleGuidesPathRelinker(TSPMultipleGuidesPathRelinker original, Cloner cloner) : base(original, cloner) { }
+    public TSPMultipleGuidesPathRelinker()
+      : base() {
+      #region Create parameters
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+      #endregion
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPMultipleGuidesPathRelinker(this, cloner);
+    }
+
+    public static ItemArray<IItem> Apply(IItem initiator, IItem[] guides, DistanceMatrix distances, PercentValue n) {
+      if (!(initiator is Permutation) || guides.Any(x => !(x is Permutation)))
+        throw new ArgumentException("Cannot relink path because some of the provided solutions have the wrong type.");
+      if (n.Value <= 0.0)
+        throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
+
+      Permutation v1 = initiator.Clone() as Permutation;
+      Permutation[] targets = new Permutation[guides.Length];
+      Array.Copy(guides, targets, guides.Length);
+
+      if (targets.Any(x => x.Length != v1.Length))
+        throw new ArgumentException("At least one solution is of different length.");
+
+      IList<Permutation> solutions = new List<Permutation>();
+      for (int i = 0; i < v1.Length; i++) {
+        int currCityIndex = i;
+        int bestCityIndex = (i + 1) % v1.Length;
+        double currDistance = distances[v1[currCityIndex], v1[bestCityIndex]];
+        // check each guiding solution
+        targets.ToList().ForEach(solution => {
+          // locate current city
+          var node = solution.Select((x, index) => new { Id = x, Index = index }).Single(x => x.Id == v1[currCityIndex]);
+          int pred = solution[(node.Index - 1 + solution.Length) % solution.Length];
+          int succ = solution[(node.Index + 1) % solution.Length];
+          // get distances to neighbors
+          var results = new[] { pred, succ }.Select(x => new { Id = x, Distance = distances[x, node.Id] });
+          var bestCity = results.Where(x => x.Distance < currDistance).OrderBy(x => x.Distance).FirstOrDefault();
+          if (bestCity != null) {
+            bestCityIndex = v1.Select((x, index) => new { Id = x, Index = index }).Single(x => x.Id == bestCity.Id).Index;
+            currDistance = bestCity.Distance;
+          }
+        });
+        Invert(v1, currCityIndex + 1, bestCityIndex);
+        solutions.Add(v1.Clone() as Permutation);
+      }
+
+      IList<IItem> selection = new List<IItem>();
+      if (solutions.Count > 0) {
+        int noSol = (int)(solutions.Count * n.Value);
+        if (noSol <= 0) noSol++;
+        double stepSize = (double)solutions.Count / (double)noSol;
+        for (int i = 0; i < noSol; i++)
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
+      }
+
+      return new ItemArray<IItem>(selection);
+    }
+
+    private static void Invert(Permutation sol, int i, int j) {
+      if (i != j)
+        for (int a = 0; a < Math.Abs(i - j) / 2; a++)
+          if (sol[(i + a) % sol.Length] != sol[(j - a + sol.Length) % sol.Length]) {
+            // XOR swap
+            sol[(i + a) % sol.Length] ^= sol[(j - a + sol.Length) % sol.Length];
+            sol[(j - a + sol.Length) % sol.Length] ^= sol[(i + a) % sol.Length];
+            sol[(i + a) % sol.Length] ^= sol[(j - a + sol.Length) % sol.Length];
+          }
+    }
+
+    protected override ItemArray<IItem> Relink(ItemArray<IItem> parents, PercentValue n) {
+      if (parents.Length < 2)
+        throw new ArgumentException("The number of parents is smaller than 2.");
+      return Apply(parents[0], parents.Skip(1).ToArray(), DistanceMatrix, n);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathRelinkers/TSPPathRelinker.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathRelinkers/TSPPathRelinker.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathRelinkers/TSPPathRelinker.cs	(revision 16132)
@@ -0,0 +1,94 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator that relinks paths between traveling salesman solutions.
+  /// </summary>
+  /// <remarks>
+  /// The operator incrementally assimilates the initiating solution into the guiding solution by correcting edges as needed.
+  /// </remarks>
+  [Item("TSPPathRelinker", "An operator that relinks paths between traveling salesman solutions. The operator incrementally assimilates the initiating solution into the guiding solution by correcting edges as needed.")]
+  [StorableClass]
+  public sealed class TSPPathRelinker : SingleObjectivePathRelinker {
+    [StorableConstructor]
+    private TSPPathRelinker(bool deserializing) : base(deserializing) { }
+    private TSPPathRelinker(TSPPathRelinker original, Cloner cloner) : base(original, cloner) { }
+    public TSPPathRelinker() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPPathRelinker(this, cloner);
+    }
+
+    public static ItemArray<IItem> Apply(IItem initiator, IItem guide, PercentValue n) {
+      if (!(initiator is Permutation) || !(guide is Permutation))
+        throw new ArgumentException("Cannot relink path because one of the provided solutions or both have the wrong type.");
+      if (n.Value <= 0.0)
+        throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
+
+      Permutation v1 = initiator.Clone() as Permutation;
+      Permutation v2 = guide as Permutation;
+
+      if (v1.Length != v2.Length)
+        throw new ArgumentException("The solutions are of different length.");
+
+      IList<Permutation> solutions = new List<Permutation>();
+      for (int i = 0; i < v1.Length; i++)
+        if (v1[i] != v2[i]) {
+          var target = v1.Select((x, index) => new { Value = x, ValueIndex = index }).First(x => x.Value == v2[i]);
+          if (v1[i] != v1[target.ValueIndex]) {
+            // XOR swap
+            v1[i] ^= v1[target.ValueIndex];
+            v1[target.ValueIndex] ^= v1[i];
+            v1[i] ^= v1[target.ValueIndex];
+            solutions.Add(v1.Clone() as Permutation);
+          }
+        }
+
+      IList<IItem> selection = new List<IItem>();
+      if (solutions.Count > 0) {
+        int noSol = (int)(solutions.Count * n.Value);
+        if (noSol <= 0) noSol++;
+        double stepSize = (double)solutions.Count / (double)noSol;
+        for (int i = 0; i < noSol; i++)
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
+      }
+
+      return new ItemArray<IItem>(selection);
+    }
+
+    protected override ItemArray<IItem> Relink(ItemArray<IItem> parents, PercentValue n) {
+      if (parents.Length != 2)
+        throw new ArgumentException("The number of parents is not equal to 2.");
+      return Apply(parents[0], parents[1], n);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathRelinkers/TSPSimultaneousPathRelinker.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathRelinkers/TSPSimultaneousPathRelinker.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathRelinkers/TSPSimultaneousPathRelinker.cs	(revision 16132)
@@ -0,0 +1,104 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator that relinks paths between traveling salesman solutions starting from both ends.
+  /// </summary>
+  /// <remarks>
+  /// The operator incrementally assimilates the initiating solution into the guiding solution and vice versa by correcting edges as needed.
+  /// </remarks>
+  [Item("TSPSimultaneousPathRelinker", "An operator that relinks paths between traveling salesman solutions starting from both ends. The operator incrementally assimilates the initiating solution into the guiding solution and vice versa by correcting edges as needed.")]
+  [StorableClass]
+  public sealed class TSPSimultaneousPathRelinker : SingleObjectivePathRelinker {
+    [StorableConstructor]
+    private TSPSimultaneousPathRelinker(bool deserializing) : base(deserializing) { }
+    private TSPSimultaneousPathRelinker(TSPSimultaneousPathRelinker original, Cloner cloner) : base(original, cloner) { }
+    public TSPSimultaneousPathRelinker() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPSimultaneousPathRelinker(this, cloner);
+    }
+
+    public static ItemArray<IItem> Apply(IItem initiator, IItem guide, PercentValue n) {
+      if (!(initiator is Permutation) || !(guide is Permutation))
+        throw new ArgumentException("Cannot relink path because one of the provided solutions or both have the wrong type.");
+      if (n.Value <= 0.0)
+        throw new ArgumentException("RelinkingAccuracy must be greater than 0.");
+
+      Permutation firstInitiator = initiator.Clone() as Permutation;
+      Permutation firstGuide = guide.Clone() as Permutation;
+      Permutation secondInitiator = firstGuide.Clone() as Permutation;
+      Permutation secondGuide = firstInitiator.Clone() as Permutation;
+
+      if (firstInitiator.Length != firstGuide.Length)
+        throw new ArgumentException("The solutions are of different length.");
+
+      IList<Permutation> solutions = new List<Permutation>();
+      for (int i = 0; i < firstInitiator.Length / 2; i++) {
+        if (firstInitiator[i] != firstGuide[i]) {
+          var target = firstInitiator.Select((x, index) => new { Value = x, ValueIndex = index }).First(x => x.Value == firstGuide[i]);
+          // XOR swap
+          firstInitiator[i] ^= firstInitiator[target.ValueIndex];
+          firstInitiator[target.ValueIndex] ^= firstInitiator[i];
+          firstInitiator[i] ^= firstInitiator[target.ValueIndex];
+          solutions.Add(firstInitiator.Clone() as Permutation);
+        }
+        int j = secondInitiator.Length - 1 - i;
+        if (secondInitiator[j] != secondGuide[j]) {
+          var target = secondInitiator.Select((x, index) => new { Value = x, ValueIndex = index }).First(x => x.Value == secondGuide[j]);
+          // XOR swap
+          secondInitiator[j] ^= secondInitiator[target.ValueIndex];
+          secondInitiator[target.ValueIndex] ^= secondInitiator[j];
+          secondInitiator[j] ^= secondInitiator[target.ValueIndex];
+          solutions.Add(secondInitiator.Clone() as Permutation);
+        }
+      }
+
+      IList<IItem> selection = new List<IItem>();
+      if (solutions.Count > 0) {
+        int noSol = (int)(solutions.Count * n.Value);
+        if (noSol <= 0) noSol++;
+        double stepSize = (double)solutions.Count / (double)noSol;
+        for (int i = 0; i < noSol; i++)
+          selection.Add(solutions.ElementAt((int)((i + 1) * stepSize - stepSize * 0.5)));
+      }
+
+      return new ItemArray<IItem>(selection);
+    }
+
+    protected override ItemArray<IItem> Relink(ItemArray<IItem> parents, PercentValue n) {
+      if (parents.Length != 2)
+        throw new ArgumentException("The number of parents is not equal to 2.");
+      return Apply(parents[0], parents[1], n);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathTSPTour.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathTSPTour.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/PathTSPTour.cs	(revision 16132)
@@ -0,0 +1,185 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// Represents a tour of a Traveling Salesman Problem given in path representation which can be visualized in the GUI.
+  /// </summary>
+  [Item("PathTSPTour", "Represents a tour of a Traveling Salesman Problem given in path representation which can be visualized in the GUI.")]
+  [StorableClass]
+  public sealed class PathTSPTour : Item {
+    public static new Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Image; }
+    }
+
+    [Storable]
+    private DoubleMatrix coordinates;
+    public DoubleMatrix Coordinates {
+      get { return coordinates; }
+      set {
+        if (coordinates != value) {
+          if (coordinates != null) DeregisterCoordinatesEvents();
+          coordinates = value;
+          if (coordinates != null) RegisterCoordinatesEvents();
+          OnCoordinatesChanged();
+        }
+      }
+    }
+    [Storable]
+    private Permutation permutation;
+    public Permutation Permutation {
+      get { return permutation; }
+      set {
+        if (permutation != value) {
+          if (permutation != null) DeregisterPermutationEvents();
+          permutation = value;
+          if (permutation != null) RegisterPermutationEvents();
+          OnPermutationChanged();
+        }
+      }
+    }
+    [Storable]
+    private DoubleValue quality;
+    public DoubleValue Quality {
+      get { return quality; }
+      set {
+        if (quality != value) {
+          if (quality != null) DeregisterQualityEvents();
+          quality = value;
+          if (quality != null) RegisterQualityEvents();
+          OnQualityChanged();
+        }
+      }
+    }
+
+    [StorableConstructor]
+    private PathTSPTour(bool deserializing) : base(deserializing) { }
+    private PathTSPTour(PathTSPTour original, Cloner cloner)
+      : base(original, cloner) {
+      this.coordinates = cloner.Clone(original.coordinates);
+      this.permutation = cloner.Clone(original.permutation);
+      this.quality = cloner.Clone(original.quality);
+      Initialize();
+    }
+    public PathTSPTour() : base() { }
+    public PathTSPTour(DoubleMatrix coordinates)
+      : base() {
+      this.coordinates = coordinates;
+      Initialize();
+    }
+    public PathTSPTour(DoubleMatrix coordinates, Permutation permutation)
+      : base() {
+      this.coordinates = coordinates;
+      this.permutation = permutation;
+      Initialize();
+    }
+    public PathTSPTour(DoubleMatrix coordinates, Permutation permutation, DoubleValue quality)
+      : base() {
+      this.coordinates = coordinates;
+      this.permutation = permutation;
+      this.quality = quality;
+      Initialize();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PathTSPTour(this, cloner);
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      Initialize();
+    }
+
+    private void Initialize() {
+      if (coordinates != null) RegisterCoordinatesEvents();
+      if (permutation != null) RegisterPermutationEvents();
+      if (quality != null) RegisterQualityEvents();
+    }
+
+    #region Events
+    public event EventHandler CoordinatesChanged;
+    private void OnCoordinatesChanged() {
+      var changed = CoordinatesChanged;
+      if (changed != null)
+        changed(this, EventArgs.Empty);
+    }
+    public event EventHandler PermutationChanged;
+    private void OnPermutationChanged() {
+      var changed = PermutationChanged;
+      if (changed != null)
+        changed(this, EventArgs.Empty);
+    }
+    public event EventHandler QualityChanged;
+    private void OnQualityChanged() {
+      var changed = QualityChanged;
+      if (changed != null)
+        changed(this, EventArgs.Empty);
+    }
+
+    private void RegisterCoordinatesEvents() {
+      Coordinates.ItemChanged += new EventHandler<EventArgs<int, int>>(Coordinates_ItemChanged);
+      Coordinates.Reset += new EventHandler(Coordinates_Reset);
+    }
+    private void DeregisterCoordinatesEvents() {
+      Coordinates.ItemChanged -= new EventHandler<EventArgs<int, int>>(Coordinates_ItemChanged);
+      Coordinates.Reset -= new EventHandler(Coordinates_Reset);
+    }
+    private void RegisterPermutationEvents() {
+      Permutation.ItemChanged += new EventHandler<EventArgs<int>>(Permutation_ItemChanged);
+      Permutation.Reset += new EventHandler(Permutation_Reset);
+    }
+    private void DeregisterPermutationEvents() {
+      Permutation.ItemChanged -= new EventHandler<EventArgs<int>>(Permutation_ItemChanged);
+      Permutation.Reset -= new EventHandler(Permutation_Reset);
+    }
+    private void RegisterQualityEvents() {
+      Quality.ValueChanged += new EventHandler(Quality_ValueChanged);
+    }
+    private void DeregisterQualityEvents() {
+      Quality.ValueChanged -= new EventHandler(Quality_ValueChanged);
+    }
+
+    private void Coordinates_ItemChanged(object sender, EventArgs<int, int> e) {
+      OnCoordinatesChanged();
+    }
+    private void Coordinates_Reset(object sender, EventArgs e) {
+      OnCoordinatesChanged();
+    }
+    private void Permutation_ItemChanged(object sender, EventArgs<int> e) {
+      OnPermutationChanged();
+    }
+    private void Permutation_Reset(object sender, EventArgs e) {
+      OnPermutationChanged();
+    }
+    private void Quality_ValueChanged(object sender, EventArgs e) {
+      OnQualityChanged();
+    }
+    #endregion
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Plugin.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Plugin.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Plugin.cs.frame	(revision 16132)
@@ -0,0 +1,45 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// Plugin class for HeuristicLab.Problems.TravelingSalesman plugin
+  /// </summary>
+  [Plugin("HeuristicLab.Problems.TravelingSalesman", "3.3.15.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.TravelingSalesman-3.3.dll", PluginFileType.Assembly)]
+  [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.PermutationEncoding", "3.3")]
+  [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.Instances", "3.3")]
+  public class HeuristicLabProblemsTravelingSalesmanPlugin : PluginBase {
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Properties/AssemblyInfo.cs.frame	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/Properties/AssemblyInfo.cs.frame	(revision 16132)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.TravelingSalesman")]
+[assembly: AssemblyDescription("HeuristicLab Traveling Salesman Problem classes")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 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("3c4c7e0d-ad0b-4e9b-8182-cd7498c7e55d")]
+
+// 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.15.$WCREV$")]
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs	(revision 16132)
@@ -0,0 +1,120 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PermutationEncoding;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  /// <summary>
+  /// An operator that performs similarity calculation between two traveling salesman solutions.
+  /// </summary>
+  /// <remarks>
+  /// The operator calculates the similarity based on the number of edges the two solutions have in common.
+  /// </remarks>
+  [Item("TSPSimilarityCalculator", "An operator that performs similarity calculation between two traveling salesman solutions. The operator calculates the similarity based on the number of edges the two solutions have in common.")]
+  [Obsolete("This operator is similar to the Hamming similarity calculator in the Encodings.PermutationEncoding namespace")]
+  [NonDiscoverableType]
+  internal sealed class TSPSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
+    protected override bool IsCommutative { get { return true; } }
+
+    private TSPSimilarityCalculator(bool deserializing) : base(deserializing) { }
+    private TSPSimilarityCalculator(TSPSimilarityCalculator original, Cloner cloner) : base(original, cloner) { }
+    public TSPSimilarityCalculator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TSPSimilarityCalculator(this, cloner);
+    }
+
+    public static double CalculateSimilarity(Permutation left, Permutation right) {
+      if (left == null || right == null)
+        throw new ArgumentException("Cannot calculate similarity because one of the provided solutions or both are null.");
+      if (left.PermutationType != right.PermutationType)
+        throw new ArgumentException("Cannot calculate similarity because the provided solutions have different types.");
+      if (left.Length != right.Length)
+        throw new ArgumentException("Cannot calculate similarity because the provided solutions have different lengths.");
+      if (object.ReferenceEquals(left, right)) return 1.0;
+
+      switch (left.PermutationType) {
+        case PermutationTypes.Absolute:
+          return CalculateAbsolute(left, right);
+        case PermutationTypes.RelativeDirected:
+          return CalculateRelativeDirected(left, right);
+        case PermutationTypes.RelativeUndirected:
+          return CalculateRelativeUndirected(left, right);
+        default:
+          throw new InvalidOperationException("unknown permutation type");
+      }
+    }
+
+    private static double CalculateAbsolute(Permutation left, Permutation right) {
+      double similarity = 0.0;
+      for (int i = 0; i < left.Length; i++)
+        if (left[i] == right[i]) similarity++;
+
+      return similarity / left.Length;
+    }
+
+    private static double CalculateRelativeDirected(Permutation left, Permutation right) {
+      int[] edgesR = CalculateEdgesVector(right);
+      int[] edgesL = CalculateEdgesVector(left);
+
+      double similarity = 0.0;
+      for (int i = 0; i < left.Length; i++) {
+        if (edgesL[i] == edgesR[i]) similarity++;
+      }
+
+      return similarity / left.Length;
+    }
+
+    private static double CalculateRelativeUndirected(Permutation left, Permutation right) {
+      int[] edgesR = CalculateEdgesVector(right);
+      int[] edgesL = CalculateEdgesVector(left);
+
+      double similarity = 0.0;
+      for (int i = 0; i < left.Length; i++) {
+        if ((edgesL[i] == edgesR[i]) || (edgesL[edgesR[i]] == i))
+          similarity++;
+      }
+
+      return similarity / left.Length;
+    }
+
+    private static int[] CalculateEdgesVector(Permutation permutation) {
+      // transform path representation into adjacency representation
+      int[] edgesVector = new int[permutation.Length];
+      for (int i = 0; i < permutation.Length - 1; i++)
+        edgesVector[permutation[i]] = permutation[i + 1];
+      edgesVector[permutation[permutation.Length - 1]] = permutation[0];
+      return edgesVector;
+    }
+
+    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
+      var sol1 = leftSolution.Variables[SolutionVariableName].Value as Permutation;
+      var sol2 = rightSolution.Variables[SolutionVariableName].Value as Permutation;
+
+      return CalculateSimilarity(sol1, sol2);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs	(revision 16132)
@@ -0,0 +1,496 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Problems.Instances;
+using HeuristicLab.Problems.TravelingSalesman.Analyzers;
+
+namespace HeuristicLab.Problems.TravelingSalesman {
+  [Item("Traveling Salesman Problem (TSP)", "Represents a symmetric Traveling Salesman Problem.")]
+  [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 100)]
+  [StorableClass]
+  public sealed class TravelingSalesmanProblem : SingleObjectiveHeuristicOptimizationProblem<ITSPEvaluator, IPermutationCreator>, IStorableContent,
+    IProblemInstanceConsumer<TSPData> {
+    private static readonly int DistanceMatrixSizeLimit = 1000;
+    public string Filename { get; set; }
+
+    #region Parameter Properties
+    public OptionalValueParameter<DoubleMatrix> CoordinatesParameter {
+      get { return (OptionalValueParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    }
+    public OptionalValueParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (OptionalValueParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+    public ValueParameter<BoolValue> UseDistanceMatrixParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
+    }
+    public OptionalValueParameter<Permutation> BestKnownSolutionParameter {
+      get { return (OptionalValueParameter<Permutation>)Parameters["BestKnownSolution"]; }
+    }
+    #endregion
+
+    #region Properties
+    public DoubleMatrix Coordinates {
+      get { return CoordinatesParameter.Value; }
+      set { CoordinatesParameter.Value = value; }
+    }
+    public DistanceMatrix DistanceMatrix {
+      get { return DistanceMatrixParameter.Value; }
+      set { DistanceMatrixParameter.Value = value; }
+    }
+    public BoolValue UseDistanceMatrix {
+      get { return UseDistanceMatrixParameter.Value; }
+      set { UseDistanceMatrixParameter.Value = value; }
+    }
+    public Permutation BestKnownSolution {
+      get { return BestKnownSolutionParameter.Value; }
+      set { BestKnownSolutionParameter.Value = value; }
+    }
+    private BestTSPSolutionAnalyzer BestTSPSolutionAnalyzer {
+      get { return Operators.OfType<BestTSPSolutionAnalyzer>().FirstOrDefault(); }
+    }
+    private TSPAlleleFrequencyAnalyzer TSPAlleleFrequencyAnalyzer {
+      get { return Operators.OfType<TSPAlleleFrequencyAnalyzer>().FirstOrDefault(); }
+    }
+
+    private TSPGenealogyAnalyzer TSPGenealogyAnalyzer {
+      get { return Operators.OfType<TSPGenealogyAnalyzer>().FirstOrDefault(); }
+    }
+    private IPermutationCrossover TSPCrossover {
+      get { return Operators.OfType<IPermutationCrossover>().FirstOrDefault(); }
+    }
+
+    private IPermutationManipulator TSPManipulator {
+      get { return Operators.OfType<IPermutationManipulator>().FirstOrDefault(); }
+    }
+    #endregion
+
+    // BackwardsCompatibility3.3
+    #region Backwards compatible code, remove with 3.4
+    [Obsolete]
+    [Storable(Name = "operators")]
+    private IEnumerable<IOperator> oldOperators {
+      get { return null; }
+      set {
+        if (value != null && value.Any())
+          Operators.AddRange(value);
+      }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private TravelingSalesmanProblem(bool deserializing) : base(deserializing) { }
+    private TravelingSalesmanProblem(TravelingSalesmanProblem original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterEventHandlers();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new TravelingSalesmanProblem(this, cloner);
+    }
+    public TravelingSalesmanProblem()
+      : base(new TSPRoundedEuclideanPathEvaluator(), new RandomPermutationCreator()) {
+      Parameters.Add(new OptionalValueParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
+      Parameters.Add(new OptionalValueParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+      Parameters.Add(new ValueParameter<BoolValue>("UseDistanceMatrix", "True if the coordinates based evaluators should calculate the distance matrix from the coordinates and use it for evaluation similar to the distance matrix evaluator, otherwise false.", new BoolValue(true)));
+      Parameters.Add(new OptionalValueParameter<Permutation>("BestKnownSolution", "The best known solution of this TSP instance."));
+
+      Maximization.Value = false;
+      MaximizationParameter.Hidden = true;
+      UseDistanceMatrixParameter.Hidden = true;
+      DistanceMatrixParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false;
+
+      Coordinates = new DoubleMatrix(new double[,] {
+        { 100, 100 }, { 100, 200 }, { 100, 300 }, { 100, 400 },
+        { 200, 100 }, { 200, 200 }, { 200, 300 }, { 200, 400 },
+        { 300, 100 }, { 300, 200 }, { 300, 300 }, { 300, 400 },
+        { 400, 100 }, { 400, 200 }, { 400, 300 }, { 400, 400 }
+      });
+
+      SolutionCreator.PermutationParameter.ActualName = "TSPTour";
+      Evaluator.QualityParameter.ActualName = "TSPTourLength";
+      ParameterizeSolutionCreator();
+      ParameterizeEvaluator();
+
+      InitializeOperators();
+      RegisterEventHandlers();
+    }
+
+    #region Events
+    protected override void OnSolutionCreatorChanged() {
+      base.OnSolutionCreatorChanged();
+      SolutionCreator.PermutationParameter.ActualNameChanged += new EventHandler(SolutionCreator_PermutationParameter_ActualNameChanged);
+      ParameterizeSolutionCreator();
+      ParameterizeEvaluator();
+      ParameterizeAnalyzers();
+      ParameterizeOperators();
+    }
+    protected override void OnEvaluatorChanged() {
+      base.OnEvaluatorChanged();
+      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      ParameterizeEvaluator();
+      ParameterizeSolutionCreator();
+      UpdateMoveEvaluators();
+      ParameterizeAnalyzers();
+      if (Evaluator is ITSPCoordinatesPathEvaluator && Coordinates != null)
+        ClearDistanceMatrix();
+    }
+    private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) {
+      if (Coordinates != null) {
+        Coordinates.ItemChanged += new EventHandler<EventArgs<int, int>>(Coordinates_ItemChanged);
+        Coordinates.Reset += new EventHandler(Coordinates_Reset);
+      }
+      if (Evaluator is ITSPCoordinatesPathEvaluator) {
+        ParameterizeSolutionCreator();
+        ClearDistanceMatrix();
+      }
+    }
+    private void Coordinates_ItemChanged(object sender, EventArgs<int, int> e) {
+      if (Evaluator is ITSPCoordinatesPathEvaluator) {
+        ClearDistanceMatrix();
+      }
+    }
+    private void Coordinates_Reset(object sender, EventArgs e) {
+      if (Evaluator is ITSPCoordinatesPathEvaluator) {
+        ParameterizeSolutionCreator();
+        ClearDistanceMatrix();
+      }
+    }
+    private void SolutionCreator_PermutationParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeEvaluator();
+      ParameterizeAnalyzers();
+      ParameterizeOperators();
+    }
+    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeAnalyzers();
+    }
+    #endregion
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code (remove with 3.4)
+      OptionalValueParameter<DoubleMatrix> oldDistanceMatrixParameter = Parameters["DistanceMatrix"] as OptionalValueParameter<DoubleMatrix>;
+      if (oldDistanceMatrixParameter != null) {
+        Parameters.Remove(oldDistanceMatrixParameter);
+        Parameters.Add(new OptionalValueParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
+        DistanceMatrixParameter.GetsCollected = oldDistanceMatrixParameter.GetsCollected;
+        DistanceMatrixParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false;
+        if (oldDistanceMatrixParameter.Value != null) {
+          DoubleMatrix oldDM = oldDistanceMatrixParameter.Value;
+          DistanceMatrix newDM = new DistanceMatrix(oldDM.Rows, oldDM.Columns, oldDM.ColumnNames, oldDM.RowNames);
+          newDM.SortableView = oldDM.SortableView;
+          for (int i = 0; i < newDM.Rows; i++)
+            for (int j = 0; j < newDM.Columns; j++)
+              newDM[i, j] = oldDM[i, j];
+          DistanceMatrixParameter.Value = (DistanceMatrix)newDM.AsReadOnly();
+        }
+      }
+
+      ValueParameter<DoubleMatrix> oldCoordinates = (Parameters["Coordinates"] as ValueParameter<DoubleMatrix>);
+      if (oldCoordinates != null) {
+        Parameters.Remove(oldCoordinates);
+        Parameters.Add(new OptionalValueParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities.", oldCoordinates.Value, oldCoordinates.GetsCollected));
+      }
+
+      if (Operators.Count == 0) InitializeOperators();
+      #endregion
+      RegisterEventHandlers();
+    }
+
+    private void RegisterEventHandlers() {
+      CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged);
+      if (Coordinates != null) {
+        Coordinates.ItemChanged += new EventHandler<EventArgs<int, int>>(Coordinates_ItemChanged);
+        Coordinates.Reset += new EventHandler(Coordinates_Reset);
+      }
+      SolutionCreator.PermutationParameter.ActualNameChanged += new EventHandler(SolutionCreator_PermutationParameter_ActualNameChanged);
+      Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+    }
+
+    private void InitializeOperators() {
+      Operators.Add(new TSPImprovementOperator());
+      Operators.Add(new TSPMultipleGuidesPathRelinker());
+      Operators.Add(new TSPPathRelinker());
+      Operators.Add(new TSPSimultaneousPathRelinker());
+
+      Operators.Add(new HammingSimilarityCalculator());
+      Operators.Add(new QualitySimilarityCalculator());
+      Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>()));
+
+      Operators.Add(new BestTSPSolutionAnalyzer());
+      Operators.Add(new TSPAlleleFrequencyAnalyzer());
+      Operators.Add(new TSPGenealogyAnalyzer());
+      ParameterizeAnalyzers();
+      var operators = new HashSet<IPermutationOperator>(new IPermutationOperator[] {
+        new OrderCrossover2(),
+        new InversionManipulator(),
+        new StochasticInversionMultiMoveGenerator()
+      }, new TypeEqualityComparer<IPermutationOperator>());
+      foreach (var op in ApplicationManager.Manager.GetInstances<IPermutationOperator>())
+        operators.Add(op);
+      Operators.AddRange(operators);
+      ParameterizeOperators();
+      UpdateMoveEvaluators();
+    }
+    private void UpdateMoveEvaluators() {
+      Operators.RemoveAll(x => x is ISingleObjectiveMoveEvaluator);
+      foreach (var op in ApplicationManager.Manager.GetInstances<ITSPMoveEvaluator>())
+        if (op.EvaluatorType == Evaluator.GetType()) {
+          Operators.Add(op);
+        }
+      ParameterizeOperators();
+      OnOperatorsChanged();
+    }
+    private void ParameterizeSolutionCreator() {
+      if (Evaluator is ITSPDistanceMatrixEvaluator && DistanceMatrix != null)
+        SolutionCreator.LengthParameter.Value = new IntValue(DistanceMatrix.Rows);
+      else if (Evaluator is ITSPCoordinatesPathEvaluator && Coordinates != null)
+        SolutionCreator.LengthParameter.Value = new IntValue(Coordinates.Rows);
+      else {
+        SolutionCreator.LengthParameter.Value = null;
+        string error = "The given problem does not support the selected evaluator.";
+        if (Evaluator is ITSPDistanceMatrixEvaluator)
+          error += Environment.NewLine + "Please review that the " + DistanceMatrixParameter.Name + " parameter is defined or choose another evaluator.";
+        else error += Environment.NewLine + "Please review that the " + CoordinatesParameter.Name + " parameter is defined or choose another evaluator.";
+        PluginInfrastructure.ErrorHandling.ShowErrorDialog(error, null);
+      }
+      SolutionCreator.LengthParameter.Hidden = SolutionCreator.LengthParameter.Value != null;
+      SolutionCreator.PermutationTypeParameter.Value = new PermutationType(PermutationTypes.RelativeUndirected);
+      SolutionCreator.PermutationTypeParameter.Hidden = true;
+    }
+    private void ParameterizeEvaluator() {
+      if (Evaluator is ITSPPathEvaluator) {
+        ITSPPathEvaluator evaluator = (ITSPPathEvaluator)Evaluator;
+        evaluator.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        evaluator.PermutationParameter.Hidden = true;
+      }
+      if (Evaluator is ITSPCoordinatesPathEvaluator) {
+        ITSPCoordinatesPathEvaluator evaluator = (ITSPCoordinatesPathEvaluator)Evaluator;
+        evaluator.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
+        evaluator.CoordinatesParameter.Hidden = true;
+        evaluator.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
+        evaluator.DistanceMatrixParameter.Hidden = true;
+        evaluator.UseDistanceMatrixParameter.ActualName = UseDistanceMatrixParameter.Name;
+        evaluator.UseDistanceMatrixParameter.Hidden = true;
+      }
+      if (Evaluator is ITSPDistanceMatrixEvaluator) {
+        var evaluator = (ITSPDistanceMatrixEvaluator)Evaluator;
+        evaluator.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
+        evaluator.DistanceMatrixParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeAnalyzers() {
+      if (BestTSPSolutionAnalyzer != null) {
+        BestTSPSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        BestTSPSolutionAnalyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
+        BestTSPSolutionAnalyzer.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        BestTSPSolutionAnalyzer.ResultsParameter.ActualName = "Results";
+        BestTSPSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
+        BestTSPSolutionAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
+        BestTSPSolutionAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      }
+
+      if (TSPAlleleFrequencyAnalyzer != null) {
+        TSPAlleleFrequencyAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
+        TSPAlleleFrequencyAnalyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
+        TSPAlleleFrequencyAnalyzer.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
+        TSPAlleleFrequencyAnalyzer.SolutionParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        TSPAlleleFrequencyAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        TSPAlleleFrequencyAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
+        TSPAlleleFrequencyAnalyzer.ResultsParameter.ActualName = "Results";
+      }
+
+    }
+    private void ParameterizeOperators() {
+      foreach (IPermutationCrossover op in Operators.OfType<IPermutationCrossover>()) {
+        op.ParentsParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        op.ParentsParameter.Hidden = true;
+        op.ChildParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        op.ChildParameter.Hidden = true;
+      }
+      foreach (IPermutationManipulator op in Operators.OfType<IPermutationManipulator>()) {
+        op.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        op.PermutationParameter.Hidden = true;
+      }
+      foreach (IPermutationMoveOperator op in Operators.OfType<IPermutationMoveOperator>()) {
+        op.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        op.PermutationParameter.Hidden = true;
+      }
+      foreach (ITSPPathMoveEvaluator op in Operators.OfType<ITSPPathMoveEvaluator>()) {
+        op.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
+        op.CoordinatesParameter.Hidden = true;
+        op.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
+        op.DistanceMatrixParameter.Hidden = true;
+        op.UseDistanceMatrixParameter.ActualName = UseDistanceMatrixParameter.Name;
+        op.UseDistanceMatrixParameter.Hidden = true;
+        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        op.QualityParameter.Hidden = true;
+        op.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        op.PermutationParameter.Hidden = true;
+      }
+      foreach (IPermutationMultiNeighborhoodShakingOperator op in Operators.OfType<IPermutationMultiNeighborhoodShakingOperator>()) {
+        op.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        op.PermutationParameter.Hidden = true;
+      }
+      foreach (ISingleObjectiveImprovementOperator op in Operators.OfType<ISingleObjectiveImprovementOperator>()) {
+        op.SolutionParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        op.SolutionParameter.Hidden = true;
+      }
+      foreach (ISingleObjectivePathRelinker op in Operators.OfType<ISingleObjectivePathRelinker>()) {
+        op.ParentsParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        op.ParentsParameter.Hidden = true;
+      }
+      foreach (ISolutionSimilarityCalculator op in Operators.OfType<ISolutionSimilarityCalculator>()) {
+        op.SolutionVariableName = SolutionCreator.PermutationParameter.ActualName;
+        op.QualityVariableName = Evaluator.QualityParameter.ActualName;
+      }
+      if (TSPGenealogyAnalyzer != null) {
+        if (TSPCrossover != null) {
+          TSPGenealogyAnalyzer.BeforeCrossoverOperatorParameter.ActualValue = new BeforeCrossoverOperator<Permutation>();
+          TSPGenealogyAnalyzer.BeforeCrossoverOperator.ParentsParameter.ActualName = TSPCrossover.ParentsParameter.ActualName;
+          TSPGenealogyAnalyzer.BeforeCrossoverOperator.ChildParameter.ActualName = TSPCrossover.ChildParameter.ActualName;
+          TSPGenealogyAnalyzer.AfterCrossoverOperatorParameter.ActualValue = new AfterCrossoverOperator<Permutation>();
+          TSPGenealogyAnalyzer.AfterCrossoverOperator.ParentsParameter.ActualName = TSPCrossover.ParentsParameter.ActualName;
+          TSPGenealogyAnalyzer.AfterCrossoverOperator.ChildParameter.ActualName = TSPCrossover.ChildParameter.ActualName;
+        }
+        if (TSPManipulator != null) {
+          TSPGenealogyAnalyzer.BeforeManipulatorOperatorParameter.ActualValue = new BeforeManipulatorOperator<Permutation>();
+          TSPGenealogyAnalyzer.BeforeManipulatorOperator.ChildParameter.ActualName = TSPManipulator.PermutationParameter.ActualName;
+          TSPGenealogyAnalyzer.AfterManipulatorOperatorParameter.ActualValue = new AfterManipulatorOperator<Permutation>();
+          TSPGenealogyAnalyzer.AfterManipulatorOperator.ChildParameter.ActualName = TSPManipulator.PermutationParameter.ActualName;
+        }
+        TSPGenealogyAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        if (Evaluator is ITSPPathEvaluator) {
+          TSPGenealogyAnalyzer.PopulationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
+        } else {
+          throw new Exception("Unknown Evaluator. Could not parameterize genealogy analyzer.");
+        }
+      }
+    }
+
+    private void ClearDistanceMatrix() {
+      DistanceMatrixParameter.Value = null;
+    }
+    #endregion
+
+    public void Load(TSPData data) {
+      if (data.Coordinates == null && data.Distances == null)
+        throw new System.IO.InvalidDataException("The given instance specifies neither coordinates nor distances!");
+      if (data.Dimension > DistanceMatrixSizeLimit && (data.DistanceMeasure == DistanceMeasure.Att
+        || data.DistanceMeasure == DistanceMeasure.Manhattan
+        || data.DistanceMeasure == DistanceMeasure.Maximum))
+        throw new System.IO.InvalidDataException("The given instance uses an unsupported distance measure and is too large for using a distance matrix.");
+      if (data.Coordinates != null && data.Coordinates.GetLength(1) != 2)
+        throw new System.IO.InvalidDataException("The coordinates of the given instance are not in the right format, there need to be one row for each customer and two columns for the x and y coordinates.");
+
+      Name = data.Name;
+      Description = data.Description;
+
+      bool clearCoordinates = false, clearDistanceMatrix = false;
+      if (data.Coordinates != null && data.Coordinates.GetLength(0) > 0)
+        Coordinates = new DoubleMatrix(data.Coordinates);
+      else clearCoordinates = true;
+
+      TSPEvaluator evaluator;
+      if (data.DistanceMeasure == DistanceMeasure.Att
+        || data.DistanceMeasure == DistanceMeasure.Manhattan
+        || data.DistanceMeasure == DistanceMeasure.Maximum) {
+        evaluator = new TSPDistanceMatrixEvaluator();
+        UseDistanceMatrix = new BoolValue(true);
+        DistanceMatrix = new DistanceMatrix(data.GetDistanceMatrix());
+      } else if (data.DistanceMeasure == DistanceMeasure.Direct && data.Distances != null) {
+        evaluator = new TSPDistanceMatrixEvaluator();
+        UseDistanceMatrix = new BoolValue(true);
+        DistanceMatrix = new DistanceMatrix(data.Distances);
+      } else {
+        clearDistanceMatrix = true;
+        UseDistanceMatrix = new BoolValue(data.Dimension <= DistanceMatrixSizeLimit);
+        switch (data.DistanceMeasure) {
+          case DistanceMeasure.Euclidean:
+            evaluator = new TSPEuclideanPathEvaluator();
+            break;
+          case DistanceMeasure.RoundedEuclidean:
+            evaluator = new TSPRoundedEuclideanPathEvaluator();
+            break;
+          case DistanceMeasure.UpperEuclidean:
+            evaluator = new TSPUpperEuclideanPathEvaluator();
+            break;
+          case DistanceMeasure.Geo:
+            evaluator = new TSPGeoPathEvaluator();
+            break;
+          default:
+            throw new InvalidDataException("An unknown distance measure is given in the instance!");
+        }
+      }
+      evaluator.QualityParameter.ActualName = "TSPTourLength";
+      Evaluator = evaluator;
+
+      // reset them after assigning the evaluator
+      if (clearCoordinates) Coordinates = null;
+      if (clearDistanceMatrix) DistanceMatrix = null;
+
+      BestKnownSolution = null;
+      BestKnownQuality = null;
+
+      if (data.BestKnownTour != null) {
+        try {
+          EvaluateAndLoadTour(data.BestKnownTour);
+        } catch (InvalidOperationException) {
+          if (data.BestKnownQuality.HasValue)
+            BestKnownQuality = new DoubleValue(data.BestKnownQuality.Value);
+        }
+      } else if (data.BestKnownQuality.HasValue) {
+        BestKnownQuality = new DoubleValue(data.BestKnownQuality.Value);
+      }
+      OnReset();
+    }
+
+    public void EvaluateAndLoadTour(int[] tour) {
+      var route = new Permutation(PermutationTypes.RelativeUndirected, tour);
+      BestKnownSolution = route;
+
+      double quality;
+      if (Evaluator is ITSPDistanceMatrixEvaluator) {
+        quality = TSPDistanceMatrixEvaluator.Apply(DistanceMatrix, route);
+      } else if (Evaluator is ITSPCoordinatesPathEvaluator) {
+        quality = TSPCoordinatesPathEvaluator.Apply((TSPCoordinatesPathEvaluator)Evaluator, Coordinates, route);
+      } else {
+        throw new InvalidOperationException("Cannot calculate solution quality, evaluator type is unknown.");
+      }
+      BestKnownQuality = new DoubleValue(quality);
+    }
+  }
+}
Index: /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Tracking.sln
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Tracking.sln	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Tracking.sln	(revision 16132)
@@ -0,0 +1,191 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.31101.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C80F4C35-CB87-4695-8A53-6F2D08275253}"
+	ProjectSection(SolutionItems) = preProject
+		Build.cmd = Build.cmd
+		HeuristicLab.Tracking.vsmdi = HeuristicLab.Tracking.vsmdi
+		Local.testsettings = Local.testsettings
+		Performance1.psess = Performance1.psess
+		Performance2.psess = Performance2.psess
+		Performance3.psess = Performance3.psess
+		PreBuildEvent.cmd = PreBuildEvent.cmd
+		TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
+	EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4", "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj", "{06D4A186-9319-48A0-BADE-A2058D462EEA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4", "HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj", "{423BD94F-963A-438E-BA45-3BB3D61CD03B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.EvolutionTracking-3.4", "HeuristicLab.EvolutionTracking\3.4\HeuristicLab.EvolutionTracking-3.4.csproj", "{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.EvolutionTracking.Views-3.4", "HeuristicLab.EvolutionTracking.Views\3.4\HeuristicLab.EvolutionTracking.Views-3.4.csproj", "{318DFE8C-CA23-4F1B-A4AC-62B425060241}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj", "{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic.Views\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj", "{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.TravelingSalesman-3.3", "HeuristicLab.Problems.TravelingSalesman\3.3\HeuristicLab.Problems.TravelingSalesman-3.3.csproj", "{D767C38D-8014-46B0-9A32-03A3AECCE34A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.TravelingSalesman.Views-3.3", "HeuristicLab.Problems.TravelingSalesman.Views\3.3\HeuristicLab.Problems.TravelingSalesman.Views-3.3.csproj", "{CDA28124-ACD0-4231-8EB0-C510B361F84E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.EvolutionTracking.Tests", "HeuristicLab.EvolutionTracking.Tests\HeuristicLab.EvolutionTracking.Tests.csproj", "{F065C97D-A66B-401C-AD1B-78D59E14BEDA}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|Mixed Platforms = Debug|Mixed Platforms
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|Mixed Platforms = Release|Mixed Platforms
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Debug|x64.ActiveCfg = Debug|x64
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Debug|x64.Build.0 = Debug|x64
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Debug|x86.ActiveCfg = Debug|x86
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Debug|x86.Build.0 = Debug|x86
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Release|Mixed Platforms.Build.0 = Release|x86
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Release|x64.ActiveCfg = Release|x64
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Release|x64.Build.0 = Release|x64
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Release|x86.ActiveCfg = Release|x86
+		{06D4A186-9319-48A0-BADE-A2058D462EEA}.Release|x86.Build.0 = Release|x86
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Debug|x64.ActiveCfg = Debug|x64
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Debug|x64.Build.0 = Debug|x64
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Debug|x86.ActiveCfg = Debug|x86
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Debug|x86.Build.0 = Debug|x86
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Release|Mixed Platforms.Build.0 = Release|x86
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Release|x64.ActiveCfg = Release|x64
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Release|x64.Build.0 = Release|x64
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Release|x86.ActiveCfg = Release|x86
+		{423BD94F-963A-438E-BA45-3BB3D61CD03B}.Release|x86.Build.0 = Release|x86
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Debug|x64.ActiveCfg = Debug|x64
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Debug|x64.Build.0 = Debug|x64
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Release|x64.ActiveCfg = Release|x64
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Release|x64.Build.0 = Release|x64
+		{1F75CEA3-464F-4A6F-B2F0-04B9841EBC16}.Release|x86.ActiveCfg = Release|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Debug|x64.ActiveCfg = Debug|x64
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Debug|x64.Build.0 = Debug|x64
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Release|Any CPU.Build.0 = Release|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Release|x64.ActiveCfg = Release|x64
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Release|x64.Build.0 = Release|x64
+		{318DFE8C-CA23-4F1B-A4AC-62B425060241}.Release|x86.ActiveCfg = Release|Any CPU
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x64.ActiveCfg = Debug|x64
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x64.Build.0 = Debug|x64
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x86.ActiveCfg = Debug|x86
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x86.Build.0 = Debug|x86
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Any CPU.Build.0 = Release|Any CPU
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Mixed Platforms.Build.0 = Release|x86
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x64.ActiveCfg = Release|x64
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x64.Build.0 = Release|x64
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x86.ActiveCfg = Release|x86
+		{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x86.Build.0 = Release|x86
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Debug|x64.ActiveCfg = Debug|x64
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Debug|x64.Build.0 = Debug|x64
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Debug|x86.ActiveCfg = Debug|x86
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Debug|x86.Build.0 = Debug|x86
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|Mixed Platforms.Build.0 = Release|x86
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|x64.ActiveCfg = Release|x64
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|x64.Build.0 = Release|x64
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|x86.ActiveCfg = Release|x86
+		{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|x86.Build.0 = Release|x86
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Debug|x64.ActiveCfg = Debug|x64
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Debug|x64.Build.0 = Debug|x64
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Debug|x86.ActiveCfg = Debug|x86
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Debug|x86.Build.0 = Debug|x86
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Release|Mixed Platforms.Build.0 = Release|x86
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Release|x64.ActiveCfg = Release|x64
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Release|x64.Build.0 = Release|x64
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Release|x86.ActiveCfg = Release|x86
+		{D767C38D-8014-46B0-9A32-03A3AECCE34A}.Release|x86.Build.0 = Release|x86
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Debug|x64.ActiveCfg = Debug|x64
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Debug|x64.Build.0 = Debug|x64
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Debug|x86.ActiveCfg = Debug|x86
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Debug|x86.Build.0 = Debug|x86
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Release|Mixed Platforms.Build.0 = Release|x86
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Release|x64.ActiveCfg = Release|x64
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Release|x64.Build.0 = Release|x64
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Release|x86.ActiveCfg = Release|x86
+		{CDA28124-ACD0-4231-8EB0-C510B361F84E}.Release|x86.Build.0 = Release|x86
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Release|x64.ActiveCfg = Release|Any CPU
+		{F065C97D-A66B-401C-AD1B-78D59E14BEDA}.Release|x86.ActiveCfg = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(TestCaseManagementSettings) = postSolution
+		CategoryFile = HeuristicLab.Tracking.vsmdi
+	EndGlobalSection
+EndGlobal
Index: /branches/1772_HeuristicLab.EvolutionTracking/PreBuildEvent.cmd
===================================================================
--- /branches/1772_HeuristicLab.EvolutionTracking/PreBuildEvent.cmd	(revision 16132)
+++ /branches/1772_HeuristicLab.EvolutionTracking/PreBuildEvent.cmd	(revision 16132)
@@ -0,0 +1,11 @@
+IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+GOTO Done
+
+:Error_Handling
+ECHO There was an error while running subwcrev. Please verify that the *.cs.frame files have been correctly converted to *.cs files, otherwise HeuristicLab won't build. 
+exit 0
+
+:Done
