Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj	(revision 3613)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj	(revision 3614)
@@ -100,4 +100,28 @@
       <DependentUpon>BatchRunView.cs</DependentUpon>
     </Compile>
+    <Compile Include="RunCollectioComparisonConstraintView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectioComparisonConstraintView.Designer.cs">
+      <DependentUpon>RunCollectioComparisonConstraintView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="RunCollectionTypeCompatibilityConstraintView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectionTypeCompatibilityConstraintView.Designer.cs">
+      <DependentUpon>RunCollectionTypeCompatibilityConstraintView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="RunCollectionConstraintCollectionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectionConstraintCollectionView.Designer.cs">
+      <DependentUpon>RunCollectionConstraintCollectionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="RunCollectionConstraintView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectionConstraintView.Designer.cs">
+      <DependentUpon>RunCollectionConstraintView.cs</DependentUpon>
+    </Compile>
     <Compile Include="OptimizerListView.cs">
       <SubType>UserControl</SubType>
@@ -117,4 +141,10 @@
     <Compile Include="RunCollectionBubbleChartView.Designer.cs">
       <DependentUpon>RunCollectionBubbleChartView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="RunCollectionEqualityConstraintView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RunCollectionEqualityConstraintView.Designer.cs">
+      <DependentUpon>RunCollectionEqualityConstraintView.cs</DependentUpon>
     </Compile>
     <Compile Include="RunCollectionTabularView.cs">
@@ -222,4 +252,9 @@
       <Name>HeuristicLab.PluginInfrastructure</Name>
     </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="RunCollectioComparisonConstraintView.resx">
