Index: /branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 17457)
@@ -223,5 +223,9 @@
 
     private async void startButton_Click(object sender, EventArgs e) {
-      await Content.StartAsync();
+      try {
+        await Content.StartAsync();
+      } catch (Exception ex) {
+        ErrorHandling.ShowErrorDialog(this, ex);
+      }
     }
     private void pauseButton_Click(object sender, EventArgs e) {
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessBase.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessBase.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessBase.cs	(revision 17457)
@@ -22,4 +22,5 @@
 
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Algorithms.GradientDescent;
 using HeuristicLab.Common;
@@ -29,5 +30,5 @@
 using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
+using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.DataAnalysis;
 
@@ -57,9 +58,9 @@
 
     #region parameter properties
-    public IValueParameter<IMeanFunction> MeanFunctionParameter {
-      get { return (IValueParameter<IMeanFunction>)Parameters[MeanFunctionParameterName]; }
-    }
-    public IValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
-      get { return (IValueParameter<ICovarianceFunction>)Parameters[CovarianceFunctionParameterName]; }
+    public IConstrainedValueParameter<IMeanFunction> MeanFunctionParameter {
+      get { return (IConstrainedValueParameter<IMeanFunction>)Parameters[MeanFunctionParameterName]; }
+    }
+    public IConstrainedValueParameter<ICovarianceFunction> CovarianceFunctionParameter {
+      get { return (IConstrainedValueParameter<ICovarianceFunction>)Parameters[CovarianceFunctionParameterName]; }
     }
     public IValueParameter<IntValue> MinimizationIterationsParameter {
@@ -106,6 +107,6 @@
       : base() {
       Problem = problem;
-      Parameters.Add(new ValueParameter<IMeanFunction>(MeanFunctionParameterName, "The mean function to use.", new MeanConst()));
-      Parameters.Add(new ValueParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function to use.", new CovarianceSquaredExponentialIso()));
+      Parameters.Add(new ConstrainedValueParameter<IMeanFunction>(MeanFunctionParameterName, "The mean function to use."));
+      Parameters.Add(new ConstrainedValueParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function to use."));
       Parameters.Add(new ValueParameter<IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization with LM-BFGS.", new IntValue(20)));
       Parameters.Add(new ValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
@@ -193,4 +194,20 @@
 
       solutionCreator.OperatorParameter.ActualName = SolutionCreatorParameterName;
+
+      foreach (var meanfunction in ApplicationManager.Manager.GetInstances<IMeanFunction>().OrderBy(s => s.ItemName))
+        MeanFunctionParameter.ValidValues.Add(meanfunction);
+
+      var defaultMeanFunction = MeanFunctionParameter.ValidValues.OfType<MeanConst>().FirstOrDefault();
+      if (defaultMeanFunction != null) {
+        MeanFunctionParameter.Value = defaultMeanFunction;
+      }
+
+      foreach (var covarianceFunction in ApplicationManager.Manager.GetInstances<ICovarianceFunction>().OrderBy(s => s.ItemName))
+        CovarianceFunctionParameter.ValidValues.Add(covarianceFunction);
+
+      var defaultCovarianceFunctionParameter = CovarianceFunctionParameter.ValidValues.OfType<CovarianceSquaredExponentialIso>().FirstOrDefault();
+      if (defaultCovarianceFunctionParameter != null) {
+        CovarianceFunctionParameter.Value = defaultCovarianceFunctionParameter;
+      }
     }
 
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Clients.Hive.Slave/3.3/Executor.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Clients.Hive.Slave/3.3/Executor.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Clients.Hive.Slave/3.3/Executor.cs	(revision 17457)
@@ -46,4 +46,5 @@
     public bool IsStopping { get; set; }
     public bool IsPausing { get; set; }
+    public bool HasFailed { get; set; }
 
     public Exception CurrentException;
@@ -84,5 +85,5 @@
 
         task.Start();
-        if (!startTaskSem.WaitOne(Settings.Default.ExecutorSemTimeouts)) {
+        if (!startTaskSem.WaitOne(Settings.Default.ExecutorSemTimeouts) && !HasFailed) {
           throw new TimeoutException("Timeout when starting the task. TaskStarted event was not fired.");
         }
@@ -159,8 +160,10 @@
     #region Task Events
     private void Task_TaskFailed(object sender, EventArgs e) {
+      HasFailed = true;
       IsStopping = true;
       EventArgs<Exception> ex = (EventArgs<Exception>)e;
       CurrentException = ex.Value;
       executorQueue.AddMessage(ExecutorMessageType.TaskFailed);
+      startTaskSem.Set(); // cancel waiting for startup
     }
 
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Clients.Hive/3.3/Tasks/EngineTask.cs	(revision 17457)
@@ -80,6 +80,10 @@
 
     public override async void Start() {
-      Item.Prepare(initialOperation);
-      await Item.StartAsync();
+      try {
+        Item.Prepare(initialOperation);
+        await Item.StartAsync();
+      } catch (Exception e) {
+        engine_ExceptionOccurred(Item, new EventArgs<Exception>(e));
+      }
     }
 
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Clients.Hive/3.3/Tasks/OptimizerTask.cs	(revision 17457)
@@ -101,5 +101,9 @@
         OnTaskStopped();
       } else {
-        await Item.StartAsync();
+        try {
+          await Item.StartAsync();
+        } catch (Exception e) {
+          optimizer_ExceptionOccurred(Item, new EventArgs<Exception>(e));
+        }
       }
     }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBAlgorithmView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBAlgorithmView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBAlgorithmView.cs	(revision 17457)
@@ -325,5 +325,9 @@
     }
     private async void startButton_Click(object sender, EventArgs e) {
-      await Content.StartAsync();
+      try {
+        await Content.StartAsync();
+      } catch (Exception ex) {
+        ErrorHandling.ShowErrorDialog(this, ex);
+      }
     }
     private void pauseButton_Click(object sender, EventArgs e) {
Index: /branches/2521_ProblemRefactoring/HeuristicLab.CodeEditor/3.4/CodeEditor.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.CodeEditor/3.4/CodeEditor.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.CodeEditor/3.4/CodeEditor.cs	(revision 17457)
@@ -282,5 +282,5 @@
     public override void ScrollToPosition(int line, int column) {
       var segment = GetSegmentAtLocation(line, column);
-      TextEditor.CaretOffset = segment.Offset + segment.Length;
+      TextEditor.CaretOffset = segment.Offset;
       TextEditor.ScrollToLine(line);
     }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Common/3.3/DoubleExtensions.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Common/3.3/DoubleExtensions.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Common/3.3/DoubleExtensions.cs	(revision 17457)
@@ -23,10 +23,28 @@
 namespace HeuristicLab.Common {
   public static class DoubleExtensions {
+    /// <summary>
+    /// Compares the similarity of value x and value y with a precision of 1.0E-12.
+    /// </summary>
+    /// <param name="x">First double value to be checked</param>
+    /// <param name="y">Second double value to compare with</param>
+    /// <returns>true if the difference is <= 1.0E-12</returns>
     public static bool IsAlmost(this double x, double y) {
+      var epsilon = 1.0E-12;
+      return IsAlmost(x, y, epsilon);
+    }
+
+    /// <summary> 
+    /// Compares the similarity of value x and value y with a given precision (epsilon).
+    /// </summary>
+    /// <param name="x">First double value to be checked</param>
+    /// <param name="y">Second double value to compare with</param>
+    /// <param name="epsilon">Error term to specify the precision</param>
+    /// <returns>true if the difference is <= epsilon</returns>
+    public static bool IsAlmost(this double x, double y, double epsilon) {
       if (double.IsInfinity(x)) {
         if (x > 0) return double.IsPositiveInfinity(y);
         else return double.IsNegativeInfinity(y);
       } else {
-        return Math.Abs(x - y) < 1.0E-12;
+        return Math.Abs(x - y) < epsilon;
       }
     }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/BalancedTreeCreator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/BalancedTreeCreator.cs	(revision 17457)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/BalancedTreeCreator.cs	(revision 17457)
@@ -0,0 +1,207 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have 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 HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  [NonDiscoverableType]
+  [StorableType("AA3649C4-18CF-480B-AA41-F5D6F148B494")]
+  [Item("BalancedTreeCreator", "An operator that produces trees with a specified distribution")]
+  public class BalancedTreeCreator : SymbolicExpressionTreeCreator {
+    private const string IrregularityBiasParameterName = "IrregularityBias";
+
+    public IFixedValueParameter<PercentValue> IrregularityBiasParameter {
+      get { return (IFixedValueParameter<PercentValue>)Parameters[IrregularityBiasParameterName]; }
+    }
+
+    public double IrregularityBias {
+      get { return IrregularityBiasParameter.Value.Value; }
+      set { IrregularityBiasParameter.Value.Value = value; }
+    }
+
+    [StorableConstructor]
+    protected BalancedTreeCreator(StorableConstructorFlag _) : base(_) { }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      if (!Parameters.ContainsKey(IrregularityBiasParameterName)) {
+        Parameters.Add(new FixedValueParameter<PercentValue>(IrregularityBiasParameterName, new PercentValue(0.0)));
+      }
+    }
+
+    protected BalancedTreeCreator(BalancedTreeCreator original, Cloner cloner) : base(original, cloner) { }
+
+    public BalancedTreeCreator() {
+      Parameters.Add(new FixedValueParameter<PercentValue>(IrregularityBiasParameterName, new PercentValue(0.0)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BalancedTreeCreator(this, cloner);
+    }
+
+    public override ISymbolicExpressionTree CreateTree(IRandom random, ISymbolicExpressionGrammar grammar, int maxLength, int maxDepth) {
+      return Create(random, grammar, maxLength, maxDepth, IrregularityBias);
+    }
+
+    public static ISymbolicExpressionTree Create(IRandom random, ISymbolicExpressionGrammar grammar, int maxLength, int maxDepth, double irregularityBias = 0) {
+      int targetLength = random.Next(3, maxLength); // because we have 2 extra nodes for the root and start symbols, and the end is exclusive
+      return CreateExpressionTree(random, grammar, targetLength, maxDepth, irregularityBias);
+    }
+
+    public static ISymbolicExpressionTree CreateExpressionTree(IRandom random, ISymbolicExpressionGrammar grammar, int targetLength, int maxDepth, double irregularityBias = 1) {
+      // even lengths cannot be achieved without symbols of odd arity
+      // therefore we randomly pick a neighbouring odd length value
+      var tree = MakeStump(random, grammar); // create a stump consisting of just a ProgramRootSymbol and a StartSymbol
+      CreateExpression(random, tree.Root.GetSubtree(0), targetLength - tree.Length, maxDepth - 2, irregularityBias); // -2 because the stump has length 2 and depth 2
+      return tree;
+    }
+
+    private static ISymbolicExpressionTreeNode SampleNode(IRandom random, ISymbolicExpressionTreeGrammar grammar, IEnumerable<ISymbol> allowedSymbols, int minChildArity, int maxChildArity) {
+      var candidates = new List<ISymbol>();
+      var weights = new List<double>();
+
+      foreach (var s in allowedSymbols) {
+        var minSubtreeCount = grammar.GetMinimumSubtreeCount(s);
+        var maxSubtreeCount = grammar.GetMaximumSubtreeCount(s);
+
+        if (maxChildArity < minSubtreeCount || minChildArity > maxSubtreeCount) { continue; }
+
+        candidates.Add(s);
+        weights.Add(s.InitialFrequency);
+      }
+      var symbol = candidates.SampleProportional(random, 1, weights).First();
+      var node = symbol.CreateTreeNode();
+      if (node.HasLocalParameters) {
+        node.ResetLocalParameters(random);
+      }
+      return node;
+    }
+
+    public static void CreateExpression(IRandom random, ISymbolicExpressionTreeNode root, int targetLength, int maxDepth, double irregularityBias = 1) {
+      var grammar = root.Grammar;
+      var minSubtreeCount = grammar.GetMinimumSubtreeCount(root.Symbol);
+      var maxSubtreeCount = grammar.GetMinimumSubtreeCount(root.Symbol);
+      var arity = random.Next(minSubtreeCount, maxSubtreeCount + 1);
+      int openSlots = arity;
+
+      var allowedSymbols = grammar.AllowedSymbols.Where(x => !(x is ProgramRootSymbol || x is GroupSymbol || x is Defun || x is StartSymbol)).ToList();
+      bool hasUnarySymbols = allowedSymbols.Any(x => grammar.GetMinimumSubtreeCount(x) <= 1 && grammar.GetMaximumSubtreeCount(x) >= 1);
+
+      if (!hasUnarySymbols && targetLength % 2 == 0) {
+        // without functions of arity 1 some target lengths cannot be reached
+        targetLength = random.NextDouble() < 0.5 ? targetLength - 1 : targetLength + 1;
+      }
+
+      var tuples = new List<NodeInfo>(targetLength) { new NodeInfo { Node = root, Depth = 0, Arity = arity } };
+
+      // we use tuples.Count instead of targetLength in the if condition 
+      // because depth limits may prevent reaching the target length 
+      for (int i = 0; i < tuples.Count; ++i) {
+        var t = tuples[i];
+        var node = t.Node;
+
+        for (int childIndex = 0; childIndex < t.Arity; ++childIndex) {
+          // min and max arity here refer to the required arity limits for the child node
+          int minChildArity = 0;
+          int maxChildArity = 0;
+
+          var allowedChildSymbols = allowedSymbols.Where(x => grammar.IsAllowedChildSymbol(node.Symbol, x, childIndex)).ToList();
+
+          // if we are reaching max depth we have to fill the slot with a leaf node (max arity will be zero)
+          // otherwise, find the maximum value from the grammar which does not exceed the length limit 
+          if (t.Depth < maxDepth - 1 && openSlots < targetLength) {
+
+            // we don't want to allow sampling a leaf symbol if it prevents us from reaching the target length
+            // this should be allowed only when we have enough open expansion points (more than one)
+            // the random check against the irregularity bias helps to increase shape variability when the conditions are met
+            int minAllowedArity = allowedChildSymbols.Min(x => grammar.GetMaximumSubtreeCount(x));
+            if (minAllowedArity == 0 && (openSlots - tuples.Count <= 1 || random.NextDouble() > irregularityBias)) {
+              minAllowedArity = 1;
+            }
+
+            // finally adjust min and max arity according to the expansion limits
+            int maxAllowedArity = allowedChildSymbols.Max(x => grammar.GetMaximumSubtreeCount(x));
+            maxChildArity = Math.Min(maxAllowedArity, targetLength - openSlots);
+            minChildArity = Math.Min(minAllowedArity, maxChildArity);
+          }
+         
+          // sample a random child with the arity limits
+          var child = SampleNode(random, grammar, allowedChildSymbols, minChildArity, maxChildArity);
+
+          // get actual child arity limits
+          minChildArity = Math.Max(minChildArity, grammar.GetMinimumSubtreeCount(child.Symbol));
+          maxChildArity = Math.Min(maxChildArity, grammar.GetMaximumSubtreeCount(child.Symbol));
+          minChildArity = Math.Min(minChildArity, maxChildArity);
+
+          // pick a random arity for the new child node
+          var childArity = random.Next(minChildArity, maxChildArity + 1);
+          var childDepth = t.Depth + 1;
+          node.AddSubtree(child);
+          tuples.Add(new NodeInfo { Node = child, Depth = childDepth, Arity = childArity });
+          openSlots += childArity;
+        }
+      }
+    }
+
+    protected override ISymbolicExpressionTree Create(IRandom random) {
+      var maxLength = MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value;
+      var maxDepth = MaximumSymbolicExpressionTreeDepthParameter.ActualValue.Value;
+      var grammar = ClonedSymbolicExpressionTreeGrammarParameter.ActualValue;
+      return Create(random, grammar, maxLength, maxDepth);
+    }
+
+    #region helpers
+    private class NodeInfo {
+      public ISymbolicExpressionTreeNode Node;
+      public int Depth;
+      public int Arity;
+    }
+
+    private static ISymbolicExpressionTree MakeStump(IRandom random, ISymbolicExpressionGrammar grammar) {
+      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);
+      tree.Root = rootNode;
+      return tree;
+    }
+
+    public void CreateExpression(IRandom random, ISymbolicExpressionTreeNode seedNode, int maxTreeLength, int maxTreeDepth) {
+      CreateExpression(random, seedNode, maxTreeLength, maxTreeDepth, IrregularityBias);
+    }
+    #endregion
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 17457)
@@ -129,4 +129,5 @@
     <Compile Include="ArchitectureManipulators\SubroutineDuplicater.cs" />
     <Compile Include="ArchitectureManipulators\SymbolicExpressionTreeArchitectureManipulator.cs" />
+    <Compile Include="Creators\BalancedTreeCreator.cs" />
     <Compile Include="Grammars\GrammarUtils.cs" />
     <Compile Include="SymbolicExpressionTreeMultiObjectiveProblem.cs" />
Index: /branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs	(revision 17457)
@@ -25,23 +25,16 @@
 namespace HeuristicLab.MainForm.WindowsForms {
   internal sealed partial class ProgressView : UserControl {
-    private readonly Control control;
-    public Control Control {
-      get { return control; }
-    }
-
-    private readonly IProgress content;
-    public IProgress Content {
-      get { return content; }
-    }
-
-    public ProgressView(Control control, IProgress content)
+    public Control TargetControl { get; }
+    public IProgress Content { get; }
+
+    public ProgressView(Control targetControl, IProgress content)
       : base() {
-      if (control == null) throw new ArgumentNullException("control");
-      if (control.Parent == null) throw new InvalidOperationException("A Progress can only be shown on controls that have a Parent-control. Therefore, Dialogs and Forms cannot have an associated ProgressView.");
-      if (content == null) throw new ArgumentNullException("content");
+      if (targetControl == null) throw new ArgumentNullException(nameof(targetControl));
+      if (targetControl.Parent == null) throw new InvalidOperationException("A Progress can only be shown on controls that have a Parent-control. Therefore, Dialogs and Forms cannot have an associated ProgressView.");
+      if (content == null) throw new ArgumentNullException(nameof(content));
       InitializeComponent();
 
-      this.control = control;
-      this.content = content;
+      this.TargetControl = targetControl;
+      this.Content = content;
 
       if (content.ProgressState != ProgressState.Finished)
@@ -52,7 +45,9 @@
     protected override void Dispose(bool disposing) {
       DeregisterContentEvents();
-      HideProgress();
-
-      if (disposing && (components != null)) {
+
+      if (!TargetControl.IsDisposed)
+        HideProgress();
+
+      if (disposing && components != null) {
         components.Dispose();
       }
@@ -101,12 +96,12 @@
 
     private void ShowProgress() {
-      if (Control.InvokeRequired) {
-        Control.Invoke((Action)ShowProgress);
+      if (TargetControl.InvokeRequired) {
+        TargetControl.Invoke((Action)ShowProgress);
         return;
       }
       if (Parent != null) return;
 
-      Left = (Control.ClientRectangle.Width / 2) - (Width / 2);
-      Top = (Control.ClientRectangle.Height / 2) - (Height / 2);
+      Left = (TargetControl.ClientRectangle.Width / 2) - (Width / 2);
+      Top = (TargetControl.ClientRectangle.Height / 2) - (Height / 2);
       Anchor = AnchorStyles.None;
 
@@ -115,15 +110,16 @@
       UpdateButtonsState();
 
-      Control.SuspendRepaint();
-      Control.Enabled = false;
-      Parent = Control.Parent;
+      TargetControl.SuspendRepaint();
+      TargetControl.Enabled = false;
+      RegisterTargetControlEvents();
+      Parent = TargetControl.Parent;
       BringToFront();
-      Control.ResumeRepaint(true);
+      TargetControl.ResumeRepaint(true);
       Visible = true;
     }
 
     private void HideProgress() {
-      if (Control.InvokeRequired) {
-        Control.Invoke((Action)HideProgress);
+      if (TargetControl.InvokeRequired) {
+        TargetControl.Invoke((Action)HideProgress);
         return;
       }
@@ -131,13 +127,37 @@
 
       Visible = false;
-      Control.SuspendRepaint();
-      Control.Enabled = true;
-      Control.ResumeRepaint(true);
+      TargetControl.SuspendRepaint();
+      TargetControl.Enabled = true;
+      DeregisterTargetControlEvents();
       Parent = null;
+      TargetControl.ResumeRepaint(TargetControl.Visible);
+    }
+
+
+    private void RegisterTargetControlEvents() {
+      TargetControl.Disposed += TargetControl_Disposed;
+      TargetControl.VisibleChanged += TargetControl_VisibleChanged;
+      TargetControl.ParentChanged += TargetControl_ParentChanged;
+    }
+
+    private void DeregisterTargetControlEvents() {
+      TargetControl.Disposed -= TargetControl_Disposed;
+      TargetControl.VisibleChanged -= TargetControl_VisibleChanged;
+      TargetControl.ParentChanged -= TargetControl_ParentChanged;
+    }
+
+    private void TargetControl_Disposed(object sender, EventArgs e) {
+      Dispose();
+    }
+    private void TargetControl_VisibleChanged(object sender, EventArgs e) {
+      Visible = TargetControl.Visible;
+    }
+    private void TargetControl_ParentChanged(object sender, EventArgs e) {
+      Parent = TargetControl.Parent;
     }
 
     private void UpdateProgressState() {
-      if (Control.InvokeRequired) {
-        Control.Invoke((Action)UpdateProgressState);
+      if (TargetControl.InvokeRequired) {
+        TargetControl.Invoke((Action)UpdateProgressState);
         return;
       }
@@ -150,10 +170,10 @@
 
     private void UpdateProgressMessage() {
-      if (Control.InvokeRequired) {
-        Control.Invoke((Action)UpdateProgressMessage);
-        return;
-      }
-
-      messageLabel.Text = content.Message;
+      if (TargetControl.InvokeRequired) {
+        TargetControl.Invoke((Action)UpdateProgressMessage);
+        return;
+      }
+
+      messageLabel.Text = Content.Message;
     }
 
@@ -167,5 +187,5 @@
         case ProgressMode.Determinate:
           progressBar.Style = ProgressBarStyle.Continuous;
-          progressBar.Value = (int)Math.Round(progressBar.Minimum + content.ProgressValue * (progressBar.Maximum - progressBar.Minimum));
+          progressBar.Value = (int)Math.Round(progressBar.Minimum + Content.ProgressValue * (progressBar.Maximum - progressBar.Minimum));
           break;
         case ProgressMode.Indeterminate:
@@ -174,19 +194,19 @@
           break;
         default:
-          throw new NotImplementedException($"Invalid Progress Mode: {content.ProgressMode}");
+          throw new NotImplementedException($"Invalid Progress Mode: {Content.ProgressMode}");
       }
     }
 
     private void UpdateButtonsState() {
-      if (Control.InvokeRequired) {
-        Control.Invoke((Action)UpdateButtonsState);
+      if (TargetControl.InvokeRequired) {
+        TargetControl.Invoke((Action)UpdateButtonsState);
         return;
       }
 
       stopButton.Visible = Content.CanBeStopped;
-      stopButton.Enabled = Content.CanBeStopped && content.ProgressState == ProgressState.Started;
+      stopButton.Enabled = Content.CanBeStopped && Content.ProgressState == ProgressState.Started;
 
       cancelButton.Visible = Content.CanBeCanceled;
-      cancelButton.Enabled = Content.CanBeCanceled && content.ProgressState == ProgressState.Started;
+      cancelButton.Enabled = Content.CanBeCanceled && Content.ProgressState == ProgressState.Started;
     }
 
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Optimization.Views/3.3/IOptimizerView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Optimization.Views/3.3/IOptimizerView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Optimization.Views/3.3/IOptimizerView.cs	(revision 17457)
@@ -137,5 +137,9 @@
     #region Control events
     protected virtual async void startButton_Click(object sender, EventArgs e) {
-      await Content.StartAsync();
+      try {
+        await Content.StartAsync();
+      } catch (Exception ex) {
+        ErrorHandling.ShowErrorDialog(this, ex);
+      }
     }
     protected virtual void pauseButton_Click(object sender, EventArgs e) {
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SolutionComparisonView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SolutionComparisonView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SolutionComparisonView.cs	(revision 17457)
@@ -91,5 +91,10 @@
       var newDs = new Dataset(variableNames, variableValues);
       var newProblemData = new ClassificationProblemData(newDs, variableNames.Take(variableNames.Length - 1), variableNames.Last());
+
+      foreach (var classValue in problemData.ClassValues) {
+        newProblemData.SetClassName(classValue, problemData.GetClassName(classValue));
+      }
       newProblemData.PositiveClass = problemData.PositiveClass;
+
       newProblemData.TrainingPartition.Start = problemData.TrainingPartition.Start;
       newProblemData.TrainingPartition.End = problemData.TrainingPartition.End;
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs	(revision 17457)
@@ -20,9 +20,14 @@
 #endregion
 
+using System.Collections.Generic;
+using System.Linq;
+using HEAL.Attic;
+using HeuristicLab.Analysis;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Data;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
@@ -38,4 +43,7 @@
     private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
     private const string EstimationLimitsParameterName = "EstimationLimits";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string ValidationPartitionParameterName = "ValidationPartition";
+    private const string AnalyzeTestErrorParameterName = "Analyze Test Error";
 
     #region parameter properties
@@ -55,4 +63,17 @@
       get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
     }
+    public ILookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntRange> ValidationPartitionParameter {
+      get { return (IValueLookupParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> AnalyzeTestErrorParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[AnalyzeTestErrorParameterName]; }
+    }
+    public bool AnalyzeTestError {
+      get { return AnalyzeTestErrorParameter.Value.Value; }
+      set { AnalyzeTestErrorParameter.Value.Value = value; }
+    }
     #endregion
 
@@ -66,4 +87,8 @@
       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."));
+      Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "Maximal length of the symbolic expression.") { Hidden = true });
+      Parameters.Add(new ValueLookupParameter<IntRange>(ValidationPartitionParameterName, "The validation partition."));
+      Parameters.Add(new FixedValueParameter<BoolValue>(AnalyzeTestErrorParameterName, "Flag whether the test error should be displayed in the Pareto-Front", new BoolValue(false)));
+
     }
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -87,4 +112,67 @@
       return model.CreateClassificationSolution((IClassificationProblemData)ProblemDataParameter.ActualValue.Clone());
     }
+
+    public override IOperation Apply() {
+      var operation = base.Apply();
+      var paretoFront = TrainingBestSolutionsParameter.ActualValue;
+
+      IResult result;
+      ScatterPlot qualityToTreeSize;
+      if (!ResultCollection.TryGetValue("Pareto Front Analysis", out result)) {
+        qualityToTreeSize = new ScatterPlot("Quality vs Tree Size", "");
+        qualityToTreeSize.VisualProperties.XAxisMinimumAuto = false;
+        qualityToTreeSize.VisualProperties.XAxisMaximumAuto = false;
+        qualityToTreeSize.VisualProperties.YAxisMinimumAuto = false;
+        qualityToTreeSize.VisualProperties.YAxisMaximumAuto = false;
+
+        qualityToTreeSize.VisualProperties.XAxisMinimumFixedValue = 0;
+        qualityToTreeSize.VisualProperties.XAxisMaximumFixedValue = MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value;
+        qualityToTreeSize.VisualProperties.YAxisMinimumFixedValue = 0;
+        qualityToTreeSize.VisualProperties.YAxisMaximumFixedValue = 1;
+        ResultCollection.Add(new Result("Pareto Front Analysis", qualityToTreeSize));
+      } else {
+        qualityToTreeSize = (ScatterPlot)result.Value;
+      }
+
+      int previousTreeLength = -1;
+      var sizeParetoFront = new LinkedList<ISymbolicClassificationSolution>();
+      foreach (var solution in paretoFront.OrderBy(s => s.Model.SymbolicExpressionTree.Length)) {
+        int treeLength = solution.Model.SymbolicExpressionTree.Length;
+        if (!sizeParetoFront.Any()) sizeParetoFront.AddLast(solution);
+        if (solution.TrainingAccuracy > sizeParetoFront.Last.Value.TrainingAccuracy) {
+          if (treeLength == previousTreeLength)
+            sizeParetoFront.RemoveLast();
+          sizeParetoFront.AddLast(solution);
+        }
+        previousTreeLength = treeLength;
+      }
+
+      qualityToTreeSize.Rows.Clear();
+      var trainingRow = new ScatterPlotDataRow("Training Accuracy", "", sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, x.TrainingAccuracy, x)));
+      trainingRow.VisualProperties.PointSize = 8;
+      qualityToTreeSize.Rows.Add(trainingRow);
+
+      if (AnalyzeTestError) {
+        var testRow = new ScatterPlotDataRow("Test Accuracy", "",
+          sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, x.TestAccuracy, x)));
+        testRow.VisualProperties.PointSize = 8;
+        qualityToTreeSize.Rows.Add(testRow);
+      }
+
+      var validationPartition = ValidationPartitionParameter.ActualValue;
+      if (validationPartition.Size != 0) {
+        var problemData = ProblemDataParameter.ActualValue;
+        var validationIndizes = Enumerable.Range(validationPartition.Start, validationPartition.Size).ToList();
+        var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, validationIndizes).ToList();
+        OnlineCalculatorError error;
+        var validationRow = new ScatterPlotDataRow("Validation Accuracy", "",
+          sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length,
+          OnlineAccuracyCalculator.Calculate(targetValues, x.GetEstimatedClassValues(validationIndizes), out error))));
+        validationRow.VisualProperties.PointSize = 7;
+        qualityToTreeSize.Rows.Add(validationRow);
+      }
+
+      return operation;
+    }
   }
 }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs	(revision 17457)
@@ -38,4 +38,11 @@
     }
 
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+
+      var tree = Content?.Model?.SymbolicExpressionTree;
+      btnOptimizeConstants.Enabled = tree != null && SymbolicRegressionConstantOptimizationEvaluator.CanOptimizeConstants(tree);
+    }
+
     protected override void UpdateModel(ISymbolicExpressionTree tree) {
       var model = new SymbolicRegressionModel(Content.ProblemData.TargetVariable, tree, Content.Model.Interpreter, Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit);
@@ -46,9 +53,10 @@
     protected override ISymbolicExpressionTree OptimizeConstants(ISymbolicExpressionTree tree, IProgress progress) {
       const int constOptIterations = 50;
-      const int maxRepetitions = 1000;
+      const int maxRepetitions = 100;
+      const double minimumImprovement = 1e-10;
       var regressionProblemData = Content.ProblemData;
       var model = Content.Model;
       progress.CanBeStopped = true;
-      var prevResult = 0.0;
+      double prevResult = 0.0, improvement = 0.0;
       var result = 0.0;
       int reps = 0;
@@ -59,9 +67,10 @@
           applyLinearScaling: true, maxIterations: constOptIterations, updateVariableWeights: true, lowerEstimationLimit: model.LowerEstimationLimit, upperEstimationLimit: model.UpperEstimationLimit,
           iterationCallback: (args, func, obj) => {
-            double newProgressValue = progress.ProgressValue + 1.0 / (constOptIterations + 2); // (maxIterations + 2) iterations are reported
+            double newProgressValue = progress.ProgressValue + (1.0 / (constOptIterations + 2) / maxRepetitions); // (constOptIterations + 2) iterations are reported
             progress.ProgressValue = Math.Min(newProgressValue, 1.0);
           });
         reps++;
-      } while (prevResult < result && reps < maxRepetitions &&
+        improvement = result - prevResult;
+      } while (improvement > minimumImprovement && reps < maxRepetitions &&
                progress.ProgressState != ProgressState.StopRequested &&
                progress.ProgressState != ProgressState.CancelRequested);
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs	(revision 17457)
@@ -57,4 +57,5 @@
       this.grpViewHost = new System.Windows.Forms.GroupBox();
       this.treeChart = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.InteractiveSymbolicExpressionTreeChart();
+      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
       this.splitContainer.Panel1.SuspendLayout();
@@ -148,4 +149,5 @@
       this.btnSimplify.Text = "Simplify";
       this.btnSimplify.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+      this.toolTip.SetToolTip(this.btnSimplify, "Simplifies the model structure based on mathematical simplification rules.");
       this.btnSimplify.UseVisualStyleBackColor = true;
       this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click);
