Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 6612)
@@ -110,4 +110,10 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Regression\RegressionEnsembleSolutionModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Regression\RegressionEnsembleSolutionModelView.Designer.cs">
+      <DependentUpon>RegressionEnsembleSolutionModelView.cs</DependentUpon>
+    </Compile>
     <Compile Include="Solution Views\ClassificationSolutionView.cs">
       <SubType>UserControl</SubType>
@@ -164,5 +170,4 @@
       <DependentUpon>DiscriminantFunctionClassificationSolutionView.cs</DependentUpon>
     </Compile>
-    <Compile Include="Interfaces\IDataAnalysisSolutionEvaluationView.cs" />
     <Compile Include="Interfaces\IDiscriminantFunctionClassificationSolutionEvaluationView.cs" />
     <Compile Include="Interfaces\IClusteringSolutionEvaluationView.cs" />
@@ -182,4 +187,10 @@
     <Compile Include="Interfaces\IRegressionSolutionEvaluationView.cs" />
     <Compile Include="MenuItems\CreateEnsembleMenuItem.cs" />
+    <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: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IClassificationSolutionEvaluationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IClassificationSolutionEvaluationView.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IClassificationSolutionEvaluationView.cs	(revision 6612)
@@ -22,5 +22,5 @@
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
-  public interface IClassificationSolutionEvaluationView : IDataAnalysisSolutionEvaluationView {
+  public interface IClassificationSolutionEvaluationView {
     new IClassificationSolution Content { get; set; }
   }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IClusteringSolutionEvaluationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IClusteringSolutionEvaluationView.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IClusteringSolutionEvaluationView.cs	(revision 6612)
@@ -22,5 +22,5 @@
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
-  public interface IClusteringSolutionEvaluationView : IDataAnalysisSolutionEvaluationView {
+  public interface IClusteringSolutionEvaluationView {
     new IClusteringSolution Content { get; set; }
   }
Index: unk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IDataAnalysisSolutionEvaluationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IDataAnalysisSolutionEvaluationView.cs	(revision 6611)
+++ 	(revision )
@@ -1,27 +1,0 @@
-﻿#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.MainForm;
-namespace HeuristicLab.Problems.DataAnalysis.Views {
-  public interface IDataAnalysisSolutionEvaluationView : IContentView {
-  }
-}
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IDiscriminantFunctionClassificationSolutionEvaluationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IDiscriminantFunctionClassificationSolutionEvaluationView.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IDiscriminantFunctionClassificationSolutionEvaluationView.cs	(revision 6612)
@@ -22,5 +22,5 @@
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
-  public interface IDiscriminantFunctionClassificationSolutionEvaluationView : IDataAnalysisSolutionEvaluationView {
+  public interface IDiscriminantFunctionClassificationSolutionEvaluationView {
     new IDiscriminantFunctionClassificationSolution Content { get; set; }
   }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IRegressionSolutionEvaluationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IRegressionSolutionEvaluationView.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IRegressionSolutionEvaluationView.cs	(revision 6612)
@@ -22,5 +22,5 @@
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
-  public interface IRegressionSolutionEvaluationView : IDataAnalysisSolutionEvaluationView {
+  public interface IRegressionSolutionEvaluationView {
     new IRegressionSolution Content { get; set; }
   }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/CreateEnsembleMenuItem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/CreateEnsembleMenuItem.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/CreateEnsembleMenuItem.cs	(revision 6612)
@@ -75,5 +75,5 @@
             var ensemble = new RegressionEnsembleSolution(Enumerable.Empty<IRegressionModel>(), problemData);
             ensemble.Name = group.Key + " ensemble";
-            ensemble.AddModelsAndPartitions(group.OfType<IRegressionSolution>());
+            ensemble.AddRegressionSolutions(group.OfType<IRegressionSolution>());
             MainFormManager.MainForm.ShowContent(ensemble);
           } else if (group.All(s => s is IClassificationSolution)) {
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.Designer.cs	(revision 6612)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.Designer.cs	(revision 6612)
@@ -0,0 +1,59 @@
+﻿#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 RegressionEnsembleSolutionModelView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.SuspendLayout();
+
+      // 
+      // RegressionSolutionEnsembleModelView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Name = "RegressionEnsembleSolutionModelView";
+      this.ResumeLayout(false);
+    }
+
+    #endregion
+  }
+}
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs	(revision 6612)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs	(revision 6612)
@@ -0,0 +1,65 @@
+﻿#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 {
+  #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;
+  using HeuristicLab.Core;
+  using HeuristicLab.Core.Views;
+  using HeuristicLab.MainForm;
+  using HeuristicLab.MainForm.WindowsForms;
+
+  [View("Ensemble Solutions")]
+  [Content(typeof(IItemCollection<IRegressionSolution>), false)]
+  internal sealed partial class RegressionEnsembleSolutionModelView : ItemCollectionView<IRegressionSolution> {
+    public RegressionEnsembleSolutionModelView() {
+      InitializeComponent();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      addButton.Enabled = Content != null && !Content.IsReadOnly && !Locked;
+      removeButton.Enabled = Content != null && !Content.IsReadOnly && !Locked && itemsListView.SelectedItems.Count > 0;
+      itemsListView.Enabled = Content != null;
+      detailsGroupBox.Enabled = Content != null && itemsListView.SelectedItems.Count == 1;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs	(revision 6612)
@@ -34,5 +34,5 @@
       var classificationSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IClassificationSolutionEvaluationView), true);
       foreach (Type viewType in classificationSolutionEvaluationViewTypes)
-        AddViewListViewItem(viewType);
+        AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs	(revision 6612)
@@ -34,5 +34,5 @@
       var clusteringSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IClusteringSolutionEvaluationView), true);
       foreach (Type viewType in clusteringSolutionEvaluationViewTypes)