+      <DependentUpon>RunCollectioComparisonConstraintView.cs</DependentUpon>
+    </EmbeddedResource>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.Designer.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.Designer.cs	(revision 3614)
@@ -0,0 +1,68 @@
+﻿namespace HeuristicLab.Optimization.Views {
+  partial class RunCollectionComparisonConstraintView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.components = new System.ComponentModel.Container();
+      this.txtConstraintData = new System.Windows.Forms.TextBox();
+      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // txtConstraintData
+      // 
+      this.txtConstraintData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.txtConstraintData.Location = new System.Drawing.Point(127, 56);
+      this.txtConstraintData.Name = "txtConstraintData";
+      this.txtConstraintData.Size = new System.Drawing.Size(246, 20);
+      this.txtConstraintData.TabIndex = 9;
+      this.txtConstraintData.TextChanged += new System.EventHandler(this.txtConstraintData_TextChanged);
+      this.txtConstraintData.Validating += new System.ComponentModel.CancelEventHandler(this.txtConstraintData_Validating);
+      // 
+      // errorProvider
+      // 
+      this.errorProvider.ContainerControl = this;
+      // 
+      // RunCollectionComparisonConstraintView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.txtConstraintData);
+      this.errorProvider.SetIconAlignment(this, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.Name = "RunCollectionComparisonConstraintView";
+      this.Controls.SetChildIndex(this.txtConstraintData, 0);
+      this.Controls.SetChildIndex(this.cmbConstraintOperation, 0);
+      this.Controls.SetChildIndex(this.cmbConstraintColumn, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.TextBox txtConstraintData;
+    private System.Windows.Forms.ErrorProvider errorProvider;
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.cs	(revision 3614)
@@ -0,0 +1,89 @@
+﻿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 HeuristicLab.MainForm;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Optimization.Views {
+  [Content(typeof(RunCollectionComparisonConstraint), true)]
+  public partial class RunCollectionComparisonConstraintView : RunCollectionConstraintView {
+    public RunCollectionComparisonConstraintView() {
+      InitializeComponent();
+    }
+
+    public new RunCollectionComparisonConstraint Content {
+      get { return (RunCollectionComparisonConstraint)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null || Content.ConstraintData == null)
+        this.txtConstraintData.Text = string.Empty;
+      else
+        this.txtConstraintData.Text = Content.ConstraintData.GetValue();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ConstraintDataChanged += new EventHandler(Content_ConstraintDataChanged);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ConstraintDataChanged -= new EventHandler(Content_ConstraintDataChanged);
+    }
+
+    protected override void UpdateColumnComboBox() {
+      this.cmbConstraintColumn.Items.Clear();
+      if (Content.ConstrainedValue != null) {
+        IStringConvertibleMatrix matrix = (IStringConvertibleMatrix)Content.ConstrainedValue;
+        foreach (string columnName in matrix.ColumnNames) {
+          IEnumerable<Type> dataTypes = Content.ConstrainedValue.GetDataType(columnName);
+          if (dataTypes.Count() == 1) {
+            Type dataType = dataTypes.First();
+            if (typeof(IStringConvertibleValue).IsAssignableFrom(dataType) && typeof(IComparable).IsAssignableFrom(dataType))
+              this.cmbConstraintColumn.Items.Add(columnName);
+          }
+        }
+        if (Content.ConstraintColumn >= 0)
+          this.cmbConstraintColumn.SelectedItem = (matrix.ColumnNames.ElementAt(Content.ConstraintColumn));
+      }
+    }
+
+    protected override void Content_ConstraintColumnChanged(object sender, EventArgs e) {
+      base.Content_ConstraintColumnChanged(sender, e);
+      this.Content.ConstraintData = (IStringConvertibleValue)Activator.CreateInstance(Content.ConstrainedValue.GetDataType(cmbConstraintColumn.SelectedItem.ToString()).First());
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      txtConstraintData.ReadOnly = Content == null || this.ReadOnly;
+    }
+
+    protected virtual void Content_ConstraintDataChanged(object sender, EventArgs e) {
+      if (Content.ConstraintData != null)
+        txtConstraintData.Text = Content.ConstraintData.GetValue();
+      else
+        txtConstraintData.Text = string.Empty;
+    }
+
+    private void txtConstraintData_TextChanged(object sender, EventArgs e) {
+      Content.ConstraintData.SetValue(txtConstraintData.Text);
+    }
+
+    private void txtConstraintData_Validating(object sender, CancelEventArgs e) {
+      string errorMessage;
+      if (!Content.ConstraintData.Validate(txtConstraintData.Text, out errorMessage)) {
+        errorProvider.SetError(txtConstraintData, errorMessage);
+        e.Cancel = true;
+      } else
+        errorProvider.Clear();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.resx
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.resx	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.resx	(revision 3614)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs	(revision 3613)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs	(revision 3614)
@@ -63,5 +63,4 @@
       this.isSelecting = false;
 
-
       this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
       this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
@@ -122,4 +121,8 @@
     private void run_Changed(object sender, EventArgs e) {
       IRun run = (IRun)sender;
+      UpdateRun(run);
+    }
+
+    private void UpdateRun(IRun run) {
       DataPoint point = this.chart.Series[0].Points.Where(p => p.Tag == run).SingleOrDefault();
       if (point != null) {
@@ -129,4 +132,9 @@
       } else
         AddDataPoint(run);
+
+      if (this.chart.Series[0].Points.Count == 0)
+        noRunsLabel.Visible = true;
+      else
+        noRunsLabel.Visible = false;
     }
 
@@ -136,4 +144,6 @@
       UpdateComboBoxes();
       UpdateDataPoints();
+      foreach(IRun run in Content) 
+        UpdateRun(run);
     }
     private void Content_ColumnNamesChanged(object sender, EventArgs e) {
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.Designer.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.Designer.cs	(revision 3614)
@@ -0,0 +1,33 @@
+﻿namespace HeuristicLab.Core.Views {
+  partial class RunCollectionConstraintCollectionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (createParameterDialog != null) createParameterDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+    }
+
+    #endregion
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.cs	(revision 3614)
@@ -0,0 +1,105 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Windows.Forms;
+using HeuristicLab.Collections;
+using HeuristicLab.MainForm;
+using HeuristicLab.Optimization;
+using System.Drawing;
+
+namespace HeuristicLab.Core.Views {
+  [View("ConstraintCollection View")]
+  [Content(typeof(RunCollectionConstraintCollection), true)]
+  [Content(typeof(IItemCollection<IRunCollectionConstraint>), false)]
+  public partial class RunCollectionConstraintCollectionView : ItemCollectionView<IRunCollectionConstraint> {
+    protected CreateParameterDialog createParameterDialog;
+    /// <summary>
+    /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View".
+    /// </summary>
+    public RunCollectionConstraintCollectionView() {
+      InitializeComponent();
+      Caption = "RunCollectionConstraintCollection";
+      itemsGroupBox.Text = "RunCollection Constraints";
+    }
+
+    protected override IRunCollectionConstraint CreateItem() {
+      if (typeSelectorDialog == null) {
+        typeSelectorDialog = new TypeSelectorDialog();
+        typeSelectorDialog.Caption = "Select RunCollection Constraint";
+        typeSelectorDialog.TypeSelector.Caption = "Available Constraints";
+        typeSelectorDialog.TypeSelector.Configure(typeof(IRunCollectionConstraint), false, true);
+      }
+
+      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
+        try {
+          return (IRunCollectionConstraint)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
+        }
+        catch (Exception ex) {
+          Auxiliary.ShowErrorMessageBox(ex);
+        }
+      }
+      return null;
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      foreach (IRunCollectionConstraint constraint in Content)
+        constraint.ActiveChanged += new EventHandler(constraint_ActiveChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      foreach (IRunCollectionConstraint constraint in Content)
+        constraint.ActiveChanged -= new EventHandler(constraint_ActiveChanged);
+    }
+    protected override void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) {
+      base.Content_ItemsAdded(sender, e);
+      foreach (IRunCollectionConstraint constraint in e.Items)
+        constraint.ActiveChanged += new EventHandler(constraint_ActiveChanged);
+    }
+    protected override void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) {
+      base.Content_ItemsRemoved(sender, e);
+      foreach (IRunCollectionConstraint constraint in e.Items)
+        constraint.ActiveChanged -= new EventHandler(constraint_ActiveChanged);
+    }
+    protected override void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) {
+      base.Content_CollectionReset(sender, e);
+      foreach (IRunCollectionConstraint constraint in e.OldItems)
+        constraint.ActiveChanged -= new EventHandler(constraint_ActiveChanged);
+      foreach (IRunCollectionConstraint constraint in e.Items)
+        constraint.ActiveChanged += new EventHandler(constraint_ActiveChanged);
+    }
+
+    protected virtual void constraint_ActiveChanged(object sender, EventArgs e) {
+      IRunCollectionConstraint constraint = sender as IRunCollectionConstraint;
+      if (constraint != null) {
+        foreach (ListViewItem listViewItem in GetListViewItemsForItem(constraint)) {
+          if (constraint.Active)
+            listViewItem.Font = new Font(listViewItem.Font, FontStyle.Bold);
+          else
+            listViewItem.Font = new Font(listViewItem.Font, FontStyle.Regular);
+        }
+      }
+    }
+
+
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintView.Designer.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintView.Designer.cs	(revision 3614)
@@ -0,0 +1,122 @@
+﻿namespace HeuristicLab.Optimization.Views {
+  partial class RunCollectionConstraintView {
+    /// <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: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintView.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintView.cs	(revision 3614)
@@ -0,0 +1,117 @@
+﻿using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.MainForm;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Optimization.Views {
+  [Content(typeof(IRunCollectionConstraint))]
+  public partial class RunCollectionConstraintView : ItemView {
+    public RunCollectionConstraintView() {
+      InitializeComponent();
+    }
+
+    public new IRunCollectionConstraint Content {
+      get { return (IRunCollectionConstraint)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      cmbConstraintColumn.Items.Clear();
+      cmbConstraintOperation.Items.Clear();
+      chbActive.Checked = false;
+      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;
+        this.UpdateColumnComboBox();
+        chbActive.Checked = Content.Active;
+        this.ReadOnly = Content.Active;
+      }
+      SetEnabledStateOfControls();
+    }
+
+    protected virtual void UpdateColumnComboBox() {
+      this.cmbConstraintColumn.Items.Clear();
+      if (Content.ConstrainedValue != null) {
+        this.cmbConstraintColumn.Items.AddRange(((IStringConvertibleMatrix)Content.ConstrainedValue).ColumnNames.ToArray());
+        if (Content.ConstraintColumn >= 0)
+          this.cmbConstraintColumn.SelectedItem = ((IStringConvertibleMatrix)Content.ConstrainedValue).ColumnNames.ElementAt(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 OnReadOnlyChanged() {
+      base.OnReadOnlyChanged();
+      SetEnabledStateOfControls();
+    }
+    protected override void OnLockedChanged() {
+      base.OnLockedChanged();
+      SetEnabledStateOfControls();
+    }
+    protected virtual void SetEnabledStateOfControls() {
+      cmbConstraintColumn.Enabled = !this.ReadOnly && !this.Locked && Content != null;
+      cmbConstraintOperation.Enabled = !this.ReadOnly && !this.Locked && 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) {
+        string columnName = ((IStringConvertibleMatrix)Content.ConstrainedValue).ColumnNames.ElementAt(Content.ConstraintColumn);
+        if (cmbConstraintColumn.SelectedItem.ToString() != columnName)
+          cmbConstraintColumn.SelectedItem = columnName;
+      }
+    }
+    private void cmbConstraintColumn_SelectedIndexChanged(object sender, EventArgs e) {
+      if (Content.ConstrainedValue != null) {
+        Content.ConstraintColumn = ((IStringConvertibleMatrix)Content.ConstrainedValue).ColumnNames.ToList().IndexOf(cmbConstraintColumn.SelectedItem.ToString());
+      }
+    }
+
+    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) {
+      Content.Active = chbActive.Checked;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.Designer.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.Designer.cs	(revision 3614)
@@ -0,0 +1,57 @@
+﻿namespace HeuristicLab.Optimization.Views {
+  partial class RunCollectionEqualityConstraintView {
+    /// <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.txtConstraintData = new System.Windows.Forms.TextBox();
+      this.SuspendLayout();
+      // 
+      // txtConstraintData
+      // 
+      this.txtConstraintData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.txtConstraintData.Location = new System.Drawing.Point(127, 56);
+      this.txtConstraintData.Name = "txtConstraintData";
+      this.txtConstraintData.Size = new System.Drawing.Size(246, 20);
+      this.txtConstraintData.TabIndex = 9;
+      this.txtConstraintData.TextChanged += new System.EventHandler(this.txtConstraintData_TextChanged);
+      // 
+      // RunCollectionEqualityConstraintView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.txtConstraintData);
+      this.Name = "RunCollectionEqualityConstraintView";
+      this.Controls.SetChildIndex(this.txtConstraintData, 0);
+      this.Controls.SetChildIndex(this.cmbConstraintOperation, 0);
+      this.Controls.SetChildIndex(this.cmbConstraintColumn, 0);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.TextBox txtConstraintData;
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionEqualityConstraintView.cs	(revision 3614)
@@ -0,0 +1,40 @@
+﻿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 HeuristicLab.MainForm;
+
+namespace HeuristicLab.Optimization.Views {
+  [Content(typeof(RunCollectionEqualityConstraint),true)]
+  public partial class RunCollectionEqualityConstraintView : RunCollectionConstraintView {
+    public RunCollectionEqualityConstraintView() {
+      InitializeComponent();
+    }
+
+    public new RunCollectionEqualityConstraint Content {
+      get { return (RunCollectionEqualityConstraint)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null || Content.ConstraintData == null)
+        this.txtConstraintData.Text = string.Empty;
+      else
+        this.txtConstraintData.Text = Content.ConstraintData.ToString();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      txtConstraintData.ReadOnly = Content == null || this.ReadOnly ;
+    }
+
+    private void txtConstraintData_TextChanged(object sender, EventArgs e) {
+      Content.ConstraintData = txtConstraintData.Text;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTabularView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTabularView.cs	(revision 3613)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTabularView.cs	(revision 3614)
@@ -54,4 +54,12 @@
     }
 
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null) {
+        foreach (IRun run in Content)
+          UpdateRun(run);
+      }
+    }
+
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
@@ -88,4 +96,8 @@
     private void run_Changed(object sender, EventArgs e) {
       IRun run = (IRun)sender;
+      UpdateRun(run);
+    }
+
+    private void UpdateRun(IRun run) {
       int rowIndex = Content.ToList().IndexOf(run);
       rowIndex = virtualRowIndizes[rowIndex];
@@ -104,5 +116,4 @@
       }
     }
-
 
     protected override int[] Sort(IEnumerable<KeyValuePair<int, SortOrder>> sortedColumns) {
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTypeCompatibilityConstraintView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTypeCompatibilityConstraintView.Designer.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTypeCompatibilityConstraintView.Designer.cs	(revision 3614)
@@ -0,0 +1,60 @@
+﻿namespace HeuristicLab.Optimization.Views {
+  partial class RunCollectionTypeCompatibilityConstraintView {
+    /// <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.cmbType = new System.Windows.Forms.ComboBox();
+      this.SuspendLayout();
+      // 
+      // cmbType
+      // 
+      this.cmbType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.cmbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.cmbType.FormattingEnabled = true;
+      this.cmbType.Location = new System.Drawing.Point(127, 55);
+      this.cmbType.Name = "cmbType";
+      this.cmbType.Size = new System.Drawing.Size(246, 21);
+      this.cmbType.TabIndex = 9;
+      this.cmbType.SelectedIndexChanged += new System.EventHandler(this.cmbType_SelectedIndexChanged);
+      // 
+      // RunCollectionTypeCompatibilityConstraintView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.cmbType);
+      this.Name = "RunCollectionTypeCompatibilityConstraintView";
+      this.Controls.SetChildIndex(this.cmbType, 0);
+      this.Controls.SetChildIndex(this.cmbConstraintOperation, 0);
+      this.Controls.SetChildIndex(this.cmbConstraintColumn, 0);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.ComboBox cmbType;
+
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTypeCompatibilityConstraintView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTypeCompatibilityConstraintView.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTypeCompatibilityConstraintView.cs	(revision 3614)
@@ -0,0 +1,66 @@
+﻿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 HeuristicLab.MainForm;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Optimization.Views {
+  [Content(typeof(RunCollectionTypeCompatibilityConstraint), true)]
+  public partial class RunCollectionTypeCompatibilityConstraintView : RunCollectionConstraintView {
+    public RunCollectionTypeCompatibilityConstraintView() {
+      InitializeComponent();
+      cmbType.DisplayMember = "Name";
+    }
+
+    public new RunCollectionTypeCompatibilityConstraint Content {
+      get { return (RunCollectionTypeCompatibilityConstraint)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void Content_ConstraintColumnChanged(object sender, EventArgs e) {
+      base.Content_ConstraintColumnChanged(sender, e);
+      UpdateTypeColumn();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateTypeColumn();
+    }
+
+    protected virtual void UpdateTypeColumn() {
+      cmbType.Items.Clear();
+      if (Content != null && Content.ConstrainedValue != null) {
+        foreach (Type t in Content.ConstrainedValue.GetDataType(cmbConstraintColumn.SelectedItem.ToString()))
+          cmbType.Items.Add(t);
+        if (Content.ConstraintData != null)
+          cmbType.SelectedItem = Content.ConstraintData;
+        else if (cmbType.Items.Count > 0)
+          cmbType.SelectedIndex = 0;
+      }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      cmbType.Enabled = Content != null && !this.ReadOnly;
+    }
+
+    private void cmbType_SelectedIndexChanged(object sender, EventArgs e) {
+      if (Content != null)
+        Content.ConstraintData = (Type)cmbType.SelectedItem;
+    }
+
+    private struct ComboBoxItem {
+      public ComboBoxItem(string name, Type type) {
+        this.Name = name;
+        this.Type = type;
+      }
+      public string Name;
+      public Type Type;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.Designer.cs	(revision 3613)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.Designer.cs	(revision 3614)
@@ -54,5 +54,8 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RunCollectionView));
       this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.toolStrip = new System.Windows.Forms.ToolStrip();
+      this.analyzeRunsToolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton();
       this.itemsListView = new System.Windows.Forms.ListView();
       this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
@@ -63,12 +66,17 @@
       this.itemsGroupBox = new System.Windows.Forms.GroupBox();
       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
-      this.toolStrip = new System.Windows.Forms.ToolStrip();
-      this.analyzeRunsToolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton();
+      this.tabControl = new System.Windows.Forms.TabControl();
+      this.runPage = new System.Windows.Forms.TabPage();
+      this.constraintPage = new System.Windows.Forms.TabPage();
+      this.runCollectionConstraintCollectionView = new HeuristicLab.Core.Views.RunCollectionConstraintCollectionView();
       this.splitContainer.Panel1.SuspendLayout();
       this.splitContainer.Panel2.SuspendLayout();
       this.splitContainer.SuspendLayout();
+      this.toolStrip.SuspendLayout();
       this.detailsGroupBox.SuspendLayout();
       this.itemsGroupBox.SuspendLayout();
-      this.toolStrip.SuspendLayout();
+      this.tabControl.SuspendLayout();
+      this.runPage.SuspendLayout();
+      this.constraintPage.SuspendLayout();
       this.SuspendLayout();
       // 
@@ -90,7 +98,31 @@
       // 
       this.splitContainer.Panel2.Controls.Add(this.detailsGroupBox);
-      this.splitContainer.Size = new System.Drawing.Size(526, 364);
+      this.splitContainer.Size = new System.Drawing.Size(512, 332);
       this.splitContainer.SplitterDistance = 250;
       this.splitContainer.TabIndex = 0;
+      // 
+      // toolStrip
+      // 
+      this.toolStrip.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.toolStrip.AutoSize = false;
+      this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;
+      this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+      this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.analyzeRunsToolStripDropDownButton});
+      this.toolStrip.Location = new System.Drawing.Point(30, 3);
+      this.toolStrip.Name = "toolStrip";
+      this.toolStrip.Size = new System.Drawing.Size(217, 24);
+      this.toolStrip.TabIndex = 1;
+      this.toolStrip.Text = "toolStrip1";
+      // 
+      // analyzeRunsToolStripDropDownButton
+      // 
+      this.analyzeRunsToolStripDropDownButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+      this.analyzeRunsToolStripDropDownButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+      this.analyzeRunsToolStripDropDownButton.Name = "analyzeRunsToolStripDropDownButton";
+      this.analyzeRunsToolStripDropDownButton.Size = new System.Drawing.Size(99, 21);
+      this.analyzeRunsToolStripDropDownButton.Text = "&Analyze Runs...";
+      this.analyzeRunsToolStripDropDownButton.ToolTipText = "Show Run Analysis Views";
       // 
       // itemsListView
@@ -107,5 +139,5 @@
       this.itemsListView.Name = "itemsListView";
       this.itemsListView.ShowItemToolTips = true;
-      this.itemsListView.Size = new System.Drawing.Size(244, 327);
+      this.itemsListView.Size = new System.Drawing.Size(244, 295);
       this.itemsListView.SmallImageList = this.imageList;
       this.itemsListView.TabIndex = 1;
@@ -147,5 +179,5 @@
       this.detailsGroupBox.Location = new System.Drawing.Point(3, 27);
       this.detailsGroupBox.Name = "detailsGroupBox";
-      this.detailsGroupBox.Size = new System.Drawing.Size(266, 335);
+      this.detailsGroupBox.Size = new System.Drawing.Size(252, 303);
       this.detailsGroupBox.TabIndex = 0;
       this.detailsGroupBox.TabStop = false;
@@ -162,5 +194,5 @@
       this.viewHost.Name = "viewHost";
       this.viewHost.ReadOnly = false;
-      this.viewHost.Size = new System.Drawing.Size(254, 310);
+      this.viewHost.Size = new System.Drawing.Size(240, 278);
       this.viewHost.TabIndex = 0;
       this.viewHost.ViewType = null;
@@ -170,40 +202,59 @@
       this.itemsGroupBox.Controls.Add(this.splitContainer);
       this.itemsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.itemsGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.itemsGroupBox.Location = new System.Drawing.Point(3, 3);
       this.itemsGroupBox.Name = "itemsGroupBox";
-      this.itemsGroupBox.Size = new System.Drawing.Size(532, 383);
+      this.itemsGroupBox.Size = new System.Drawing.Size(518, 351);
       this.itemsGroupBox.TabIndex = 0;
       this.itemsGroupBox.TabStop = false;
       this.itemsGroupBox.Text = "Items";
       // 
-      // toolStrip
-      // 
-      this.toolStrip.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.toolStrip.AutoSize = false;
-      this.toolStrip.Dock = System.Windows.Forms.DockStyle.None;
-      this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
-      this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.analyzeRunsToolStripDropDownButton});
-      this.toolStrip.Location = new System.Drawing.Point(30, 3);
-      this.toolStrip.Name = "toolStrip";
-      this.toolStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.ManagerRenderMode;
-      this.toolStrip.Size = new System.Drawing.Size(217, 24);
-      this.toolStrip.TabIndex = 1;
-      this.toolStrip.Text = "toolStrip1";
-      // 
-      // analyzeRunsToolStripDropDownButton
-      // 
-      this.analyzeRunsToolStripDropDownButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
-      this.analyzeRunsToolStripDropDownButton.ImageTransparentColor = System.Drawing.Color.Magenta;
-      this.analyzeRunsToolStripDropDownButton.Name = "analyzeRunsToolStripDropDownButton";
-      this.analyzeRunsToolStripDropDownButton.Size = new System.Drawing.Size(45, 21);
-      this.analyzeRunsToolStripDropDownButton.Text = "&Analyze Runs...";
-      this.analyzeRunsToolStripDropDownButton.ToolTipText = "Show Run Analysis Views";
+      // tabControl
+      // 
+      this.tabControl.Controls.Add(this.runPage);
+      this.tabControl.Controls.Add(this.constraintPage);
+      this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.tabControl.Location = new System.Drawing.Point(0, 0);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(532, 383);
+      this.tabControl.TabIndex = 1;
+      // 
+      // runPage
+      // 
+      this.runPage.Controls.Add(this.itemsGroupBox);
+      this.runPage.Location = new System.Drawing.Point(4, 22);
+      this.runPage.Name = "runPage";
+      this.runPage.Padding = new System.Windows.Forms.Padding(3);
+      this.runPage.Size = new System.Drawing.Size(524, 357);
+      this.runPage.TabIndex = 0;
+      this.runPage.Text = "Runs";
+      this.runPage.UseVisualStyleBackColor = true;
+      // 
+      // constraintPage
+      // 
+      this.constraintPage.Controls.Add(this.runCollectionConstraintCollectionView);
+      this.constraintPage.Location = new System.Drawing.Point(4, 22);
+      this.constraintPage.Name = "constraintPage";
+      this.constraintPage.Padding = new System.Windows.Forms.Padding(3);
+      this.constraintPage.Size = new System.Drawing.Size(524, 357);
+      this.constraintPage.TabIndex = 1;
+      this.constraintPage.Text = "Filtering";
+      this.constraintPage.UseVisualStyleBackColor = true;
+      // 
+      // runCollectionConstraintCollectionView
+      // 
+      this.runCollectionConstraintCollectionView.Caption = "Filter";
+      this.runCollectionConstraintCollectionView.Content = null;
+      this.runCollectionConstraintCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.runCollectionConstraintCollectionView.Location = new System.Drawing.Point(3, 3);
+      this.runCollectionConstraintCollectionView.Name = "runCollectionConstraintCollectionView";
+      this.runCollectionConstraintCollectionView.ReadOnly = false;
+      this.runCollectionConstraintCollectionView.Size = new System.Drawing.Size(518, 351);
+      this.runCollectionConstraintCollectionView.TabIndex = 0;
       // 
       // RunCollectionView
       // 
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.Controls.Add(this.itemsGroupBox);
+      this.Controls.Add(this.tabControl);
       this.Name = "RunCollectionView";
       this.Size = new System.Drawing.Size(532, 383);
@@ -211,8 +262,11 @@
       this.splitContainer.Panel2.ResumeLayout(false);
       this.splitContainer.ResumeLayout(false);
+      this.toolStrip.ResumeLayout(false);
+      this.toolStrip.PerformLayout();
       this.detailsGroupBox.ResumeLayout(false);
       this.itemsGroupBox.ResumeLayout(false);
-      this.toolStrip.ResumeLayout(false);
-      this.toolStrip.PerformLayout();
+      this.tabControl.ResumeLayout(false);
+      this.runPage.ResumeLayout(false);
+      this.constraintPage.ResumeLayout(false);
       this.ResumeLayout(false);
 
@@ -232,4 +286,8 @@
     protected ToolStrip toolStrip;
     protected ToolStripDropDownButton analyzeRunsToolStripDropDownButton;
+    private TabControl tabControl;
+    private TabPage runPage;
+    private TabPage constraintPage;
+    private HeuristicLab.Core.Views.RunCollectionConstraintCollectionView runCollectionConstraintCollectionView;
   }
 }
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs	(revision 3613)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs	(revision 3614)
@@ -42,4 +42,8 @@
     }
 
+    public RunCollection RunCollection {
+      get { return Content as RunCollection; }
+    }
+
     public ListView ItemsListView {
       get { return itemsListView; }
@@ -94,9 +98,18 @@
       while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]);
       viewHost.Content = null;
+      runCollectionConstraintCollectionView.Content = null;
+      tabControl.TabPages.Remove(constraintPage);
 
       if (Content != null) {
+        if (RunCollection != null) {
+          tabControl.TabPages.Add(constraintPage);
+          runCollectionConstraintCollectionView.Content = RunCollection.Constraints;
+          runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
+        }
         Caption += " (" + Content.GetType().Name + ")";
-        foreach (IRun item in Content)
+        foreach (IRun item in Content) {
           AddListViewItem(CreateListViewItem(item));
+          UpdateRun(item);
+        }
       }
       SetEnabledStateOfControls();
@@ -110,4 +123,5 @@
       if (Content == null) {
         analyzeRunsToolStripDropDownButton.Enabled = false;
+        runCollectionConstraintCollectionView.ReadOnly = true;
         itemsListView.Enabled = false;
         detailsGroupBox.Enabled = false;
@@ -116,4 +130,5 @@
       } else {
         analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
+        runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
         itemsListView.Enabled = true;
         detailsGroupBox.Enabled = true;
@@ -262,4 +277,5 @@
           AddListViewItem(CreateListViewItem(item));
         analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
+        runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
       }
     }
@@ -276,4 +292,5 @@
         }
         analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
+        runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
       }
     }
@@ -293,4 +310,5 @@
           AddListViewItem(CreateListViewItem(item));
         analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
+        runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
       }
     }
@@ -318,4 +336,8 @@
     protected virtual void Run_Changed(object sender, EventArgs e) {
       IRun run = (IRun)sender;
+      UpdateRun(run);
+    }
+
+    protected virtual void UpdateRun(IRun run) {
       foreach (ListViewItem listViewItem in GetListViewItemsForItem(run)) {
         if (run.Visible) {
Index: /trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj	(revision 3613)
+++ /trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj	(revision 3614)
@@ -87,4 +87,8 @@
     <Compile Include="Algorithm.cs" />
     <Compile Include="BatchRun.cs" />
+    <Compile Include="RunCollectionComparisonConstraint.cs" />
+    <Compile Include="RunCollectionConstraintCollection.cs" />
+    <Compile Include="RunCollectionTypeCompatiblityConstraint.cs" />
+    <Compile Include="RunCollectionEqualityConstraint.cs" />
     <Compile Include="Interfaces\ISingleObjectiveReplacer.cs" />
     <Compile Include="Interfaces\IMigrator.cs" />
@@ -97,4 +101,5 @@
     <Compile Include="Interfaces\IStrategyParameterCreator.cs" />
     <Compile Include="Interfaces\IRun.cs" />
+    <Compile Include="IRunCollectionConstraint.cs" />
     <Compile Include="OptimizerList.cs" />
     <Compile Include="Experiment.cs" />
Index: /trunk/sources/HeuristicLab.Optimization/3.3/IRunCollectionConstraint.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization/3.3/IRunCollectionConstraint.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization/3.3/IRunCollectionConstraint.cs	(revision 3614)
@@ -0,0 +1,34 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Optimization {
+  public interface IRunCollectionConstraint : IConstraint{
+    new RunCollection ConstrainedValue { get; set; }
+    int ConstraintColumn { get; set; }
+    event EventHandler ConstraintColumnChanged;
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization/3.3/RunCollection.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization/3.3/RunCollection.cs	(revision 3613)
+++ /trunk/sources/HeuristicLab.Optimization/3.3/RunCollection.cs	(revision 3614)
@@ -27,4 +27,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Collections;
 
 namespace HeuristicLab.Optimization {
@@ -38,8 +39,20 @@
       parameterNames = new List<string>();
       resultNames = new List<string>();
-    }
-
-    protected static Type[] viewableDataTypes = new Type[]{typeof(BoolValue), typeof(DoubleValue), typeof(IntValue),
-      typeof(PercentValue), typeof(StringValue)};
+      dataTypes = new Dictionary<string, HashSet<Type>>();
+      constraints = new RunCollectionConstraintCollection();
+      constraints.ItemsAdded += new CollectionItemsChangedEventHandler<IRunCollectionConstraint>(Constraints_ItemsAdded);
+      constraints.ItemsRemoved += new CollectionItemsChangedEventHandler<IRunCollectionConstraint>(Constraints_ItemsRemoved);
+      constraints.CollectionReset += new CollectionItemsChangedEventHandler<IRunCollectionConstraint>(Constraints_CollectionReset);
+    }
+    private Dictionary<string, HashSet<Type>> dataTypes;
+    public IEnumerable<Type> GetDataType(string columnName) {
+      if (!dataTypes.ContainsKey(columnName))
+        return new Type[0];
+      return dataTypes[columnName];
+    }
+    private RunCollectionConstraintCollection constraints;
+    public RunCollectionConstraintCollection Constraints {
+      get { return constraints;}
+    }
 
     protected override void OnCollectionReset(IEnumerable<IRun> items, IEnumerable<IRun> oldItems) {
@@ -90,8 +103,10 @@
         return false;
       if (!parameterNames.Contains(name)) {
-        // && viewableDataTypes.Any(x => x.IsAssignableFrom(value.GetType()))) {
         parameterNames.Add(name);
-        return true;
-      }
+        dataTypes[name] = new HashSet<Type>();
+        dataTypes[name].Add(value.GetType());
+        return true;
+      }
+      dataTypes[name].Add(value.GetType());
       return false;
     }
@@ -100,8 +115,10 @@
         return false;
       if (!resultNames.Contains(name)) {
-        // && viewableDataTypes.Any(x => x.IsAssignableFrom(value.GetType()))) {
         resultNames.Add(name);
-        return true;
-      }
+        dataTypes[name] = new HashSet<Type>();
+        dataTypes[name].Add(value.GetType());
+        return true;
+      }
+      dataTypes[name].Add(value.GetType());
       return false;
     }
@@ -221,4 +238,57 @@
     public bool SetValue(string value, int rowIndex, int columnIndex) { throw new NotSupportedException(); }
     #endregion
+
+    #region filtering
+    private void UpdateFiltering() {
+      list.ForEach(r => r.Visible = true);
+      foreach (IRunCollectionConstraint constraint in this.constraints)
+        constraint.Check();
+    }
+
+    protected virtual void RegisterConstraintEvents(IEnumerable<IRunCollectionConstraint> constraints) {
+      foreach (IRunCollectionConstraint constraint in constraints) {
+        constraint.ActiveChanged += new EventHandler(Constraint_ActiveChanged);
+        constraint.ConstrainedValueChanged += new EventHandler(Constraint_ConstrainedValueChanged);
+        constraint.ConstraintOperationChanged += new EventHandler(Constraint_ConstraintOperationChanged);
+        constraint.ConstraintDataChanged += new EventHandler(Constraint_ConstraintDataChanged);
+      }
+    }
+    protected virtual void DeregisterConstraintEvents(IEnumerable<IRunCollectionConstraint> constraints) {
+      foreach (IRunCollectionConstraint constraint in constraints) {
+        constraint.ActiveChanged -= new EventHandler(Constraint_ActiveChanged);
+        constraint.ConstrainedValueChanged -= new EventHandler(Constraint_ConstrainedValueChanged);
+        constraint.ConstraintOperationChanged -= new EventHandler(Constraint_ConstraintOperationChanged);
+        constraint.ConstraintDataChanged -= new EventHandler(Constraint_ConstraintDataChanged);
+      }
+    }
+
+    protected virtual void Constraints_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) {
+      DeregisterConstraintEvents(e.OldItems);
+      RegisterConstraintEvents(e.Items);
+      this.UpdateFiltering();
+    }
+    protected virtual void Constraints_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) {
+      RegisterConstraintEvents(e.Items);
+      foreach (IRunCollectionConstraint constraint in e.Items)
+        constraint.ConstrainedValue = this;
+      this.UpdateFiltering();
+    }
+    protected virtual void Constraints_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) {
+      DeregisterConstraintEvents(e.Items);
+      this.UpdateFiltering();
+    }
+    protected virtual void Constraint_ActiveChanged(object sender, EventArgs e) {
+      this.UpdateFiltering();
+    }
+    protected virtual void Constraint_ConstrainedValueChanged(object sender, EventArgs e) {
+      //mkommend: this method is intentionally left empty, because the constrainedValue is set in the ItemsAdded method
+    }
+    protected virtual void Constraint_ConstraintOperationChanged(object sender, EventArgs e) {
+      this.UpdateFiltering();
+    }
+    protected virtual void Constraint_ConstraintDataChanged(object sender, EventArgs e) {
+      this.UpdateFiltering();
+    }
+    #endregion
   }
 }