@@ -162,4 +164,6 @@
       this.btnOptimizeConstants.Text = "Optimize";
       this.btnOptimizeConstants.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+      this.toolTip.SetToolTip(this.btnOptimizeConstants, "Optimizes the numerical constants of the model. \r\nIf the algorithm converges, opt" +
+        "imization is stopped.");
       this.btnOptimizeConstants.UseVisualStyleBackColor = true;
       this.btnOptimizeConstants.Click += new System.EventHandler(this.btnOptimizeConstants_Click);
@@ -226,4 +230,5 @@
     protected System.Windows.Forms.Button btnOptimizeConstants;
     private System.Windows.Forms.Label treeStatusValue;
+    private System.Windows.Forms.ToolTip toolTip;
   }
 }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 17457)
@@ -168,4 +168,5 @@
     private void Content_Changed(object sender, EventArgs e) {
       UpdateView();
+      SetEnabledStateOfControls();
     }
 
@@ -192,16 +193,22 @@
 
       progress.Start("Calculate Impact and Replacement Values ...");
+      cancellationTokenSource = new CancellationTokenSource();
       progress.CanBeStopped = true;
-      cancellationTokenSource = new CancellationTokenSource();
-      var impactAndReplacementValues = await Task.Run(() => CalculateImpactAndReplacementValues(tree));
       try {
-        await Task.Delay(500, cancellationTokenSource.Token); // wait for progressbar to finish animation
-      } catch (OperationCanceledException) { }
-      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();
+        var impactAndReplacementValues = await Task.Run(() => CalculateImpactAndReplacementValues(tree));
+        try {
+          await Task.Delay(300, cancellationTokenSource.Token); // wait for progressbar to finish animation
+        } catch (OperationCanceledException) { }
+
+        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);
+      } finally {
+        progress.Finish();
+      }
+
       progress.CanBeStopped = false;
       PaintNodeImpacts();
