Index: branches/HeuristicLab.GoalSeekingProblem/HeuristicLab.GoalSeekingProblem/3.4/GoalSeekingOptimizer.cs
===================================================================
--- branches/HeuristicLab.GoalSeekingProblem/HeuristicLab.GoalSeekingProblem/3.4/GoalSeekingOptimizer.cs	(revision 14380)
+++ branches/HeuristicLab.GoalSeekingProblem/HeuristicLab.GoalSeekingProblem/3.4/GoalSeekingOptimizer.cs	(revision 14383)
@@ -22,6 +22,6 @@
 using System;
 using System.Collections.Generic;
+using System.Drawing;
 using System.Linq;
-using System.Threading;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -31,4 +31,6 @@
 
 namespace HeuristicLab.GoalSeeking {
+  internal enum GoalSeekingOptimizerAction { None, Prepare, Start, Stop, Pause }
+
   [StorableClass]
   [Item("GoalSeeking Optimizer", "A wrapper for the GoalSeekingProblem class to facilitate adding models and problem data.")]
@@ -90,4 +92,6 @@
     }
 
+    private GoalSeekingOptimizerAction gsoAction;
+
     public GoalSeekingOptimizer() {
       Name = "Goal Seeking Optimizer";
@@ -136,17 +140,17 @@
 
     private int calculatedRows;
-    private readonly ManualResetEvent mutex = new ManualResetEvent(false);
     public void Start() {
       if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused))
         throw new InvalidOperationException(string.Format("Start not allowed in execution state \"{0}\".", ExecutionState));
       if (optimizer == null) return;
-
-      Prepare(clearRuns: true);
-
-      calculatedRows = 0;
-
-      var row = problemData.TrainingIndices.Skip(calculatedRows).First();
-      problem.Configure(problemData, row);
-      optimizer.Prepare();
+      gsoAction = GoalSeekingOptimizerAction.Start;
+      if (Optimizer.ExecutionState == ExecutionState.Stopped) {
+        Optimizer.Prepare(clearRuns: true);
+        calculatedRows = 0;
+
+        var row = problemData.TrainingIndices.Skip(calculatedRows).First();
+        problem.Configure(problemData, row);
+        optimizer.Prepare();
+      }
       optimizer.Start();
     }
@@ -156,4 +160,5 @@
         throw new InvalidOperationException(string.Format("Pause not allowed in execution state \"{0}\".", ExecutionState));
       if (optimizer == null) return;
+      gsoAction = GoalSeekingOptimizerAction.Pause;
       if (optimizer.ExecutionState != ExecutionState.Started) return;
       // a race-condition may occur when the algorithm has changed the state by itself in the meantime
@@ -166,4 +171,5 @@
         throw new InvalidOperationException(string.Format("Stop not allowed in execution state \"{0}\".", ExecutionState));
       if (optimizer == null) return;
+      gsoAction = GoalSeekingOptimizerAction.Stop;
       if (optimizer.ExecutionState != ExecutionState.Started && optimizer.ExecutionState != ExecutionState.Paused) {
         OnStopped();
@@ -185,4 +191,5 @@
         ExecutionTime = TimeSpan.Zero;
         if (clearRuns) optimizer.Runs.Clear();
+        gsoAction = GoalSeekingOptimizerAction.Prepare;
         // a race-condition may occur when the algorithm has changed the state by itself in the meantime
         try { optimizer.Prepare(clearRuns); }
@@ -220,4 +227,17 @@
     public string Filename { get; set; }
 
+    public new static Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
+    }
+    public override Image ItemImage {
+      get {
+        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunPrepared;
+        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunStarted;
+        else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunPaused;
+        else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunStopped;
+        else return base.ItemImage;
+      }
+    }
+
     #region Events
     protected override void OnNameChanged() {
@@ -241,4 +261,5 @@
     public event EventHandler Prepared;
     private void OnPrepared() {
+      gsoAction = GoalSeekingOptimizerAction.None;
       ExecutionState = ExecutionState.Prepared;
       EventHandler handler = Prepared;
@@ -255,4 +276,5 @@
     public event EventHandler Paused;
     private void OnPaused() {
+      gsoAction = GoalSeekingOptimizerAction.None;
       ExecutionState = ExecutionState.Paused;
       EventHandler handler = Paused;
@@ -262,4 +284,5 @@
     public event EventHandler Stopped;
     private void OnStopped() {
+      gsoAction = GoalSeekingOptimizerAction.None;
       ExecutionState = ExecutionState.Stopped;
       EventHandler handler = Stopped;
@@ -326,5 +349,6 @@
 
     private void Optimizer_Prepared(object sender, EventArgs e) {
-      if (ExecutionState == ExecutionState.Stopped) {
+      if (gsoAction == GoalSeekingOptimizerAction.Prepare || ExecutionState == ExecutionState.Stopped) {
+        calculatedRows = 0;
         ExecutionTime = TimeSpan.Zero;
         OnPrepared();
@@ -341,14 +365,17 @@
       calculatedRows++;
       ExecutionTime += optimizer.ExecutionTime;
-
       var remainingRows = problemData.TrainingIndices.Skip(calculatedRows);
-      if (remainingRows.Any()) {
+
+      if (gsoAction == GoalSeekingOptimizerAction.Stop) OnStopped();
+      else if (!remainingRows.Any()) OnStopped();
+      else if (gsoAction == GoalSeekingOptimizerAction.Pause) OnPaused();
+      else if (gsoAction == GoalSeekingOptimizerAction.Start) {
         var row = remainingRows.First();
         problem.Configure(problemData, row);
         optimizer.Prepare();
         optimizer.Start();
-      } else {
-        OnStopped();
-      }
+      } else if (ExecutionState == ExecutionState.Started) {
+        OnPaused();
+      } else OnStopped();
     }
     #endregion
Index: branches/HeuristicLab.GoalSeekingProblem/HeuristicLab.GoalSeekingProblem/3.4/GoalSeekingProblem.csproj
===================================================================
--- branches/HeuristicLab.GoalSeekingProblem/HeuristicLab.GoalSeekingProblem/3.4/GoalSeekingProblem.csproj	(revision 14380)
+++ branches/HeuristicLab.GoalSeekingProblem/HeuristicLab.GoalSeekingProblem/3.4/GoalSeekingProblem.csproj	(revision 14383)
@@ -124,4 +124,9 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\HeuristicLab trunk sources\binHeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
       <Private>False</Private>
     </Reference>
Index: branches/HeuristicLab.GoalSeekingProblem/HeuristicLab.GoalSeekingProblem/3.4/Properties/AssemblyInfo.cs
===================================================================
--- branches/HeuristicLab.GoalSeekingProblem/HeuristicLab.GoalSeekingProblem/3.4/Properties/AssemblyInfo.cs	(revision 14380)
+++ branches/HeuristicLab.GoalSeekingProblem/HeuristicLab.GoalSeekingProblem/3.4/Properties/AssemblyInfo.cs	(revision 14383)
@@ -54,3 +54,3 @@
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("3.3.0.0")]
-[assembly: AssemblyFileVersion("3.3.11.14379")]
+[assembly: AssemblyFileVersion("3.3.11.14380")]