-        AddViewListViewItem(viewType);
+        AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs	(revision 6612)
@@ -22,6 +22,7 @@
 using System;
 using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
 using System.Windows.Forms;
-using HeuristicLab.Common.Resources;
 using HeuristicLab.MainForm;
 using HeuristicLab.Optimization.Views;
@@ -46,8 +47,8 @@
 
       //cache old viewTypes;
-      var viewTypes = new List<Type>();
+      var viewTypes = new List<Tuple<Type, Image>>();
       foreach (ListViewItem item in ItemsListView.Items) {
         var viewType = item.Tag as Type;
-        if (viewType != null) viewTypes.Add(viewType);
+        if (viewType != null) viewTypes.Add(Tuple.Create(viewType, imageList.Images[item.ImageIndex]));
       }
 
@@ -55,6 +56,6 @@
 
       //readd viewTypes
-      foreach (Type viewType in viewTypes)
-        AddViewListViewItem(viewType);
+      foreach (var tuple in viewTypes)
+        AddViewListViewItem(tuple.Item1, tuple.Item2);
 
       //recover selection
@@ -85,11 +86,8 @@
     }
 
-    protected void AddViewListViewItem(Type viewType) {
-      if (!typeof(IDataAnalysisSolutionEvaluationView).IsAssignableFrom(viewType))
-        throw new ArgumentException("Given type " + viewType + " is not a IDataAnalysisSolutionEvaluationView.");
-
+    protected void AddViewListViewItem(Type viewType, Image image) {
       ListViewItem listViewItem = new ListViewItem();
       listViewItem.Text = ViewAttribute.GetViewName(viewType);
-      itemsListView.SmallImageList.Images.Add(VSImageLibrary.Graph);
+      itemsListView.SmallImageList.Images.Add(image);
       listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
       listViewItem.Tag = viewType;
@@ -100,8 +98,5 @@
 
     protected void RemoveViewListViewItem(Type viewType) {
-      List<ListViewItem> itemsToRemove = new List<ListViewItem>(); ;
-      foreach (ListViewItem item in itemsListView.Items)
-        if (item.Tag as Type == typeof(IDataAnalysisSolutionEvaluationView))
-          itemsToRemove.Add(item);
+      List<ListViewItem> itemsToRemove = itemsListView.Items.Cast<ListViewItem>().Where(item => item.Tag as Type == viewType).ToList();
 
       foreach (ListViewItem item in itemsToRemove)
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DiscriminantFunctionClassificationSolutionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DiscriminantFunctionClassificationSolutionView.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DiscriminantFunctionClassificationSolutionView.cs	(revision 6612)
@@ -34,10 +34,10 @@
       var classificationSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IClassificationSolutionEvaluationView), true);
       foreach (Type viewType in classificationSolutionEvaluationViewTypes)
-        AddViewListViewItem(viewType);
+        AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
       RemoveViewListViewItem(typeof(ClassificationSolutionEstimatedClassValuesView));
 
       var regressionSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IDiscriminantFunctionClassificationSolutionEvaluationView), true);
       foreach (Type viewType in regressionSolutionEvaluationViewTypes)