@@ -313,8 +320,17 @@
     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)
+      cancellationTokenSource = new CancellationTokenSource();
+      progress.CanBeStopped = true;
+      try {
+        var tree = (ISymbolicExpressionTree)Content.Model.SymbolicExpressionTree.Clone();
+
+        var newTree = await Task.Run(() => OptimizeConstants(tree, progress));
+        try {
+          await Task.Delay(300, cancellationTokenSource.Token); // wait for progressbar to finish animation
+        } catch (OperationCanceledException) { }
+        UpdateModel(newTree); // triggers progress.Finish after calculating the node impacts when model is changed
+      } catch {
+        progress.Finish();
+      }
     }
   }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionBalancedTreeCreator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionBalancedTreeCreator.cs	(revision 17457)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/SymbolicDataAnalysisExpressionBalancedTreeCreator.cs	(revision 17457)
@@ -0,0 +1,38 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("BalancedTreeCreator", "An operator that creates new symbolic expression trees using the 'Balanced' method")]
+  [StorableType("E268BE19-BBEB-46EF-9632-1799A43D01F9")]
+  public class SymbolicDataAnalysisExpressionBalancedTreeCreator : BalancedTreeCreator, ISymbolicDataAnalysisSolutionCreator {
+    [StorableConstructor]
+    protected SymbolicDataAnalysisExpressionBalancedTreeCreator(StorableConstructorFlag _) : base(_) { }
+    protected SymbolicDataAnalysisExpressionBalancedTreeCreator(SymbolicDataAnalysisExpressionBalancedTreeCreator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicDataAnalysisExpressionBalancedTreeCreator(this, cloner); }
+
+    public SymbolicDataAnalysisExpressionBalancedTreeCreator() : base() { }
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/ArithmeticExpressionGrammar.cs	(revision 17457)
@@ -21,8 +21,8 @@
 
 using System.Collections.Generic;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
 using HeuristicLab.PluginInfrastructure;
 
@@ -31,5 +31,5 @@
   [StorableType("FCBA02B7-5D29-42F5-A64C-A60AD8EA475D")]
   [Item("ArithmeticExpressionGrammar", "Represents a grammar for functional expressions using only arithmetic operations.")]
-  public class ArithmeticExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+  public class ArithmeticExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
 
     [StorableConstructor]
@@ -56,5 +56,5 @@
       var factorVariableSymbol = new FactorVariable();
 
-      var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol, binFactorVariableSymbol, factorVariableSymbol};
+      var allSymbols = new List<Symbol>() { add, sub, mul, div, constant, variableSymbol, binFactorVariableSymbol, factorVariableSymbol };
       var functionSymbols = new List<Symbol>() { add, sub, mul, div };
 
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/DataAnalysisGrammar.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/DataAnalysisGrammar.cs	(revision 17457)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/DataAnalysisGrammar.cs	(revision 17457)
@@ -0,0 +1,68 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have 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 HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+
+  [StorableType("B91038EA-338E-40BB-99D2-738B96C66D81")]
+  public abstract class DataAnalysisGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+    [StorableConstructor]
+    protected DataAnalysisGrammar(StorableConstructorFlag _) : base(_) { }
+    protected DataAnalysisGrammar(DataAnalysisGrammar original, Cloner cloner) : base(original, cloner) { }
+    protected DataAnalysisGrammar(string name, string description) : base(name, description) { }
+
+    public void ConfigureVariableSymbols(IDataAnalysisProblemData problemData) {
+      var dataset = problemData.Dataset;
+      foreach (var varSymbol in Symbols.OfType<VariableBase>()) {
+        if (!varSymbol.Fixed) {
+          varSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<double>(x));
+          varSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<double>(x));
+        }
+      }
+      foreach (var factorSymbol in Symbols.OfType<BinaryFactorVariable>()) {
+        if (!factorSymbol.Fixed) {
+          factorSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<string>(x));
+          factorSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<string>(x));
+          factorSymbol.VariableValues = factorSymbol.VariableNames
+            .ToDictionary(varName => varName, varName => dataset.GetStringValues(varName).Distinct().ToList());
+        }
+      }
+      foreach (var factorSymbol in Symbols.OfType<FactorVariable>()) {
+        if (!factorSymbol.Fixed) {
+          factorSymbol.AllVariableNames = problemData.InputVariables.Select(x => x.Value).Where(x => dataset.VariableHasType<string>(x));
+          factorSymbol.VariableNames = problemData.AllowedInputVariables.Where(x => dataset.VariableHasType<string>(x));
+          factorSymbol.VariableValues = factorSymbol.VariableNames
+            .ToDictionary(varName => varName,
+            varName => dataset.GetStringValues(varName).Distinct()
+            .Select((n, i) => Tuple.Create(n, i))
+            .ToDictionary(tup => tup.Item1, tup => tup.Item2));
+        }
+      }
+    }
+
+
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs	(revision 17457)
@@ -22,13 +22,13 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [StorableType("44B0829C-1CB5-4BE9-9514-BBA54FAB2912")]
   [Item("FullFunctionalExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
-  public class FullFunctionalExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+  public class FullFunctionalExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
     [StorableConstructor]
     protected FullFunctionalExpressionGrammar(StorableConstructorFlag _) : base(_) { }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs	(revision 17457)
@@ -22,12 +22,12 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [StorableType("36A22322-0627-4E25-A468-F2A788AF6D46")]
   [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 {
+  public class TypeCoherentExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
     private const string ArithmeticFunctionsName = "Arithmetic Functions";
     private const string TrigonometricFunctionsName = "Trigonometric Functions";
@@ -117,6 +117,6 @@
       #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, tanh});
-      var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log});
+      var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan, tanh });
+      var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log });
       var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { abs, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi,
         fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral, analyticalQuotient});
