Index: branches/PerformanceComparison/HeuristicLab.Analysis/3.3/Optimizers/IteratedAlgorithm.cs
===================================================================
--- branches/PerformanceComparison/HeuristicLab.Analysis/3.3/Optimizers/IteratedAlgorithm.cs	(revision 14035)
+++ branches/PerformanceComparison/HeuristicLab.Analysis/3.3/Optimizers/IteratedAlgorithm.cs	(revision 14058)
@@ -475,6 +475,6 @@
         }
       }
-      if (Algorithm.Results.TryGetValue(perClockAnalyzer.QualityPerClockParameter.ResultName, out result)) UpdateQualityPerClockResult((IndexedDataTable<double>)result.Value, restarts.Value);
-      if (Algorithm.Results.TryGetValue(perEvaluationsAnalyzer.QualityPerEvaluationsParameter.ResultName, out result)) UpdateQualityPerEvaluationsResult((IndexedDataTable<double>)result.Value, restarts.Value);
+      if (Algorithm.Results.TryGetValue(perClockAnalyzer.QualityPerClockParameter.ActualName, out result)) UpdateQualityPerClockResult((IndexedDataTable<double>)result.Value, restarts.Value);
+      if (Algorithm.Results.TryGetValue(perEvaluationsAnalyzer.QualityPerEvaluationsParameter.ActualName, out result)) UpdateQualityPerEvaluationsResult((IndexedDataTable<double>)result.Value, restarts.Value);
       if (StoreSolutionInRun) {
         foreach (var r in Algorithm.Results) {
Index: branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerClockAnalyzer.cs
===================================================================
--- branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerClockAnalyzer.cs	(revision 14035)
+++ branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerClockAnalyzer.cs	(revision 14058)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -76,5 +76,5 @@
     public override IOperation Apply() {
       var bestQuality = BestQualityParameter.ActualValue.Value;
-      var dataTable = QualityPerClockParameter.ResultValue;
+      var dataTable = QualityPerClockParameter.ActualValue;
       var values = dataTable.Rows["First-hit Graph"].Values;
 
Index: branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerEvaluationsAnalyzer.cs
===================================================================
--- branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerEvaluationsAnalyzer.cs	(revision 14035)
+++ branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerEvaluationsAnalyzer.cs	(revision 14058)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -88,5 +88,5 @@
       if (evalMoves != null) evaluations += evalMoves.Value * MoveCostPerSolutionParameter.ActualValue.Value;
 
-      var dataTable = QualityPerEvaluationsParameter.ResultValue;
+      var dataTable = QualityPerEvaluationsParameter.ActualValue;
       var values = dataTable.Rows["First-hit Graph"].Values;
       if (evaluations == 0 || values.Count > 0 && evaluations < values.Last().Item1) evaluations = 1;
Index: branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ResultParameterView.Designer.cs
===================================================================
--- branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ResultParameterView.Designer.cs	(revision 14035)
+++ branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ResultParameterView.Designer.cs	(revision 14058)
@@ -1,5 +1,5 @@
 #region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -26,16 +26,5 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
-
+    
     #region Component Designer generated code
 
@@ -45,19 +34,23 @@
     /// </summary>
     private void InitializeComponent() {
-      this.resultNameTextBox = new System.Windows.Forms.TextBox();
-      this.resultNameLabel = new System.Windows.Forms.Label();
+      this.resultCollectionNameTextBox = new System.Windows.Forms.TextBox();
+      this.resultCollectionNameLabel = new System.Windows.Forms.Label();
+      this.defaultValueGroupBox = new System.Windows.Forms.GroupBox();
+      this.removeDefaultValueButton = new System.Windows.Forms.Button();
+      this.setDefaultValueButton = new System.Windows.Forms.Button();
+      this.defaultValueViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.defaultValueGroupBox.SuspendLayout();
       this.SuspendLayout();
       // 
-      // dataTypeLabel
+      // actualNameTextBox
       // 
-      this.dataTypeLabel.Location = new System.Drawing.Point(3, 55);
-      this.dataTypeLabel.TabIndex = 5;
+      this.actualNameTextBox.Location = new System.Drawing.Point(98, 26);
+      this.actualNameTextBox.Size = new System.Drawing.Size(288, 20);
       // 
       // dataTypeTextBox
       // 
-      this.dataTypeTextBox.Location = new System.Drawing.Point(80, 52);
-      this.dataTypeTextBox.Size = new System.Drawing.Size(306, 20);
-      this.dataTypeTextBox.TabIndex = 6;
+      this.dataTypeTextBox.Location = new System.Drawing.Point(98, 52);
+      this.dataTypeTextBox.Size = new System.Drawing.Size(288, 20);
       // 
       // nameTextBox
@@ -65,57 +58,89 @@
       this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
       this.errorProvider.SetIconPadding(this.nameTextBox, 2);
-      this.nameTextBox.Location = new System.Drawing.Point(80, 0);
-      this.nameTextBox.Size = new System.Drawing.Size(281, 20);
+      this.nameTextBox.Location = new System.Drawing.Point(98, 0);
+      this.nameTextBox.Size = new System.Drawing.Size(263, 20);
       // 
-      // infoLabel
+      // resultCollectionNameTextBox
       // 
-      this.infoLabel.Location = new System.Drawing.Point(367, 3);
+      this.resultCollectionNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.resultCollectionNameTextBox.Location = new System.Drawing.Point(98, 78);
+      this.resultCollectionNameTextBox.Name = "resultCollectionNameTextBox";
+      this.resultCollectionNameTextBox.Size = new System.Drawing.Size(288, 20);
+      this.resultCollectionNameTextBox.TabIndex = 6;
+      this.resultCollectionNameTextBox.Validated += new System.EventHandler(this.resultNameTextBox_Validated);
       // 
-      // actualNameTextBox
+      // resultCollectionNameLabel
       // 
-      this.actualNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.actualNameTextBox.Location = new System.Drawing.Point(80, 26);
-      this.actualNameTextBox.Name = "actualNameTextBox";
-      this.actualNameTextBox.Size = new System.Drawing.Size(306, 20);
-      this.actualNameTextBox.TabIndex = 4;
-      this.actualNameTextBox.Validated += new System.EventHandler(this.actualNameTextBox_Validated);
+      this.resultCollectionNameLabel.AutoSize = true;
+      this.resultCollectionNameLabel.Location = new System.Drawing.Point(3, 81);
+      this.resultCollectionNameLabel.Name = "resultCollectionNameLabel";
+      this.resultCollectionNameLabel.Size = new System.Drawing.Size(89, 13);
+      this.resultCollectionNameLabel.TabIndex = 5;
+      this.resultCollectionNameLabel.Text = "&Result Collection:";
       // 
-      // actualNameLabel
+      // defaultValueGroupBox
       // 
-      this.actualNameLabel.AutoSize = true;
-      this.actualNameLabel.Location = new System.Drawing.Point(3, 29);
-      this.actualNameLabel.Name = "actualNameLabel";
-      this.actualNameLabel.Size = new System.Drawing.Size(71, 13);
-      this.actualNameLabel.TabIndex = 3;
-      this.actualNameLabel.Text = "&Actual Name:";
+      this.defaultValueGroupBox.AllowDrop = true;
+      this.defaultValueGroupBox.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.defaultValueGroupBox.Controls.Add(this.removeDefaultValueButton);
+      this.defaultValueGroupBox.Controls.Add(this.setDefaultValueButton);
+      this.defaultValueGroupBox.Controls.Add(this.defaultValueViewHost);
+      this.defaultValueGroupBox.Location = new System.Drawing.Point(0, 104);
+      this.defaultValueGroupBox.Name = "defaultValueGroupBox";
+      this.defaultValueGroupBox.Size = new System.Drawing.Size(386, 222);
+      this.defaultValueGroupBox.TabIndex = 7;
+      this.defaultValueGroupBox.TabStop = false;
+      this.defaultValueGroupBox.Text = "Default Value";
+      this.defaultValueGroupBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.defaultValueGroupBox_DragDrop);
+      this.defaultValueGroupBox.DragEnter += new System.Windows.Forms.DragEventHandler(this.defaultValueGroupBox_DragEnterOver);
+      this.defaultValueGroupBox.DragOver += new System.Windows.Forms.DragEventHandler(this.defaultValueGroupBox_DragEnterOver);
       // 
-      // resultNameTextBox
+      // removeDefaultValueButton
       // 
-      this.resultNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.resultNameTextBox.Location = new System.Drawing.Point(80, 78);
-      this.resultNameTextBox.Name = "resultNameTextBox";
-      this.resultNameTextBox.Size = new System.Drawing.Size(306, 20);
-      this.resultNameTextBox.TabIndex = 6;
-      this.resultNameTextBox.Validated += new System.EventHandler(this.resultNameTextBox_Validated);
+      this.removeDefaultValueButton.Location = new System.Drawing.Point(38, 19);
+      this.removeDefaultValueButton.Name = "removeDefaultValueButton";
+      this.removeDefaultValueButton.Size = new System.Drawing.Size(26, 23);
+      this.removeDefaultValueButton.TabIndex = 1;
+      this.removeDefaultValueButton.Text = "Remove";
+      this.removeDefaultValueButton.UseVisualStyleBackColor = true;
+      this.removeDefaultValueButton.Click += new System.EventHandler(this.removeDefaultValueButton_Click);
       // 
-      // resultNameLabel
+      // setDefaultValueButton
       // 
-      this.resultNameLabel.AutoSize = true;
-      this.resultNameLabel.Location = new System.Drawing.Point(3, 81);
-      this.resultNameLabel.Name = "resultNameLabel";
-      this.resultNameLabel.Size = new System.Drawing.Size(71, 13);
-      this.resultNameLabel.TabIndex = 5;
-      this.resultNameLabel.Text = "&Result Name:";
+      this.setDefaultValueButton.Location = new System.Drawing.Point(6, 19);
+      this.setDefaultValueButton.Name = "setDefaultValueButton";
+      this.setDefaultValueButton.Size = new System.Drawing.Size(26, 23);
+      this.setDefaultValueButton.TabIndex = 1;
+      this.setDefaultValueButton.Text = "Set";
+      this.setDefaultValueButton.UseVisualStyleBackColor = true;
+      this.setDefaultValueButton.Click += new System.EventHandler(this.setDefaultValueButton_Click);
       // 
-      // LookupParameterView
+      // defaultValueViewHost
       // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.defaultValueViewHost.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.defaultValueViewHost.Caption = "View";
+      this.defaultValueViewHost.Content = null;
+      this.defaultValueViewHost.Enabled = false;
+      this.defaultValueViewHost.Location = new System.Drawing.Point(6, 48);
+      this.defaultValueViewHost.Name = "defaultValueViewHost";
+      this.defaultValueViewHost.ReadOnly = false;
+      this.defaultValueViewHost.Size = new System.Drawing.Size(374, 168);
+      this.defaultValueViewHost.TabIndex = 0;
+      this.defaultValueViewHost.ViewsLabelVisible = true;
+      this.defaultValueViewHost.ViewType = null;
+      // 
+      // ResultParameterView
+      // 
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
-      this.Controls.Add(this.resultNameTextBox);
-      this.Controls.Add(this.resultNameLabel);
+      this.Controls.Add(this.defaultValueGroupBox);
+      this.Controls.Add(this.resultCollectionNameTextBox);
+      this.Controls.Add(this.resultCollectionNameLabel);
       this.Name = "ResultParameterView";
-      this.Size = new System.Drawing.Size(386, 76);
+      this.Size = new System.Drawing.Size(386, 326);
       this.Controls.SetChildIndex(this.dataTypeLabel, 0);
       this.Controls.SetChildIndex(this.dataTypeTextBox, 0);
@@ -125,7 +150,9 @@
       this.Controls.SetChildIndex(this.actualNameTextBox, 0);
       this.Controls.SetChildIndex(this.nameLabel, 0);
-      this.Controls.SetChildIndex(this.resultNameLabel, 0);
-      this.Controls.SetChildIndex(this.resultNameTextBox, 0);
+      this.Controls.SetChildIndex(this.resultCollectionNameLabel, 0);
+      this.Controls.SetChildIndex(this.resultCollectionNameTextBox, 0);
+      this.Controls.SetChildIndex(this.defaultValueGroupBox, 0);
       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.defaultValueGroupBox.ResumeLayout(false);
       this.ResumeLayout(false);
       this.PerformLayout();
@@ -135,6 +162,10 @@
     #endregion
 
-    protected System.Windows.Forms.TextBox resultNameTextBox;
-    protected System.Windows.Forms.Label resultNameLabel;
+    protected System.Windows.Forms.TextBox resultCollectionNameTextBox;
+    protected System.Windows.Forms.Label resultCollectionNameLabel;
+    private System.Windows.Forms.GroupBox defaultValueGroupBox;
+    private MainForm.WindowsForms.ViewHost defaultValueViewHost;
+    private System.Windows.Forms.Button removeDefaultValueButton;
+    private System.Windows.Forms.Button setDefaultValueButton;
   }
 }
Index: branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ResultParameterView.cs
===================================================================
--- branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ResultParameterView.cs	(revision 14035)
+++ branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ResultParameterView.cs	(revision 14058)
@@ -1,5 +1,5 @@
 #region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -21,7 +21,11 @@
 
 using System;
+using System.Windows.Forms;
+using HeuristicLab.Common.Resources;
 using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
 using HeuristicLab.Parameters.Views;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Optimization.Views {
@@ -29,5 +33,6 @@
   [Content(typeof(ResultParameter<>), true)]
   [Content(typeof(IResultParameter<>), false)]
-  public partial class ResultParameterView<T> : LookupParameterView<ResultCollection> where T : class, IItem, new() {
+  public partial class ResultParameterView<T> : LookupParameterView<T> where T : class, IItem {
+    protected TypeSelectorDialog typeSelectorDialog;
 
     public new IResultParameter<T> Content {
@@ -38,8 +43,25 @@
     public ResultParameterView() {
       InitializeComponent();
+      setDefaultValueButton.Text = string.Empty;
+      setDefaultValueButton.Image = VSImageLibrary.Edit;
+      removeDefaultValueButton.Text = string.Empty;
+      removeDefaultValueButton.Image = VSImageLibrary.Remove;
+    }
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
     protected override void DeregisterContentEvents() {
-      Content.ResultNameChanged -= new EventHandler(Content_ResultNameChanged);
+      Content.ResultCollectionNameChanged -= ContentOnResultCollectionNameChanged;
+      Content.DefaultValueChanged -= ContentOnDefaultValueChanged;
       base.DeregisterContentEvents();
     }
@@ -47,30 +69,75 @@
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
-      Content.ResultNameChanged += new EventHandler(Content_ResultNameChanged);
+      Content.ResultCollectionNameChanged += ContentOnResultCollectionNameChanged;
+      Content.DefaultValueChanged += ContentOnDefaultValueChanged;
     }
 
     protected override void OnContentChanged() {
       base.OnContentChanged();
-      if (Content == null)
-        resultNameTextBox.Text = "-";
-      else
-        resultNameTextBox.Text = Content.ResultName;
+      if (Content == null) {
+        resultCollectionNameTextBox.Text = "-";
+        defaultValueViewHost.Content = null;
+      } else {
+        resultCollectionNameTextBox.Text = Content.ResultCollectionName;
+        defaultValueViewHost.Content = Content.DefaultValue;
+      }
     }
 
     protected override void SetEnabledStateOfControls() {
       base.SetEnabledStateOfControls();
-      resultNameTextBox.Enabled = Content != null;
-      resultNameTextBox.ReadOnly = ReadOnly;
+      resultCollectionNameTextBox.Enabled = Content != null;
+      resultCollectionNameTextBox.ReadOnly = ReadOnly;
     }
 
-    private void Content_ResultNameChanged(object sender, EventArgs e) {
-      if (InvokeRequired)
-        Invoke(new EventHandler(Content_ResultNameChanged), sender, e);
-      else
-        resultNameTextBox.Text = Content.ResultName;
+    private void ContentOnDefaultValueChanged(object sender, EventArgs e) {
+      if (InvokeRequired) Invoke((Action<object, EventArgs>)ContentOnDefaultValueChanged, sender, e);
+      else defaultValueViewHost.Content = Content.DefaultValue;
+    }
+
+    private void ContentOnResultCollectionNameChanged(object sender, EventArgs e) {
+      if (InvokeRequired) Invoke((Action<object, EventArgs>)ContentOnResultCollectionNameChanged, sender, e);
+      else resultCollectionNameTextBox.Text = Content.ResultCollectionName;
     }
 
     private void resultNameTextBox_Validated(object sender, EventArgs e) {
-      Content.ResultName = resultNameTextBox.Text;
+      if (InvokeRequired) Invoke((Action<object, EventArgs>)resultNameTextBox_Validated, sender, e);
+      else Content.ResultCollectionName = resultCollectionNameTextBox.Text;
+    }
+
+    private void setDefaultValueButton_Click(object sender, EventArgs e) {
+      if (typeSelectorDialog == null) {
+        typeSelectorDialog = new TypeSelectorDialog();
+        typeSelectorDialog.Caption = "Select Value";
+        typeSelectorDialog.TypeSelector.Configure(Content.DataType, false, true);
+      }
+      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
+        try {
+          Content.DefaultValue = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
+        } catch (Exception ex) {
+          ErrorHandling.ShowErrorDialog(this, ex);
+        }
+      }
+    }
+
+    private void removeDefaultValueButton_Click(object sender, EventArgs e) {
+      Content.DefaultValue = null;
+    }
+
+    protected virtual void defaultValueGroupBox_DragEnterOver(object sender, DragEventArgs e) {
+      e.Effect = DragDropEffects.None;
+      if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) != null) && Content.DataType.IsAssignableFrom(e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat).GetType())) {
+        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
+        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
+        else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
+        else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move;
+        else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link;
+      }
+    }
+    protected virtual void defaultValueGroupBox_DragDrop(object sender, DragEventArgs e) {
+      if (e.Effect != DragDropEffects.None) {
+        T value = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as T;
+        if (e.Effect.HasFlag(DragDropEffects.Copy)) value = (T)value.Clone();
+        Content.DefaultValue = value;
+      }
     }
   }