-        AddViewListViewItem(viewType);
+        AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.Designer.cs	(revision 6612)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.Designer.cs	(revision 6612)
@@ -0,0 +1,87 @@
+﻿#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 RegressionEnsembleSolutionView {
+    /// <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.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);
+      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);
+
+    }
+
+    #endregion
+  }
+}
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs	(revision 6612)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs	(revision 6612)
@@ -0,0 +1,63 @@
+﻿#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.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("RegressionEnsembleSolution View")]
+  [Content(typeof(RegressionEnsembleSolution), true)]
+  public partial class RegressionEnsembleSolutionView : RegressionSolutionView {
+    public RegressionEnsembleSolutionView() {
+      InitializeComponent();
+      AddViewListViewItem(typeof(RegressionEnsembleSolutionModelView), HeuristicLab.Common.Resources.VSImageLibrary.Function);
+    }
+
+    public new RegressionEnsembleSolution Content {
+      get { return (RegressionEnsembleSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    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);
+    }
+
+    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);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs	(revision 6612)
@@ -34,5 +34,5 @@
       var regressionSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IRegressionSolutionEvaluationView), true);
       foreach (Type viewType in regressionSolutionEvaluationViewTypes)
-        AddViewListViewItem(viewType);
+        AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
     }
 
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs	(revision 6612)
@@ -74,4 +74,7 @@
       models.Add(model);
     }
+    public void Remove(IRegressionModel model) {
+      models.Remove(model);
+    }
 
     public IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(Dataset dataset, IEnumerable<int> rows) {
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs	(revision 6612)
@@ -23,4 +23,5 @@
 using System.Collections.Generic;
 using System.Linq;
+using HeuristicLab.Collections;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -40,4 +41,9 @@
     }
 
+    private readonly ItemCollection<IRegressionSolution> regressionSolutions;
+    public IItemCollection<IRegressionSolution> RegressionSolutions {
+      get { return regressionSolutions; }
+    }
+
     [Storable]
     private Dictionary<IRegressionModel, IntRange> trainingPartitions;
@@ -46,5 +52,22 @@
 
     [StorableConstructor]
-    private RegressionEnsembleSolution(bool deserializing) : base(deserializing) { }
+    private RegressionEnsembleSolution(bool deserializing)
+      : base(deserializing) {
+      regressionSolutions = new ItemCollection<IRegressionSolution>();
+    }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      foreach (var model in Model.Models) {
+        IRegressionProblemData problemData = (IRegressionProblemData)ProblemData.Clone();
+        problemData.TrainingPartition.Start = trainingPartitions[model].Start;
+        problemData.TrainingPartition.End = trainingPartitions[model].End;
+        problemData.TestPartition.Start = testPartitions[model].Start;
+        problemData.TestPartition.End = testPartitions[model].End;
+
+        regressionSolutions.Add(model.CreateRegressionSolution(problemData));
+      }
+      RegisterRegressionSolutionsEventHandler();
+    }
+
     private RegressionEnsembleSolution(RegressionEnsembleSolution original, Cloner cloner)
       : base(original, cloner) {
@@ -57,23 +80,41 @@
         testPartitions[cloner.Clone(pair.Key)] = cloner.Clone(pair.Value);
       }
-      RecalculateResults();
+
+      regressionSolutions = cloner.Clone(original.regressionSolutions);
+      RegisterRegressionSolutionsEventHandler();
     }
 
     public RegressionEnsembleSolution(IEnumerable<IRegressionModel> models, IRegressionProblemData problemData)