@@ -149,5 +149,5 @@
       SetSubtreeCount(cubeRoot, 1, 1);
       SetSubtreeCount(exponentialAndLogarithmicSymbols, 1, 1);
-      foreach(var sy in specialFunctions.Symbols.Except(new[] { analyticalQuotient})) {
+      foreach (var sy in specialFunctions.Symbols.Except(new[] { analyticalQuotient })) {
         SetSubtreeCount(sy, 1, 1);
       }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 17457)
@@ -150,4 +150,5 @@
     <Compile Include="Converters\DerivativeCalculator.cs" />
     <Compile Include="Converters\TreeToAutoDiffTermConverter.cs" />
+    <Compile Include="Creators\SymbolicDataAnalysisExpressionBalancedTreeCreator.cs" />
     <Compile Include="Crossovers\SymbolicDataAnalysisExpressionDiversityPreservingCrossover.cs" />
     <Compile Include="Formatters\InfixExpressionFormatter.cs" />
@@ -155,4 +156,5 @@
     <Compile Include="Formatters\SymbolicDataAnalysisExpressionMathematicaFormatter.cs" />
     <Compile Include="Formatters\SymbolicDataAnalysisExpressionCSharpFormatter.cs" />
+    <Compile Include="Grammars\DataAnalysisGrammar.cs" />
     <Compile Include="Hashing\HashExtensions.cs" />
     <Compile Include="Hashing\HashUtil.cs" />
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisGrammar.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisGrammar.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisGrammar.cs	(revision 17457)
@@ -20,10 +20,11 @@
 #endregion
 
+using HEAL.Attic;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [StorableType("5b0720d7-b1f0-4c2f-893e-cd2549e20e9e")]
   public interface ISymbolicDataAnalysisGrammar : ISymbolicExpressionGrammar {
+    void ConfigureVariableSymbols(IDataAnalysisProblemData problemData);
   }
 }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 17457)
