Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs	(revision 6675)
@@ -106,5 +106,5 @@
 
       var model = LinearDiscriminantAnalysis.CreateDiscriminantFunctionModel(tree, new SymbolicDataAnalysisExpressionTreeInterpreter(), problemData, rows);
-      SymbolicDiscriminantFunctionClassificationSolution solution = new SymbolicDiscriminantFunctionClassificationSolution(model, problemData);
+      SymbolicDiscriminantFunctionClassificationSolution solution = new SymbolicDiscriminantFunctionClassificationSolution(model, (IClassificationProblemData)problemData.Clone());
 
       return solution;
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs	(revision 6675)
@@ -110,5 +110,5 @@
       addition.AddSubtree(cNode);
 
-      SymbolicRegressionSolution solution = new SymbolicRegressionSolution(new SymbolicRegressionModel(tree, new SymbolicDataAnalysisExpressionTreeInterpreter()), problemData);
+      SymbolicRegressionSolution solution = new SymbolicRegressionSolution(new SymbolicRegressionModel(tree, new SymbolicDataAnalysisExpressionTreeInterpreter()), (IRegressionProblemData)problemData.Clone());
       solution.Model.Name = "Linear Regression Model";
       return solution;
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassification.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassification.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassification.cs	(revision 6675)
@@ -95,5 +95,5 @@
       relClassError = alglib.mnlrelclserror(lm, inputMatrix, nRows);
 
-      MultinomialLogitClassificationSolution solution = new MultinomialLogitClassificationSolution(problemData, new MultinomialLogitModel(lm, targetVariable, allowedInputVariables, classValues));
+      MultinomialLogitClassificationSolution solution = new MultinomialLogitClassificationSolution((IClassificationProblemData)problemData.Clone(), new MultinomialLogitModel(lm, targetVariable, allowedInputVariables, classValues));
       return solution;
     }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourClassification.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourClassification.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourClassification.cs	(revision 6675)
@@ -107,6 +107,6 @@
       }
       alglib.nearestneighbor.kdtreebuild(inputMatrix, nRows, inputMatrix.GetLength(1) - 1, 1, 2, kdtree);
-
-      return new NearestNeighbourClassificationSolution(problemData, new NearestNeighbourModel(kdtree, k, targetVariable, allowedInputVariables, problemData.ClassValues.ToArray()));
+      var problemDataClone = (IClassificationProblemData) problemData.Clone();
+      return new NearestNeighbourClassificationSolution(problemDataClone, new NearestNeighbourModel(kdtree, k, targetVariable, allowedInputVariables, problemDataClone.ClassValues.ToArray()));
     }
     #endregion
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourRegression.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourRegression.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourRegression.cs	(revision 6675)
@@ -98,5 +98,5 @@
       alglib.nearestneighbor.kdtreebuild(inputMatrix, nRows, inputMatrix.GetLength(1) - 1, 1, 2, kdtree);
 
-      return new NearestNeighbourRegressionSolution(problemData, new NearestNeighbourModel(kdtree, k, targetVariable, allowedInputVariables));
+      return new NearestNeighbourRegressionSolution((IRegressionProblemData)problemData.Clone(), new NearestNeighbourModel(kdtree, k, targetVariable, allowedInputVariables));
     }
     #endregion
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassification.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassification.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassification.cs	(revision 6675)
@@ -188,5 +188,6 @@
       relClassError = alglib.mlpclserror(multiLayerPerceptron, inputMatrix, nRows) / (double)nRows;
 
-      return new NeuralNetworkClassificationSolution(problemData, new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables, problemData.ClassValues.ToArray()));
+      var problemDataClone = (IClassificationProblemData)problemData.Clone();
+      return new NeuralNetworkClassificationSolution(problemDataClone, new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables, problemDataClone.ClassValues.ToArray()));
     }
     #endregion
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassification.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassification.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassification.cs	(revision 6675)
@@ -198,6 +198,6 @@
       avgRelError = alglib.mlpeavgrelerror(mlpEnsemble, inputMatrix, nRows);
       relClassError = alglib.mlperelclserror(mlpEnsemble, inputMatrix, nRows);
-
-      return new NeuralNetworkEnsembleClassificationSolution(problemData, new NeuralNetworkEnsembleModel(mlpEnsemble, targetVariable, allowedInputVariables, problemData.ClassValues.ToArray()));
+      var problemDataClone = (IClassificationProblemData)problemData.Clone();
+      return new NeuralNetworkEnsembleClassificationSolution(problemDataClone, new NeuralNetworkEnsembleModel(mlpEnsemble, targetVariable, allowedInputVariables, problemDataClone.ClassValues.ToArray()));
     }
     #endregion
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegression.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegression.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegression.cs	(revision 6675)
@@ -185,5 +185,5 @@
       avgRelError = alglib.mlpeavgrelerror(mlpEnsemble, inputMatrix, nRows);
 
-      return new NeuralNetworkEnsembleRegressionSolution(problemData, new NeuralNetworkEnsembleModel(mlpEnsemble, targetVariable, allowedInputVariables));
+      return new NeuralNetworkEnsembleRegressionSolution((IRegressionProblemData)problemData.Clone(), new NeuralNetworkEnsembleModel(mlpEnsemble, targetVariable, allowedInputVariables));
     }
     #endregion
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs	(revision 6675)
@@ -179,5 +179,5 @@
       avgRelError = alglib.mlpavgrelerror(multiLayerPerceptron, inputMatrix, nRows);      
 
-      return new NeuralNetworkRegressionSolution(problemData, new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables));
+      return new NeuralNetworkRegressionSolution((IRegressionProblemData)problemData.Clone(), new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables));
     }
     #endregion
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs	(revision 6675)
@@ -126,5 +126,5 @@
       relClassificationError = rep.relclserror;
       outOfBagRelClassificationError = rep.oobrelclserror;
-      return new RandomForestClassificationSolution(problemData, new RandomForestModel(dforest, targetVariable, allowedInputVariables, classValues));
+      return new RandomForestClassificationSolution((IClassificationProblemData)problemData.Clone(), new RandomForestModel(dforest, targetVariable, allowedInputVariables, classValues));
     }
     #endregion
Index: /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs	(revision 6675)
@@ -116,5 +116,5 @@
       outOfBagRmsError = rep.oobrmserror;
 
-      return new RandomForestRegressionSolution(problemData, new RandomForestModel(dforest, targetVariable, allowedInputVariables));
+      return new RandomForestRegressionSolution((IRegressionProblemData)problemData.Clone(), new RandomForestModel(dforest, targetVariable, allowedInputVariables));
     }
     #endregion
Index: /branches/GP.Grammar.Editor/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs	(revision 6675)
@@ -45,4 +45,9 @@
     }
 