Index: branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Results/IResultParameter.cs
===================================================================
--- branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Results/IResultParameter.cs	(revision 14035)
+++ branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Results/IResultParameter.cs	(revision 14058)
@@ -1,5 +1,5 @@
 #region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -25,11 +25,11 @@
 namespace HeuristicLab.Optimization {
   public interface IResultParameter : ILookupParameter {
-    string ResultName { get; set; }
-    event EventHandler ResultNameChanged;
+    string ResultCollectionName { get; set; }
+    event EventHandler ResultCollectionNameChanged;
   }
 
-  public interface IResultParameter<T> : ILookupParameter<ResultCollection>, IResultParameter where T : class, IItem, new() {
+  public interface IResultParameter<T> : ILookupParameter<T>, IResultParameter where T : class, IItem {
     T DefaultValue { get; set; }
-    T ResultValue { get; set; }
+    event EventHandler DefaultValueChanged;
   }
 }
Index: branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Results/ResultParameter.cs
===================================================================
--- branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Results/ResultParameter.cs	(revision 14035)
+++ branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Results/ResultParameter.cs	(revision 14058)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -21,5 +21,7 @@
 
 using System;
+using System.Drawing;
 using HeuristicLab.Common;
+using HeuristicLab.Common.Resources;
 using HeuristicLab.Core;
 using HeuristicLab.Parameters;
@@ -31,18 +33,17 @@
   [StorableClass]
   [NonDiscoverableType]
-  public sealed class ResultParameter<T> : LookupParameter<ResultCollection>, IResultParameter<T> where T : class, IItem, new() {
+  public sealed class ResultParameter<T> : LookupParameter<T>, IResultParameter<T> where T : class, IItem {
+    public override Image ItemImage { get { return VSImageLibrary.Exception; } }
 
     [Storable]
-    private string resultName;
-    public string ResultName {
-      get { return resultName; }
+    private string resultCollectionName;
+    public string ResultCollectionName {
+      get { return resultCollectionName; }
       set {
         if (value == null) throw new ArgumentNullException();
-        if (string.IsNullOrWhiteSpace(value)) {
-          resultName = Name;
-          OnResultNameChanged();
-        } else if (!resultName.Equals(value)) {
-          resultName = value;
-          OnResultNameChanged();
+        if (string.IsNullOrWhiteSpace(value)) throw new ArgumentNullException();
+        else if (!resultCollectionName.Equals(value)) {
+          resultCollectionName = value;
+          OnResultCollectionNameChanged();
         }
       }
@@ -61,14 +62,9 @@
     }
 
-    public T ResultValue {
-      get { return GetResultValue(); }
-      set { SetResultValue(value); }
-    }
-
     [StorableConstructor]
     private ResultParameter(bool deserializing) : base(deserializing) { }
     private ResultParameter(ResultParameter<T> original, Cloner cloner)
       : base(original, cloner) {
-      resultName = original.resultName;
+      resultCollectionName = original.resultCollectionName;
       defaultValue = cloner.Clone(original.defaultValue);
     }
@@ -76,56 +72,70 @@
       return new ResultParameter<T>(this, cloner);
     }
-    public ResultParameter() : this("Anonymous") { }
-    public ResultParameter(string name)
-      : base(name, string.Empty, "Results") {
-      resultName = Name;
-      defaultValue = new T();
-    }
-    public ResultParameter(string name, string description) : this(name, description, new T()) { }
-    public ResultParameter(string name, string description, T defaultValue)
-      : base(name, description, "Results") {
+    public ResultParameter() : this("Anonymous", string.Empty, "Results") { }
+    public ResultParameter(string name) : this(name, string.Empty, "Results") { }
+    public ResultParameter(string name, string description) : this(name, description, "Results") { }
+    public ResultParameter(string name, string description, string resultCollectionName)
+      : base(name, description, string.Empty) {
+      if (string.IsNullOrEmpty(resultCollectionName)) throw new ArgumentException("resultCollectionName");
+      this.resultCollectionName = resultCollectionName;
+    } 
+    public ResultParameter(string name, string description, string resultCollectionName, T defaultValue)
+      : base(name, description, string.Empty) {
+      if (string.IsNullOrEmpty(resultCollectionName)) throw new ArgumentException("resultCollectionName");
       if (defaultValue == null) throw new ArgumentNullException("defaultValue");
-      resultName = Name;
+      this.resultCollectionName = resultCollectionName;
       this.defaultValue = defaultValue;
     }
-    public ResultParameter(string name, string description, string resultName) : this(name, description, new T(), resultName) { }
-    public ResultParameter(string name, string description, T defaultValue, string resultName)
-      : base(name, description, "Results") {
-      if (defaultValue == null) throw new ArgumentNullException("defaultValue");
-      this.resultName = string.IsNullOrWhiteSpace(resultName) ? Name : resultName;
-      this.defaultValue = defaultValue;
-    }
+    
+    protected override IItem GetActualValue() {
+      ResultCollection results;
+      if (CachedActualValue != null) {
+        results = CachedActualValue as ResultCollection;
+        if (results == null) throw new InvalidOperationException("ResultParameter (" + ActualName + "): ResultCollection not found.");
+      } else {
+        var tmp = ResultCollectionName;
+        // verifyType has to be disabled, because the ResultCollection may not be identical to the generic type of the parameter
+        results = GetValue(ExecutionContext, ref tmp) as ResultCollection;
+        if (results == null) throw new InvalidOperationException("ResultParameter (" + ActualName + "): ResultCollection with name " + tmp + " not found.");
+        CachedActualValue = results;
+      }
 
-    public override string ToString() {
-      if (Name.Equals(ResultName)) return Name;
-      return Name + ": " + ResultName;
-    }
+      IResult result;
+      if (!results.TryGetValue(ActualName, out result)) {
+        if (DefaultValue == null) throw new InvalidOperationException("ResultParameter (" + ActualName + "): Result not found and no default value specified.");
+        result = new Result(ActualName, (T)DefaultValue.Clone()); 
+        results.Add(result);
+      }
 
-    private T GetResultValue() {
-      var results = ActualValue;
-      if (results == null)
-        throw new InvalidOperationException("ResultParameter (" + ResultName + "): ResultCollection " + ActualName + " not found.");
-
-      if (!results.ContainsKey(ResultName)) results.Add(new Result(ResultName, (T)DefaultValue.Clone()));
-      var resultValue = results[ResultName].Value as T;
+      var resultValue = result.Value as T;
       if (resultValue == null)
-        throw new InvalidOperationException(string.Format("Type mismatch. Result \"{0}\" does not contain a \"{1}\".", ResultName, typeof(T).GetPrettyName()));
+        throw new InvalidOperationException(string.Format("Type mismatch. Result \"{0}\" does not contain a \"{1}\".", ActualName, typeof(T).GetPrettyName()));
 
       return resultValue;
     }
 
-    private void SetResultValue(T value) {
-      var results = ActualValue;
-      if (results == null)
-        throw new InvalidOperationException("ResultParameter (" + ResultName + "): ResultCollection " + ActualName + " not found.");
+    protected override void SetActualValue(IItem value) {
+      ResultCollection results;
+      if (CachedActualValue != null) {
+        results = CachedActualValue as ResultCollection;
+        if (results == null) throw new InvalidOperationException("ResultParameter (" + ActualName + "): ResultCollection not found.");
+      } else {
+        var tmp = ResultCollectionName;
+        results = GetValue(ExecutionContext, ref tmp) as ResultCollection;
+        if (results == null) throw new InvalidOperationException("ResultParameter (" + ActualName + "): ResultCollection with name " + tmp + " not found.");
+        CachedActualValue = results;
+      }
 
-      if (!results.ContainsKey(ResultName))
-        results.Add(new Result(ResultName, value));
-      else results[ResultName].Value = value;
+      IResult result;
+      if (!results.TryGetValue(ActualName, out result)) {
+        result = new Result(ActualName, value);
+        results.Add(result);
+      } else result.Value = value;
     }
 
-    public event EventHandler ResultNameChanged;
-    private void OnResultNameChanged() {
-      var handler = ResultNameChanged;
+
+    public event EventHandler ResultCollectionNameChanged;
+    private void OnResultCollectionNameChanged() {
+      var handler = ResultCollectionNameChanged;
       if (handler != null) handler(this, EventArgs.Empty);
       OnToStringChanged();