@@ -52,5 +52,5 @@
     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 IsAlmost = typeof(DoubleExtensions).GetMethod("IsAlmost", new Type[] { typeof(double), typeof(double)});
     private static readonly MethodInfo Gamma = typeof(alglib).GetMethod("gammafunction", new[] { typeof(double) });
     private static readonly MethodInfo Psi = typeof(alglib).GetMethod("psi", new[] { typeof(double) });
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs	(revision 17457)
@@ -1,3 +1,24 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have 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;
@@ -181,11 +202,11 @@
 
     [ThreadStatic]
-    private Dictionary<string, double[]> cachedData;
+    private static Dictionary<string, double[]> cachedData;
 
     [ThreadStatic]
-    private IDataset dataset;
+    private static IDataset cachedDataset;
 
     private void InitCache(IDataset dataset) {
-      this.dataset = dataset;
+      cachedDataset = dataset;
       cachedData = new Dictionary<string, double[]>();
       foreach (var v in dataset.DoubleVariables) {
@@ -196,10 +217,10 @@
     public void InitializeState() {
       cachedData = null;
-      dataset = null;
+      cachedDataset = null;
       EvaluatedSolutions = 0;
     }
 
     private double[] GetValues(ISymbolicExpressionTree tree, IDataset dataset, int[] rows) {
-      if (cachedData == null || this.dataset != dataset) {
+      if (cachedData == null || cachedDataset != dataset) {
         InitCache(dataset);
       }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs	(revision 17457)
@@ -99,5 +99,5 @@
 
     [ThreadStatic]
-    private IDataset dataset;
+    private static IDataset cachedDataset;
 
     private static readonly HashSet<byte> supportedOpCodes = new HashSet<byte>() {
@@ -127,5 +127,5 @@
       if (!rows.Any()) return Enumerable.Empty<double>();
 
-      if (cachedData == null || this.dataset != dataset) {
+      if (cachedData == null || cachedDataset != dataset) {
         InitCache(dataset);
       }
@@ -152,5 +152,5 @@
 
     private void InitCache(IDataset dataset) {
-      this.dataset = dataset;
+      cachedDataset = dataset;
 
       // free handles to old data
@@ -178,5 +178,5 @@
         cachedData = null;
       }
-      dataset = null;
+      cachedDataset = null;
       EvaluatedSolutions = 0;
     }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 17457)
@@ -24,4 +24,5 @@
 using System.Drawing;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Common.Resources;
@@ -31,5 +32,4 @@
 using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
 using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.Instances;
@@ -210,33 +210,10 @@
     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));
-        }
-      }
+
+      grammar.ConfigureVariableSymbols(problemData);
     }
 
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionVariableImpactsView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionVariableImpactsView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionVariableImpactsView.cs	(revision 17457)
@@ -25,4 +25,5 @@
 using System.Threading;
 using System.Threading.Tasks;
+using System.Windows.Forms;
 using HeuristicLab.Common;
 using HeuristicLab.Data;
@@ -40,5 +41,4 @@
     private CancellationTokenSource cancellationToken = new CancellationTokenSource();
     private List<Tuple<string, double>> rawVariableImpacts = new List<Tuple<string, double>>();
-    private bool attachedToProgress = false;
 
     public new IClassificationSolution Content {
@@ -87,12 +87,14 @@
       }
     }
-    protected override void OnHidden(EventArgs e) {
-      base.OnHidden(e);
+    protected override void OnVisibleChanged(EventArgs e) {
+      base.OnVisibleChanged(e);
+      if (!this.Visible) {
+        cancellationToken.Cancel();
+      }
+    }
+
+    protected override void OnClosed(FormClosedEventArgs e) {
+      base.OnClosed(e);
       cancellationToken.Cancel();
-
-      if (attachedToProgress) {
-        Progress.Hide(this);
-        attachedToProgress = false;
-      }
     }
 
@@ -133,5 +135,4 @@
       variableImpactsArrayView.Caption = Content.Name + " Variable Impacts";
       progress = Progress.Show(this, "Calculating variable impacts for " + Content.Name);
-      attachedToProgress = true;
       cancellationToken = new CancellationTokenSource();
 
@@ -145,15 +146,11 @@
           .ToList();
 
-        List<Tuple<string, double>> impacts = null;
-        await Task.Run(() => { impacts = CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedClassValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress); });
-        if (impacts == null) { return; }
+        var impacts = await Task.Run(() => CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedClassValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress));
 
         rawVariableImpacts.AddRange(impacts);
         UpdateOrdering();
+      } catch (OperationCanceledException) {
       } finally {
-        if (attachedToProgress) {
-          Progress.Hide(this);
-          attachedToProgress = false;
-        }
+        Progress.Hide(this);
       }
     }
@@ -180,5 +177,5 @@
       var clonedModel = (IClassificationModel)model.Clone();
       foreach (var variableName in originalVariableOrdering) {
-        if (cancellationToken.Token.IsCancellationRequested) { return null; }
+        token.ThrowIfCancellationRequested();
         progress.ProgressValue = (double)++i / count;
         progress.Message = string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count);
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualAnalysisView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualAnalysisView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualAnalysisView.cs	(revision 17457)
@@ -93,25 +93,26 @@
       var dateTimeVars = ds.DateTimeVariables.Where(vn => ds.GetDateTimeValues(vn).Distinct().Skip(1).Any()).ToArray();
 
-      // produce training and test values separately as they might overlap (e.g. for ensembles)
-      var predictedValuesTrain = Content.EstimatedTrainingValues.ToArray();
-      int j = 0; // idx for predictedValues array
-      foreach (var i in problemData.TrainingIndices) {
+      var predictedValues = Content.EstimatedValues.ToArray();
+      foreach (var i in problemData.AllIndices) {
         var run = CreateRunForIdx(i, problemData, doubleVars, stringVars, dateTimeVars);
         var targetValue = ds.GetDoubleValue(problemData.TargetVariable, i);
-        AddErrors(run, predictedValuesTrain[j++], targetValue);
-        run.Results.Add(PartitionLabel, new StringValue("Training"));
-        run.Color = Color.Gold;
+        AddErrors(run, predictedValues[i], targetValue);
+
+        if (problemData.IsTrainingSample(i) && problemData.IsTestSample(i)) {
+          run.Results.Add(PartitionLabel, new StringValue("Training + Test"));
+          run.Color = Color.Orange;
+        } else if (problemData.IsTrainingSample(i)) {
+          run.Results.Add(PartitionLabel, new StringValue("Training"));
+          run.Color = Color.Gold;
+        } else if (problemData.IsTestSample(i)) {
+          run.Results.Add(PartitionLabel, new StringValue("Test"));
+          run.Color = Color.Red;
+        } else {
+          run.Results.Add(PartitionLabel, new StringValue("Additional Data"));
+          run.Color = Color.Black;
+        }
         runs.Add(run);
       }
-      var predictedValuesTest = Content.EstimatedTestValues.ToArray();
-      j = 0;
-      foreach (var i in problemData.TestIndices) {
-        var run = CreateRunForIdx(i, problemData, doubleVars, stringVars, dateTimeVars);
-        var targetValue = ds.GetDoubleValue(problemData.TargetVariable, i);
-        AddErrors(run, predictedValuesTest[j++], targetValue);
-        run.Results.Add(PartitionLabel, new StringValue("Test"));
-        run.Color = Color.Red;
-        runs.Add(run);
-      }
+
       if (string.IsNullOrEmpty(selectedXAxis))
         selectedXAxis = "Index";
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs	(revision 17457)
@@ -25,4 +25,5 @@
 using System.Threading;
 using System.Threading.Tasks;
+using System.Windows.Forms;
 using HeuristicLab.Common;
 using HeuristicLab.Data;
@@ -40,5 +41,4 @@
     private CancellationTokenSource cancellationToken = new CancellationTokenSource();
     private List<Tuple<string, double>> rawVariableImpacts = new List<Tuple<string, double>>();
-    private bool attachedToProgress = false;
 
     public new IRegressionSolution Content {
@@ -88,12 +88,14 @@
     }
 
-    protected override void OnHidden(EventArgs e) {
-      base.OnHidden(e);
+    protected override void OnVisibleChanged(EventArgs e) {
+      base.OnVisibleChanged(e);
+      if (!this.Visible) {
+        cancellationToken.Cancel();
+      }
+    }
+
+    protected override void OnClosed(FormClosedEventArgs e) {
+      base.OnClosed(e);
       cancellationToken.Cancel();
-
-      if (attachedToProgress) {
-        Progress.Hide(this);
-        attachedToProgress = false;
-      }
     }
 
@@ -132,5 +134,4 @@
       variableImpactsArrayView.Caption = Content.Name + " Variable Impacts";
       var progress = Progress.Show(this, "Calculating variable impacts for " + Content.Name);
-      attachedToProgress = true;
       cancellationToken = new CancellationTokenSource();
 
@@ -144,15 +145,11 @@
           .ToList();
 
-        List<Tuple<string, double>> impacts = null;
-        await Task.Run(() => { impacts = CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress); });
-        if (impacts == null) { return; }
+        var impacts = await Task.Run(() => CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress));
 
         rawVariableImpacts.AddRange(impacts);
         UpdateOrdering();
+      } catch (OperationCanceledException) {
       } finally {
-        if (attachedToProgress) {
-          Progress.Hide(this);
-          attachedToProgress = false;
-        }
+        Progress.Hide(this);
       }
     }
@@ -179,5 +176,5 @@
 
       foreach (var variableName in originalVariableOrdering) {
-        if (cancellationToken.Token.IsCancellationRequested) { return null; }
+        token.ThrowIfCancellationRequested();
         progress.ProgressValue = (double)++i / count;
         progress.Message = string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count);
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionVariableImpactsCalculator.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionVariableImpactsCalculator.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionVariableImpactsCalculator.cs	(revision 17457)
@@ -26,9 +26,9 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
 using HeuristicLab.Random;
 
@@ -173,7 +173,7 @@
 
       IList originalValues = null;
-      IList replacementValues = GetReplacementValues(modifiableDataset, variableName, model, rows, targetValues, out originalValues, replacementMethod, factorReplacementMethod);
-
-      double newValue = CalculateQualityForReplacement(model, modifiableDataset, variableName, originalValues, rows, replacementValues, targetValues);
+      IList replacementValues = GetReplacementValues(modifiableDataset, variableName, model, problemData.AllowedInputVariables, rows, targetValues, out originalValues, replacementMethod, factorReplacementMethod);
+
+      double newValue = CalculateQualityForReplacement(model, modifiableDataset, problemData.AllowedInputVariables, variableName, originalValues, rows, replacementValues, targetValues);
       double impact = quality - newValue;
 