-      : base(new RegressionEnsembleModel(models), new RegressionEnsembleProblemData(problemData)) {
-      trainingPartitions = new Dictionary<IRegressionModel, IntRange>();
-      testPartitions = new Dictionary<IRegressionModel, IntRange>();
-      AddModelsAndPartitions(models,
-        from m in models select (IntRange)problemData.TrainingPartition.Clone(),
-        from m in models select (IntRange)problemData.TestPartition.Clone());
-      RecalculateResults();
-    }
+      : this(models, problemData,
+             models.Select(m => (IntRange)problemData.TrainingPartition.Clone()),
+             models.Select(m => (IntRange)problemData.TestPartition.Clone())
+      ) { }
 
     public RegressionEnsembleSolution(IEnumerable<IRegressionModel> models, IRegressionProblemData problemData, IEnumerable<IntRange> trainingPartitions, IEnumerable<IntRange> testPartitions)
-      : base(new RegressionEnsembleModel(models), new RegressionEnsembleProblemData(problemData)) {
+      : base(new RegressionEnsembleModel(Enumerable.Empty<IRegressionModel>()), new RegressionEnsembleProblemData(problemData)) {
       this.trainingPartitions = new Dictionary<IRegressionModel, IntRange>();
       this.testPartitions = new Dictionary<IRegressionModel, IntRange>();
-      AddModelsAndPartitions(models, trainingPartitions, testPartitions);
-      RecalculateResults();
+      this.regressionSolutions = new ItemCollection<IRegressionSolution>();
+
+      List<IRegressionSolution> solutions = new List<IRegressionSolution>();
+      var modelEnumerator = models.GetEnumerator();
+      var trainingPartitionEnumerator = trainingPartitions.GetEnumerator();
+      var testPartitionEnumerator = testPartitions.GetEnumerator();
+
+      while (modelEnumerator.MoveNext() & trainingPartitionEnumerator.MoveNext() & testPartitionEnumerator.MoveNext()) {
+        var p = (IRegressionProblemData)problemData.Clone();
+        p.TrainingPartition.Start = trainingPartitionEnumerator.Current.Start;
+        p.TrainingPartition.End = trainingPartitionEnumerator.Current.End;
+        p.TestPartition.Start = testPartitionEnumerator.Current.Start;
+        p.TestPartition.End = testPartitionEnumerator.Current.End;
+
+        solutions.Add(modelEnumerator.Current.CreateRegressionSolution(p));
+      }
+      if (modelEnumerator.MoveNext() | trainingPartitionEnumerator.MoveNext() | testPartitionEnumerator.MoveNext()) {
+        throw new ArgumentException();
+      }
+
+      RegisterRegressionSolutionsEventHandler();
+      regressionSolutions.AddRange(solutions);
     }
 
@@ -81,4 +122,9 @@
       return new RegressionEnsembleSolution(this, cloner);
     }
+    private void RegisterRegressionSolutionsEventHandler() {
+      regressionSolutions.ItemsAdded += new CollectionItemsChangedEventHandler<IRegressionSolution>(regressionSolutions_ItemsAdded);
+      regressionSolutions.ItemsRemoved += new CollectionItemsChangedEventHandler<IRegressionSolution>(regressionSolutions_ItemsRemoved);
+      regressionSolutions.CollectionReset += new CollectionItemsChangedEventHandler<IRegressionSolution>(regressionSolutions_CollectionReset);
+    }
 
     protected override void RecalculateResults() {
@@ -86,4 +132,5 @@
     }
 
