Index: trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/HeuristicLab.ThreadParallelEngine-3.2.csproj
===================================================================
--- trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/HeuristicLab.ThreadParallelEngine-3.2.csproj	(revision 1867)
+++ trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/HeuristicLab.ThreadParallelEngine-3.2.csproj	(revision 1867)
@@ -0,0 +1,121 @@
+﻿<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{6E757D0E-20F9-4E89-AF06-D7DA256870DB}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.ThreadParallelEngine</RootNamespace>
+    <AssemblyName>HeuristicLab.ThreadParallelEngine-3.2</AssemblyName>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>2.0</OldToolsVersion>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+    <DocumentationFile>bin\Release\HeuristicLab.ThreadParallelEngine-3.2.XML</DocumentationFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>bin\Release\HeuristicLab.ThreadParallelEngine-3.2.XML</DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>bin\Release\HeuristicLab.ThreadParallelEngine-3.2.XML</DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="HeuristicLabThreadParallelEnginePlugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ThreadParallelEngine.cs" />
+    <Compile Include="ThreadParallelEngineEditor.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="ThreadParallelEngineEditor.Designer.cs">
+      <DependentUpon>ThreadParallelEngineEditor.cs</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
+      <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
+      <Name>HeuristicLab.Core-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/HeuristicLabThreadParallelEnginePlugin.cs
===================================================================
--- trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/HeuristicLabThreadParallelEnginePlugin.cs	(revision 1867)
+++ trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/HeuristicLabThreadParallelEnginePlugin.cs	(revision 1867)
@@ -0,0 +1,36 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.ThreadParallelEngine {
+  /// <summary>
+  /// Plugin class for HeuristicLab.ThreadParallelEngine plugin.
+  /// </summary>
+  [ClassInfo(Name = "HeuristicLab.ThreadParallelEngine-3.2")]
+  [PluginFile(Filename = "HeuristicLab.ThreadParallelEngine-3.2.dll", Filetype = PluginFileType.Assembly)]
+  [Dependency(Dependency = "HeuristicLab.Core-3.2")]
+  public class HeuristicLabThreadParallelEnginePlugin : PluginBase {
+  }
+}
Index: trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/Properties/AssemblyInfo.frame
===================================================================
--- trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/Properties/AssemblyInfo.frame	(revision 1867)
+++ trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/Properties/AssemblyInfo.frame	(revision 1867)
@@ -0,0 +1,58 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using HeuristicLab.PluginInfrastructure;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.ThreadParallelEngine")]
+[assembly: AssemblyDescription("HeuristicLab engine for parallel processing using multiple threads")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2008 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("015adceb-e1e1-405f-a0d1-be1a977772d9")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.2.0.$WCREV$")]
+[assembly: AssemblyFileVersion("3.2.0.$WCREV$")]
+[assembly: AssemblyBuildDate("$WCNOW$")]
Index: trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/ThreadParallelEngine.cs
===================================================================
--- trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/ThreadParallelEngine.cs	(revision 1867)
+++ trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/ThreadParallelEngine.cs	(revision 1867)
@@ -0,0 +1,246 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Text;
+using System.Xml;
+using System.Threading;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.ThreadParallelEngine {
+  /// <summary>
+  /// Implementation of an engine being able to run in parallel with threads.
+  /// </summary>
+  public class ThreadParallelEngine : EngineBase, IEditable {
+    #region Inner Class Task
+    private class TaskList {
+      public Stack<IOperation>[] tasks;
+      public int next;
+      public Semaphore semaphore;
+    }
+    #endregion
+
+    // currently executed operators
+    private IOperator[] currentOperators;
+    private int operatorIndex;
+
+    private int myWorkers;
+    /// <summary>
+    /// Gets or sets the number of worker threads of the current engine.
+    /// </summary>
+    /// <remarks>Calls <see cref="OnWorkersChanged"/> in the setter.</remarks>
+    public int Workers {
+      get { return myWorkers; }
+      set {
+        if (value != myWorkers) {
+          myWorkers = value;
+          OnWorkersChanged();
+        }
+      }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="ThreadParallelEngine"/> with the number of processors
+    /// as number of worker threads.
+    /// </summary>
+    public ThreadParallelEngine() {
+      myWorkers = Environment.ProcessorCount;
+      currentOperators = new IOperator[1000];
+    }
+
+
+    /// <inheritdoc/>
+    /// <returns>The cloned object as <see cref="ThreadParallelEngine"/>.</returns>
+    public override object Clone(IDictionary<Guid, object> clonedObjects) {
+      ThreadParallelEngine clone = (ThreadParallelEngine)base.Clone(clonedObjects);
+      clone.myWorkers = Workers;
+      return clone;
+    }
+
+    /// <summary>
+    /// Creates a new instance of <see cref="ThreadParallelEngineEditor"/> to display the current 
+    /// instance.
+    /// </summary>
+    /// <returns>The created instance as <see cref="ThreadParallelEngineEditor"/>.</returns>
+    public override IView CreateView() {
+      return new ThreadParallelEngineEditor(this);
+    }
+    /// <summary>
+    /// Creates a new instance of <see cref="ThreadParallelEngineEditor"/>.
+    /// </summary>
+    /// <returns>The created instance as <see cref="ThreadParallelEngineEditor"/>.</returns>
+    public virtual IEditor CreateEditor() {
+      return new ThreadParallelEngineEditor(this);
+    }
+
+    /// <summary>
+    /// This execution method is not supported by ThreadParallelEngines.
+    /// </summary>
+    /// <exception cref="InvalidOperationException">Thrown because the current instance of an engine
+    /// does not support stepwise execution.</exception>
+    /// <param name="steps">The number of steps to execute.</param>
+    public override void ExecuteSteps(int steps) {
+      throw new InvalidOperationException("ThreadParallelEngine doesn't support stepwise execution");
+    }
+
+    /// <inheritdoc/>
+    public override void Abort() {
+      base.Abort();
+      for (int i = 0; i < currentOperators.Length; i++) {
+        if (currentOperators[i] != null)
+          currentOperators[i].Abort();
+      }
+    }
+    /// <summary>
+    /// Processes the next operation (if it is a compositeOperation and it can be executed in parallel it is 
+    /// done).
+    /// </summary>
+    protected override void ProcessNextOperation() {
+      operatorIndex = 1;
+      ProcessNextOperation(myExecutionStack, 0);
+    }
+    private void ProcessNextOperation(Stack<IOperation> stack, int currentOperatorIndex) {
+      IOperation operation = stack.Pop();
+      if (operation is AtomicOperation) {
+        AtomicOperation atomicOperation = (AtomicOperation)operation;
+        IOperation next = null;
+        try {
+          currentOperators[currentOperatorIndex] = atomicOperation.Operator;
+          next = atomicOperation.Operator.Execute(atomicOperation.Scope);
+        }
+        catch (Exception ex) {
+          // push operation on stack again
+          stack.Push(atomicOperation);
+          Abort();
+          ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(ex); });
+        }
+        if (next != null)
+          stack.Push(next);
+        OnOperationExecuted(atomicOperation);
+        if (atomicOperation.Operator.Breakpoint) Abort();
+      } else if (operation is CompositeOperation) {
+        CompositeOperation compositeOperation = (CompositeOperation)operation;
+        if (compositeOperation.ExecuteInParallel) {
+          TaskList list = new TaskList();
+          list.tasks = new Stack<IOperation>[compositeOperation.Operations.Count];
+          for (int i = 0; i < list.tasks.Length; i++) {
+            list.tasks[i] = new Stack<IOperation>();
+            list.tasks[i].Push(compositeOperation.Operations[i]);
+          }
+          list.next = 0;
+          list.semaphore = new Semaphore(0, Workers);
+
+          for (int i = 0; i < Workers; i++)
+            ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessParallelOperation), list);
+          for (int i = 0; i < Workers; i++)
+            list.semaphore.WaitOne();
+          list.semaphore.Close();
+
+          if (Canceled) {
+            // write back not finished tasks
+            CompositeOperation remaining = new CompositeOperation();
+            remaining.ExecuteInParallel = true;
+            for (int i = 0; i < list.tasks.Length; i++) {
+              if (list.tasks[i].Count > 0) {
+                CompositeOperation task = new CompositeOperation();
+                while (list.tasks[i].Count > 0)
+                  task.AddOperation(list.tasks[i].Pop());
+                remaining.AddOperation(task);
+              }
+            }
+            if (remaining.Operations.Count > 0)
+              stack.Push(remaining);
+          }
+        } else {
+          for (int i = compositeOperation.Operations.Count - 1; i >= 0; i--)
+            stack.Push(compositeOperation.Operations[i]);
+        }
+      }
+    }
+    private void ProcessParallelOperation(object state) {
+      TaskList list = (TaskList)state;
+      int currentOperatorIndex, next;
+
+      do {
+        lock (currentOperators) {
+          currentOperatorIndex = operatorIndex;
+          operatorIndex++;
+        }
+        lock (list) {
+          next = list.next;
+          list.next++;
+        }
+
+        if (next < list.tasks.Length) {
+          Stack<IOperation> stack = list.tasks[next];
+          while ((!Canceled) && (stack.Count > 0))
+            ProcessNextOperation(stack, currentOperatorIndex);
+        }
+      } while ((!Canceled) && (next < list.tasks.Length));
+      list.semaphore.Release();
+    }
+
+    /// <summary>
+    /// Occurs when the number of workers has been changed.
+    /// </summary>
+    public event EventHandler WorkersChanged;
+    /// <summary>
+    /// Fires a new <c>WorkersChanged</c> event.
+    /// </summary>
+    protected virtual void OnWorkersChanged() {
+      if (WorkersChanged != null)
+        WorkersChanged(this, new EventArgs());
+    }
+
+    #region Persistence Methods
+    /// <summary>
+    /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.
+    /// </summary>
+    /// <remarks>The number of workers is saved as <see cref="XmlAttribute"/> with attribute name 
+    /// <c>Workers</c>.</remarks>
+    /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>
+    /// <param name="document">The <see cref="XmlDocument"/> where the data is saved.</param>
+    /// <param name="persistedObjects">The dictionary of all already persisted objects. 
+    /// (Needed to avoid cycles.)</param>
+    /// <returns>The saved <see cref="XmlNode"/>.</returns>
+    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
+      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
+      XmlAttribute workersAttribute = document.CreateAttribute("Workers");
+      workersAttribute.Value = Workers.ToString();
+      node.Attributes.Append(workersAttribute);
+      return node;
+    }
+    /// <summary>
+    /// Loads the persisted engine from the specified <paramref name="node"/>.
+    /// </summary>
+    /// <remarks>The number of workers must be saved in a specific way, see <see cref="GetXmlNode"/>
+    /// for further information.</remarks>
+    /// <param name="node">The <see cref="XmlNode"/> where the instance is saved.</param>
+    /// <param name="restoredObjects">The dictionary of all already restored objects. 
+    /// (Needed to avoid cycles.)</param>
+    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
+      base.Populate(node, restoredObjects);
+      myWorkers = int.Parse(node.Attributes["Workers"].Value);
+    }
+    #endregion
+  }
+}
Index: trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/ThreadParallelEngineEditor.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/ThreadParallelEngineEditor.Designer.cs	(revision 1867)
+++ trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/ThreadParallelEngineEditor.Designer.cs	(revision 1867)
@@ -0,0 +1,134 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.ThreadParallelEngine {
+  partial class ThreadParallelEngineEditor {
+    /// <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.workersNumericUpDown = new System.Windows.Forms.NumericUpDown();
+      this.workersLabel = new System.Windows.Forms.Label();
+      this.splitContainer1.Panel1.SuspendLayout();
+      this.splitContainer1.Panel2.SuspendLayout();
+      this.splitContainer1.SuspendLayout();
+      this.operatorGraphGroupBox.SuspendLayout();
+      this.globalScopeGroupBox.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.workersNumericUpDown)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // executionTimeTextBox
+      // 
+      this.executionTimeTextBox.TabIndex = 7;
+      // 
+      // executionTimeLabel
+      // 
+      this.executionTimeLabel.TabIndex = 6;
+      // 
+      // splitContainer1
+      // 
+      // 
+      // workersNumericUpDown
+      // 
+      this.workersNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+      this.workersNumericUpDown.Location = new System.Drawing.Point(406, 460);
+      this.workersNumericUpDown.Maximum = new decimal(new int[] {
+            10000,
+            0,
+            0,
+            0});
+      this.workersNumericUpDown.Minimum = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+      this.workersNumericUpDown.Name = "workersNumericUpDown";
+      this.workersNumericUpDown.Size = new System.Drawing.Size(87, 20);
+      this.workersNumericUpDown.TabIndex = 5;
+      this.workersNumericUpDown.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+      this.workersNumericUpDown.ValueChanged += new System.EventHandler(this.workersNumericUpDown_ValueChanged);
+      // 
+      // workersLabel
+      // 
+      this.workersLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+      this.workersLabel.AutoSize = true;
+      this.workersLabel.Location = new System.Drawing.Point(403, 444);
+      this.workersLabel.Name = "workersLabel";
+      this.workersLabel.Size = new System.Drawing.Size(87, 13);
+      this.workersLabel.TabIndex = 4;
+      this.workersLabel.Text = "&Worker Threads:";
+      // 
+      // ThreadParallelEngineEditor
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.workersNumericUpDown);
+      this.Controls.Add(this.workersLabel);
+      this.Name = "ThreadParallelEngineEditor";
+      this.Controls.SetChildIndex(this.workersLabel, 0);
+      this.Controls.SetChildIndex(this.workersNumericUpDown, 0);
+      this.Controls.SetChildIndex(this.executionTimeLabel, 0);
+      this.Controls.SetChildIndex(this.executeButton, 0);
+      this.Controls.SetChildIndex(this.abortButton, 0);
+      this.Controls.SetChildIndex(this.resetButton, 0);
+      this.Controls.SetChildIndex(this.splitContainer1, 0);
+      this.Controls.SetChildIndex(this.executionTimeTextBox, 0);
+      this.splitContainer1.Panel1.ResumeLayout(false);
+      this.splitContainer1.Panel2.ResumeLayout(false);
+      this.splitContainer1.ResumeLayout(false);
+      this.operatorGraphGroupBox.ResumeLayout(false);
+      this.globalScopeGroupBox.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.workersNumericUpDown)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.NumericUpDown workersNumericUpDown;
+    private System.Windows.Forms.Label workersLabel;
+
+  }
+}
Index: trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/ThreadParallelEngineEditor.cs
===================================================================
--- trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/ThreadParallelEngineEditor.cs	(revision 1867)
+++ trunk/sources/HeuristicLab.ThreadParallelEngine/3.3/ThreadParallelEngineEditor.cs	(revision 1867)
@@ -0,0 +1,112 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.ThreadParallelEngine {
+  /// <summary>
+  /// Visual representation of a <see cref="ThreadParallelEngine"/>.
+  /// </summary>
+  public partial class ThreadParallelEngineEditor : EngineBaseEditor {
+    /// <summary>
+    /// Gets or sets the ThreadParallelEngine to display.
+    /// </summary>
+    /// <remarks>Uses property <see cref="EngineBaseEditor.Engine"/> of base class 
+    /// <see cref="EngineBaseEditor"/>. No own data storage present.</remarks>
+    public ThreadParallelEngine ThreadParallelEngine {
+      get { return (ThreadParallelEngine)Engine; }
+      set { base.Engine = value; }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="ThreadParallelEngineEditor"/>.
+    /// </summary>
+    public ThreadParallelEngineEditor() {
+      InitializeComponent();
+    }
+    /// <summary>
+    /// Initializes a new instance of <see cref="ThreadParallelEngineEditor"/> with the given
+    /// <paramref name="threadParallelEngine"/> to display.
+    /// </summary>
+    /// <param name="threadParallelEngine">The engine to represent visually.</param>
+    public ThreadParallelEngineEditor(ThreadParallelEngine threadParallelEngine)
+      : this() {
+      ThreadParallelEngine = threadParallelEngine;
+    }
+
+    /// <summary>
+    /// Removes the eventhandlers from the underlying <see cref="ThreadParallelEngine"/>.
+    /// </summary>
+    /// <remarks>Calls <see cref="EngineBaseEditor.RemoveItemEvents"/> of base class 
+    /// <see cref="EngineBaseEditor"/>.
+    /// </remarks>
+    protected override void RemoveItemEvents() {
+      ThreadParallelEngine.WorkersChanged -= new EventHandler(ThreadParallelEngine_WorkersChanged);
+      base.RemoveItemEvents();
+    }
+
+    /// <summary>
+    /// Adds eventhandlers to the underlying <see cref="ThreadParallelEngine"/>.
+    /// </summary>
+    /// <remarks>Calls <see cref="EngineBaseEditor.AddItemEvents"/> of base class 
+    /// <see cref="EngineBaseEditor"/>.
+    /// </remarks>
+    protected override void AddItemEvents() {
+      base.AddItemEvents();
+      ThreadParallelEngine.WorkersChanged += new EventHandler(ThreadParallelEngine_WorkersChanged);
+    }
+
+    /// <summary>
+    /// Updates the controls with the latest data.
+    /// </summary>
+    /// <remarks>Calls <see cref="EngineBaseEditor.UpdateControls"/> of base class 
+    /// <see cref="EngineBaseEditor"/>.</remarks>
+    protected override void UpdateControls() {
+      base.UpdateControls();
+      if (ThreadParallelEngine == null) {
+        workersNumericUpDown.Value = 1;
+        workersNumericUpDown.Enabled = false;
+      } else {
+        workersNumericUpDown.Value = ThreadParallelEngine.Workers;
+        workersNumericUpDown.Enabled = true;
+      }
+    }
+
+    #region ThreadParallelEngine Events
+    private void ThreadParallelEngine_WorkersChanged(object sender, EventArgs e) {
+      workersNumericUpDown.Value = ThreadParallelEngine.Workers;
+    }
+    #endregion
+
+    #region NumericUpDown Events
+    private void workersNumericUpDown_ValueChanged(object sender, EventArgs e) {
+      ThreadParallelEngine.Workers = (int)workersNumericUpDown.Value;
+    }
+    #endregion
+  }
+}