@@ -184,4 +184,5 @@
       string variableName,
       IClassificationModel model,
+      IEnumerable<string> allowedInputVariables,
       IEnumerable<int> rows,
       IEnumerable<double> targetValues,
@@ -196,5 +197,5 @@
       } else if (modifiableDataset.VariableHasType<string>(variableName)) {
         originalValues = modifiableDataset.GetReadOnlyStringValues(variableName).ToList();
-        replacementValues = GetReplacementValuesForString(model, modifiableDataset, variableName, rows, (List<string>)originalValues, targetValues, factorReplacementMethod);
+        replacementValues = GetReplacementValuesForString(model, modifiableDataset, allowedInputVariables, variableName, rows, (List<string>)originalValues, targetValues, factorReplacementMethod);
       } else {
         throw new NotSupportedException("Variable not supported");
@@ -254,4 +255,5 @@
     private static IList GetReplacementValuesForString(IClassificationModel model,
       ModifiableDataset modifiableDataset,
+      IEnumerable<string> allowedInputVariables,
       string variableName,
       IEnumerable<int> rows,
@@ -270,5 +272,5 @@
             List<string> curReplacementValues = Enumerable.Repeat(repl, modifiableDataset.Rows).ToList();
             //fholzing: this result could be used later on (theoretically), but is neglected for better readability/method consistency 
-            var newValue = CalculateQualityForReplacement(model, modifiableDataset, variableName, originalValues, rows, curReplacementValues, targetValues);
+            var newValue = CalculateQualityForReplacement(model, modifiableDataset, allowedInputVariables, variableName, originalValues, rows, curReplacementValues, targetValues);
             var curQuality = newValue;
 
@@ -308,4 +310,5 @@
       IClassificationModel model,
       ModifiableDataset modifiableDataset,
+      IEnumerable<string> allowedInputVariables,
       string variableName,
       IList originalValues,
@@ -317,5 +320,5 @@
       var discModel = model as IDiscriminantFunctionClassificationModel;
       if (discModel != null) {
-        var problemData = new ClassificationProblemData(modifiableDataset, modifiableDataset.VariableNames, model.TargetVariable);
+        var problemData = new ClassificationProblemData(modifiableDataset, allowedInputVariables, model.TargetVariable);
         discModel.RecalculateModelParameters(problemData, rows);
       }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationModel.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationModel.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationModel.cs	(revision 17457)
@@ -74,4 +74,5 @@
       classValues = (double[])original.classValues.Clone();
       thresholds = (double[])original.thresholds.Clone();
+      thresholdCalculator = (IDiscriminantFunctionThresholdCalculator)original.thresholdCalculator.Clone();
     }
 
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs	(revision 17457)
@@ -37,5 +37,27 @@
     protected Interval(StorableConstructorFlag _) { }
 
+    /// <summary>
+    /// Creates an interval with given bounds, where lower bound must be smaller than
+    /// the upper bound. Floating point precision errors trough calculations are fixed by,
+    /// checking if the intervals are almost the same (E-12). If this is the case, the bounds 
+    /// will be set to the bound closer to zero.
+    /// </summary>
+    /// <param name="lowerBound">Lower bound of the interval</param>
+    /// <param name="upperBound">Upper bound of the interval</param>
     public Interval(double lowerBound, double upperBound) {
+      if (lowerBound.IsAlmost(upperBound)) {
+        //If the bounds go over zero
+        if (lowerBound <= 0 && upperBound >= 0) {
+          lowerBound = 0.0;
+          upperBound = 0.0;
+          //Interval is negative
+        } else if (upperBound < 0) {
+          lowerBound = upperBound;
+          //Interval is positive
+        } else {
+          upperBound = lowerBound;
+        }
+      }
+
       if (lowerBound > upperBound)
         throw new ArgumentException("LowerBound must be smaller than UpperBound.");
@@ -58,4 +80,18 @@
                 double.IsNaN(LowerBound) || double.IsNaN(UpperBound);
       }
+    }
+
+    /// <summary>
+    /// True if the interval is positive without zero
+    /// </summary>
+    public bool IsPositive {
+      get => LowerBound > 0.0; 
+    }
+
+    /// <summary>
+    /// True if the interval is negative without zero
+    /// </summary>
+    public bool IsNegative {
+      get => UpperBound < 0.0;
     }
 
@@ -128,5 +164,5 @@
     }
 
-    //mkommend: Division by intervals containing 0 is implemented as defined in
+    //Division by intervals containing 0 is implemented as defined in
     //http://en.wikipedia.org/wiki/Interval_arithmetic
     public static Interval Divide(Interval a, Interval b) {
@@ -171,5 +207,5 @@
     public static Interval Tangens(Interval a) {
       return Interval.Divide(Interval.Sine(a), Interval.Cosine(a));
-    }  
+    }
     public static Interval HyperbolicTangent(Interval a) {
       return new Interval(Math.Tanh(a.LowerBound), Math.Tanh(a.UpperBound));
@@ -206,5 +242,5 @@
       if (a.UpperBound <= 0) return new Interval(a.UpperBound * a.UpperBound, a.LowerBound * a.LowerBound);     // interval is negative
       else if (a.LowerBound >= 0) return new Interval(a.LowerBound * a.LowerBound, a.UpperBound * a.UpperBound); // interval is positive
-      else return new Interval(0, Math.Max(a.LowerBound*a.LowerBound, a.UpperBound*a.UpperBound)); // interval goes over zero
+      else return new Interval(0, Math.Max(a.LowerBound * a.LowerBound, a.UpperBound * a.UpperBound)); // interval goes over zero
     }
 
@@ -235,5 +271,21 @@
       var absLower = Math.Abs(a.LowerBound);
       var absUpper = Math.Abs(a.UpperBound);