+    #region Evaluation
     public override IEnumerable<double> EstimatedTrainingValues {
       get {
@@ -154,42 +201,39 @@
       return estimatedValues.DefaultIfEmpty(double.NaN).Average();
     }
-
-
-    public void AddModelsAndPartitions(IEnumerable<IRegressionSolution> solutions) {
-      foreach (var solution in solutions) {
-        var ensembleSolution = solution as RegressionEnsembleSolution;
-        if (ensembleSolution != null) {
-          var data = from m in ensembleSolution.Model.Models
-                     let train = ensembleSolution.trainingPartitions[m]
-                     let test = ensembleSolution.testPartitions[m]
-                     select new { m, train, test };
-
-          foreach (var d in data) {
-            Model.Add(d.m);
-            trainingPartitions[d.m] = (IntRange)d.train.Clone();
-            testPartitions[d.m] = (IntRange)d.test.Clone();
-          }
-        } else {
-          Model.Add(solution.Model);
-          trainingPartitions[solution.Model] = (IntRange)solution.ProblemData.TrainingPartition.Clone();
-          testPartitions[solution.Model] = (IntRange)solution.ProblemData.TestPartition.Clone();
-        }
-      }
-
+    #endregion
+
+    public void AddRegressionSolutions(IEnumerable<IRegressionSolution> solutions) {
+      regressionSolutions.AddRange(solutions);
+    }
+    public void RemoveRegressionSolutions(IEnumerable<IRegressionSolution> solutions) {
+      regressionSolutions.RemoveRange(solutions);
+    }
+
+    private void regressionSolutions_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRegressionSolution> e) {
+      foreach (var solution in e.Items) AddRegressionSolution(solution);
       RecalculateResults();
     }
-
-    private void AddModelsAndPartitions(IEnumerable<IRegressionModel> models, IEnumerable<IntRange> trainingPartitions, IEnumerable<IntRange> testPartitions) {
-      var modelEnumerator = models.GetEnumerator();
-      var trainingPartitionEnumerator = trainingPartitions.GetEnumerator();
-      var testPartitionEnumerator = testPartitions.GetEnumerator();
-
-      while (modelEnumerator.MoveNext() & trainingPartitionEnumerator.MoveNext() & testPartitionEnumerator.MoveNext()) {
-        this.trainingPartitions[modelEnumerator.Current] = (IntRange)trainingPartitionEnumerator.Current.Clone();
-        this.testPartitions[modelEnumerator.Current] = (IntRange)testPartitionEnumerator.Current.Clone();
-      }
-      if (modelEnumerator.MoveNext() | trainingPartitionEnumerator.MoveNext() | testPartitionEnumerator.MoveNext()) {
-        throw new ArgumentException();
-      }
+    private void regressionSolutions_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRegressionSolution> e) {
+      foreach (var solution in e.Items) RemoveRegressionSolution(solution);
+      RecalculateResults();
+    }
+    private void regressionSolutions_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRegressionSolution> e) {
+      foreach (var solution in e.OldItems) RemoveRegressionSolution(solution);
+      foreach (var solution in e.Items) AddRegressionSolution(solution);
+      RecalculateResults();
+    }
+
+    private void AddRegressionSolution(IRegressionSolution solution) {
+      if (Model.Models.Contains(solution.Model)) throw new ArgumentException();
+      Model.Add(solution.Model);
+      trainingPartitions[solution.Model] = solution.ProblemData.TrainingPartition;
+      testPartitions[solution.Model] = solution.ProblemData.TestPartition;
+    }
+
+    private void RemoveRegressionSolution(IRegressionSolution solution) {
+      if (!Model.Models.Contains(solution.Model)) throw new ArgumentException();
+      Model.Remove(solution.Model);
+      trainingPartitions.Remove(solution.Model);
+      testPartitions.Remove(solution.Model);
     }
   }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleModel.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleModel.cs	(revision 6612)
@@ -24,4 +24,5 @@
   public interface IRegressionEnsembleModel : IRegressionModel {
     void Add(IRegressionModel model);
+    void Remove(IRegressionModel model);
     IEnumerable<IRegressionModel> Models { get; }
     IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(Dataset dataset, IEnumerable<int> rows);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs	(revision 6611)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs	(revision 6612)
@@ -21,7 +21,9 @@
 
 using System.Collections.Generic;
+using HeuristicLab.Core;
 namespace HeuristicLab.Problems.DataAnalysis {
   public interface IRegressionEnsembleSolution : IRegressionSolution {
     new IRegressionEnsembleModel Model { get; }
+    IItemCollection<IRegressionSolution> RegressionSolutions { get; }
     IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(Dataset dataset, IEnumerable<int> rows);
   }