+    public bool ShowDetails {
+      get { return showDetailsCheckBox.Checked; }
+      set { showDetailsCheckBox.Checked = value; }
+    }
+
     public ListView ItemsListView {
       get { return itemsListView; }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj	(revision 6675)
@@ -120,4 +120,5 @@
     <Compile Include="Crossovers\UniformLikeCrossover.cs" />
     <Compile Include="HeuristicLabEncodingsPermutationEncodingPlugin.cs" />
+    <Compile Include="Interfaces\IPermutationScrambleMoveOperator.cs" />
     <Compile Include="Interfaces\IPermutationMultiNeighborhoodShakingOperator.cs" />
     <Compile Include="Interfaces\IPermutationSwap2MoveOperator.cs" />
@@ -139,4 +140,8 @@
     <Compile Include="Moves\Edge.cs" />
     <Compile Include="Moves\PermutationMoveAttribute.cs" />
+    <Compile Include="Moves\Scramble\StochasticScrambleMultiMoveGenerator.cs" />
+    <Compile Include="Moves\Scramble\ScrambleMove.cs" />
+    <Compile Include="Moves\Scramble\ScrambleMoveGenerator.cs" />
+    <Compile Include="Moves\Scramble\ScrambleMoveMaker.cs" />
     <Compile Include="Moves\StandardEdgeEqualityComparer.cs" />
     <Compile Include="Moves\Swap2\ExhaustiveSwap2MoveGenerator.cs" />
Index: /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Interfaces/IPermutationScrambleMoveOperator.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Interfaces/IPermutationScrambleMoveOperator.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Interfaces/IPermutationScrambleMoveOperator.cs	(revision 6675)
@@ -0,0 +1,28 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  public interface IPermutationScrambleMoveOperator : IPermutationMoveOperator {
+    ILookupParameter<ScrambleMove> ScrambleMoveParameter { get; }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/ScrambleManipulator.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/ScrambleManipulator.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/ScrambleManipulator.cs	(revision 6675)
@@ -50,12 +50,10 @@
     /// <param name="permutation">The permutation to manipulate.</param>
     public static void Apply(IRandom random, Permutation permutation) {
-      Permutation original = (Permutation)permutation.Clone();
-
       int breakPoint1, breakPoint2;
       int[] scrambledIndices, remainingIndices, temp;
       int selectedIndex, index;
 
-      breakPoint1 = random.Next(original.Length - 1);
-      breakPoint2 = random.Next(breakPoint1 + 1, original.Length);
+      breakPoint1 = random.Next(permutation.Length - 1);
+      breakPoint2 = random.Next(breakPoint1 + 1, permutation.Length);
 
       scrambledIndices = new int[breakPoint2 - breakPoint1 + 1];
@@ -80,6 +78,11 @@
       }
 
-      for (int i = 0; i <= (breakPoint2 - breakPoint1); i++) {  // scramble permutation between breakpoints
-        permutation[breakPoint1 + i] = original[breakPoint1 + scrambledIndices[i]];
+      Apply(permutation, breakPoint1, scrambledIndices);
+    }
+
+    public static void Apply(Permutation permutation, int startIndex, int[] scrambleArray) {
+      Permutation original = (Permutation)permutation.Clone();
+      for (int i = 0; i < scrambleArray.Length; i++) {  // scramble permutation between breakpoints
+        permutation[startIndex + i] = original[startIndex + scrambleArray[i]];
       }
     }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMove.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMove.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMove.cs	(revision 6675)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  [Item("ScrambleMove", "Item that describes a scramble move.")]
+  [StorableClass]
+  public sealed class ScrambleMove : Item {
+    [Storable]
+    public int StartIndex { get; private set; }
+    [Storable]
+    public int[] ScrambledIndices { get; private set; }
+
+    [StorableConstructor]
+    private ScrambleMove(bool deserializing) : base(deserializing) { }
+    private ScrambleMove(ScrambleMove original, Cloner cloner)
+      : base(original, cloner) {
+      this.StartIndex = original.StartIndex;
+      this.ScrambledIndices = (int[])original.ScrambledIndices.Clone();
+    }
+    public ScrambleMove() : this(-1, null) { }
+    public ScrambleMove(int startIndex, int[] scrambledIndices)
+      : base() {
+      this.StartIndex = startIndex;
+      this.ScrambledIndices = scrambledIndices;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ScrambleMove(this, cloner);
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveGenerator.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveGenerator.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveGenerator.cs	(revision 6675)
@@ -0,0 +1,67 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  [Item("ScrambleMoveGenerator", "Base class for all scramble move generators.")]
+  [StorableClass]
+  public abstract class ScrambleMoveGenerator : SingleSuccessorOperator, IPermutationScrambleMoveOperator, IMoveGenerator {
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+    public ILookupParameter<ScrambleMove> ScrambleMoveParameter {
+      get { return (LookupParameter<ScrambleMove>)Parameters["ScrambleMove"]; }
+    }
+
+    [StorableConstructor]
+    protected ScrambleMoveGenerator(bool deserializing) : base(deserializing) { }
+    protected ScrambleMoveGenerator(ScrambleMoveGenerator original, Cloner cloner) : base(original, cloner) { }
+    public ScrambleMoveGenerator()
+      : base() {
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated."));
+      Parameters.Add(new LookupParameter<ScrambleMove>("ScrambleMove", "The moves that should be generated in subscopes."));
+    }
+
+    public override IOperation Apply() {
+      IScope scope = ExecutionContext.Scope;
+      Permutation p = PermutationParameter.ActualValue;
+      ScrambleMove[] moves = GenerateMoves(p);
+      Scope[] moveScopes = new Scope[moves.Length];
+      for (int i = 0; i < moveScopes.Length; i++) {
+        moveScopes[i] = new Scope(i.ToString());
+        moveScopes[i].Variables.Add(new Variable(ScrambleMoveParameter.ActualName, moves[i]));
+      }
+      scope.SubScopes.AddRange(moveScopes);
+      return base.Apply();
+    }
+
+    protected abstract ScrambleMove[] GenerateMoves(Permutation permutation);
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveMaker.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveMaker.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/ScrambleMoveMaker.cs	(revision 6675)
@@ -0,0 +1,77 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  [Item("ScrambleMoveMaker", "Peforms a scramble move on a given permutation and updates the quality.")]
+  [StorableClass]
+  public class ScrambleMoveMaker : SingleSuccessorOperator, IPermutationScrambleMoveOperator, IMoveMaker {
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public ILookupParameter<DoubleValue> MoveQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
+    }
+    public ILookupParameter<ScrambleMove> ScrambleMoveParameter {
+      get { return (ILookupParameter<ScrambleMove>)Parameters["ScrambleMove"]; }
+    }
+    public ILookupParameter<Permutation> PermutationParameter {
+      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
+    }
+
+    [StorableConstructor]
+    protected ScrambleMoveMaker(bool deserializing) : base(deserializing) { }
+    protected ScrambleMoveMaker(ScrambleMoveMaker original, Cloner cloner) : base(original, cloner) { }
+    public ScrambleMoveMaker()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution."));
+      Parameters.Add(new LookupParameter<ScrambleMove>("ScrambleMove", "The move to evaluate."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move."));
+      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ScrambleMoveMaker(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      ScrambleMove move = ScrambleMoveParameter.ActualValue;
+      Permutation permutation = PermutationParameter.ActualValue;
+      DoubleValue moveQuality = MoveQualityParameter.ActualValue;
+      DoubleValue quality = QualityParameter.ActualValue;
+
+      ScrambleManipulator.Apply(permutation, move.StartIndex, move.ScrambledIndices);
+      quality.Value = moveQuality.Value;
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/StochasticScrambleMultiMoveGenerator.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/StochasticScrambleMultiMoveGenerator.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/Scramble/StochasticScrambleMultiMoveGenerator.cs	(revision 6675)
@@ -0,0 +1,106 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.PermutationEncoding {
+  [Item("StochasticScrambleMultiMoveGenerator", "Randomly samples n from all possible scramble moves from a given permutation.")]
+  [StorableClass]
+  public class StochasticScrambleMultiMoveGenerator : ScrambleMoveGenerator, IMultiMoveGenerator, IStochasticOperator {
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    public IValueLookupParameter<IntValue> SampleSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; }
+    }
+
+    public IntValue SampleSize {
+      get { return SampleSizeParameter.Value; }
+      set { SampleSizeParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    protected StochasticScrambleMultiMoveGenerator(bool deserializing) : base(deserializing) { }
+    protected StochasticScrambleMultiMoveGenerator(StochasticScrambleMultiMoveGenerator original, Cloner cloner) : base(original, cloner) { }
+    public StochasticScrambleMultiMoveGenerator()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new StochasticScrambleMultiMoveGenerator(this, cloner);
+    }
+
+    public static ScrambleMove GenerateRandomMove(Permutation permutation, IRandom random) {
+      int breakPoint1, breakPoint2;
+      int[] scrambledIndices;
+
+      breakPoint1 = random.Next(permutation.Length);
+      do {
+        breakPoint2 = random.Next(permutation.Length);
+      } while (Math.Abs(breakPoint2 - breakPoint1) <= 1);
+      if (breakPoint2 < breakPoint1) { int h = breakPoint1; breakPoint1 = breakPoint2; breakPoint2 = h; }
+
+      scrambledIndices = new int[breakPoint2 - breakPoint1 + 1];
+      for (int i = 0; i < scrambledIndices.Length; i++)
+        scrambledIndices[i] = i;
+      bool[] moved = new bool[scrambledIndices.Length];
+      bool changed = false;
+      do {
+        for (int i = scrambledIndices.Length - 1; i > 0; i--) {
+          int j = random.Next(i + 1);
+          int t = scrambledIndices[j];
+          scrambledIndices[j] = scrambledIndices[i];
+          scrambledIndices[i] = t;
+          if (scrambledIndices[j] == j) moved[j] = false;
+          else moved[j] = true;
+          if (scrambledIndices[i] == i) moved[i] = false;
+          else moved[i] = true;
+        }
+        changed = moved.Any(x => x);
+      } while (!changed);
+
+      return new ScrambleMove(breakPoint1, scrambledIndices);
+    }
+
+    public static ScrambleMove[] Apply(Permutation permutation, IRandom random, int sampleSize) {
+      int length = permutation.Length;
+      ScrambleMove[] moves = new ScrambleMove[sampleSize];
+      for (int i = 0; i < sampleSize; i++) {
+        moves[i] = GenerateRandomMove(permutation, random);
+      }
+      return moves;
+    }
+
+    protected override ScrambleMove[] GenerateMoves(Permutation permutation) {
+      IRandom random = RandomParameter.ActualValue;
+      return Apply(permutation, random, SampleSizeParameter.ActualValue.Value);
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj	(revision 6675)
@@ -128,4 +128,10 @@
       <DependentUpon>BatchRunView.cs</DependentUpon>
     </Compile>
+    <Compile Include="RunCollectionContentConstraintView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectionContentConstraintView.Designer.cs">
+      <DependentUpon>RunCollectionContentConstraintView.cs</DependentUpon>
+    </Compile>
     <Compile Include="ExperimentTreeView.cs">
       <SubType>UserControl</SubType>
@@ -152,4 +158,10 @@
       <DependentUpon>RunCollectionBoxPlotView.cs</DependentUpon>
     </Compile>
+    <Compile Include="RunCollectionModificationEvaluatorView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectionModificationEvaluatorView.Designer.cs">
+      <DependentUpon>RunCollectionModificationEvaluatorView.cs</DependentUpon>
+    </Compile>
     <Compile Include="RunCollectionComparisonConstraintView.cs">
       <SubType>UserControl</SubType>
@@ -170,9 +182,9 @@
       <DependentUpon>RunCollectionConstraintCollectionView.cs</DependentUpon>
     </Compile>
-    <Compile Include="RunCollectionConstraintView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="RunCollectionConstraintView.Designer.cs">
-      <DependentUpon>RunCollectionConstraintView.cs</DependentUpon>
+    <Compile Include="RunCollectionColumnConstraintView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectionColumnConstraintView.Designer.cs">
+      <DependentUpon>RunCollectionColumnConstraintView.cs</DependentUpon>
     </Compile>
     <Compile Include="OptimizerListView.cs">
@@ -295,4 +307,8 @@
       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
       <Name>HeuristicLab.Optimization-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
+      <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
+      <Name>HeuristicLab.Parameters-3.3</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/HeuristicLabOptimizationViewsPlugin.cs.frame
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/HeuristicLabOptimizationViewsPlugin.cs.frame	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/HeuristicLabOptimizationViewsPlugin.cs.frame	(revision 6675)
@@ -38,4 +38,5 @@
   [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
   [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
   [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions","3.3")]
   public class HeuristicLabOptimizationViewsPlugin : PluginBase {
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.Designer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.Designer.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.Designer.cs	(revision 6675)
@@ -61,4 +61,5 @@
       this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
       this.openBoxPlotViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.hideRunToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.zoomButton = new System.Windows.Forms.RadioButton();
       this.selectButton = new System.Windows.Forms.RadioButton();
@@ -214,4 +215,11 @@
       this.openBoxPlotViewToolStripMenuItem.Text = "Open BoxPlot View";
       this.openBoxPlotViewToolStripMenuItem.Click += new System.EventHandler(this.openBoxPlotViewToolStripMenuItem_Click);
+      //
+      // hideRunToolStripMenuItem
+      //
+      this.hideRunToolStripMenuItem.Name = "hideRunToolStripMenuItem";
+      this.hideRunToolStripMenuItem.Size = new System.Drawing.Size(256, 22);
+      this.hideRunToolStripMenuItem.Text = "Hide Run";
+      this.hideRunToolStripMenuItem.Click += new System.EventHandler(hideRunToolStripMenuItem_Click);
       // 
       // zoomButton
@@ -374,4 +382,5 @@
     private System.Windows.Forms.Label noRunsLabel;
     private System.Windows.Forms.ToolStripMenuItem openBoxPlotViewToolStripMenuItem;
+    private System.Windows.Forms.ToolStripMenuItem hideRunToolStripMenuItem;
     private System.Windows.Forms.Button colorXAxisButton;
     private System.Windows.Forms.Button colorYAxisButton;
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs	(revision 6675)
@@ -55,5 +55,8 @@
     public RunCollectionBubbleChartView() {
       InitializeComponent();
-      chart.ContextMenuStrip.Items.Insert(0, openBoxPlotViewToolStripMenuItem);
+
+      chart.ContextMenuStrip.Items.Insert(0, hideRunToolStripMenuItem);
+      chart.ContextMenuStrip.Items.Insert(1, openBoxPlotViewToolStripMenuItem);
+      chart.ContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(ContextMenuStrip_Opening);
 
       runToDataPointMapping = new Dictionary<IRun, List<DataPoint>>();
@@ -631,4 +634,29 @@
     }
 
+    private IRun runToHide = null;
+    private void ContextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) {
+      var pos = Control.MousePosition;
+      var chartPos = chart.PointToClient(pos);
+
+      HitTestResult h = this.chart.HitTest(chartPos.X, chartPos.Y);
+      if (h.ChartElementType == ChartElementType.DataPoint) {
+        runToHide = (IRun)((DataPoint)h.Object).Tag;
+        hideRunToolStripMenuItem.Visible = true;
+      } else {
+        runToHide = null;
+        hideRunToolStripMenuItem.Visible = false;
+      }
+
+    }
+    private void hideRunToolStripMenuItem_Click(object sender, EventArgs e) {
+      var constraint = Content.Constraints.OfType<RunCollectionContentConstraint>().Where(c => c.Active).FirstOrDefault();
+      if (constraint == null) {
+        constraint = new RunCollectionContentConstraint();
+        Content.Constraints.Add(constraint);
+        constraint.Active = true;
+      }
+      constraint.ConstraintData.Add(runToHide);
+    }
+
     private void openBoxPlotViewToolStripMenuItem_Click(object sender, EventArgs e) {
       RunCollectionBoxPlotView boxplotView = new RunCollectionBoxPlotView();
@@ -662,5 +690,4 @@
     }
     #endregion
-
   }
 }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionColumnConstraintView.Designer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionColumnConstraintView.Designer.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionColumnConstraintView.Designer.cs	(revision 6675)
@@ -0,0 +1,143 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Optimization.Views {
+  partial class RunCollectionColumnConstraintView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.lblConstrainedMember = new System.Windows.Forms.Label();
+      this.lblComparisonOperation = new System.Windows.Forms.Label();
+      this.lblCompareValue = new System.Windows.Forms.Label();
+      this.cmbConstraintOperation = new System.Windows.Forms.ComboBox();
+      this.chbActive = new System.Windows.Forms.CheckBox();
+      this.cmbConstraintColumn = new System.Windows.Forms.ComboBox();
+      this.SuspendLayout();
+      // 
+      // lblConstrainedMember
+      // 
+      this.lblConstrainedMember.AutoSize = true;
+      this.lblConstrainedMember.Location = new System.Drawing.Point(3, 6);
+      this.lblConstrainedMember.Name = "lblConstrainedMember";
+      this.lblConstrainedMember.Size = new System.Drawing.Size(107, 13);
+      this.lblConstrainedMember.TabIndex = 0;
+      this.lblConstrainedMember.Text = "Constrained Member:";
+      // 
+      // lblComparisonOperation
+      // 
+      this.lblComparisonOperation.AutoSize = true;
+      this.lblComparisonOperation.Location = new System.Drawing.Point(3, 32);
+      this.lblComparisonOperation.Name = "lblComparisonOperation";
+      this.lblComparisonOperation.Size = new System.Drawing.Size(106, 13);
+      this.lblComparisonOperation.TabIndex = 1;
+      this.lblComparisonOperation.Text = "Constraint Operation:";
+      // 
+      // lblCompareValue
+      // 
+      this.lblCompareValue.AutoSize = true;
+      this.lblCompareValue.Location = new System.Drawing.Point(3, 59);
+      this.lblCompareValue.Name = "lblCompareValue";
+      this.lblCompareValue.Size = new System.Drawing.Size(83, 13);
+      this.lblCompareValue.TabIndex = 2;
+      this.lblCompareValue.Text = "Constraint Data:";
+      // 
+      // cmbConstraintOperation
+      // 
+      this.cmbConstraintOperation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.cmbConstraintOperation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.cmbConstraintOperation.FormattingEnabled = true;
+      this.cmbConstraintOperation.Location = new System.Drawing.Point(127, 29);
+      this.cmbConstraintOperation.Name = "cmbConstraintOperation";
+      this.cmbConstraintOperation.Size = new System.Drawing.Size(246, 21);
+      this.cmbConstraintOperation.TabIndex = 4;
+      this.cmbConstraintOperation.SelectedIndexChanged += new System.EventHandler(this.cmbComparisonOperation_SelectedIndexChanged);
+      // 
+      // chbActive
+      // 
+      this.chbActive.AutoSize = true;
+      this.chbActive.Location = new System.Drawing.Point(127, 82);
+      this.chbActive.Name = "chbActive";
+      this.chbActive.Size = new System.Drawing.Size(56, 17);
+      this.chbActive.TabIndex = 7;
+      this.chbActive.Text = "Active";
+      this.chbActive.UseVisualStyleBackColor = true;
+      this.chbActive.CheckedChanged += new System.EventHandler(this.chbActive_CheckedChanged);
+      // 
+      // cmbConstraintColumn
+      // 
+      this.cmbConstraintColumn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.cmbConstraintColumn.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.cmbConstraintColumn.FormattingEnabled = true;
+      this.cmbConstraintColumn.Location = new System.Drawing.Point(127, 3);
+      this.cmbConstraintColumn.Name = "cmbConstraintColumn";
+      this.cmbConstraintColumn.Size = new System.Drawing.Size(246, 21);
+      this.cmbConstraintColumn.TabIndex = 8;
+      this.cmbConstraintColumn.SelectedIndexChanged += new System.EventHandler(this.cmbConstraintColumn_SelectedIndexChanged);
+      // 
+      // RunCollectionConstraintView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.cmbConstraintColumn);
+      this.Controls.Add(this.chbActive);
+      this.Controls.Add(this.cmbConstraintOperation);
+      this.Controls.Add(this.lblCompareValue);
+      this.Controls.Add(this.lblComparisonOperation);
+      this.Controls.Add(this.lblConstrainedMember);
+      this.Name = "RunCollectionConstraintView";
+      this.Size = new System.Drawing.Size(376, 102);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label lblConstrainedMember;
+    private System.Windows.Forms.Label lblComparisonOperation;
+    private System.Windows.Forms.Label lblCompareValue;
+    private System.Windows.Forms.CheckBox chbActive;
+    protected System.Windows.Forms.ComboBox cmbConstraintColumn;
+    protected System.Windows.Forms.ComboBox cmbConstraintOperation;
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionColumnConstraintView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionColumnConstraintView.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionColumnConstraintView.cs	(revision 6675)
@@ -0,0 +1,125 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Data;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Optimization.Views {
+  [Content(typeof(IRunCollectionColumnConstraint))]
+  public partial class RunCollectionColumnConstraintView : ItemView {
+    public RunCollectionColumnConstraintView() {
+      InitializeComponent();
+    }
+
+    public new IRunCollectionColumnConstraint Content {
+      get { return (IRunCollectionColumnConstraint)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      cmbConstraintColumn.Items.Clear();
+      cmbConstraintOperation.Items.Clear();
+
+      if (Content != null) {
+        cmbConstraintOperation.Items.AddRange(Content.AllowedConstraintOperations.ToArray());
+        if (Content.ConstraintOperation != null)
+          cmbConstraintOperation.SelectedItem = Content.ConstraintOperation;
+        else if (cmbConstraintOperation.Items.Count != 0)
+          cmbConstraintOperation.SelectedIndex = 0;
+        UpdateColumnComboBox();
+        chbActive.Checked = Content.Active;
+        ReadOnly = Content.Active;
+      } else
+        chbActive.Checked = false;
+    }
+
+    protected virtual void UpdateColumnComboBox() {
+      this.cmbConstraintColumn.Items.Clear();
+      if (Content.ConstrainedValue != null) {
+        this.cmbConstraintColumn.Items.AddRange(((IStringConvertibleMatrix)Content.ConstrainedValue).ColumnNames.ToArray());
+        if (!string.IsNullOrEmpty(Content.ConstraintColumn))
+          this.cmbConstraintColumn.SelectedItem = Content.ConstraintColumn;
+      }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      this.Content.ActiveChanged += new EventHandler(Content_ActiveChanged);
+      this.Content.ConstraintOperationChanged += new EventHandler(Content_ComparisonOperationChanged);
+      this.Content.ConstraintColumnChanged += new EventHandler(Content_ConstraintColumnChanged);
+      this.Content.ConstrainedValueChanged += new EventHandler(Content_ConstrainedValueChanged);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      this.Content.ActiveChanged -= new EventHandler(Content_ActiveChanged);
+      this.Content.ConstraintOperationChanged -= new EventHandler(Content_ComparisonOperationChanged);
+      this.Content.ConstraintColumnChanged -= new EventHandler(Content_ConstraintColumnChanged);
+      this.Content.ConstrainedValueChanged += new EventHandler(Content_ConstrainedValueChanged);
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      cmbConstraintColumn.Enabled = !this.ReadOnly && Content != null;
+      cmbConstraintOperation.Enabled = !this.ReadOnly && Content != null;
+      chbActive.Enabled = !this.Locked && Content != null;
+    }
+
+    protected virtual void Content_ConstrainedValueChanged(object sender, EventArgs e) {
+      this.UpdateColumnComboBox();
+    }
+
+    protected virtual void Content_ConstraintColumnChanged(object sender, EventArgs e) {
+      if (Content.ConstrainedValue != null) {
+        if (cmbConstraintColumn.SelectedItem.ToString() != Content.ConstraintColumn)
+          cmbConstraintColumn.SelectedItem = Content.ConstraintColumn;
+      }
+    }
+    private void cmbConstraintColumn_SelectedIndexChanged(object sender, EventArgs e) {
+      if (Content.ConstrainedValue != null) {
+        Content.ConstraintColumn = (string)cmbConstraintColumn.SelectedItem;
+      }
+    }
+
+    protected virtual void Content_ComparisonOperationChanged(object sender, EventArgs e) {
+      if (Content.ConstraintOperation != (ConstraintOperation)this.cmbConstraintOperation.SelectedItem)
+        this.cmbConstraintOperation.SelectedItem = Content.ConstraintOperation;
+    }
+    protected virtual void cmbComparisonOperation_SelectedIndexChanged(object sender, EventArgs e) {
+      Content.ConstraintOperation = (ConstraintOperation)this.cmbConstraintOperation.SelectedItem;
+    }
+
+    protected virtual void Content_ActiveChanged(object sender, EventArgs e) {
+      if (this.chbActive.Checked != Content.Active)
+        this.chbActive.Checked = Content.Active;
+      this.ReadOnly = Content.Active;
+    }
+    protected virtual void chbActive_CheckedChanged(object sender, EventArgs e) {
+      if (Content != null)
+        Content.Active = chbActive.Checked;
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionComparisonConstraintView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionComparisonConstraintView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionComparisonConstraintView.cs	(revision 6675)
@@ -29,5 +29,5 @@
 namespace HeuristicLab.Optimization.Views {
   [Content(typeof(RunCollectionComparisonConstraint), true)]
-  public partial class RunCollectionComparisonConstraintView : RunCollectionConstraintView {
+  public partial class RunCollectionComparisonConstraintView : RunCollectionColumnConstraintView {
     public RunCollectionComparisonConstraintView() {
       InitializeComponent();
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionContentConstraintView.Designer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionContentConstraintView.Designer.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionContentConstraintView.Designer.cs	(revision 6675)
@@ -0,0 +1,93 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Windows.Forms;
+
+namespace HeuristicLab.Optimization.Views {
+  partial class RunCollectionContentConstraintView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.chbActive = new System.Windows.Forms.CheckBox();
+      this.runsView = new HeuristicLab.Optimization.Views.RunCollectionContentConstraintView.RunSetView();
+      this.SuspendLayout();
+      // 
+      // chbActive
+      // 
+      this.chbActive.AutoSize = true;
+      this.chbActive.Location = new System.Drawing.Point(3, 3);
+      this.chbActive.Name = "chbActive";
+      this.chbActive.Size = new System.Drawing.Size(56, 17);
+      this.chbActive.TabIndex = 7;
+      this.chbActive.Text = "Active";
+      this.chbActive.UseVisualStyleBackColor = true;
+      this.chbActive.CheckedChanged += new System.EventHandler(this.chbActive_CheckedChanged);
+      // 
+      // operatorSetView1
+      // 
+      this.runsView.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
+      this.runsView.Caption = "Runs View";
+      this.runsView.Content = null;
+      this.runsView.Location = new System.Drawing.Point(3, 26);
+      this.runsView.Name = "runsView";
+      this.runsView.ReadOnly = false;
+      this.runsView.Size = new System.Drawing.Size(309, 323);
+      this.runsView.TabIndex = 8;
+      // 
+      // RunCollectionContentConstraintView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.runsView);
+      this.Controls.Add(this.chbActive);
+      this.Name = "RunCollectionContentConstraintView";
+      this.Size = new System.Drawing.Size(315, 352);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.CheckBox chbActive;
+    private RunSetView runsView;
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionContentConstraintView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionContentConstraintView.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionContentConstraintView.cs	(revision 6675)
@@ -0,0 +1,101 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Optimization.Views {
+  [Content(typeof(RunCollectionContentConstraint), true)]
+  public partial class RunCollectionContentConstraintView : ItemView {
+    public RunCollectionContentConstraintView() {
+      InitializeComponent();
+      runsView.ShowDetails = false;
+    }
+
+    public new RunCollectionContentConstraint Content {
+      get { return (RunCollectionContentConstraint)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null) {
+        chbActive.Checked = Content.Active;
+        ReadOnly = Content.Active;
+        runsView.RunCollection = Content.ConstrainedValue;
+        runsView.Content = Content.ConstraintData;
+      } else {
+        chbActive.Checked = false;
+        runsView.RunCollection = null;
+        runsView.Content = null;
+      }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ActiveChanged += new EventHandler(Content_ActiveChanged);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ActiveChanged -= new EventHandler(Content_ActiveChanged);
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      chbActive.Enabled = !Locked && Content != null;
+      runsView.Enabled = !Locked && Content != null;
+    }
+
+    protected virtual void Content_ActiveChanged(object sender, EventArgs e) {
+      chbActive.Checked = Content.Active;
+      ReadOnly = Content.Active;
+    }
+    protected virtual void chbActive_CheckedChanged(object sender, EventArgs e) {
+      if (Content != null)
+        Content.Active = chbActive.Checked;
+    }
+
+    private class RunSetView : ItemSetView<IRun> {
+      public RunCollection RunCollection { get; set; }
+
+      protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {
+        base.itemsListView_DragEnter(sender, e);
+        if (RunCollection != null) {
+          var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+          foreach (var run in dropData.GetObjectGraphObjects().OfType<IRun>())
+            validDragOperation = validDragOperation && RunCollection.Contains(run);
+        }
+      }
+
+      protected override void itemsListView_DragOver(object sender, DragEventArgs e) {
+        e.Effect = DragDropEffects.None;
+        if (validDragOperation) {
+          e.Effect = DragDropEffects.Link;
+        }
+      }
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.cs	(revision 6675)
@@ -25,5 +25,5 @@
 namespace HeuristicLab.Optimization.Views {
   [Content(typeof(RunCollectionEqualityConstraint), true)]
-  public partial class RunCollectionEqualityConstraintView : RunCollectionConstraintView {
+  public partial class RunCollectionEqualityConstraintView : RunCollectionColumnConstraintView {
     public RunCollectionEqualityConstraintView() {
       InitializeComponent();
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionModificationEvaluatorView.Designer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionModificationEvaluatorView.Designer.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionModificationEvaluatorView.Designer.cs	(revision 6675)
@@ -0,0 +1,155 @@
+﻿namespace HeuristicLab.Optimization.Views {
+  partial class RunCollectionModificationEvaluatorView {
+    /// <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.evaluateButton = new System.Windows.Forms.Button();
+      this.tabControl = new System.Windows.Forms.TabControl();
+      this.runsTabPage = new System.Windows.Forms.TabPage();
+      this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.modifiersTabPage = new System.Windows.Forms.TabPage();
+      this.modifiersViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.tabControl.SuspendLayout();
+      this.runsTabPage.SuspendLayout();
+      this.modifiersTabPage.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Size = new System.Drawing.Size(419, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(483, 3);
+      // 
+      // evaluateButton
+      // 
+      this.evaluateButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+      this.evaluateButton.Location = new System.Drawing.Point(6, 266);
+      this.evaluateButton.Name = "evaluateButton";
+      this.evaluateButton.Size = new System.Drawing.Size(75, 23);
+      this.evaluateButton.TabIndex = 4;
+      this.evaluateButton.Text = "&Evaluate";
+      this.evaluateButton.UseVisualStyleBackColor = true;
+      this.evaluateButton.Click += new System.EventHandler(this.evaluateButton_Click);
+      // 
+      // tabControl
+      // 
+      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.tabControl.Controls.Add(this.runsTabPage);
+      this.tabControl.Controls.Add(this.modifiersTabPage);
+      this.tabControl.Location = new System.Drawing.Point(3, 26);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(496, 318);
+      this.tabControl.TabIndex = 5;
+      // 
+      // runsTabPage
+      // 
+      this.runsTabPage.Controls.Add(this.runCollectionViewHost);
+      this.runsTabPage.Location = new System.Drawing.Point(4, 22);
+      this.runsTabPage.Name = "runsTabPage";
+      this.runsTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.runsTabPage.Size = new System.Drawing.Size(488, 292);
+      this.runsTabPage.TabIndex = 0;
+      this.runsTabPage.Text = "Runs";
+      this.runsTabPage.UseVisualStyleBackColor = true;
+      // 
+      // runCollectionViewHost
+      // 
+      this.runCollectionViewHost.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.runCollectionViewHost.Caption = "View";
+      this.runCollectionViewHost.Content = null;
+      this.runCollectionViewHost.Enabled = false;
+      this.runCollectionViewHost.Location = new System.Drawing.Point(6, 6);
+      this.runCollectionViewHost.Name = "runCollectionViewHost";
+      this.runCollectionViewHost.ReadOnly = false;
+      this.runCollectionViewHost.Size = new System.Drawing.Size(476, 280);
+      this.runCollectionViewHost.TabIndex = 0;
+      this.runCollectionViewHost.ViewsLabelVisible = true;
+      this.runCollectionViewHost.ViewType = null;
+      // 
+      // modifiersTabPage
+      // 
+      this.modifiersTabPage.Controls.Add(this.modifiersViewHost);
+      this.modifiersTabPage.Controls.Add(this.evaluateButton);
+      this.modifiersTabPage.Location = new System.Drawing.Point(4, 22);
+      this.modifiersTabPage.Name = "modifiersTabPage";
+      this.modifiersTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.modifiersTabPage.Size = new System.Drawing.Size(488, 292);
+      this.modifiersTabPage.TabIndex = 1;
+      this.modifiersTabPage.Text = "Modifiers";
+      this.modifiersTabPage.UseVisualStyleBackColor = true;
+      // 
+      // modifiersViewHost
+      // 
+      this.modifiersViewHost.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.modifiersViewHost.Caption = "View";
+      this.modifiersViewHost.Content = null;
+      this.modifiersViewHost.Enabled = false;
+      this.modifiersViewHost.Location = new System.Drawing.Point(6, 6);
+      this.modifiersViewHost.Name = "modifiersViewHost";
+      this.modifiersViewHost.ReadOnly = false;
+      this.modifiersViewHost.Size = new System.Drawing.Size(476, 254);
+      this.modifiersViewHost.TabIndex = 0;
+      this.modifiersViewHost.ViewsLabelVisible = true;
+      this.modifiersViewHost.ViewType = null;
+      // 
+      // RunCollectionModificationEvaluatorView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.Controls.Add(this.tabControl);
+      this.Name = "RunCollectionModificationEvaluatorView";
+      this.Size = new System.Drawing.Size(502, 347);
+      this.Controls.SetChildIndex(this.tabControl, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.tabControl.ResumeLayout(false);
+      this.runsTabPage.ResumeLayout(false);
+      this.modifiersTabPage.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Button evaluateButton;
+    private System.Windows.Forms.TabControl tabControl;
+    private System.Windows.Forms.TabPage runsTabPage;
+    private MainForm.WindowsForms.ViewHost runCollectionViewHost;
+    private System.Windows.Forms.TabPage modifiersTabPage;
+    private MainForm.WindowsForms.ViewHost modifiersViewHost;
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionModificationEvaluatorView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionModificationEvaluatorView.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionModificationEvaluatorView.cs	(revision 6675)
@@ -0,0 +1,83 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Optimization.Views {
+
+  [View("RunCollection Calculator View")]
+  [Content(typeof(RunCollectionModificationEvaluator), IsDefaultView = true)]
+  public sealed partial class RunCollectionModificationEvaluatorView : NamedItemView {
+
+    public new RunCollectionModificationEvaluator Content {
+      get { return (RunCollectionModificationEvaluator)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public RunCollectionModificationEvaluatorView() {
+      InitializeComponent();
+    }
+
+    protected override void DeregisterContentEvents() {
+      Content.RunCollectionParameter.ValueChanged -= new EventHandler(RunCollection_Changed);
+      Content.ModifiersParameter.ValueChanged -= new EventHandler(Modifiers_Changed);
+      base.DeregisterContentEvents();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.RunCollectionParameter.ValueChanged += new EventHandler(RunCollection_Changed);
+      Content.ModifiersParameter.ValueChanged += new EventHandler(Modifiers_Changed);
+    }
+
+    #region Event Handlers (Content)
+    private void RunCollection_Changed(object sender, EventArgs args) {
+      if (InvokeRequired)
+        Invoke(new EventHandler(RunCollection_Changed), sender, args);
+      else
+        runCollectionViewHost.Content = Content.RunCollection;
+    }
+    private void Modifiers_Changed(object sender, EventArgs args) {
+      if (InvokeRequired)
+        Invoke(new EventHandler(Modifiers_Changed), sender, args);
+      else
+        modifiersViewHost.Content = Content.Modifiers;
+    }
+    #endregion
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        runCollectionViewHost.Content = null;
+        modifiersViewHost.Content = null;
+      } else {
+        runCollectionViewHost.Content = Content.RunCollection;
+        modifiersViewHost.Content = Content.Modifiers;
+      }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      evaluateButton.Enabled = Content != null;
+    }
+
+    #region Event Handlers (child controls)
+    private void evaluateButton_Click(object sender, EventArgs e) {
+      evaluateButton.Enabled = false;
+      var worker = new BackgroundWorker();
+      worker.DoWork += (s, a) => Content.Evaluate();
+      worker.RunWorkerCompleted += (s, a) => { evaluateButton.Enabled = Content != null; };
+      worker.RunWorkerAsync();
+    }        
+    #endregion
+
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionTypeCompatibilityConstraintView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionTypeCompatibilityConstraintView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionTypeCompatibilityConstraintView.cs	(revision 6675)
@@ -25,5 +25,5 @@
 namespace HeuristicLab.Optimization.Views {
   [Content(typeof(RunCollectionTypeCompatibilityConstraint), true)]
-  public partial class RunCollectionTypeCompatibilityConstraintView : RunCollectionConstraintView {
+  public partial class RunCollectionTypeCompatibilityConstraintView : RunCollectionColumnConstraintView {
     public RunCollectionTypeCompatibilityConstraintView() {
       InitializeComponent();
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs	(revision 6675)
@@ -98,4 +98,8 @@
         }
       }
+      var modifierMenuItem = new ToolStripMenuItem();
+      modifierMenuItem.Text = "Modify RunCollection";
+      modifierMenuItem.Click += ModifierMenuItem_OnClick;
+      analyzeRunsToolStripDropDownButton.DropDownItems.Add(modifierMenuItem);
     }
 
@@ -336,4 +340,9 @@
       }
     }
+    private void ModifierMenuItem_OnClick(object sender, EventArgs args) {
+      var modifier = new RunCollectionModificationEvaluator();
+      modifier.RunCollection.AddRange(Content.Select(r => (IRun)r.Clone()));
+      MainFormManager.MainForm.ShowContent(modifier);
+    }
     private void removeButton_Click(object sender, EventArgs e) {
       if (itemsListView.SelectedItems.Count > 0) {
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/Calculator.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/Calculator.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/Calculator.cs	(revision 6675)
@@ -0,0 +1,106 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text.RegularExpressions;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System.Globalization;
+
+namespace HeuristicLab.Optimization {  
+    
+  [StorableClass]
+  public class Calculator : IDeepCloneable {
+
+    #region Fields & Properties
+    
+    private List<string> tokens;
+
+    [Storable]
+    public string Formula {
+      get { return string.Join(" ", tokens); }
+      set { tokens = Tokenize(value).ToList(); }
+    }
+
+    private static readonly Regex TokenRegex = new Regex(@"[a-zA-Z0-9._]+|""([^""]|\"")+""|[-+*/^]|log");    
+
+    #endregion
+
+    #region Construction & Cloning
+
+    [StorableConstructor]
+    protected Calculator(bool deserializing) { }
+    public Calculator() { }
+    public Calculator(Calculator original, Cloner cloner) {
+      this.tokens = original.tokens.ToList();
+    }
+    public IDeepCloneable Clone(Cloner cloner) {
+      return new Calculator(this, cloner);
+    }
+    public object Clone() {
+      return Clone(new Cloner());
+    }
+    #endregion
+
+    public IEnumerable<string> Tokenize(string s) {
+      return TokenRegex.Matches(s).Cast<Match>().Select(m => m.Value);
+    }
+
+    private double GetVariableValue(IDictionary<string, IItem> variables, string name) {
+      if (variables.ContainsKey(name)) {
+        var item = variables[name];
+        var intValue = item as IntValue;
+        if (intValue != null) {
+          return intValue.Value;
+        } else {
+          var doubleValue = item as DoubleValue;
+          if (doubleValue != null)
+            return doubleValue.Value;
+          else
+            throw new InvalidOperationException("Non numerical argument");
+        }
+      } else {
+        throw new InvalidOperationException(string.Format("variable \"{0}\" not found", name));
+      }
+    }
+
+    public IItem GetValue(IDictionary<string, IItem> variables) {
+      var stack = new Stack<double>();
+      Action<Func<double, double, double>> binf = op => {
+        var b = stack.Pop();
+        stack.Push(op(stack.Pop(), b));
+      };
+      try {
+        foreach (var token in tokens) {
+          double d;
+          if (double.TryParse(token,
+                NumberStyles.AllowDecimalPoint |
+              NumberStyles.AllowExponent |
+              NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out d)) {
+            stack.Push(d);
+          } else if (token.StartsWith("\"")) {
+            stack.Push(GetVariableValue(variables, token.Substring(1, token.Length - 2).Replace(@"\""", @"""")));
+          } else {
+            switch (token) {
+              case "log": stack.Push(Math.Log(stack.Pop())); break;
+              case "+": binf((x, y) => x + y); break;
+              case "-": binf((x, y) => x - y); break;
+              case "*": binf((x, y) => x * y); break;
+              case "/": binf((x, y) => x / y); break;
+              case "^": binf(Math.Pow); break;
+              default: stack.Push(GetVariableValue(variables, token)); break;
+            }
+          }
+        }
+      } catch (InvalidOperationException x) {
+        return new StringValue(string.Format("Calculation Failed: {0}", x.Message));
+      }
+      if (stack.Count != 1)
+        return new StringValue("Invalid final evaluation stack size != 1");
+      return new DoubleValue(stack.Pop());      
+    }    
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj	(revision 6675)
@@ -111,7 +111,10 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="RunCollectionValueRemover.cs" />
+    <Compile Include="IRunCollectionModifier.cs" />
     <None Include="HeuristicLabOptimizationPlugin.cs.frame" />
     <Compile Include="Algorithms\Algorithm.cs" />
     <Compile Include="BatchRun.cs" />
+    <Compile Include="Calculator.cs" />
     <Compile Include="Interfaces\IDiscreteDoubleMatrixModifier.cs" />
     <Compile Include="Algorithms\HeuristicOptimizationEngineAlgorithm.cs" />
@@ -136,6 +139,10 @@
     <Compile Include="Interfaces\ISingleObjectiveHeuristicOptimizationProblem.cs" />
     <Compile Include="Problems\Problem.cs" />
+    <Compile Include="RunCollectionFormulaModifer.cs" />
+    <Compile Include="RunCollectionFuzzifier.cs" />
+    <Compile Include="RunCollectionModificationEvaluator.cs" />
     <Compile Include="RunCollectionConstraints\RunCollectionComparisonConstraint.cs" />
     <Compile Include="RunCollectionConstraints\RunCollectionConstraintCollection.cs" />
+    <Compile Include="RunCollectionConstraints\RunCollectionContentConstraint.cs" />
     <Compile Include="RunCollectionConstraints\RunCollectionTypeCompatiblityConstraint.cs" />
     <Compile Include="RunCollectionConstraints\RunCollectionEqualityConstraint.cs" />
@@ -244,4 +251,5 @@
     </BootstrapperPackage>
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/IRunCollectionModifier.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/IRunCollectionModifier.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/IRunCollectionModifier.cs	(revision 6675)
@@ -0,0 +1,11 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Optimization {
+  public interface IRunCollectionModifier : IItem {    
+    void Modify(List<IRun> runs);
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/IRunCollectionConstraint.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/IRunCollectionConstraint.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/IRunCollectionConstraint.cs	(revision 6675)
@@ -26,4 +26,7 @@
   public interface IRunCollectionConstraint : IConstraint {
     new RunCollection ConstrainedValue { get; set; }
+  }
+
+  public interface IRunCollectionColumnConstraint : IRunCollectionConstraint {
     string ConstraintColumn { get; set; }
     event EventHandler ConstraintColumnChanged;
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionComparisonConstraint.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionComparisonConstraint.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionComparisonConstraint.cs	(revision 6675)
@@ -30,5 +30,5 @@
   [StorableClass]
   [Item("RunCollectionComparisonConstraint", "A constraint which compares the members of the contained runs with the constraint data.")]
-  public class RunCollectionComparisonConstraint : ComparisonConstraint, IRunCollectionConstraint {
+  public class RunCollectionComparisonConstraint : ComparisonConstraint, IRunCollectionColumnConstraint {
     [StorableConstructor]
     protected RunCollectionComparisonConstraint(bool deserializing) : base(deserializing) { }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionContentConstraint.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionContentConstraint.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionContentConstraint.cs	(revision 6675)
@@ -0,0 +1,107 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization {
+  [StorableClass]
+  public class RunCollectionContentConstraint : Constraint, IRunCollectionConstraint {
+    public new RunCollection ConstrainedValue {
+      get { return (RunCollection)base.ConstrainedValue; }
+      set { base.ConstrainedValue = value; }
+    }
+
+    public new ItemSet<IRun> ConstraintData {
+      get { return (ItemSet<IRun>)base.ConstraintData; }
+      set { base.ConstraintData = value; }
+    }
+
+    public override IEnumerable<ConstraintOperation> AllowedConstraintOperations {
+      get { return new List<ConstraintOperation>() { ConstraintOperation.Equal }; }
+    }
+
+    [StorableConstructor]
+    protected RunCollectionContentConstraint(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterConstraintDataEvents();
+    }
+    protected RunCollectionContentConstraint(RunCollectionContentConstraint original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterConstraintDataEvents();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) { return new RunCollectionContentConstraint(this, cloner); }
+
+    public RunCollectionContentConstraint()
+      : base() {
+      ConstraintData = new ItemSet<IRun>();
+    }
+    public RunCollectionContentConstraint(RunCollection constrainedValue, IObservableSet<IRun> constraintData)
+      : base(constrainedValue, ConstraintOperation.Equal, constraintData) {
+    }
+    public RunCollectionContentConstraint(RunCollection constrainedValue, IObservableSet<IRun> constraintData, bool active)
+      : base(constrainedValue, ConstraintOperation.Equal, constraintData, active) {
+    }
+
+    protected override void OnConstraintDataChanged() {
+      RegisterConstraintDataEvents();
+      base.OnConstraintDataChanged();
+    }
+    private void RegisterConstraintDataEvents() {
+      if (ConstraintData != null) {
+        ConstraintData.ItemsAdded += new CollectionItemsChangedEventHandler<IRun>(ConstraintData_ItemsAdded);
+        ConstraintData.ItemsRemoved += new CollectionItemsChangedEventHandler<IRun>(ConstraintData_ItemsRemoved);
+        ConstraintData.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(ConstraintData_CollectionReset);
+      }
+    }
+    private void ConstraintData_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) {
+      base.OnConstraintDataChanged();
+    }
+    private void ConstraintData_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
+      base.OnConstraintDataChanged();
+    }
+    private void ConstraintData_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
+      base.OnConstraintDataChanged();
+    }
+
+    protected override bool Check(object constrainedMember) {
+      if (!Active) return true;
+
+      foreach (IRun run in ConstrainedValue.Where(r => r.Visible))
+        run.Visible = !ConstraintData.Contains(run);
+      return true;
+    }
+
+    protected override bool Check(object constrainedMember, out string errorMessage) {
+      errorMessage = string.Empty;
+      if (!Active) return true;
+
+      foreach (IRun run in ConstrainedValue.Where(r => r.Visible))
+        run.Visible = !ConstraintData.Contains(run);
+      return true;
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionEqualityConstraint.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionEqualityConstraint.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionEqualityConstraint.cs	(revision 6675)
@@ -30,5 +30,5 @@
   [StorableClass]
   [Item("RunCollectionEqualityConstraint", "A constraint which checks the members of the contained runs for equality to the constraint data.")]
-  public class RunCollectionEqualityConstraint : EqualityConstraint, IRunCollectionConstraint {
+  public class RunCollectionEqualityConstraint : EqualityConstraint, IRunCollectionColumnConstraint {
     [StorableConstructor]
     protected RunCollectionEqualityConstraint(bool deserializing) : base(deserializing) { }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionTypeCompatiblityConstraint.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionTypeCompatiblityConstraint.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionTypeCompatiblityConstraint.cs	(revision 6675)
@@ -30,5 +30,5 @@
   [StorableClass]
   [Item("RunCollectionTypeCompatibilityConstraint", "A constraint which checks the members of the contained runs for type compabitiliby to the constraint data.")]
-  public class RunCollectionTypeCompatibilityConstraint : TypeCompatibilityConstraint, IRunCollectionConstraint {
+  public class RunCollectionTypeCompatibilityConstraint : TypeCompatibilityConstraint, IRunCollectionColumnConstraint {
     [StorableConstructor]
     protected RunCollectionTypeCompatibilityConstraint(bool deserializing) {
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionFormulaModifer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionFormulaModifer.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionFormulaModifer.cs	(revision 6675)
@@ -0,0 +1,77 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization {
+
+  [Item("RunCollection Formula Modifier", "Modifies a RunCollection by adding results using the given formula.")]
+  [StorableClass]
+  public class RunCollectionFormulaModifer : ParameterizedNamedItem, IRunCollectionModifier {
+
+    public override bool CanChangeName { get { return false; } }
+    public override bool CanChangeDescription { get { return false; } }
+
+    public ValueParameter<StringValue> ResultNameParameter {
+      get { return (ValueParameter<StringValue>)Parameters["ResultName"]; }
+    }    
+    
+    public ValueParameter<StringValue> FormulaParameter {
+      get { return (ValueParameter<StringValue>)Parameters["Formula"]; }
+    }    
+
+    #region Construction & Cloning    
+    [StorableConstructor]
+    protected RunCollectionFormulaModifer(bool deserializing) : base(deserializing) { }
+    protected RunCollectionFormulaModifer(RunCollectionFormulaModifer original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterEvents();
+    }
+    public RunCollectionFormulaModifer() {
+      Parameters.Add(new ValueParameter<StringValue>("ResultName", "The name of the result to be generated by this formula.", new StringValue("Calc.Value")));
+      Parameters.Add(new ValueParameter<StringValue>("Formula", "RPN formula for new value. This can contain existing run parameters or results (optionally in quotes if they contain whitespace), numbers and arithmetic operators in postfix notation.", new StringValue("1 1 +")));
+      UpdateName();
+      RegisterEvents();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RunCollectionFormulaModifer(this, cloner);
+    }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+    #endregion
+
+    private void RegisterEvents() {
+      ResultNameParameter.ToStringChanged += Parameter_NameChanged;
+      FormulaParameter.ToStringChanged += Parameter_NameChanged;
+    }
+
+    void Parameter_NameChanged(object sender, EventArgs e) {
+      UpdateName();
+    }
+
+    private void UpdateName() {
+      name = string.Format("{0} := {1}", ResultNameParameter.Value.Value, FormulaParameter.Value.Value);
+      OnNameChanged();
+    }
+
+    public void Modify(List<IRun> runs) {
+      var calc = new Calculator {Formula = FormulaParameter.Value.Value};      
+      foreach (var run in runs) {
+        var variables = new Dictionary<string, IItem>();
+        foreach (var param in run.Parameters)
+          variables[param.Key] = param.Value;
+        foreach (var result in run.Results)
+          variables[result.Key] = result.Value;
+        run.Results[ResultNameParameter.Value.Value] = calc.GetValue(variables);        
+      }      
+    }
+    
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionFuzzifier.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionFuzzifier.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionFuzzifier.cs	(revision 6675)
@@ -0,0 +1,161 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization {
+  [Item("RunCollection Fuzzifier", "Creates several levels from the distribution of a certain result accross a run collection and assignes a fuzzified value.")]
+  [StorableClass]
+  public class RunCollectionFuzzifier : ParameterizedNamedItem, IRunCollectionModifier {
+
+    public override bool CanChangeName { get { return false; } }
+    public override bool CanChangeDescription { get { return false; } }
+
+    #region Parameters
+    public ValueParameter<StringValue> SourceParameter {
+      get { return (ValueParameter<StringValue>)Parameters["Source"]; }
+    }
+    public ValueParameter<StringValue> TargetParameter {
+      get { return (ValueParameter<StringValue>)Parameters["Target"]; }
+    }
+    public ValueParameter<DoubleValue> SpreadParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters["Spread"]; }
+    }
+    public ValueParameter<StringValue> GroupByParameter {
+      get { return (ValueParameter<StringValue>)Parameters["GroupBy"]; }
+    }    
+    public ValueParameter<ItemList<StringValue>> LevelsParameter {
+      get { return (ValueParameter<ItemList<StringValue>>)Parameters["Levels"]; }
+    }    
+    #endregion
+
+    private string Source { get { return SourceParameter.Value.Value; } }
+    private string Target { get { return TargetParameter.Value.Value; } }    
+    private double Spread { get { return SpreadParameter.Value.Value; } }
+    private string GroupBy { get { return GroupByParameter.Value.Value; } }
+    private List<string> Levels { get { return LevelsParameter.Value.Select(v => v.Value).ToList(); } }
+
+      #region Construction & Cloning
+    [StorableConstructor]
+    protected RunCollectionFuzzifier(bool deserializing) : base(deserializing) { }
+    protected RunCollectionFuzzifier(RunCollectionFuzzifier original, Cloner cloner)
+      : base(original, cloner) {
+      RegisterEvents();
+    }
+    public RunCollectionFuzzifier() {
+      Parameters.Add(new ValueParameter<StringValue>("Source", "Source value name to be fuzzified.", new StringValue("Value")));
+      Parameters.Add(new ValueParameter<StringValue>("Target", "Target value name. The new, fuzzified variable to be created.", new StringValue("Calc.Value")));      
+      Parameters.Add(new ValueParameter<DoubleValue>("Spread", "The number of standard deviations considered one additional level.", new DoubleValue(1)));
+      Parameters.Add(new ValueParameter<StringValue>("GroupBy", "Create separate analyzes for different values of this variable.", new StringValue("")));
+      Parameters.Add(new ValueParameter<ItemList<StringValue>>("Levels", "The list of levels to be assigned.",
+        new ItemList<StringValue> {
+          new StringValue("Very Low"),
+          new StringValue("Low"),
+          new StringValue("Average"),
+          new StringValue("High"),
+          new StringValue("Very High"),
+        }));     
+      RegisterEvents();
+      UpdateName();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RunCollectionFuzzifier(this, cloner);
+    }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterEvents();
+    }
+    #endregion
+
+    private void RegisterEvents() {
+      SourceParameter.ToStringChanged += Parameter_NameChanged;
+      TargetParameter.ToStringChanged += Parameter_NameChanged;      
+      GroupByParameter.ToStringChanged += Parameter_NameChanged;
+    }
+
+    private void Parameter_NameChanged(object sender, EventArgs e) {
+      UpdateName();
+    }
+
+    private void UpdateName() {
+      name = string.Format("{0} := Fuzzy({1}{2})",
+        Target,
+        Source,
+        string.IsNullOrWhiteSpace(GroupBy) ? "" : string.Format("/{0}", GroupBy));        
+      OnNameChanged();
+    }
+
+    #region IRunCollectionModifier Members
+
+    public void Modify(List<IRun> runs) {
+      foreach (var group in runs
+        .Select(r => new {Run=r, Value=GetSourceValue(r)})
+        .Where(r => r.Value.HasValue && !double.IsNaN(r.Value.Value) && !double.IsInfinity(r.Value.Value))
+        .Select(r => new {r.Run, r.Value.Value, Bin=GetGroupByValue(r.Run)})
+        .GroupBy(r => r.Bin).ToList()) {
+        var values = group.Select(r => r.Value).ToList();
+        if (values.Count > 0) {
+          var avg = values.Average();
+          var stdDev = values.StandardDeviation();
+          foreach (var r in group) {
+            r.Run.Results[Target] = new StringValue(Fuzzify(r.Value, avg, stdDev));
+          }
+        }
+      }      
+    }
+
+    private double? GetSourceValue(IRun run) {
+      return CastSourceValue(run.Results) ?? CastSourceValue(run.Parameters);
+    }
+
+    private string GetGroupByValue(IRun run) {
+      if (string.IsNullOrWhiteSpace(GroupBy))
+        return String.Empty;
+      IItem value;
+      run.Results.TryGetValue(GroupBy, out value);
+      if (value == null)
+        run.Parameters.TryGetValue(GroupBy, out value);
+      if (value != null)
+        return value.ToString();
+      else
+        return String.Empty;
+    }
+
+    private double? CastSourceValue(IDictionary<string, IItem> variables) {
+      IItem value;
+      variables.TryGetValue(Source, out value);
+      var intValue = value as IntValue;
+      if (intValue != null) {
+        return intValue.Value;
+      } else {
+        var doubleValue = value as DoubleValue;
+        if (doubleValue != null)
+          return doubleValue.Value;
+      }
+      return null;
+    }
+
+    private string Fuzzify(double value, double avg, double stdDev) {
+      double dev = (value - avg)/(stdDev*Spread);
+      int index;
+      if (Levels.Count % 2 == 1) {
+        index = (int) Math.Floor(Math.Abs(dev));
+        index = (Levels.Count - 1)/2 + Math.Sign(dev) * index;
+      } else {
+        index = (int) Math.Ceiling(Math.Abs(dev));
+        if (dev > 0)
+          index = Levels.Count/2 + index;
+        else
+          index = Levels.Count/2 + 1 - index;
+      }
+      return Levels[Math.Min(Levels.Count - 1, Math.Max(0, index))];
+    }
+
+    #endregion
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionModificationEvaluator.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionModificationEvaluator.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionModificationEvaluator.cs	(revision 6675)
@@ -0,0 +1,63 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization {
+  [Item("RunCollection Modification Evaluator", "Applies a series of RunCollection modifiers.")]
+  [Creatable("Testing & Analysis")]
+  [StorableClass]
+  public class RunCollectionModificationEvaluator : ParameterizedNamedItem, IStorableContent {
+
+    public string Filename { get; set; }
+
+    #region Parameters
+    public ValueParameter<RunCollection> RunCollectionParameter {
+      get { return (ValueParameter<RunCollection>)Parameters["RunCollection"]; }
+    }
+
+    public ValueParameter<CheckedItemList<IRunCollectionModifier>> ModifiersParameter {
+      get { return (ValueParameter<CheckedItemList<IRunCollectionModifier>>)Parameters["Modifiers"]; }
+    }
+    #endregion
+
+    #region Parameter Values
+    public RunCollection RunCollection {
+      get { return RunCollectionParameter.Value; }
+    }
+    public CheckedItemList<IRunCollectionModifier> Modifiers {
+      get { return ModifiersParameter.Value; }
+    }
+    #endregion
+
+    #region Construction & Cloning
+    [StorableConstructor]
+    protected RunCollectionModificationEvaluator(bool deserializing) : base(deserializing) { }
+    protected RunCollectionModificationEvaluator(RunCollectionModificationEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public RunCollectionModificationEvaluator() {
+      Parameters.Add(new ValueParameter<RunCollection>("RunCollection", "The RunCollection to be modified.", new RunCollection()));
+      Parameters.Add(new ValueParameter<CheckedItemList<IRunCollectionModifier>>("Modifiers", "A list of modifiers to be applied to the run collection.", new CheckedItemList<IRunCollectionModifier>()));
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RunCollectionModificationEvaluator(this, cloner);
+    }
+    #endregion
+
+    public void Evaluate() {
+      RunCollection.UpdateOfRunsInProgress = true;
+      var runs = RunCollection.Where(r => r.Visible).ToList();
+      foreach (var modifier in Modifiers.CheckedItems)
+        modifier.Value.Modify(runs);
+      RunCollection.UpdateOfRunsInProgress = false;
+      if (runs.Count > 0) { // force update
+        var run = (IRun) runs[0].Clone();
+        RunCollection.Add(run);
+        RunCollection.Remove(run);
+      }
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionValueRemover.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionValueRemover.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Optimization/3.3/RunCollectionValueRemover.cs	(revision 6675)
@@ -0,0 +1,49 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Optimization {
+
+  [Item("RunCollection Value Remover", "Modifies a RunCollection by removing results or parameters.")]
+  [StorableClass]
+  public class RunCollectionValueRemover : ParameterizedNamedItem, IRunCollectionModifier {
+    
+    public ValueParameter<CheckedItemCollection<StringValue>> ValuesParameter {
+      get { return (ValueParameter<CheckedItemCollection<StringValue>>)Parameters["Values"]; }
+    }
+
+    public IEnumerable<string> Values {
+      get { return ValuesParameter.Value.CheckedItems.Select(v => v.Value); }
+    }
+
+    #region Construction & Cloning    
+    [StorableConstructor]
+    protected RunCollectionValueRemover(bool deserializing) : base(deserializing) { }
+    protected RunCollectionValueRemover(RunCollectionValueRemover original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public RunCollectionValueRemover() {
+      Parameters.Add(new ValueParameter<CheckedItemCollection<StringValue>>("Values", "The result or parameter values to be removed from each run."));      
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RunCollectionValueRemover(this, cloner);
+    }    
+    #endregion    
+
+    public void Modify(List<IRun> runs) {      
+      foreach (var run in runs) {
+        foreach (var value in Values) {
+          run.Parameters.Remove(value);
+          run.Results.Remove(value);
+        }        
+      }      
+    }
+    
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs	(revision 6675)
@@ -26,5 +26,5 @@
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
-  [Content(typeof(SymbolicRegressionSolution), true)]
+  [Content(typeof(SymbolicRegressionSolution), false)]
   [View("SymbolicRegressionSolution View")]
   public partial class SymbolicRegressionSolutionView : RegressionSolutionView {
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj	(revision 6675)
@@ -110,4 +110,10 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="SymbolicDataAnalysisSolutionResponseFunctionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicDataAnalysisSolutionResponseFunctionView.Designer.cs">
+      <DependentUpon>SymbolicDataAnalysisSolutionResponseFunctionView.cs</DependentUpon>
+    </Compile>
     <Compile Include="TextualSymbolicDataAnalysisModelView.cs">
       <SubType>UserControl</SubType>
@@ -157,4 +163,10 @@
     <Compile Include="Symbols\VariableView.Designer.cs">
       <DependentUpon>VariableView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="VariableTrackbar.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="VariableTrackbar.Designer.cs">
+      <DependentUpon>VariableTrackbar.cs</DependentUpon>
     </Compile>
     <None Include="HeuristicLab.snk" />
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisSolutionResponseFunctionView.Designer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisSolutionResponseFunctionView.Designer.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisSolutionResponseFunctionView.Designer.cs	(revision 6675)
@@ -0,0 +1,132 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  partial class SymbolicDataAnalysisSolutionResponseFunctionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
+      this.responseChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+      this.comboBox = new System.Windows.Forms.ComboBox();
+      this.freeVariableLabel = new System.Windows.Forms.Label();
+      ((System.ComponentModel.ISupportInitialize)(this.responseChart)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // flowLayoutPanel
+      // 
+      this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.flowLayoutPanel.AutoScroll = true;
+      this.flowLayoutPanel.Location = new System.Drawing.Point(3, 202);
+      this.flowLayoutPanel.Name = "flowLayoutPanel";
+      this.flowLayoutPanel.Size = new System.Drawing.Size(261, 268);
+      this.flowLayoutPanel.TabIndex = 2;
+      this.flowLayoutPanel.WrapContents = false;
+      // 
+      // responseChart
+      // 
+      this.responseChart.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)));
+      chartArea1.Name = "ChartArea";
+      this.responseChart.ChartAreas.Add(chartArea1);
+      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
+      legend1.LegendStyle = System.Windows.Forms.DataVisualization.Charting.LegendStyle.Row;
+      legend1.Name = "Legend";
+      this.responseChart.Legends.Add(legend1);
+      this.responseChart.Location = new System.Drawing.Point(3, 30);
+      this.responseChart.Name = "responseChart";
+      series1.ChartArea = "ChartArea";
+      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
+      series1.Legend = "Legend";
+      series1.MarkerSize = 3;
+      series1.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Cross;
+      series1.Name = "Model Response";
+      this.responseChart.Series.Add(series1);
+      this.responseChart.Size = new System.Drawing.Size(258, 166);
+      this.responseChart.TabIndex = 3;
+      // 
+      // comboBox
+      // 
+      this.comboBox.FormattingEnabled = true;
+      this.comboBox.Location = new System.Drawing.Point(80, 3);
+      this.comboBox.Name = "comboBox";
+      this.comboBox.Size = new System.Drawing.Size(166, 21);
+      this.comboBox.TabIndex = 4;
+      this.comboBox.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectedIndexChanged);
+      // 
+      // freeVariableLabel
+      // 
+      this.freeVariableLabel.AutoSize = true;
+      this.freeVariableLabel.Location = new System.Drawing.Point(3, 6);
+      this.freeVariableLabel.Name = "freeVariableLabel";
+      this.freeVariableLabel.Size = new System.Drawing.Size(71, 13);
+      this.freeVariableLabel.TabIndex = 5;
+      this.freeVariableLabel.Text = "Free variable:";
+      // 
+      // SymbolicDataAnalysisSolutionResponseFunctionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.freeVariableLabel);
+      this.Controls.Add(this.comboBox);
+      this.Controls.Add(this.responseChart);
+      this.Controls.Add(this.flowLayoutPanel);
+      this.Name = "SymbolicDataAnalysisSolutionResponseFunctionView";
+      this.Size = new System.Drawing.Size(264, 473);
+      ((System.ComponentModel.ISupportInitialize)(this.responseChart)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
+    private System.Windows.Forms.DataVisualization.Charting.Chart responseChart;
+    private System.Windows.Forms.ComboBox comboBox;
+    private System.Windows.Forms.Label freeVariableLabel;
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisSolutionResponseFunctionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisSolutionResponseFunctionView.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisSolutionResponseFunctionView.cs	(revision 6675)
@@ -0,0 +1,177 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+using HeuristicLab.MainForm.WindowsForms;
+using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  [View("Response Function View")]
+  [Content(typeof(RegressionSolutionBase), false)]
+  public partial class SymbolicDataAnalysisSolutionResponseFunctionView : AsynchronousContentView {
+    private Dictionary<string, List<ISymbolicExpressionTreeNode>> variableNodes;
+    private ISymbolicExpressionTree clonedTree;
+    private Dictionary<string, double> medianValues;
+    public SymbolicDataAnalysisSolutionResponseFunctionView() {
+      InitializeComponent();
+      this.variableNodes = new Dictionary<string, List<ISymbolicExpressionTreeNode>>();
+      medianValues = new Dictionary<string, double>();
+      this.Caption = "Response Function View";
+    }
+
+    public new ISymbolicDataAnalysisSolution Content {
+      get { return (ISymbolicDataAnalysisSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ModelChanged += new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+
+    private void Content_ModelChanged(object sender, EventArgs e) {
+      OnModelChanged();
+    }
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      OnProblemDataChanged();
+    }
+
+    protected virtual void OnModelChanged() {
+      this.UpdateView();
+    }
+
+    protected virtual void OnProblemDataChanged() {
+      this.UpdateView();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      this.UpdateView();
+    }
+
+    private void UpdateView() {
+      if (Content != null && Content.Model != null && Content.ProblemData != null) {
+        var referencedVariables =
+       (from varNode in Content.Model.SymbolicExpressionTree.IterateNodesPrefix().OfType<VariableTreeNode>()
+        select varNode.VariableName)
+         .Distinct()
+         .OrderBy(x=>x)
+         .ToList();
+
+        medianValues.Clear();
+        foreach (var variableName in referencedVariables) {
+          medianValues.Add(variableName, Content.ProblemData.Dataset.GetEnumeratedVariableValues(variableName).Median());
+        }
+
+        comboBox.Items.Clear();
+        comboBox.Items.AddRange(referencedVariables.ToArray());
+        comboBox.SelectedIndex = 0;
+      }
+    }
+
+    private void CreateSliders(IEnumerable<string> variableNames) {
+      flowLayoutPanel.Controls.Clear();
+
+      foreach (var variableName in variableNames) {
+        var variableTrackbar = new VariableTrackbar(variableName,
+                                                    Content.ProblemData.Dataset.GetEnumeratedVariableValues(variableName));
+        variableTrackbar.Size = new Size(variableTrackbar.Size.Width, flowLayoutPanel.Size.Height - 23);
+        variableTrackbar.ValueChanged += TrackBarValueChanged;
+        flowLayoutPanel.Controls.Add(variableTrackbar);
+      }
+    }
+
+    private void TrackBarValueChanged(object sender, EventArgs e) {
+      var trackBar = (VariableTrackbar)sender;
+      string variableName = trackBar.VariableName;
+      ChangeVariableValue(variableName, trackBar.Value);
+    }
+
+    private void ChangeVariableValue(string variableName, double value) {
+      foreach (var constNode in variableNodes[variableName].Cast<ConstantTreeNode>())
+        constNode.Value = value;
+
+      UpdateChart();
+    }
+
+    private void UpdateChart() {
+      string freeVariable = (string)comboBox.SelectedItem;
+      IEnumerable<string> fixedVariables = comboBox.Items.OfType<string>()
+        .Except(new string[] { freeVariable });
+
+      var freeVariableValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(freeVariable, Content.ProblemData.TrainingIndizes).ToArray();
+      var responseValues = Content.Model.Interpreter.GetSymbolicExpressionTreeValues(clonedTree,
+                                                                              Content.ProblemData.Dataset,
+                                                                              Content.ProblemData.TrainingIndizes).ToArray();
+      Array.Sort(freeVariableValues, responseValues);
+      responseChart.Series["Model Response"].Points.DataBindXY(freeVariableValues, responseValues);
+    }
+
+    private ConstantTreeNode MakeConstantTreeNode(double value) {
+      Constant constant = new Constant();
+      constant.MinValue = value - 1;
+      constant.MaxValue = value + 1;
+      ConstantTreeNode constantTreeNode = (ConstantTreeNode)constant.CreateTreeNode();
+      constantTreeNode.Value = value;
+      return constantTreeNode;
+    }
+
+    private void ComboBoxSelectedIndexChanged(object sender, EventArgs e) {
+      string freeVariable = (string)comboBox.SelectedItem;
+      IEnumerable<string> fixedVariables = comboBox.Items.OfType<string>()
+        .Except(new string[] { freeVariable });
+
+      variableNodes.Clear();
+      clonedTree = (ISymbolicExpressionTree)Content.Model.SymbolicExpressionTree.Clone();
+
+      foreach (var varNode in clonedTree.IterateNodesPrefix().OfType<VariableTreeNode>()) {
+        if (fixedVariables.Contains(varNode.VariableName)) {
+          if (!variableNodes.ContainsKey(varNode.VariableName))
+            variableNodes.Add(varNode.VariableName, new List<ISymbolicExpressionTreeNode>());
+
+          int childIndex = varNode.Parent.IndexOfSubtree(varNode);
+          var replacementNode = MakeConstantTreeNode(medianValues[varNode.VariableName]);
+          var parent = varNode.Parent;
+          parent.RemoveSubtree(childIndex);
+          parent.InsertSubtree(childIndex, replacementNode);
+          variableNodes[varNode.VariableName].Add(replacementNode);
+        }
+      }
+
+      CreateSliders(fixedVariables);
+      UpdateChart();
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/VariableTrackbar.Designer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/VariableTrackbar.Designer.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/VariableTrackbar.Designer.cs	(revision 6675)
@@ -0,0 +1,136 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  partial class VariableTrackbar {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      this.valueLabel = new System.Windows.Forms.Label();
+      this.valueTextBox = new System.Windows.Forms.TextBox();
+      this.trackBar = new System.Windows.Forms.TrackBar();
+      this.boxPlotChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
+      this.groupBox = new System.Windows.Forms.GroupBox();
+      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
+      ((System.ComponentModel.ISupportInitialize)(this.boxPlotChart)).BeginInit();
+      this.groupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // valueLabel
+      // 
+      this.valueLabel.AutoSize = true;
+      this.valueLabel.Location = new System.Drawing.Point(6, 22);
+      this.valueLabel.Name = "valueLabel";
+      this.valueLabel.Size = new System.Drawing.Size(37, 13);
+      this.valueLabel.TabIndex = 0;
+      this.valueLabel.Text = "Value:";
+      // 
+      // valueTextBox
+      // 
+      this.valueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.valueTextBox.Location = new System.Drawing.Point(49, 19);
+      this.valueTextBox.Name = "valueTextBox";
+      this.valueTextBox.ReadOnly = true;
+      this.valueTextBox.Size = new System.Drawing.Size(56, 20);
+      this.valueTextBox.TabIndex = 1;
+      // 
+      // trackBar
+      // 
+      this.trackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)));
+      this.trackBar.Location = new System.Drawing.Point(6, 45);
+      this.trackBar.Name = "trackBar";
+      this.trackBar.Orientation = System.Windows.Forms.Orientation.Vertical;
+      this.trackBar.Size = new System.Drawing.Size(45, 277);
+      this.trackBar.TabIndex = 2;
+      this.trackBar.TickStyle = System.Windows.Forms.TickStyle.None;
+      this.trackBar.ValueChanged += new System.EventHandler(this.TrackBarValueChanged);
+      // 
+      // boxPlotChart
+      // 
+      this.boxPlotChart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)));
+      this.boxPlotChart.BackColor = System.Drawing.SystemColors.Control;
+      chartArea1.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
+      chartArea1.AxisY.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
+      chartArea1.BackColor = System.Drawing.SystemColors.Control;
+      chartArea1.BackSecondaryColor = System.Drawing.Color.White;
+      chartArea1.Name = "ChartArea";
+      this.boxPlotChart.ChartAreas.Add(chartArea1);
+      this.boxPlotChart.Location = new System.Drawing.Point(39, 45);
+      this.boxPlotChart.Name = "boxPlotChart";
+      series1.ChartArea = "ChartArea";
+      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.BoxPlot;
+      series1.Name = "BoxPlot";
+      series1.YValuesPerPoint = 6;
+      series2.ChartArea = "ChartArea";
+      series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
+      series2.Enabled = false;
+      series2.Name = "DataSeries";
+      this.boxPlotChart.Series.Add(series1);
+      this.boxPlotChart.Series.Add(series2);
+      this.boxPlotChart.Size = new System.Drawing.Size(66, 277);
+      this.boxPlotChart.TabIndex = 3;
+      this.boxPlotChart.Text = "boxPlotChart";
+      // 
+      // groupBox
+      // 
+      this.groupBox.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.groupBox.Controls.Add(this.valueLabel);
+      this.groupBox.Controls.Add(this.boxPlotChart);
+      this.groupBox.Controls.Add(this.valueTextBox);
+      this.groupBox.Controls.Add(this.trackBar);
+      this.groupBox.Location = new System.Drawing.Point(3, 3);
+      this.groupBox.Name = "groupBox";
+      this.groupBox.Size = new System.Drawing.Size(111, 328);
+      this.groupBox.TabIndex = 4;
+      this.groupBox.TabStop = false;
+      this.groupBox.Text = "groupBox";
+      // 
+      // VariableTrackbar
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.groupBox);
+      this.Name = "VariableTrackbar";
+      this.Size = new System.Drawing.Size(117, 334);
+      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit();
+      ((System.ComponentModel.ISupportInitialize)(this.boxPlotChart)).EndInit();
+      this.groupBox.ResumeLayout(false);
+      this.groupBox.PerformLayout();
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Label valueLabel;
+    private System.Windows.Forms.TextBox valueTextBox;
+    private System.Windows.Forms.TrackBar trackBar;
+    private System.Windows.Forms.DataVisualization.Charting.Chart boxPlotChart;
+    private System.Windows.Forms.GroupBox groupBox;
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/VariableTrackbar.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/VariableTrackbar.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/VariableTrackbar.cs	(revision 6675)
@@ -0,0 +1,62 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
+  public partial class VariableTrackbar : UserControl {
+    private readonly string variableName;
+    private const double FACTOR = 1000;
+
+    public double Value {
+      get { return trackBar.Value / FACTOR; }
+    }
+
+    public string VariableName {
+      get { return variableName; }
+    }
+
+    public VariableTrackbar(string variableName, IEnumerable<double> values) {
+      InitializeComponent();
+      this.variableName = variableName;
+      groupBox.Text = variableName;
+      var valuesArr = values.ToArray();
+      this.valueTextBox.Text = string.Format("{0:0.000e+00}", valuesArr.Median());
+      boxPlotChart.Series["DataSeries"].Points.Clear();
+      boxPlotChart.Series["DataSeries"].Points.DataBindY(valuesArr);
+      boxPlotChart.Series["BoxPlot"].ChartType = SeriesChartType.BoxPlot;
+      boxPlotChart.Series["BoxPlot"]["BoxPlotSeries"] = "DataSeries";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotWhiskerPercentile"] = "5";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotPercentile"] = "30";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotShowAverage"] = "true";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotShowMedian"] = "true";
+      boxPlotChart.Series["BoxPlot"]["BoxPlotShowUnusualValues"] = "true";
+      boxPlotChart.ChartAreas[0].AxisY.Minimum = valuesArr.Min() ;
+      boxPlotChart.ChartAreas[0].AxisY.Maximum = valuesArr.Max() ;
+      
+
+      trackBar.Minimum = (int)Math.Round(valuesArr.Min() * FACTOR);
+      trackBar.Maximum = (int)Math.Round(valuesArr.Max() * FACTOR);
+      trackBar.Value = (int)Math.Round(valuesArr.Median() * FACTOR);
+      trackBar.TickStyle = TickStyle.None;
+      trackBar.Tag = variableName;
+    }
+
+    private void TrackBarValueChanged(object sender, EventArgs e) {
+      valueTextBox.Text = string.Format("{0:0.000e+00}", trackBar.Value / FACTOR);
+      RaiseValueChanged(EventArgs.Empty);
+    }
+
+    public event EventHandler ValueChanged;
+    private void RaiseValueChanged(EventArgs e) {
+      var handler = ValueChanged;
+      if (handler != null) handler(this, e);
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.Designer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.Designer.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.Designer.cs	(revision 6675)
@@ -0,0 +1,101 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class ClassificationEnsembleSolutionEstimatedClassValuesView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.problemView1 = new HeuristicLab.Optimization.Views.ProblemView();
+      this.SamplesComboBox = new System.Windows.Forms.ComboBox();
+      this.SuspendLayout();
+      // 
+      // matrixView
+      // 
+      this.matrixView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.matrixView.Dock = System.Windows.Forms.DockStyle.None;
+      this.matrixView.Location = new System.Drawing.Point(3, 31);
+      this.matrixView.Size = new System.Drawing.Size(304, 251);
+      // 
+      // problemView1
+      // 
+      this.problemView1.Caption = "Problem View";
+      this.problemView1.Content = null;
+      this.problemView1.Location = new System.Drawing.Point(1147, 687);
+      this.problemView1.Name = "problemView1";
+      this.problemView1.ReadOnly = false;
+      this.problemView1.Size = new System.Drawing.Size(490, 353);
+      this.problemView1.TabIndex = 1;
+      // 
+      // SamplesComboBox
+      // 
+      this.SamplesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.SamplesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.SamplesComboBox.FormattingEnabled = true;
+      this.SamplesComboBox.Location = new System.Drawing.Point(4, 4);
+      this.SamplesComboBox.Name = "SamplesComboBox";
+      this.SamplesComboBox.Size = new System.Drawing.Size(303, 21);
+      this.SamplesComboBox.TabIndex = 2;
+      this.SamplesComboBox.SelectedIndexChanged += new System.EventHandler(this.SamplesComboBox_SelectedIndexChanged);
+      // 
+      // ClassificationEnsembleSolutionEstimatedClassValuesView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.SamplesComboBox);
+      this.Controls.Add(this.problemView1);
+      this.Name = "ClassificationEnsembleSolutionEstimatedClassValuesView";
+      this.Controls.SetChildIndex(this.matrixView, 0);
+      this.Controls.SetChildIndex(this.problemView1, 0);
+      this.Controls.SetChildIndex(this.SamplesComboBox, 0);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private Optimization.Views.ProblemView problemView1;
+    private System.Windows.Forms.ComboBox SamplesComboBox;
+
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs	(revision 6675)
@@ -0,0 +1,155 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Data;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Estimated Class Values")]
+  [Content(typeof(ClassificationEnsembleSolution))]
+  public partial class ClassificationEnsembleSolutionEstimatedClassValuesView :
+    ClassificationSolutionEstimatedClassValuesView {
+    private const string RowColumnName = "Row";
+    private const string TargetClassValuesColumnName = "TargetVariable";
+    private const string EstimatedClassValuesColumnName = "EstimatedClassValues";
+    private const string ConfidenceColumnName = "Confidence";
+
+    private const string SamplesComboBoxAllSamples = "All Samples";
+    private const string SamplesComboBoxTrainingSamples = "Training Samples";
+    private const string SamplesComboBoxTestSamples = "Test Samples";
+
+    public new ClassificationEnsembleSolution Content {
+      get { return (ClassificationEnsembleSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public ClassificationEnsembleSolutionEstimatedClassValuesView()
+      : base() {
+      InitializeComponent();
+      SamplesComboBox.Items.AddRange(new string[] { SamplesComboBoxAllSamples, SamplesComboBoxTrainingSamples, SamplesComboBoxTestSamples });
+      SamplesComboBox.SelectedIndex = 0;
+    }
+
+    private void SamplesComboBox_SelectedIndexChanged(object sender, EventArgs e) {
+      UpdateEstimatedValues();
+    }
+
+    protected override void UpdateEstimatedValues() {
+      if (InvokeRequired) {
+        Invoke((Action)UpdateEstimatedValues);
+        return;
+      }
+      if (Content == null) {
+        matrixView.Content = null;
+        return;
+      }
+
+      int[] indizes;
+      double[] estimatedClassValues;
+
+      switch (SamplesComboBox.SelectedItem.ToString()) {
+        case SamplesComboBoxAllSamples: {
+            indizes = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray();
+            estimatedClassValues = Content.EstimatedClassValues.ToArray();
+            break;
+          }
+        case SamplesComboBoxTrainingSamples: {
+            indizes = Content.ProblemData.TrainingIndizes.ToArray();
+            estimatedClassValues = Content.EstimatedTrainingClassValues.ToArray();
+            break;
+          }
+        case SamplesComboBoxTestSamples: {
+            indizes = Content.ProblemData.TestIndizes.ToArray();
+            estimatedClassValues = Content.EstimatedTestClassValues.ToArray();
+            break;
+          }
+        default:
+          throw new ArgumentException();
+      }
+
+      int classValuesCount = Content.ProblemData.ClassValues.Count;
+      int modelCount = Content.Model.Models.Count();
+      string[,] values = new string[indizes.Length, 4 + classValuesCount + modelCount];
+      double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable);
+      List<List<double?>> estimatedValuesVector = GetEstimatedValues(SamplesComboBox.SelectedItem.ToString(), indizes,
+                                                            Content.ClassificationSolutions);
+
+      for (int i = 0; i < indizes.Length; i++) {
+        int row = indizes[i];
+        values[i, 0] = row.ToString();
+        values[i, 1] = target[i].ToString();
+        values[i, 2] = estimatedClassValues[i].ToString();
+        var groups = estimatedValuesVector[i].GroupBy(x => x).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
+        var estimationCount = groups.Where(g => g.Key != null).Select(g => g.Count).Sum();
+        values[i, 3] = (((double)groups.Where(g => g.Key == estimatedClassValues[i]).Single().Count) / estimationCount).ToString();
+        for (int classIndex = 0; classIndex < Content.ProblemData.ClassValues.Count; classIndex++) {
+          var group = groups.Where(g => g.Key == Content.ProblemData.ClassValues[classIndex]).SingleOrDefault();
+          if (group == null) values[i, 4 + classIndex] = 0.ToString();
+          else values[i, 4 + classIndex] = group.Count.ToString();
+        }
+        for (int modelIndex = 0; modelIndex < estimatedValuesVector[i].Count; modelIndex++) {
+          values[i, 4 + classValuesCount + modelIndex] = estimatedValuesVector[i][modelIndex] == null
+                                                           ? string.Empty
+                                                           : estimatedValuesVector[i][modelIndex].ToString();
+        }
+
+      }
+
+      StringMatrix matrix = new StringMatrix(values);
+      List<string> columnNames = new List<string>() { "Id", TargetClassValuesColumnName, EstimatedClassValuesColumnName, ConfidenceColumnName };
+      columnNames.AddRange(Content.ProblemData.ClassNames);
+      columnNames.AddRange(Content.Model.Models.Select(m => m.Name));
+      matrix.ColumnNames = columnNames;
+      matrix.SortableView = true;
+      matrixView.Content = matrix;
+    }
+
+    private List<List<double?>> GetEstimatedValues(string samplesSelection, int[] rows, IEnumerable<IClassificationSolution> solutions) {
+      List<List<double?>> values = new List<List<double?>>();
+      int solutionIndex = 0;
+      foreach (var solution in solutions) {
+        double[] estimation = solution.GetEstimatedClassValues(rows).ToArray();
+        for (int i = 0; i < rows.Length; i++) {
+          var row = rows[i];
+          if (solutionIndex == 0) values.Add(new List<double?>());
+
+          if (samplesSelection == SamplesComboBoxAllSamples)
+            values[i].Add(estimation[i]);
+          else if (samplesSelection == SamplesComboBoxTrainingSamples && solution.ProblemData.IsTrainingSample(row))
+            values[i].Add(estimation[i]);
+          else if (samplesSelection == SamplesComboBoxTestSamples && solution.ProblemData.IsTestSample(row))
+            values[i].Add(estimation[i]);
+          else
+            values[i].Add(null);
+        }
+        solutionIndex++;
+      }
+      return values;
+    }
+
+
+
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionModelView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionModelView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionModelView.cs	(revision 6675)
@@ -19,5 +19,8 @@
  */
 #endregion
+
+using System.Linq;
 using System.Windows.Forms;
+using HeuristicLab.Common;
 using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
@@ -44,7 +47,8 @@
     protected override void OnContentChanged() {
       base.OnContentChanged();
-      if (Content != null)
+      if (Content != null) {
+        view.Locked = Content.ProblemData == ClassificationEnsembleProblemData.EmptyProblemData;
         view.Content = Content.ClassificationSolutions;
-      else
+      } else
         view.Content = null;
     }
@@ -62,4 +66,25 @@
         detailsGroupBox.Enabled = Content != null && itemsListView.SelectedItems.Count == 1;
       }
+
+      protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {
+        validDragOperation = false;
+        if (ReadOnly || Locked) return;
+        if (Content.IsReadOnly) return;
+
+        var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+        validDragOperation = dropData.GetObjectGraphObjects().OfType<IClassificationSolution>().Any();
+      }
+      protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {
+        if (e.Effect != DragDropEffects.None) {
+          var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+          var solutions = dropData.GetObjectGraphObjects().OfType<IClassificationSolution>();
+          if (e.Effect.HasFlag(DragDropEffects.Copy)) {
+            Cloner cloner = new Cloner();
+            solutions = solutions.Select(s => cloner.Clone(s));
+          }
+          foreach (var solution in solutions)
+            Content.Add(solution);
+        }
+      }
     }
   }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 6675)
@@ -110,4 +110,10 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Classification\ClassificationEnsembleSolutionEstimatedClassValuesView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Classification\ClassificationEnsembleSolutionEstimatedClassValuesView.Designer.cs">
+      <DependentUpon>ClassificationEnsembleSolutionEstimatedClassValuesView.cs</DependentUpon>
+    </Compile>
     <Compile Include="Classification\ClassificationEnsembleSolutionModelView.cs">
       <SubType>UserControl</SubType>
@@ -182,4 +188,10 @@
       <DependentUpon>ClusteringSolutionView.cs</DependentUpon>
     </Compile>
+    <Compile Include="Solution Views\ClassificationEnsembleSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Solution Views\ClassificationEnsembleSolutionView.Designer.cs">
+      <DependentUpon>ClassificationEnsembleSolutionView.cs</DependentUpon>
+    </Compile>
     <Compile Include="Solution Views\DiscriminantFunctionClassificationSolutionView.cs">
       <SubType>UserControl</SubType>
@@ -202,4 +214,16 @@
     <Compile Include="Interfaces\IDataAnalysisSolutionEvaluationView.cs" />
     <Compile Include="MenuItems\CreateEnsembleMenuItem.cs" />
+    <Compile Include="Solution Views\NamedDataAnalysisSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Solution Views\NamedDataAnalysisSolutionView.Designer.cs">
+      <DependentUpon>NamedDataAnalysisSolutionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Solution Views\RegressionEnsembleSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Solution Views\RegressionEnsembleSolutionView.Designer.cs">
+      <DependentUpon>RegressionEnsembleSolutionView.cs</DependentUpon>
+    </Compile>
     <Compile Include="Solution Views\RegressionSolutionView.cs">
       <SubType>UserControl</SubType>
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs	(revision 6675)
@@ -19,5 +19,8 @@
  */
 #endregion
+
+using System.Linq;
 using System.Windows.Forms;
+using HeuristicLab.Common;
 using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
@@ -44,7 +47,8 @@
     protected override void OnContentChanged() {
       base.OnContentChanged();
-      if (Content != null)
+      if (Content != null) {
+        view.Locked = Content.ProblemData == RegressionEnsembleProblemData.EmptyProblemData;
         view.Content = Content.RegressionSolutions;
-      else
+      } else
         view.Content = null;
     }
@@ -59,6 +63,27 @@
         addButton.Enabled = Content != null && !Content.IsReadOnly && !Locked;
         removeButton.Enabled = Content != null && !Content.IsReadOnly && !Locked && itemsListView.SelectedItems.Count > 0;
-        itemsListView.Enabled = Content != null;
+        itemsListView.Enabled = Content != null && !Locked;
         detailsGroupBox.Enabled = Content != null && itemsListView.SelectedItems.Count == 1;
+      }
+
+      protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {
+        validDragOperation = false;
+        if (ReadOnly || Locked) return;
+        if (Content.IsReadOnly) return;
+
+        var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+        validDragOperation = dropData.GetObjectGraphObjects().OfType<IRegressionSolution>().Any();
+      }
+      protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {
+        if (e.Effect != DragDropEffects.None) {
+          var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+          var solutions = dropData.GetObjectGraphObjects().OfType<IRegressionSolution>();
+          if (e.Effect.HasFlag(DragDropEffects.Copy)) {
+            Cloner cloner = new Cloner();
+            solutions = solutions.Select(s => cloner.Clone(s));
+          }
+          foreach (var solution in solutions)
+            Content.Add(solution);
+        }
       }
     }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.Designer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.Designer.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.Designer.cs	(revision 6675)
@@ -19,5 +19,4 @@
  */
 #endregion
-
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   partial class ClassificationEnsembleSolutionView {
@@ -45,40 +44,6 @@
     /// </summary>
     private void InitializeComponent() {
-      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
-      this.splitContainer.Panel1.SuspendLayout();
-      this.splitContainer.Panel2.SuspendLayout();
-      this.splitContainer.SuspendLayout();
-      this.itemsGroupBox.SuspendLayout();
-      this.detailsGroupBox.SuspendLayout();
-      this.SuspendLayout();
-      // 
-      // splitContainer
-      // 
-      // 
-      // itemsGroupBox
-      // 
-      this.itemsGroupBox.Text = "Regression Solution";
-      // 
-      // addButton
-      // 
-      this.toolTip.SetToolTip(this.addButton, "Add");
-      // 
-      // removeButton
-      // 
-      this.toolTip.SetToolTip(this.removeButton, "Remove");
-      // 
-      // RegressionSolutionView
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      components = new System.ComponentModel.Container();
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Name = "RegressionSolutionView";
-      this.splitContainer.Panel1.ResumeLayout(false);
-      this.splitContainer.Panel2.ResumeLayout(false);
-      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
-      this.splitContainer.ResumeLayout(false);
-      this.itemsGroupBox.ResumeLayout(false);
-      this.detailsGroupBox.ResumeLayout(false);
-      this.ResumeLayout(false);
-
     }
 
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs	(revision 6675)
@@ -20,16 +20,14 @@
 #endregion
 
-using System;
 using System.Windows.Forms;
+using HeuristicLab.Core;
 using HeuristicLab.MainForm;
-using HeuristicLab.MainForm.WindowsForms;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   [View("ClassificationEnsembleSolution View")]
-  [Content(typeof(ClassificationEnsembleSolution), true)]
+  [Content(typeof(ClassificationEnsembleSolution), false)]
   public partial class ClassificationEnsembleSolutionView : ClassificationSolutionView {
     public ClassificationEnsembleSolutionView() {
       InitializeComponent();
-      AddViewListViewItem(typeof(ClassificationEnsembleSolutionModelView), HeuristicLab.Common.Resources.VSImageLibrary.Function);
     }
 
@@ -39,25 +37,20 @@
     }
 
-    protected override void itemsListView_DoubleClick(object sender, EventArgs e) {
-      if (Content != null && itemsListView.SelectedItems.Count == 1 && itemsListView.SelectedItems[0].Tag == typeof(ClassificationEnsembleSolutionModelView)) {
-        Type viewType = (Type)itemsListView.SelectedItems[0].Tag;
-        var view = MainFormManager.MainForm.ShowContent(Content.ClassificationSolutions, viewType);
-        view.ReadOnly = false;
-        view.Locked = Locked;
-      } else
-        base.itemsListView_DoubleClick(sender, e);
+    #region drag & drop
+    protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {
+      if (e.Effect != DragDropEffects.None) {
+        var droppedData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+        if (droppedData is IValueParameter) droppedData = ((IValueParameter)droppedData).Value;
+
+        ClassificationEnsembleProblemData ensembleProblemData = droppedData as ClassificationEnsembleProblemData;
+        ClassificationProblemData problemData = droppedData as ClassificationProblemData;
+        if (ensembleProblemData != null) {
+          Content.ProblemData = (ClassificationEnsembleProblemData)ensembleProblemData.Clone();
+        } else if (problemData != null) {
+          Content.ProblemData = new ClassificationEnsembleProblemData((IClassificationProblemData)problemData.Clone());
+        }
+      }
     }
-
-    protected override void itemsListView_SelectedIndexChanged(object sender, EventArgs e) {
-      if (Content != null && itemsListView.SelectedItems.Count == 1 && itemsListView.SelectedItems[0].Tag == typeof(ClassificationEnsembleSolutionModelView)) {
-        detailsGroupBox.Enabled = true;
-        Type viewType = (Type)itemsListView.SelectedItems[0].Tag;
-        viewHost.ViewType = viewType;
-        viewHost.Content = Content.ClassificationSolutions;
-        viewHost.ReadOnly = false;
-        viewHost.Locked = Locked;
-      } else
-        base.itemsListView_SelectedIndexChanged(sender, e);
-    }
+    #endregion
   }
 }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs	(revision 6675)
@@ -21,9 +21,10 @@
 
 using System.Windows.Forms;
+using HeuristicLab.Core;
 using HeuristicLab.MainForm;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   [View("ClassificationSolution View")]
-  [Content(typeof(ClassificationSolutionBase), true)]
+  [Content(typeof(ClassificationSolutionBase), false)]
   public partial class ClassificationSolutionView : DataAnalysisSolutionView {
     public ClassificationSolutionView() {
@@ -35,4 +36,18 @@
       set { base.Content = value; }
     }
+
+    #region drag and drop
+    protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      if (ReadOnly) return;
+
+      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      if (dropData is ClassificationProblemData) validDragOperation = true;
+      else if (dropData is IValueParameter) {
+        var param = (IValueParameter)dropData;
+        if (param.Value is ClassificationProblemData) validDragOperation = true;
+      }
+    }
+    #endregion
   }
 }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs	(revision 6675)
@@ -25,5 +25,5 @@
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   [View("ClusteringSolution View")]
-  [Content(typeof(ClusteringSolution), true)]
+  [Content(typeof(ClusteringSolution), false)]
   public partial class ClusteringSolutionView : DataAnalysisSolutionView {
     public ClusteringSolutionView() {
@@ -35,4 +35,13 @@
       set { base.Content = value; }
     }
+
+    #region drag and drop
+    protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is ClusteringProblemData)) {
+        validDragOperation = true;
+      }
+    }
+    #endregion
   }
 }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs	(revision 6675)
@@ -25,13 +25,16 @@
 using System.Linq;
 using System.Windows.Forms;
+using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
+using HeuristicLab.Optimization;
 using HeuristicLab.Optimization.Views;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   [View("DataAnalysisSolution View")]
-  [Content(typeof(DataAnalysisSolution), true)]
-  public partial class DataAnalysisSolutionView : ResultCollectionView {
+  [Content(typeof(DataAnalysisSolution), false)]
+  public partial class DataAnalysisSolutionView : NamedItemCollectionView<IResult> {
     public DataAnalysisSolutionView() {
       InitializeComponent();
+      viewHost.ViewsLabelVisible = false;
     }
 
@@ -39,4 +42,22 @@
       get { return (DataAnalysisSolution)base.Content; }
       set { base.Content = value; }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      addButton.Enabled = false;
+      removeButton.Enabled = false;
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      OnContentChanged();
     }
 
@@ -58,6 +79,10 @@
     }
 
+    protected override IResult CreateItem() {
+      return null;
+    }
+
     protected virtual void AddEvaluationViewTypes() {
-      if (Content != null) {
+      if (Content != null && !Content.ProblemData.IsEmpty) {
         var viewTypes = MainFormManager.GetViewTypes(Content.GetType(), true)
           .Where(t => typeof(IDataAnalysisSolutionEvaluationView).IsAssignableFrom(t));
@@ -68,9 +93,17 @@
 
     protected override void itemsListView_DoubleClick(object sender, EventArgs e) {
-      if (itemsListView.SelectedItems.Count == 1 && itemsListView.SelectedItems[0].Tag is Type) {
-        Type viewType = (Type)itemsListView.SelectedItems[0].Tag;
+      if (itemsListView.SelectedItems.Count != 1) return;
+
+      IResult result = itemsListView.SelectedItems[0].Tag as IResult;
+      Type viewType = itemsListView.SelectedItems[0].Tag as Type;
+      if (result != null) {
+        IContentView view = MainFormManager.MainForm.ShowContent(result, typeof(ResultView));
+        if (view != null) {
+          view.ReadOnly = ReadOnly;
+          view.Locked = Locked;
+        }
+      } else if (viewType != null) {
         MainFormManager.MainForm.ShowContent(Content, viewType);
-      } else
-        base.itemsListView_DoubleClick(sender, e);
+      }
     }
 
@@ -102,4 +135,22 @@
         itemsListView.Items.Remove(item);
     }
+
+    #region drag and drop
+    protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is DataAnalysisProblemData)) {
+        validDragOperation = true;
+      }
+    }
+
+    protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {
+      if (e.Effect != DragDropEffects.None) {
+        if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is DataAnalysisProblemData) {
+          DataAnalysisProblemData problemData = (DataAnalysisProblemData)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+          Content.ProblemData = (DataAnalysisProblemData)problemData.Clone();
+        }
+      }
+    }
+    #endregion
   }
 }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DiscriminantFunctionClassificationSolutionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DiscriminantFunctionClassificationSolutionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DiscriminantFunctionClassificationSolutionView.cs	(revision 6675)
@@ -20,11 +20,10 @@
 #endregion
 
-using System.Windows.Forms;
+
 using HeuristicLab.MainForm;
-
 namespace HeuristicLab.Problems.DataAnalysis.Views {
-  [View("DiscriminantFunctionClassificationSolution View")]
-  [Content(typeof(DiscriminantFunctionClassificationSolutionBase), true)]
-  public partial class DiscriminantFunctionClassificationSolutionView : DataAnalysisSolutionView {
+  [View("ClassificationSolution View")]
+  [Content(typeof(DiscriminantFunctionClassificationSolutionBase), false)]
+  public partial class DiscriminantFunctionClassificationSolutionView : ClassificationSolutionView {
     public DiscriminantFunctionClassificationSolutionView() {
       InitializeComponent();
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/NamedDataAnalysisSolutionView.Designer.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/NamedDataAnalysisSolutionView.Designer.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/NamedDataAnalysisSolutionView.Designer.cs	(revision 6675)
@@ -0,0 +1,66 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Views.Solution_Views {
+  partial class NamedDataAnalysisSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.panel = new System.Windows.Forms.Panel();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      // 
+      // panel
+      // 
+      this.panel.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.panel.Location = new System.Drawing.Point(3, 26);
+      this.panel.Name = "panel";
+      this.panel.Size = new System.Drawing.Size(345, 235);
+      this.panel.TabIndex = 3;
+      // 
+      // NamedDataAnalysisSolutionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.panel);
+      this.Name = "NamedDataAnalysisSolutionView";
+      this.Size = new System.Drawing.Size(351, 264);
+      this.Controls.SetChildIndex(this.panel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Panel panel;
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/NamedDataAnalysisSolutionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/NamedDataAnalysisSolutionView.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/NamedDataAnalysisSolutionView.cs	(revision 6675)
@@ -0,0 +1,56 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views.Solution_Views {
+  [View("DataAnalysisSolutionView")]
+  [Content(typeof(DataAnalysisSolution), true)]
+  public partial class NamedDataAnalysisSolutionView : NamedItemView {
+    public NamedDataAnalysisSolutionView() {
+      InitializeComponent();
+    }
+
+    public new DataAnalysisSolution Content {
+      get { return (DataAnalysisSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      panel.Controls.Clear();
+
+      if (Content != null) {
+        var viewType = MainFormManager.GetViewTypes(Content.GetType(), true).Where(t => typeof(DataAnalysisSolutionView).IsAssignableFrom(t)).FirstOrDefault();
+        if (viewType != null) {
+          var view = (DataAnalysisSolutionView)Activator.CreateInstance(viewType);
+          view.Dock = DockStyle.Fill;
+          view.Content = Content;
+          panel.Controls.Add(view);
+        }
+      }
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs	(revision 6675)
@@ -20,16 +20,14 @@
 #endregion
 
-using System;
 using System.Windows.Forms;
+using HeuristicLab.Core;
 using HeuristicLab.MainForm;
-using HeuristicLab.MainForm.WindowsForms;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   [View("RegressionEnsembleSolution View")]
-  [Content(typeof(RegressionEnsembleSolution), true)]
+  [Content(typeof(RegressionEnsembleSolution), false)]
   public partial class RegressionEnsembleSolutionView : RegressionSolutionView {
     public RegressionEnsembleSolutionView() {
       InitializeComponent();
-      AddViewListViewItem(typeof(RegressionEnsembleSolutionModelView), HeuristicLab.Common.Resources.VSImageLibrary.Function);
     }
 
@@ -39,25 +37,20 @@
     }
 
-    protected override void itemsListView_DoubleClick(object sender, EventArgs e) {
-      if (Content != null && itemsListView.SelectedItems.Count == 1 && itemsListView.SelectedItems[0].Tag == typeof(RegressionEnsembleSolutionModelView)) {
-        Type viewType = (Type)itemsListView.SelectedItems[0].Tag;
-        var view = MainFormManager.MainForm.ShowContent(Content.RegressionSolutions, viewType);
-        view.ReadOnly = false;
-        view.Locked = Locked;
-      } else
-        base.itemsListView_DoubleClick(sender, e);
+    #region drag & drop
+    protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {
+      if (e.Effect != DragDropEffects.None) {
+        var droppedData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+        if (droppedData is IValueParameter) droppedData = ((IValueParameter)droppedData).Value;
+
+        RegressionEnsembleProblemData ensembleProblemData = droppedData as RegressionEnsembleProblemData;
+        RegressionProblemData problemData = droppedData as RegressionProblemData;
+        if (ensembleProblemData != null) {
+          Content.ProblemData = (RegressionEnsembleProblemData)ensembleProblemData.Clone();
+        } else if (problemData != null) {
+          Content.ProblemData = new RegressionEnsembleProblemData((IRegressionProblemData)problemData.Clone());
+        }
+      }
     }
-
-    protected override void itemsListView_SelectedIndexChanged(object sender, EventArgs e) {
-      if (Content != null && itemsListView.SelectedItems.Count == 1 && itemsListView.SelectedItems[0].Tag == typeof(RegressionEnsembleSolutionModelView)) {
-        detailsGroupBox.Enabled = true;
-        Type viewType = (Type)itemsListView.SelectedItems[0].Tag;
-        viewHost.ViewType = viewType;
-        viewHost.Content = Content.RegressionSolutions;
-        viewHost.ReadOnly = false;
-        viewHost.Locked = Locked;
-      } else
-        base.itemsListView_SelectedIndexChanged(sender, e);
-    }
+    #endregion
   }
 }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs	(revision 6675)
@@ -21,9 +21,10 @@
 
 using System.Windows.Forms;
+using HeuristicLab.Core;
 using HeuristicLab.MainForm;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   [View("RegressionSolution View")]
-  [Content(typeof(RegressionSolutionBase), true)]
+  [Content(typeof(RegressionSolutionBase), false)]
   public partial class RegressionSolutionView : DataAnalysisSolutionView {
     public RegressionSolutionView() {
@@ -35,4 +36,18 @@
       set { base.Content = value; }
     }
+
+    #region drag and drop
+    protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      if (ReadOnly) return;
+
+      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      if (dropData is RegressionProblemData) validDragOperation = true;
+      else if (dropData is IValueParameter) {
+        var param = (IValueParameter)dropData;
+        if (param.Value is RegressionProblemData) validDragOperation = true;
+      }
+    }
+    #endregion
   }
 }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleModel.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleModel.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleModel.cs	(revision 6675)
@@ -46,4 +46,6 @@
       this.models = original.Models.Select(m => cloner.Clone(m)).ToList();
     }
+
+    public ClassificationEnsembleModel() : this(Enumerable.Empty<IClassificationModel>()) { }
     public ClassificationEnsembleModel(IEnumerable<IClassificationModel> models)
       : base() {
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs	(revision 6675)
@@ -20,8 +20,5 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
-using System.IO;
-using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -35,23 +32,45 @@
   public class ClassificationEnsembleProblemData : ClassificationProblemData {
 
-    public override IEnumerable<int> TrainingIndizes {
-      get {
-        return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start);
-      }
+    public override bool IsTrainingSample(int index) {
+      return index >= 0 && index < Dataset.Rows &&
+             TrainingPartition.Start <= index && index < TrainingPartition.End;
     }
-    public override IEnumerable<int> TestIndizes {
-      get {
-        return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start);
-      }
+
+    public override bool IsTestSample(int index) {
+      return index >= 0 && index < Dataset.Rows &&
+             TestPartition.Start <= index && index < TestPartition.End;
+    }
+
+    private static readonly ClassificationEnsembleProblemData emptyProblemData;
+    public static ClassificationEnsembleProblemData EmptyProblemData {
+      get { return emptyProblemData; }
+    }
+
+    static ClassificationEnsembleProblemData() {
+      var problemData = new ClassificationEnsembleProblemData();
+      problemData.Parameters.Clear();
+      problemData.Name = "Empty Classification ProblemData";
+      problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded.";
+      problemData.isEmpty = true;
+
+      problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset()));
+      problemData.Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, ""));
+      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>()));
+      problemData.Parameters.Add(new FixedValueParameter<StringMatrix>(ClassNamesParameterName, "", new StringMatrix(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new FixedValueParameter<DoubleMatrix>(ClassificationPenaltiesParameterName, "", (DoubleMatrix)new DoubleMatrix(0, 0).AsReadOnly()));
+      emptyProblemData = problemData;
     }
 
     [StorableConstructor]
     protected ClassificationEnsembleProblemData(bool deserializing) : base(deserializing) { }
+    protected ClassificationEnsembleProblemData(ClassificationEnsembleProblemData original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      if (this == emptyProblemData) return emptyProblemData;
+      return new ClassificationEnsembleProblemData(this, cloner);
+    }
 
-    protected ClassificationEnsembleProblemData(ClassificationEnsembleProblemData original, Cloner cloner)
-      : base(original, cloner) {
-    }
-    public override IDeepCloneable Clone(Cloner cloner) { return new ClassificationEnsembleProblemData(this, cloner); }
-
+    public ClassificationEnsembleProblemData() : base() { }
     public ClassificationEnsembleProblemData(IClassificationProblemData classificationProblemData)
       : base(classificationProblemData.Dataset, classificationProblemData.AllowedInputVariables, classificationProblemData.TargetVariable) {
@@ -61,4 +80,8 @@
       this.TestPartition.End = classificationProblemData.TestPartition.End;
     }
+
+    public ClassificationEnsembleProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable)
+      : base(dataset, allowedInputVariables, targetVariable) {
+    }
   }
 }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs	(revision 6675)
@@ -35,8 +35,12 @@
   [StorableClass]
   [Item("Classification Ensemble Solution", "A classification solution that contains an ensemble of multiple classification models")]
-  // [Creatable("Data Analysis")]
+  [Creatable("Data Analysis - Ensembles")]
   public sealed class ClassificationEnsembleSolution : ClassificationSolution, IClassificationEnsembleSolution {
     public new IClassificationEnsembleModel Model {
       get { return (IClassificationEnsembleModel)base.Model; }
+    }
+    public new ClassificationEnsembleProblemData ProblemData {
+      get { return (ClassificationEnsembleProblemData)base.ProblemData; }
+      set { base.ProblemData = value; }
     }
 
@@ -82,4 +86,13 @@
 
       classificationSolutions = cloner.Clone(original.classificationSolutions);
+      RegisterClassificationSolutionsEventHandler();
+    }
+
+    public ClassificationEnsembleSolution()
+      : base(new ClassificationEnsembleModel(), ClassificationEnsembleProblemData.EmptyProblemData) {
+      trainingPartitions = new Dictionary<IClassificationModel, IntRange>();
+      testPartitions = new Dictionary<IClassificationModel, IntRange>();
+      classificationSolutions = new ItemCollection<IClassificationSolution>();
+
       RegisterClassificationSolutionsEventHandler();
     }
@@ -208,4 +221,31 @@
     #endregion
 
+    protected override void OnProblemDataChanged() {
+      IClassificationProblemData problemData = new ClassificationProblemData(ProblemData.Dataset,
+                                                                     ProblemData.AllowedInputVariables,
+                                                                     ProblemData.TargetVariable);
+      problemData.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
+      problemData.TrainingPartition.End = ProblemData.TrainingPartition.End;
+      problemData.TestPartition.Start = ProblemData.TestPartition.Start;
+      problemData.TestPartition.End = ProblemData.TestPartition.End;
+
+      foreach (var solution in ClassificationSolutions) {
+        if (solution is ClassificationEnsembleSolution)
+          solution.ProblemData = ProblemData;
+        else
+          solution.ProblemData = problemData;
+      }
+      foreach (var trainingPartition in trainingPartitions.Values) {
+        trainingPartition.Start = ProblemData.TrainingPartition.Start;
+        trainingPartition.End = ProblemData.TrainingPartition.End;
+      }
+      foreach (var testPartition in testPartitions.Values) {
+        testPartition.Start = ProblemData.TestPartition.Start;
+        testPartition.End = ProblemData.TestPartition.End;
+      }
+
+      base.OnProblemDataChanged();
+    }
+
     public void AddClassificationSolutions(IEnumerable<IClassificationSolution> solutions) {
       classificationSolutions.AddRange(solutions);
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs	(revision 6675)
@@ -34,9 +34,9 @@
   [Item("ClassificationProblemData", "Represents an item containing all data defining a classification problem.")]
   public class ClassificationProblemData : DataAnalysisProblemData, IClassificationProblemData {
-    private const string TargetVariableParameterName = "TargetVariable";
-    private const string ClassNamesParameterName = "ClassNames";
-    private const string ClassificationPenaltiesParameterName = "ClassificationPenalties";
-    private const int MaximumNumberOfClasses = 20;
-    private const int InspectedRowsToDetermineTargets = 500;
+    protected const string TargetVariableParameterName = "TargetVariable";
+    protected const string ClassNamesParameterName = "ClassNames";
+    protected const string ClassificationPenaltiesParameterName = "ClassificationPenalties";
+    protected const int MaximumNumberOfClasses = 20;
+    protected const int InspectedRowsToDetermineTargets = 500;
 
     #region default data
@@ -171,7 +171,13 @@
      {1176881,7,5,3,7,4,10,7,5,5,4        }
 };
-    private static Dataset defaultDataset;
-    private static IEnumerable<string> defaultAllowedInputVariables;
-    private static string defaultTargetVariable;
+    private static readonly Dataset defaultDataset;
+    private static readonly IEnumerable<string> defaultAllowedInputVariables;
+    private static readonly string defaultTargetVariable;
+
+    private static readonly ClassificationProblemData emptyProblemData;
+    public static ClassificationProblemData EmptyProblemData {
+      get { return EmptyProblemData; }
+    }
+
     static ClassificationProblemData() {
       defaultDataset = new Dataset(defaultVariableNames, defaultData);
@@ -181,4 +187,19 @@
       defaultAllowedInputVariables = defaultVariableNames.Except(new List<string>() { "sample", "class" });
       defaultTargetVariable = "class";
+
+      var problemData = new ClassificationProblemData();
+      problemData.Parameters.Clear();
+      problemData.Name = "Empty Classification ProblemData";
+      problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded.";
+      problemData.isEmpty = true;
+
+      problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset()));
+      problemData.Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, ""));
+      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>()));
+      problemData.Parameters.Add(new FixedValueParameter<StringMatrix>(ClassNamesParameterName, "", new StringMatrix(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new FixedValueParameter<DoubleMatrix>(ClassificationPenaltiesParameterName, "", (DoubleMatrix)new DoubleMatrix(0, 0).AsReadOnly()));
+      emptyProblemData = problemData;
     }
     #endregion
@@ -249,5 +270,8 @@
       RegisterParameterEvents();
     }
-    public override IDeepCloneable Clone(Cloner cloner) { return new ClassificationProblemData(this, cloner); }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      if (this == emptyProblemData) return emptyProblemData;
+      return new ClassificationProblemData(this, cloner);
+    }
 
     public ClassificationProblemData() : this(defaultDataset, defaultAllowedInputVariables, defaultTargetVariable) { }
@@ -267,11 +291,11 @@
     private static IEnumerable<string> CheckVariablesForPossibleTargetVariables(Dataset dataset) {
       int maxSamples = Math.Min(InspectedRowsToDetermineTargets, dataset.Rows);
-      var validTargetVariables = from v in dataset.VariableNames
-                                 let DistinctValues = dataset.GetVariableValues(v)
-                                   .Take(maxSamples)
-                                   .Distinct()
-                                   .Count()
-                                 where DistinctValues < MaximumNumberOfClasses
-                                 select v;
+      var validTargetVariables = (from v in dataset.VariableNames
+                                  let distinctValues = dataset.GetEnumeratedVariableValues(v)
+                                    .Take(maxSamples)
+                                    .Distinct()
+                                    .Count()
+                                  where distinctValues < MaximumNumberOfClasses
+                                  select v).ToArray();
 
       if (!validTargetVariables.Any())
@@ -283,5 +307,5 @@
 
     private void ResetTargetVariableDependentMembers() {
-      DergisterParameterEvents();
+      DeregisterParameterEvents();
 
       classNames = null;
@@ -357,5 +381,5 @@
       ClassificationPenaltiesParameter.Value.ItemChanged += new EventHandler<EventArgs<int, int>>(MatrixParameter_ItemChanged);
     }
-    private void DergisterParameterEvents() {
+    private void DeregisterParameterEvents() {
       TargetVariableParameter.ValueChanged -= new EventHandler(TargetVariableParameter_ValueChanged);
       ClassNamesParameter.Value.Reset -= new EventHandler(Parameter_ValueChanged);
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs	(revision 6675)
@@ -40,5 +40,5 @@
     public new IClassificationProblemData ProblemData {
       get { return (IClassificationProblemData)base.ProblemData; }
-      protected set { base.ProblemData = value; }
+      set { base.ProblemData = value; }
     }
 
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs	(revision 6675)
@@ -33,8 +33,8 @@
   [StorableClass]
   public abstract class DataAnalysisProblemData : ParameterizedNamedItem, IDataAnalysisProblemData {
-    private const string DatasetParameterName = "Dataset";
-    private const string InputVariablesParameterName = "InputVariables";
-    private const string TrainingPartitionParameterName = "TrainingPartition";
-    private const string TestPartitionParameterName = "TestPartition";
+    protected const string DatasetParameterName = "Dataset";
+    protected const string InputVariablesParameterName = "InputVariables";
+    protected const string TrainingPartitionParameterName = "TrainingPartition";
+    protected const string TestPartitionParameterName = "TestPartition";
 
     #region parameter properites
@@ -53,5 +53,9 @@
     #endregion
 
-    #region propeties
+    #region properties
+    protected bool isEmpty = false;
+    public bool IsEmpty {
+      get { return isEmpty; }
+    }
     public Dataset Dataset {
       get { return DatasetParameter.Value; }
@@ -74,5 +78,5 @@
       get {
         return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start)
-                         .Where(i => i >= 0 && i < Dataset.Rows && (i < TestPartition.Start || TestPartition.End <= i));
+                         .Where(IsTrainingSample);
       }
     }
@@ -80,6 +84,17 @@
       get {
         return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start)
-           .Where(i => i >= 0 && i < Dataset.Rows);
+           .Where(IsTestSample);
       }
+    }
+
+    public virtual bool IsTrainingSample(int index) {
+      return index >= 0 && index < Dataset.Rows &&
+        TrainingPartition.Start <= index && index < TrainingPartition.End &&
+        (index < TestPartition.Start || TestPartition.End <= index);
+    }
+
+    public virtual bool IsTestSample(int index) {
+      return index >= 0 && index < Dataset.Rows &&
+             TestPartition.Start <= index && index < TestPartition.End;
     }
     #endregion
@@ -87,4 +102,5 @@
     protected DataAnalysisProblemData(DataAnalysisProblemData original, Cloner cloner)
       : base(original, cloner) {
+      isEmpty = original.isEmpty;
       RegisterEventHandlers();
     }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisSolution.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisSolution.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisSolution.cs	(revision 6675)
@@ -56,5 +56,5 @@
     public IDataAnalysisProblemData ProblemData {
       get { return (IDataAnalysisProblemData)this[ProblemDataResultName].Value; }
-      protected set {
+      set {
         if (this[ProblemDataResultName].Value != value) {
           if (value != null) {
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs	(revision 6675)
@@ -58,4 +58,6 @@
       this.models = original.Models.Select(m => cloner.Clone(m)).ToList();
     }
+
+    public RegressionEnsembleModel() : this(Enumerable.Empty<IRegressionModel>()) { }
     public RegressionEnsembleModel(IEnumerable<IRegressionModel> models)
       : base() {
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleProblemData.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleProblemData.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleProblemData.cs	(revision 6675)
@@ -20,8 +20,5 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
-using System.IO;
-using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -35,24 +32,42 @@
   public sealed class RegressionEnsembleProblemData : RegressionProblemData {
 
-    public override IEnumerable<int> TrainingIndizes {
-      get {
-        return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start);
-      }
+    public override bool IsTrainingSample(int index) {
+      return index >= 0 && index < Dataset.Rows &&
+             TrainingPartition.Start <= index && index < TrainingPartition.End;
     }
 
-    public override IEnumerable<int> TestIndizes {
-      get {
-        return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start);
-      }
+    public override bool IsTestSample(int index) {
+      return index >= 0 && index < Dataset.Rows &&
+             TestPartition.Start <= index && index < TestPartition.End;
+    }
+
+    private static readonly RegressionEnsembleProblemData emptyProblemData;
+    public new static RegressionEnsembleProblemData EmptyProblemData {
+      get { return emptyProblemData; }
+    }
+    static RegressionEnsembleProblemData() {
+      var problemData = new RegressionEnsembleProblemData();
+      problemData.Parameters.Clear();
+      problemData.Name = "Empty Regression ProblemData";
+      problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded.";
+      problemData.isEmpty = true;
+
+      problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset()));
+      problemData.Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, ""));
+      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>()));
+      emptyProblemData = problemData;
     }
 
     [StorableConstructor]
     private RegressionEnsembleProblemData(bool deserializing) : base(deserializing) { }
+    private RegressionEnsembleProblemData(RegressionEnsembleProblemData original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      if (this == emptyProblemData) return emptyProblemData;
+      return new RegressionEnsembleProblemData(this, cloner);
+    }
 
-    private RegressionEnsembleProblemData(RegressionEnsembleProblemData original, Cloner cloner)
-      : base(original, cloner) {
-    }
-    public override IDeepCloneable Clone(Cloner cloner) { return new RegressionEnsembleProblemData(this, cloner); }
-
+    public RegressionEnsembleProblemData() : base() { }
     public RegressionEnsembleProblemData(IRegressionProblemData regressionProblemData)
       : base(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable) {
@@ -62,4 +77,7 @@
       TestPartition.End = regressionProblemData.TestPartition.End;
     }
+    public RegressionEnsembleProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable)
+      : base(dataset, allowedInputVariables, targetVariable) {
+    }
   }
 }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs	(revision 6675)
@@ -35,8 +35,13 @@
   [StorableClass]
   [Item("Regression Ensemble Solution", "A regression solution that contains an ensemble of multiple regression models")]
-  // [Creatable("Data Analysis")]
+  [Creatable("Data Analysis - Ensembles")]
   public sealed class RegressionEnsembleSolution : RegressionSolution, IRegressionEnsembleSolution {
     public new IRegressionEnsembleModel Model {
       get { return (IRegressionEnsembleModel)base.Model; }
+    }
+
+    public new RegressionEnsembleProblemData ProblemData {
+      get { return (RegressionEnsembleProblemData)base.ProblemData; }
+      set { base.ProblemData = value; }
     }
 
@@ -59,5 +64,5 @@
     private void AfterDeserialization() {
       foreach (var model in Model.Models) {
-        IRegressionProblemData problemData = (IRegressionProblemData)ProblemData.Clone();
+        IRegressionProblemData problemData = (IRegressionProblemData) ProblemData.Clone();
         problemData.TrainingPartition.Start = trainingPartitions[model].Start;
         problemData.TrainingPartition.End = trainingPartitions[model].End;
@@ -82,4 +87,13 @@
 
       regressionSolutions = cloner.Clone(original.regressionSolutions);
+      RegisterRegressionSolutionsEventHandler();
+    }
+
+    public RegressionEnsembleSolution()
+      : base(new RegressionEnsembleModel(), RegressionEnsembleProblemData.EmptyProblemData) {
+      trainingPartitions = new Dictionary<IRegressionModel, IntRange>();
+      testPartitions = new Dictionary<IRegressionModel, IntRange>();
+      regressionSolutions = new ItemCollection<IRegressionSolution>();
+
       RegisterRegressionSolutionsEventHandler();
     }
@@ -203,6 +217,32 @@
     #endregion
 
+    protected override void OnProblemDataChanged() {
+      IRegressionProblemData problemData = new RegressionProblemData(ProblemData.Dataset,
+                                                                     ProblemData.AllowedInputVariables,
+                                                                     ProblemData.TargetVariable);
+      problemData.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
+      problemData.TrainingPartition.End = ProblemData.TrainingPartition.End;
+      problemData.TestPartition.Start = ProblemData.TestPartition.Start;
+      problemData.TestPartition.End = ProblemData.TestPartition.End;
+
+      foreach (var solution in RegressionSolutions) {
+        if (solution is RegressionEnsembleSolution)
+          solution.ProblemData = ProblemData;
+        else
+          solution.ProblemData = problemData;
+      }
+      foreach (var trainingPartition in trainingPartitions.Values) {
+        trainingPartition.Start = ProblemData.TrainingPartition.Start;
+        trainingPartition.End = ProblemData.TrainingPartition.End;
+      }
+      foreach (var testPartition in testPartitions.Values) {
+        testPartition.Start = ProblemData.TestPartition.Start;
+        testPartition.End = ProblemData.TestPartition.End;
+      }
+
+      base.OnProblemDataChanged();
+    }
+
     public void AddRegressionSolutions(IEnumerable<IRegressionSolution> solutions) {
-      solutions.OfType<RegressionEnsembleSolution>().SelectMany(ensemble => ensemble.RegressionSolutions);
       regressionSolutions.AddRange(solutions);
     }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs	(revision 6675)
@@ -34,5 +34,5 @@
   [Item("RegressionProblemData", "Represents an item containing all data defining a regression problem.")]
   public class RegressionProblemData : DataAnalysisProblemData, IRegressionProblemData {
-    private const string TargetVariableParameterName = "TargetVariable";
+    protected const string TargetVariableParameterName = "TargetVariable";
 
     #region default data
@@ -64,7 +64,12 @@
           {0.83763905,	0.468046718}
     };
-    private static Dataset defaultDataset;
-    private static IEnumerable<string> defaultAllowedInputVariables;
-    private static string defaultTargetVariable;
+    private static readonly Dataset defaultDataset;
+    private static readonly IEnumerable<string> defaultAllowedInputVariables;
+    private static readonly string defaultTargetVariable;
+
+    private static readonly RegressionProblemData emptyProblemData;
+    public static RegressionProblemData EmptyProblemData {
+      get { return emptyProblemData; }
+    }
 
     static RegressionProblemData() {
@@ -74,4 +79,17 @@
       defaultAllowedInputVariables = new List<string>() { "x" };
       defaultTargetVariable = "y";
+
+      var problemData = new RegressionProblemData();
+      problemData.Parameters.Clear();
+      problemData.Name = "Empty Regression ProblemData";
+      problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded.";
+      problemData.isEmpty = true;
+
+      problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset()));
+      problemData.Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, ""));
+      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
+      problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>()));
+      emptyProblemData = problemData;
     }
     #endregion
@@ -91,10 +109,12 @@
     }
 
-
     protected RegressionProblemData(RegressionProblemData original, Cloner cloner)
       : base(original, cloner) {
       RegisterParameterEvents();
     }
-    public override IDeepCloneable Clone(Cloner cloner) { return new RegressionProblemData(this, cloner); }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      if (this == emptyProblemData) return emptyProblemData;
+      return new RegressionProblemData(this, cloner);
+    }
 
     public RegressionProblemData()
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs	(revision 6675)
@@ -48,5 +48,5 @@
     public new IRegressionProblemData ProblemData {
       get { return (IRegressionProblemData)base.ProblemData; }
-      protected set { base.ProblemData = value; }
+      set { base.ProblemData = value; }
     }
 
@@ -127,5 +127,5 @@
         OnlineCalculatorError errorState;
         Add(new Result(TrainingMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the training partition", new DoubleValue()));
-        double trainingMAE = OnlineMeanSquaredErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes), out errorState);
+        double trainingMAE = OnlineMeanAbsoluteErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes), out errorState);
         TrainingMeanAbsoluteError = errorState == OnlineCalculatorError.None ? trainingMAE : double.NaN;
       }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationSolution.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationSolution.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationSolution.cs	(revision 6675)
@@ -20,10 +20,9 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
 namespace HeuristicLab.Problems.DataAnalysis {
   public interface IClassificationSolution : IDataAnalysisSolution {
     new IClassificationModel Model { get; }
-    new IClassificationProblemData ProblemData { get; }
+    new IClassificationProblemData ProblemData { get; set; }
 
     IEnumerable<double> EstimatedClassValues { get; }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringSolution.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringSolution.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringSolution.cs	(revision 6675)
@@ -24,5 +24,5 @@
   public interface IClusteringSolution : IDataAnalysisSolution {
     new IClusteringModel Model { get; }
-    new IClusteringProblemData ProblemData { get; }
+    new IClusteringProblemData ProblemData { get; set; }
 
     IEnumerable<int> ClusterValues { get; }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs	(revision 6675)
@@ -27,4 +27,6 @@
 namespace HeuristicLab.Problems.DataAnalysis {
   public interface IDataAnalysisProblemData : INamedItem {
+    bool IsEmpty { get; }
+
     Dataset Dataset { get; }
     ICheckedItemList<StringValue> InputVariables { get; }
@@ -37,4 +39,7 @@
     IEnumerable<int> TestIndizes { get; }
 
+    bool IsTrainingSample(int index);
+    bool IsTestSample(int index);
+
     event EventHandler Changed;
   }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolution.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolution.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolution.cs	(revision 6675)
@@ -21,11 +21,11 @@
 
 using System;
+using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Common;
 
 namespace HeuristicLab.Problems.DataAnalysis {
   public interface IDataAnalysisSolution : INamedItem, IStorableContent {
     IDataAnalysisModel Model { get; }
-    IDataAnalysisProblemData ProblemData { get; }
+    IDataAnalysisProblemData ProblemData { get; set; }
 
     event EventHandler ModelChanged;
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs	(revision 6675)
@@ -25,4 +25,5 @@
   public interface IRegressionEnsembleSolution : IRegressionSolution {
     new IRegressionEnsembleModel Model { get; }
+    new RegressionEnsembleProblemData ProblemData { get; set; }
     IItemCollection<IRegressionSolution> RegressionSolutions { get; }
     IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(Dataset dataset, IEnumerable<int> rows);
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs	(revision 6675)
@@ -24,5 +24,5 @@
   public interface IRegressionSolution : IDataAnalysisSolution {
     new IRegressionModel Model { get; }
-    new IRegressionProblemData ProblemData { get; }
+    new IRegressionProblemData ProblemData { get; set; }
 
     IEnumerable<double> EstimatedValues { get; }
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPScrambleMoveEvaluator.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPScrambleMoveEvaluator.cs	(revision 6675)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPScrambleMoveEvaluator.cs	(revision 6675)
@@ -0,0 +1,99 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.QuadraticAssignment {
+  [Item("QAPScrambleMoveEvaluator", "Evaluated a scramble move on a QAP solution.")]
+  [StorableClass]
+  public class QAPScrambleMoveEvaluator : QAPMoveEvaluator, IPermutationScrambleMoveOperator {
+    public ILookupParameter<ScrambleMove> ScrambleMoveParameter {
+      get { return (ILookupParameter<ScrambleMove>)Parameters["ScrambleMove"]; }
+    }
+
+    [StorableConstructor]
+    protected QAPScrambleMoveEvaluator(bool deserializing) : base(deserializing) { }
+    protected QAPScrambleMoveEvaluator(QAPScrambleMoveEvaluator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public QAPScrambleMoveEvaluator() {
+      Parameters.Add(new LookupParameter<ScrambleMove>("ScrambleMove", "The move to evaluate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new QAPScrambleMoveEvaluator(this, cloner);
+    }
+
+    /// <summary>
+    /// Calculates the quality of the move <paramref name="move"/> by evaluating the changes.
+    /// The runtime complexity of this method is O(N) with N being the size of the permutation.
+    /// </summary>
+    /// <param name="assignment">The current permutation.</param>
+    /// <param name="move">The move that is to be evaluated if it was applied to the current permutation.</param>
+    /// <param name="weights">The weights matrix.</param>
+    /// <param name="distances">The distances matrix.</param>
+    /// <returns>The relative change in quality if <paramref name="move"/> was applied to <paramref name="assignment"/>.</returns>
+    public static double Apply(Permutation assignment, ScrambleMove move, DoubleMatrix weights, DoubleMatrix distances) {
+      double moveQuality = 0;
+      int min = move.StartIndex;
+      int max = min + move.ScrambledIndices.Length - 1;
+
+      for (int i = min; i <= max; i++) {
+        int locI = assignment[i];
+        int newlocI = assignment[min + move.ScrambledIndices[i - min]];
+        if (locI == newlocI) continue;
+
+        for (int j = 0; j < assignment.Length; j++) {
+          int locJ = assignment[j];
+          if (j >= min && j <= max) {
+            int newlocJ = assignment[min + move.ScrambledIndices[j - min]];
+            moveQuality += weights[i, j] * (distances[newlocI, newlocJ] - distances[locI, locJ]);
+            if (locJ == newlocJ)
+              moveQuality += weights[j, i] * (distances[newlocJ, newlocI] - distances[locJ, locI]);
+          } else {
+            moveQuality += weights[i, j] * (distances[newlocI, locJ] - distances[locI, locJ]);
+            moveQuality += weights[j, i] * (distances[locJ, newlocI] - distances[locJ, locI]);
+          }
+        }
+      }
+      return moveQuality;
+    }
+
+    public override IOperation Apply() {
+      ScrambleMove move = ScrambleMoveParameter.ActualValue;
+      if (move == null) throw new InvalidOperationException("Scramble move is not found.");
+      Permutation assignment = PermutationParameter.ActualValue;
+      DoubleMatrix distances = DistancesParameter.ActualValue;
+      DoubleMatrix weights = WeightsParameter.ActualValue;
+
+      double moveQuality = QualityParameter.ActualValue.Value;
+      moveQuality += Apply(assignment, move, weights, distances);
+      MoveQualityParameter.ActualValue = new DoubleValue(moveQuality);
+      return base.Apply();
+    }
+  }
+}
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/HeuristicLab.Problems.QuadraticAssignment-3.3.csproj
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/HeuristicLab.Problems.QuadraticAssignment-3.3.csproj	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/HeuristicLab.Problems.QuadraticAssignment-3.3.csproj	(revision 6675)
@@ -111,4 +111,5 @@
     <Compile Include="Analyzers\QAPAlleleFrequencyAnalyzer.cs" />
     <Compile Include="Analyzers\QAPPopulationDiversityAnalyzer.cs" />
+    <Compile Include="Evaluators\QAPScrambleMoveEvaluator.cs" />
     <Compile Include="Evaluators\QAPSwap2MoveEvaluator.cs" />
     <Compile Include="Evaluators\QAPEvaluator.cs" />
Index: /branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/Tests/QAPMoveEvaluatorTest.cs
===================================================================
--- /branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/Tests/QAPMoveEvaluatorTest.cs	(revision 6674)
+++ /branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/Tests/QAPMoveEvaluatorTest.cs	(revision 6675)
@@ -226,4 +226,35 @@
     }
 
+    [TestMethod]
+    public void ScrambleMoveEvaluatorTest() {
+      for (int i = 0; i < 500; i++) {
+        ScrambleMove scramble = StochasticScrambleMultiMoveGenerator.GenerateRandomMove(assignment, random);
+
+        // SYMMETRIC MATRICES
+        double before = QAPEvaluator.Apply(assignment, symmetricWeights, symmetricDistances);
+        Permutation clone = new Cloner().Clone(assignment);
+        ScrambleManipulator.Apply(assignment, scramble.StartIndex, scramble.ScrambledIndices);
+        double after = QAPEvaluator.Apply(assignment, symmetricWeights, symmetricDistances);
+        double move = QAPScrambleMoveEvaluator.Apply(clone, scramble, symmetricWeights, symmetricDistances);
+        Assert.IsTrue(move.IsAlmost(after - before), "Failed on symmetric matrices");
+
+        // ASYMMETRIC MATRICES
+        before = QAPEvaluator.Apply(assignment, asymmetricWeights, asymmetricDistances);
+        clone = new Cloner().Clone(assignment);
+        ScrambleManipulator.Apply(assignment, scramble.StartIndex, scramble.ScrambledIndices);
+        after = QAPEvaluator.Apply(assignment, asymmetricWeights, asymmetricDistances);
+        move = QAPScrambleMoveEvaluator.Apply(clone, scramble, asymmetricWeights, asymmetricDistances);
+        Assert.IsTrue(move.IsAlmost(after - before), "Failed on asymmetric matrices");
+
+        // NON-ZERO DIAGONAL ASYMMETRIC MATRICES
+        before = QAPEvaluator.Apply(assignment, nonZeroDiagonalWeights, nonZeroDiagonalDistances);
+        clone = new Cloner().Clone(assignment);
+        ScrambleManipulator.Apply(assignment, scramble.StartIndex, scramble.ScrambledIndices);
+        after = QAPEvaluator.Apply(assignment, nonZeroDiagonalWeights, nonZeroDiagonalDistances);
+        move = QAPScrambleMoveEvaluator.Apply(clone, scramble, nonZeroDiagonalWeights, nonZeroDiagonalDistances);
+        Assert.IsTrue(move.IsAlmost(after - before), "Failed on non-zero diagonal matrices");
+      }
+    }
+
   }
 }