-      return new Interval(Math.Min(absLower, absUpper), Math.Max(absLower, absUpper));
+      var min = Math.Min(absLower, absUpper);
+      var max = Math.Max(absLower, absUpper);
+
+      if (a.Contains(0.0)) {
+        min = 0.0;
+      }
+
+      return new Interval(min, max);
+    }
+
+    public static Interval AnalyticalQuotient(Interval a, Interval b) {
+      var dividend = a;
+      var divisor = Add(Square(b), new Interval(1.0, 1.0));
+      divisor = SquareRoot(divisor);
+
+      var quotient = Divide(dividend, divisor);
+      return quotient;
     }
     #endregion
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation.GP/3.5/ExternalEvaluationExpressionGrammar.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation.GP/3.5/ExternalEvaluationExpressionGrammar.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation.GP/3.5/ExternalEvaluationExpressionGrammar.cs	(revision 17457)
@@ -21,14 +21,14 @@
 
 using System.Collections.Generic;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HEAL.Attic;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Problems.DataAnalysis.Symbolic;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 
 namespace HeuristicLab.Problems.ExternalEvaluation.GP {
   [StorableType("747A7784-EF15-4CEF-A621-79A9071A69F5")]
   [Item("ExternalEvaluationExpressionGrammar", "Represents a grammar for functional expressions using all available functions.")]
-  public class ExternalEvaluationExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+  public class ExternalEvaluationExpressionGrammar : DataAnalysisGrammar {
     [Storable]
     private HeuristicLab.Problems.DataAnalysis.Symbolic.Variable variableSymbol;
@@ -45,5 +45,5 @@
     }
 
-    private void Initialize() {      
+    private void Initialize() {
       var add = new Addition();
       var sub = new Subtraction();
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/SymbolicRegression/GESymbolicExpressionGrammar.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/SymbolicRegression/GESymbolicExpressionGrammar.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/SymbolicRegression/GESymbolicExpressionGrammar.cs	(revision 17457)
@@ -25,8 +25,8 @@
 using System.Collections.Generic;
 using System.Linq;
+using HEAL.Attic;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HEAL.Attic;
 using HeuristicLab.Problems.DataAnalysis.Symbolic;
 using HeuristicLab.Random;
@@ -35,5 +35,5 @@
   [StorableType("73D43A23-02FF-4BD8-9834-55D8A90E0FCE")]
   [Item("GESymbolicExpressionGrammar", "Represents a grammar for functional expressions for grammatical evolution.")]
-  public class GESymbolicExpressionGrammar : SymbolicExpressionGrammar, ISymbolicDataAnalysisGrammar {
+  public class GESymbolicExpressionGrammar : DataAnalysisGrammar, ISymbolicDataAnalysisGrammar {
     [StorableConstructor]
     protected GESymbolicExpressionGrammar(StorableConstructorFlag _) : base(_) { }
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/CompilerErrorDialog.Designer.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/CompilerErrorDialog.Designer.cs	(revision 17457)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/CompilerErrorDialog.Designer.cs	(revision 17457)
@@ -0,0 +1,212 @@
+﻿namespace HeuristicLab.Scripting.Views {
+  partial class CompilerErrorDialog {
+    /// <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.iconLabel = new System.Windows.Forms.Label();
+      this.detailsGroupBox = new System.Windows.Forms.GroupBox();
+      this.codeValueLinkLabel = new System.Windows.Forms.LinkLabel();
+      this.messageLabel = new System.Windows.Forms.Label();
+      this.codeLabel = new System.Windows.Forms.Label();
+      this.columnValueLabel = new System.Windows.Forms.Label();
+      this.columnLabel = new System.Windows.Forms.Label();
+      this.lineValueLabel = new System.Windows.Forms.Label();
+      this.lineLabel = new System.Windows.Forms.Label();
+      this.messageValueTextBox = new System.Windows.Forms.TextBox();
+      this.infoTextBox = new System.Windows.Forms.TextBox();
+      this.okButton = new System.Windows.Forms.Button();
+      this.detailsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // iconLabel
+      // 
+      this.iconLabel.Location = new System.Drawing.Point(12, 9);
+      this.iconLabel.Name = "iconLabel";
+      this.iconLabel.Size = new System.Drawing.Size(30, 30);
+      this.iconLabel.TabIndex = 1;
+      // 
+      // detailsGroupBox
+      // 
+      this.detailsGroupBox.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.detailsGroupBox.Controls.Add(this.codeValueLinkLabel);
+      this.detailsGroupBox.Controls.Add(this.messageLabel);
+      this.detailsGroupBox.Controls.Add(this.codeLabel);
+      this.detailsGroupBox.Controls.Add(this.columnValueLabel);
+      this.detailsGroupBox.Controls.Add(this.columnLabel);
+      this.detailsGroupBox.Controls.Add(this.lineValueLabel);
+      this.detailsGroupBox.Controls.Add(this.lineLabel);
+      this.detailsGroupBox.Controls.Add(this.messageValueTextBox);
+      this.detailsGroupBox.Location = new System.Drawing.Point(12, 42);
+      this.detailsGroupBox.Name = "detailsGroupBox";
+      this.detailsGroupBox.Size = new System.Drawing.Size(560, 212);
+      this.detailsGroupBox.TabIndex = 3;
+      this.detailsGroupBox.TabStop = false;
+      this.detailsGroupBox.Text = "Details";
+      // 
+      // codeValueLinkLabel
+      // 
+      this.codeValueLinkLabel.AutoSize = true;
+      this.codeValueLinkLabel.Location = new System.Drawing.Point(65, 65);
+      this.codeValueLinkLabel.Name = "codeValueLinkLabel";
+      this.codeValueLinkLabel.Size = new System.Drawing.Size(21, 13);
+      this.codeValueLinkLabel.TabIndex = 5;
+      this.codeValueLinkLabel.TabStop = true;
+      this.codeValueLinkLabel.Text = "{0}";
+      this.codeValueLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.codeLinkLabel_LinkClicked);
+      // 
+      // messageLabel
+      // 
+      this.messageLabel.AutoSize = true;
+      this.messageLabel.Location = new System.Drawing.Point(6, 88);
+      this.messageLabel.Name = "messageLabel";
+      this.messageLabel.Size = new System.Drawing.Size(53, 13);
+      this.messageLabel.TabIndex = 6;
+      this.messageLabel.Text = "Message:";
+      // 
+      // codeLabel
+      // 
+      this.codeLabel.AutoSize = true;
+      this.codeLabel.Location = new System.Drawing.Point(6, 65);
+      this.codeLabel.Name = "codeLabel";
+      this.codeLabel.Size = new System.Drawing.Size(35, 13);
+      this.codeLabel.TabIndex = 4;
+      this.codeLabel.Text = "Code:";
+      // 
+      // columnValueLabel
+      // 
+      this.columnValueLabel.AutoSize = true;
+      this.columnValueLabel.Location = new System.Drawing.Point(65, 42);
+      this.columnValueLabel.Name = "columnValueLabel";
+      this.columnValueLabel.Size = new System.Drawing.Size(21, 13);
+      this.columnValueLabel.TabIndex = 3;
+      this.columnValueLabel.Text = "{0}";
+      // 
+      // columnLabel
+      // 
+      this.columnLabel.AutoSize = true;
+      this.columnLabel.Location = new System.Drawing.Point(6, 42);
+      this.columnLabel.Name = "columnLabel";
+      this.columnLabel.Size = new System.Drawing.Size(45, 13);
+      this.columnLabel.TabIndex = 2;
+      this.columnLabel.Text = "Column:";
+      // 
+      // lineValueLabel
+      // 
+      this.lineValueLabel.AutoSize = true;
+      this.lineValueLabel.Location = new System.Drawing.Point(65, 19);
+      this.lineValueLabel.Name = "lineValueLabel";
+      this.lineValueLabel.Size = new System.Drawing.Size(21, 13);
+      this.lineValueLabel.TabIndex = 1;
+      this.lineValueLabel.Text = "{0}";
+      // 
+      // lineLabel
+      // 
+      this.lineLabel.AutoSize = true;
+      this.lineLabel.Location = new System.Drawing.Point(6, 19);
+      this.lineLabel.Name = "lineLabel";
+      this.lineLabel.Size = new System.Drawing.Size(30, 13);
+      this.lineLabel.TabIndex = 0;
+      this.lineLabel.Text = "Line:";
+      // 
+      // messageValueTextBox
+      // 
+      this.messageValueTextBox.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.messageValueTextBox.BackColor = System.Drawing.SystemColors.Control;
+      this.messageValueTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
+      this.messageValueTextBox.Location = new System.Drawing.Point(68, 88);
+      this.messageValueTextBox.Multiline = true;
+      this.messageValueTextBox.Name = "messageValueTextBox";
+      this.messageValueTextBox.ReadOnly = true;
+      this.messageValueTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+      this.messageValueTextBox.Size = new System.Drawing.Size(486, 118);
+      this.messageValueTextBox.TabIndex = 7;
+      this.messageValueTextBox.Text = "{0}";
+      // 
+      // infoTextBox
+      // 
+      this.infoTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.infoTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
+      this.infoTextBox.Cursor = System.Windows.Forms.Cursors.Default;
+      this.infoTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+      this.infoTextBox.Location = new System.Drawing.Point(48, 17);
+      this.infoTextBox.Name = "infoTextBox";
+      this.infoTextBox.ReadOnly = true;
+      this.infoTextBox.Size = new System.Drawing.Size(524, 13);
+      this.infoTextBox.TabIndex = 2;
+      this.infoTextBox.Text = "{0} was generated during compilation.";
+      // 
+      // okButton
+      // 
+      this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+      this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
+      this.okButton.Location = new System.Drawing.Point(497, 260);
+      this.okButton.Name = "okButton";
+      this.okButton.Size = new System.Drawing.Size(75, 23);
+      this.okButton.TabIndex = 0;
+      this.okButton.Text = "&OK";
+      this.okButton.UseVisualStyleBackColor = true;
+      // 
+      // CompilerErrorDialog
+      // 
+      this.AcceptButton = this.okButton;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.CancelButton = this.okButton;
+      this.ClientSize = new System.Drawing.Size(584, 295);
+      this.Controls.Add(this.okButton);
+      this.Controls.Add(this.infoTextBox);
+      this.Controls.Add(this.detailsGroupBox);
+      this.Controls.Add(this.iconLabel);
+      this.MaximizeBox = false;
+      this.MinimizeBox = false;
+      this.Name = "CompilerErrorDialog";
+      this.ShowInTaskbar = false;
+      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+      this.Text = "{0}";
+      this.detailsGroupBox.ResumeLayout(false);
+      this.detailsGroupBox.PerformLayout();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label iconLabel;
+    private System.Windows.Forms.GroupBox detailsGroupBox;
+    private System.Windows.Forms.TextBox messageValueTextBox;
+    private System.Windows.Forms.Label lineLabel;
+    private System.Windows.Forms.Label columnLabel;
+    private System.Windows.Forms.Label lineValueLabel;
+    private System.Windows.Forms.Label codeLabel;
+    private System.Windows.Forms.Label columnValueLabel;
+    private System.Windows.Forms.LinkLabel codeValueLinkLabel;
+    private System.Windows.Forms.Label messageLabel;
+    private System.Windows.Forms.TextBox infoTextBox;
+    private System.Windows.Forms.Button okButton;
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/CompilerErrorDialog.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/CompilerErrorDialog.cs	(revision 17457)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/CompilerErrorDialog.cs	(revision 17457)
@@ -0,0 +1,34 @@
+﻿using System.CodeDom.Compiler;
+using System.Diagnostics;
+using System.Drawing;
+using System.Windows.Forms;
+using HeuristicLab.Common.Resources;
+
+namespace HeuristicLab.Scripting.Views {
+  public partial class CompilerErrorDialog : Form {
+    private const string ErrorLinkFormatString = "https://docs.microsoft.com/en-us/search/?search={0}&scope=.NET";
+
+    private static readonly Bitmap WarningImage = VSImageLibrary.Warning;
+    private static readonly Bitmap ErrorImage = VSImageLibrary.Error;
+
+    public CompilerErrorDialog(CompilerError error) {
+      InitializeComponent();
+
+      var image = error.IsWarning ? WarningImage : ErrorImage;
+
+      Icon = Icon.FromHandle(image.GetHicon());
+      Text = error.IsWarning ? "Warning" : "Error";
+      iconLabel.Image = image;
+      infoTextBox.Text = string.Format(infoTextBox.Text, error.IsWarning ? "A warning" : "An error");
+      lineValueLabel.Text = error.Line.ToString();
+      columnValueLabel.Text = error.Column.ToString();
+      codeValueLinkLabel.Text = error.ErrorNumber;
+      codeValueLinkLabel.Links.Add(new LinkLabel.Link(0, error.ErrorNumber.Length, string.Format(ErrorLinkFormatString, error.ErrorNumber)));
+      messageValueTextBox.Text = error.ErrorText;
+    }
+
+    private void codeLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
+      Process.Start((string)e.Link.LinkData);
+    }
+  }
+}
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/HeuristicLab.Scripting.Views-3.3.csproj
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/HeuristicLab.Scripting.Views-3.3.csproj	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/HeuristicLab.Scripting.Views-3.3.csproj	(revision 17457)
@@ -97,4 +97,10 @@
     <Compile Include="CSharpScriptView.Designer.cs">
       <DependentUpon>CSharpScriptView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="CompilerErrorDialog.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="CompilerErrorDialog.Designer.cs">
+      <DependentUpon>CompilerErrorDialog.cs</DependentUpon>
     </Compile>
     <Compile Include="ExecutableScriptView.cs">
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/ScriptView.Designer.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/ScriptView.Designer.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/ScriptView.Designer.cs	(revision 17457)
@@ -184,4 +184,5 @@
       this.errorListView.UseCompatibleStateImageBehavior = false;
       this.errorListView.View = System.Windows.Forms.View.Details;
+      this.errorListView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.errorListView_MouseClick);
       this.errorListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.errorListView_MouseDoubleClick);
       // 
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/ScriptView.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/ScriptView.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Scripting.Views/3.3/ScriptView.cs	(revision 17457)
@@ -209,11 +209,23 @@
     }
 
+    private void errorListView_MouseClick(object sender, MouseEventArgs e) {
+      if (e.Button != MouseButtons.Left) return;
+
+      var item = errorListView.SelectedItems[0];
+      var message = (CompilerError)item.Tag;
+
+      codeEditor.ScrollToPosition(message.Line, message.Column);
+      codeEditor.Focus();
+    }
+
     private void errorListView_MouseDoubleClick(object sender, MouseEventArgs e) {
-      if (e.Button == MouseButtons.Left) {
-        var item = errorListView.SelectedItems[0];
-        var message = (CompilerError)item.Tag;
-        codeEditor.ScrollToPosition(message.Line, message.Column);
-        codeEditor.Focus();
-      }
+      if (e.Button != MouseButtons.Left) return;
+
+      var item = errorListView.SelectedItems[0];
+      var message = (CompilerError)item.Tag;
+
+      using (var dialog = new CompilerErrorDialog(message)) {
+        dialog.ShowDialog(this);
+      };
     }
     #endregion
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Services.Hive/3.3/HiveService.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Services.Hive/3.3/HiveService.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Services.Hive/3.3/HiveService.cs	(revision 17457)
@@ -665,7 +665,9 @@
             bool oldIsAllowedToCalculate = slave.IsAllowedToCalculate;
             Guid? oldParentResourceId = slave.ParentResourceId;
+            bool? oldIsDisposable = slave.IsDisposable;
             slaveInfo.CopyToEntity(slave);
             slave.IsAllowedToCalculate = oldIsAllowedToCalculate;
             slave.ParentResourceId = oldParentResourceId;
+            slave.IsDisposable = oldIsDisposable;
             slave.LastHeartbeat = DateTime.Now;
             slave.SlaveState = DA.SlaveState.Idle;
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GaussianProcessRegressionSampleTest.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GaussianProcessRegressionSampleTest.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GaussianProcessRegressionSampleTest.cs	(revision 17457)
@@ -68,6 +68,6 @@
       gpr.Problem = regProblem;
 
-      gpr.CovarianceFunction = new CovarianceSquaredExponentialIso();
-      gpr.MeanFunction = new MeanConst();
+      gpr.CovarianceFunction = gpr.CovarianceFunctionParameter.ValidValues.OfType<CovarianceSquaredExponentialIso>().First();
+      gpr.MeanFunction = gpr.MeanFunctionParameter.ValidValues.OfType<MeanConst>().First();
       gpr.MinimizationIterations = 20;
       gpr.Seed = 0;
Index: /branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs
===================================================================
--- /branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs	(revision 17456)
+++ /branches/2521_ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs	(revision 17457)
@@ -14,5 +14,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalAddOperation() {
+    public void AddIntervalTest() {
       //add        [x1,x2] + [y1,y2] = [x1 + y1,x2 + y2]
 
@@ -28,5 +28,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalSubOperation() {
+    public void SubtractIntervalTest() {
       //subtract   [x1,x2] − [y1,y2] = [x1 − y2,x2 − y1]
 
@@ -42,5 +42,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalMutlipyOperation() {
+    public void MultiplyIntervalTest() {
       //multiply   [x1,x2] * [y1,y2] = [min(x1*y1,x1*y2,x2*y1,x2*y2),max(x1*y1,x1*y2,x2*y1,x2*y2)]
 
@@ -59,5 +59,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalDivideOperation() {
+    public void DivideIntervalTest() {
       //divide  [x1, x2] / [y1, y2] = [x1, x2] * (1/[y1, y2]), where 1 / [y1,y2] = [1 / y2,1 / y1] if 0 not in [y_1, y_2].
 
@@ -80,5 +80,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalSineOperator() {
+    public void SineIntervalTest() {
       //sine depends on interval
       //sin([0, 2*pi]) = [-1, 1]
@@ -98,5 +98,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalCosineOperator() {
+    public void CosineIntervalTest() {
       //Cosine uses sine Interval.Sine(Interval.Subtract(a, new Interval(Math.PI / 2, Math.PI / 2)));
       Assert.AreEqual<Interval>(Interval.Cosine(new Interval(0, 2 * Math.PI)), new Interval(-1, 1));
@@ -107,5 +107,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalLogOperator() {
+    public void LogIntervalTest() {
       //Log([3, 5]) = [log(3), log(5)]
       Assert.AreEqual<Interval>(new Interval(Math.Log(3), Math.Log(5)), Interval.Logarithm(new Interval(3, 5)));
@@ -122,5 +122,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalExpOperator() {
+    public void ExponentialIntervalTest() {
       //Exp([0, 1]) = [exp(0), exp(1)]
       Assert.AreEqual<Interval>(new Interval(1, Math.Exp(1)), Interval.Exponential(new Interval(0, 1)));
@@ -131,5 +131,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalSqrOperator() {
+    public void SquareIntervalTest() {
       Assert.AreEqual<Interval>(new Interval(1, 4), Interval.Square(new Interval(1, 2)));
       Assert.AreEqual<Interval>(new Interval(1, 4), Interval.Square(new Interval(-2, -1)));
@@ -140,5 +140,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalSqrtOperator() {
+    public void SquarerootIntervalTest() {
       Assert.AreEqual<Interval>(new Interval(1, 2), Interval.SquareRoot(new Interval(1, 4)));
       Assert.AreEqual<Interval>(new Interval(double.NaN, double.NaN), Interval.SquareRoot(new Interval(-4, -1)));
@@ -148,5 +148,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalCubeOperator() {
+    public void CubeIntervalTest() {
       Assert.AreEqual<Interval>(new Interval(1, 8), Interval.Cube(new Interval(1, 2)));
       Assert.AreEqual<Interval>(new Interval(-8, -1), Interval.Cube(new Interval(-2, -1)));
@@ -157,5 +157,5 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalCbrtOperator() {
+    public void CubeRootIntervalTest() {
       Assert.AreEqual<Interval>(new Interval(1, 2), Interval.CubicRoot(new Interval(1, 8)));
       Assert.AreEqual<Interval>(new Interval(-2, -2), Interval.CubicRoot(new Interval(-8, -8)));
@@ -170,15 +170,82 @@
     [TestCategory("Problems.DataAnalysis")]
     [TestProperty("Time", "short")]
-    public void TestIntervalAbsoluteOperator() {
-      Assert.AreEqual(new Interval(2, 2), Interval.Absolute(new Interval(-2, -2)));
-      Assert.AreEqual(new Interval(5, 5), Interval.Absolute(new Interval(5, 5)));
-      Assert.AreEqual(new Interval(2, 8), Interval.Absolute(new Interval(2, 8)));
-      Assert.AreEqual(new Interval(5, 14), Interval.Absolute(new Interval(-14, -5)));
-      Assert.AreEqual(new Interval(2, 7), Interval.Absolute(new Interval(-2, 7)));
-      Assert.AreEqual(new Interval(2, 22), Interval.Absolute(new Interval(-22, -2)));
-      Assert.AreEqual(new Interval(6, 22), Interval.Absolute(new Interval(-22, 6)));
-      Assert.AreEqual(new Interval(0, 0), Interval.Absolute(new Interval(0, 0)));
-      Assert.AreEqual(new Interval(0, 2), Interval.Absolute(new Interval(-2, 0)));
-      Assert.AreEqual(new Interval(0, 2), Interval.Absolute(new Interval(0, 2)));
+    public void AbsoluteIntervalTest() {
+      Assert.AreEqual(new Interval(2, 5), Interval.Absolute(new Interval(-5, -2)));
+      Assert.AreEqual(new Interval(2, 5), Interval.Absolute(new Interval(2, 5)));
+      Assert.AreEqual(new Interval(0, 3), Interval.Absolute(new Interval(-3, 0)));
+      Assert.AreEqual(new Interval(0, 5), Interval.Absolute(new Interval(0, 5)));
+      Assert.AreEqual(new Interval(0, 5), Interval.Absolute(new Interval(-2, 5)));
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void AnalyticalQuotientIntervalTest() {
+      //Analytical Quotient ==> a / sqrt(b^2 + 1)
+      var aPos = new Interval(3, 5);
+      var aZero = new Interval(-3, 5);
+      var aNeg = new Interval(-5, -3);
+
+      var bPos = new Interval(2, 4);
+      var bZero = new Interval(-2, 4);
+      var bNeg = new Interval(-4, -2);
+
+      //Second interval goes over zero
+      Assert.AreEqual(new Interval(aPos.LowerBound/Math.Sqrt(17), aPos.UpperBound), Interval.AnalyticalQuotient(aPos, bZero));
+      Assert.AreEqual(new Interval(aZero.LowerBound, aZero.UpperBound), Interval.AnalyticalQuotient(aZero, bZero));
+      Assert.AreEqual(new Interval(aNeg.LowerBound, aNeg.UpperBound/Math.Sqrt(17)), Interval.AnalyticalQuotient(aNeg, bZero));
+      //Second interval is positive
+      Assert.AreEqual(new Interval(aPos.LowerBound/Math.Sqrt(17), aPos.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aPos, bPos));
+      Assert.AreEqual(new Interval(aZero.LowerBound/Math.Sqrt(5), aZero.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aZero, bPos));
+      Assert.AreEqual(new Interval(aNeg.LowerBound/Math.Sqrt(5), aNeg.UpperBound/Math.Sqrt(17)), Interval.AnalyticalQuotient(aNeg, bPos));
+      //Second interval is negative
+      Assert.AreEqual(new Interval(aPos.LowerBound/Math.Sqrt(17), aPos.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aPos, bNeg));
+      Assert.AreEqual(new Interval(aZero.LowerBound/Math.Sqrt(5), aZero.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aZero, bNeg));
+      Assert.AreEqual(new Interval(aNeg.LowerBound/Math.Sqrt(5), aNeg.UpperBound/Math.Sqrt(17)), Interval.AnalyticalQuotient(aNeg, bNeg));
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void IsNegativeIntervalTest() {
+      Assert.IsTrue(new Interval(-2, -1).IsNegative);
+      Assert.IsFalse(new Interval(-2, 0).IsNegative);
+      Assert.IsFalse(new Interval(-2, 2).IsNegative);
+      Assert.IsFalse(new Interval(2, 4).IsNegative);
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void IsPositiveIntervalTest() {
+      Assert.IsTrue(new Interval(3, 5).IsPositive);
+      Assert.IsFalse(new Interval(0, 5).IsPositive);
+      Assert.IsFalse(new Interval(-1, 5).IsPositive);
+      Assert.IsFalse(new Interval(-5, -2).IsPositive);
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void IsAlmostIntervalTest() {
+      var negativeLowerBound = -2E-13;
+      var negativeUpperBound = -1E-13;
+      var positiveLowerBound = 3E-13;
+      var positiveUpperBound = 5E-13;
+
+      var negativeInterval = new Interval(negativeLowerBound, negativeUpperBound);
+      var positiveInterval = new Interval(positiveLowerBound, positiveUpperBound);
+      var zeroInterval = new Interval(negativeUpperBound, positiveLowerBound);
+
+      //Check for right-shift of negative interval
+      Assert.AreEqual(negativeUpperBound, negativeInterval.LowerBound);
+      Assert.AreEqual(negativeUpperBound, negativeInterval.UpperBound);
+      //Check for left-shift of positive interval
+      Assert.AreEqual(positiveLowerBound, positiveInterval.LowerBound);
+      Assert.AreEqual(positiveLowerBound, positiveInterval.UpperBound);
+      //Check for setting interval to zero
+      Assert.AreEqual(0, zeroInterval.LowerBound);
+      Assert.AreEqual(0, zeroInterval.UpperBound);
+
     }
   }