Index: /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionComparisonConstraint.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionComparisonConstraint.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionComparisonConstraint.cs	(revision 3614)
@@ -0,0 +1,126 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Optimization {
+  [StorableClass]
+  [Item("RunCollectionComparisonConstraint", "A constraint which compares the members of the contained runs with the constraint data.")]
+  public class RunCollectionComparisonConstraint : ComparisonConstraint, IRunCollectionConstraint {
+    public RunCollectionComparisonConstraint()
+      : base() {
+    }
+    [StorableConstructor]
+    protected RunCollectionComparisonConstraint(bool deserializing) {
+    }
+    public RunCollectionComparisonConstraint(RunCollection constrainedValue, ConstraintOperation constraintOperation, object constraintData)
+      : base(constrainedValue, constraintOperation, constraintData) {
+    }
+    public RunCollectionComparisonConstraint(RunCollection constrainedValue, ConstraintOperation constraintOperation, object constraintData, bool active)
+      : base(constrainedValue, constraintOperation, constraintData, active) {
+    }
+
+    public new RunCollection ConstrainedValue {
+      get { return (RunCollection)base.ConstrainedValue; }
+      set { base.ConstrainedValue = value; }
+    }
+
+    public new IStringConvertibleValue ConstraintData {
+      get { return (IStringConvertibleValue)base.ConstraintData; }
+      set {
+        if (!(value is IComparable))
+          throw new ArgumentException("Only IComparables allowed for ConstraintData");
+        base.ConstraintData = value;
+      }
+    }
+
+    [Storable]
+    private int constraintColumn;
+    public int ConstraintColumn {
+      get { return constraintColumn; }
+      set {
+        if (value < 0 || value >= ((IStringConvertibleMatrix)ConstrainedValue).ColumnNames.Count())
+          throw new ArgumentException("Could not set ConstraintData to not existing column index.");
+        if (constraintColumn != value) {
+          constraintColumn = value;
+          this.OnConstraintColumnChanged();
+        }
+      }
+    }
+
+    public event EventHandler ConstraintColumnChanged;
+    protected virtual void OnConstraintColumnChanged() {
+      EventHandler handler = ConstraintColumnChanged;
+      if (handler != null)
+        handler(this, EventArgs.Empty);
+    }
+
+    protected override bool Check(object constrainedMember) {
+      if (!Active)
+        return true;
+
+      foreach (IRun run in ConstrainedValue.Where(r => r.Visible)) {
+        IItem item = ConstrainedValue.GetValue(run, constraintColumn);
+        if (!base.Check(item))
+          run.Visible = false;
+      }
+      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)) {
+        IItem item = ConstrainedValue.GetValue(run, constraintColumn);
+        if (!base.Check(item))
+          run.Visible = false;
+      }
+      return true;
+    }
+
+    public override string ToString() {
+      string s = string.Empty;
+      IStringConvertibleMatrix matrix = ConstrainedValue;
+      if (matrix != null && matrix.ColumnNames.Count() != 0)
+        s += matrix.ColumnNames.ElementAt(constraintColumn) + " ";
+      else
+        return "ComparisonConstraint";
+
+      if (ConstraintOperation != null)
+        s += ConstraintOperation.ToString() + " ";
+
+      if (ConstraintData != null)
+        s += ConstraintData.GetValue();
+      else
+        s += "null";
+
+      return s;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionConstraintCollection.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionConstraintCollection.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionConstraintCollection.cs	(revision 3614)
@@ -0,0 +1,38 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Optimization {
+  [StorableClass]
+  [Item("RunCollectionConstraintCollection", "Represents a collection of constraints.")]
+  public class RunCollectionConstraintCollection : ItemCollection<IRunCollectionConstraint> {
+    public RunCollectionConstraintCollection() : base() { }
+    public RunCollectionConstraintCollection(int capacity) : base(capacity) { }
+    public RunCollectionConstraintCollection(IEnumerable<IRunCollectionConstraint> collection) : base(collection) { }
+    [StorableConstructor]
+    protected RunCollectionConstraintCollection(bool deserializing) : base(deserializing) { }
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionEqualityConstraint.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionEqualityConstraint.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionEqualityConstraint.cs	(revision 3614)
@@ -0,0 +1,124 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Optimization {
+  [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 RunCollectionEqualityConstraint()
+      : base() {
+      this.ConstraintData = string.Empty;
+    }
+    [StorableConstructor]
+    protected RunCollectionEqualityConstraint(bool deserializing) {
+    }
+    public RunCollectionEqualityConstraint(RunCollection constrainedValue, ConstraintOperation constraintOperation, string constraintData)
+      : base(constrainedValue, constraintOperation, constraintData) {
+    }
+    public RunCollectionEqualityConstraint(RunCollection constrainedValue, ConstraintOperation constraintOperation, string constraintData, bool active)
+      : base(constrainedValue, constraintOperation, constraintData, active) {
+    }
+
+    public new RunCollection ConstrainedValue {
+      get { return (RunCollection)base.ConstrainedValue; }
+      set { base.ConstrainedValue = value; }
+    }
+
+    public new string ConstraintData {
+      get { return (string) base.ConstraintData;}
+      set { base.ConstraintData = value;}
+    }
+
+    [Storable]
+    private int constraintColumn;
+    public int ConstraintColumn {
+      get { return constraintColumn; }
+      set {
+        if (value < 0 || value >= ((IStringConvertibleMatrix)ConstrainedValue).ColumnNames.Count())
+          throw new ArgumentException("Could not set ConstraintData to not existing column index.");
+        if (constraintColumn != value) {
+          constraintColumn = value;
+          this.OnConstraintColumnChanged();
+          this.OnToStringChanged();
+        }
+      }
+    }
+
+    public event EventHandler ConstraintColumnChanged;
+    protected virtual void OnConstraintColumnChanged() {
+      EventHandler handler = ConstraintColumnChanged;
+      if (handler != null)
+        handler(this, EventArgs.Empty);
+    }
+
+    protected override bool Check(object constrainedMember) {
+      if (!Active)
+        return true;
+
+      foreach (IRun run in ConstrainedValue.Where(r => r.Visible)) {
+        IItem item = ConstrainedValue.GetValue(run, constraintColumn);
+        if (!base.Check(item.ToString()))
+          run.Visible = false;
+      }
+      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)) {
+        IItem item = ConstrainedValue.GetValue(run, constraintColumn);
+        if (!base.Check(item))
+          run.Visible = false;
+      }
+      return true;
+    }
+
+    public override string ToString() {
+      string s = string.Empty;
+      IStringConvertibleMatrix matrix = ConstrainedValue;
+      if (matrix != null && matrix.ColumnNames.Count() != 0)
+        s += matrix.ColumnNames.ElementAt(constraintColumn) + " ";
+      else
+        return "EqualityConstraint";
+
+      if (ConstraintOperation != null)
+        s += ConstraintOperation.ToString() + " ";
+
+      if (!string.IsNullOrEmpty(ConstraintData))
+        s += ConstraintData;
+      else
+        s += "null";
+
+      return s;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionTypeCompatiblityConstraint.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionTypeCompatiblityConstraint.cs	(revision 3614)
+++ /trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionTypeCompatiblityConstraint.cs	(revision 3614)
@@ -0,0 +1,116 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Optimization {
+  [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 RunCollectionTypeCompatibilityConstraint()
+      : base() {
+    }
+    [StorableConstructor]
+    protected RunCollectionTypeCompatibilityConstraint(bool deserializing) {
+    }
+    public RunCollectionTypeCompatibilityConstraint(RunCollection constrainedValue, ConstraintOperation constraintOperation, Type constraintData)
+      : base(constrainedValue, constraintOperation, constraintData) {
+    }
+    public RunCollectionTypeCompatibilityConstraint(RunCollection constrainedValue, ConstraintOperation constraintOperation, Type constraintData, bool active)
+      : base(constrainedValue, constraintOperation, constraintData, active) {
+    }
+
+    public new RunCollection ConstrainedValue {
+      get { return (RunCollection)base.ConstrainedValue; }
+      set { base.ConstrainedValue = value; }
+    }
+    [Storable]
+    private int constraintColumn;
+    public int ConstraintColumn {
+      get { return constraintColumn; }
+      set {
+        if (value < 0 || value >= ((IStringConvertibleMatrix)ConstrainedValue).ColumnNames.Count())
+          throw new ArgumentException("Could not set ConstraintData to not existing column index.");
+        if (constraintColumn != value) {
+          constraintColumn = value;
+          this.OnConstraintColumnChanged();
+        }
+      }
+    }
+
+    public event EventHandler ConstraintColumnChanged;
+    protected virtual void OnConstraintColumnChanged() {
+      EventHandler handler = ConstraintColumnChanged;
+      if (handler != null)
+        handler(this, EventArgs.Empty);
+    }
+
+    protected override bool Check(object constrainedMember) {
+      if (!Active)
+        return true;
+
+      foreach (IRun run in ConstrainedValue.Where(r => r.Visible)) {
+        IItem item = ConstrainedValue.GetValue(run, constraintColumn);
+        if (item == null || !base.Check(item))
+          run.Visible = false;
+      }
+      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)) {
+        IItem item = ConstrainedValue.GetValue(run, constraintColumn);
+        if (!base.Check(item))
+          run.Visible = false;
+      }
+      return true;
+    }
+
+    public override string ToString() {
+      string s = string.Empty;
+      IStringConvertibleMatrix matrix = ConstrainedValue;
+      if (matrix != null && matrix.ColumnNames.Count() != 0)
+        s += matrix.ColumnNames.ElementAt(constraintColumn) + " ";
+      else
+        return "TypeCompabitilityConstraint";
+
+      if (ConstraintOperation != null)
+        s += ConstraintOperation.ToString() + " ";
+
+      if (ConstraintData != null)
+        s += ConstraintData;
+      else
+        s += "null";
+
+      return s;
+    }
+  }
+}
