Index: /trunk/sources/HeuristicLab.FixedOperators/3.2/FixedBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.FixedOperators/3.2/FixedBase.cs	(revision 1693)
+++ /trunk/sources/HeuristicLab.FixedOperators/3.2/FixedBase.cs	(revision 1693)
@@ -0,0 +1,67 @@
+﻿#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.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+
+namespace HeuristicLab.FixedOperators {
+  class FixedBase : CombinedOperator {
+
+    protected virtual void Execute(IOperator op, IScope scope){
+      IOperation operation;
+      IOperator currentOperator;
+      Stack<IOperation> executionStack = new Stack<IOperation>();
+      executionStack.Push(op.Execute(scope));
+
+      while (executionStack.Count > 0) {
+        operation = executionStack.Pop();
+        if (operation is AtomicOperation) {
+          AtomicOperation atomicOperation = (AtomicOperation)operation;
+          IOperation next = null;
+          try {
+            currentOperator = atomicOperation.Operator;
+            next = atomicOperation.Operator.Execute(atomicOperation.Scope);
+          }
+          catch (Exception) {
+            // push operation on stack again
+            executionStack.Push(atomicOperation);
+            //Abort();
+            //ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(ex); });
+            throw new InvalidOperationException("Invalid Operation occured in FixedBase.Execute");
+          }
+          if (next != null)
+            executionStack.Push(next);
+          //OnOperationExecuted(atomicOperation);
+          //if (atomicOperation.Operator.Breakpoint) Abort();
+        } else if (operation is CompositeOperation) {
+          CompositeOperation compositeOperation = (CompositeOperation)operation;
+          for (int i = compositeOperation.Operations.Count - 1; i >= 0; i--)
+            executionStack.Push(compositeOperation.Operations[i]);
+        } // else if
+      } // while
+    } // Execute
+
+  } // class FixedBase
+} // namespace HeuristicLab.FixedOperators
Index: /trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs
===================================================================
--- /trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs	(revision 1692)
+++ /trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs	(revision 1693)
@@ -35,5 +35,5 @@
 
 namespace HeuristicLab.FixedOperators {
-  class FixedSGAMain : CombinedOperator {
+  class FixedSGAMain : FixedBase {
     public override string Description {
       get { return @"Implements the functionality of SGAMain with fixed control structures. Operators like selection, crossover, mutation and evaluation are delegated."; }
@@ -61,5 +61,5 @@
 
 
-    long[] timesExecuteCreateChildren;
+    //long[] timesExecuteCreateChildren;
 
     public FixedSGAMain()
@@ -68,4 +68,6 @@
       AddVariableInfo(new VariableInfo("MaximumGenerations", "Maximum number of generations to create", typeof(IntData), VariableKind.In));
       AddVariableInfo(new VariableInfo("Generations", "Number of processed generations", typeof(IntData), VariableKind.In | VariableKind.Out));
+      AddVariableInfo(new VariableInfo("ExecutionPointer", "Execution pointer for algorithm abortion", typeof(IntData), VariableKind.New));
+
       Name = "FixedSGAMain";
 
@@ -140,47 +142,97 @@
       IntData nrOfGenerations = GetVariableValue<IntData>("Generations", scope, true);
 
+
+      // executionpointer saves the reentry point after engine abort occurs.
+      IntData executionPointer;
+      try 
+	    {
+    		executionPointer = GetVariableValue<IntData>("ExecutionPointer", scope, true);
+	    }
+	    catch (Exception)
+	    {
+        scope.AddVariable(new Variable("ExecutionPointer", new IntData(-1)));
+        executionPointer = GetVariableValue<IntData>("ExecutionPointer", scope, true);
+      }
+      
+      // fetch variables from scope for create children
       InitializeExecuteCreateChildren(scope);
-      Stopwatch watch = new Stopwatch();
-      long[] times = new long[10];
-      timesExecuteCreateChildren = new long[10];
       for (int i = nrOfGenerations.Data; i < maxGenerations.Data && !Canceled; i++) {
-        watch.Start();
-        selector.Execute(scope);
-        watch.Stop();
-        times[0] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        ExecuteCreateChildrenWithFixedControlStructures(scope.SubScopes[1]);
-        watch.Stop();
-        times[1] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        ExecuteCreateReplacementWithFixedConstrolStructures(scope);
-        watch.Stop();
-        times[2] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        ql.Execute(scope);
-        watch.Stop();
-        times[3] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        bawqc.Execute(scope);
-        watch.Stop();
-        times[4] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        dc.Execute(scope);
-        watch.Stop();
-        times[5] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        lci.Execute(scope);
-        watch.Stop();
-        times[6] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        nrOfGenerations.Data++;
-      }
+        if (Canceled) {
+          executionPointer.Data = -1;
+          continue;
+        }
+        if (executionPointer.Data < 0)
+          Execute(selector, scope);
+
+        if (Canceled) {
+          executionPointer.Data = 0;
+          continue;
+        }
+        if (executionPointer.Data < 1)
+          ExecuteCreateChildrenWithFixedControlStructures(scope.SubScopes[1]);
+
+        if (Canceled) {
+          executionPointer.Data = 1;
+          continue;
+        }
+        if (executionPointer.Data < 2)
+          ExecuteCreateReplacementWithFixedConstrolStructures(scope);
+
+        if (Canceled) {
+          executionPointer.Data = 2;
+          continue;
+        }
+        if (executionPointer.Data < 3) {
+          ql.Execute(scope);
+          bawqc.Execute(scope);
+          dc.Execute(scope);
+          lci.Execute(scope);
+          nrOfGenerations.Data++;
+        }
+        executionPointer.Data = -1;
+      } // for i
+
+      //Stopwatch watch = new Stopwatch();
+      //long[] times = new long[10];
+      //timesExecuteCreateChildren = new long[10];
+      //for (int i = nrOfGenerations.Data; i < maxGenerations.Data && !Canceled; i++) {
+      //  watch.Start();
+      //  selector.Execute(scope);
+      //  watch.Stop();
+      //  times[0] += watch.ElapsedTicks;
+      //  watch.Reset();
+      //  watch.Start();
+      //  ExecuteCreateChildrenWithFixedControlStructures(scope.SubScopes[1]);
+      //  watch.Stop();
+      //  times[1] += watch.ElapsedTicks;
+      //  watch.Reset();
+      //  watch.Start();
+      //  ExecuteCreateReplacementWithFixedConstrolStructures(scope);
+      //  watch.Stop();
+      //  times[2] += watch.ElapsedTicks;
+      //  watch.Reset();
+      //  watch.Start();
+      //  ql.Execute(scope);
+      //  watch.Stop();
+      //  times[3] += watch.ElapsedTicks;
+      //  watch.Reset();
+      //  watch.Start();
+      //  bawqc.Execute(scope);
+      //  watch.Stop();
+      //  times[4] += watch.ElapsedTicks;
+      //  watch.Reset();
+      //  watch.Start();
+      //  dc.Execute(scope);
+      //  watch.Stop();
+      //  times[5] += watch.ElapsedTicks;
+      //  watch.Reset();
+      //  watch.Start();
+      //  lci.Execute(scope);
+      //  watch.Stop();
+      //  times[6] += watch.ElapsedTicks;
+      //  watch.Reset();
+      //  watch.Start();
+      //  nrOfGenerations.Data++;
+      //}
 
       swApply.Stop();
@@ -215,9 +267,9 @@
       // UniformSequentialSubScopesProcessor
       foreach (IScope s in scope.SubScopes) {
-        crossover.Execute(s);
+        Execute(crossover, s);
         // Stochastic Branch
         if (random.NextDouble() < probability.Data)
-          mutator.Execute(s);
-        evaluator.Execute(s);
+          Execute(mutator, s);
+        Execute(evaluator, s);
         sr.Execute(s);
         counter.Execute(s);
Index: /trunk/sources/HeuristicLab.FixedOperators/3.2/HeuristicLab.FixedOperators-3.2.csproj
===================================================================
--- /trunk/sources/HeuristicLab.FixedOperators/3.2/HeuristicLab.FixedOperators-3.2.csproj	(revision 1692)
+++ /trunk/sources/HeuristicLab.FixedOperators/3.2/HeuristicLab.FixedOperators-3.2.csproj	(revision 1693)
@@ -71,4 +71,5 @@
     <Compile Include="CreateReplacement.cs" />
     <Compile Include="CreateChildrenHardWired.cs" />
+    <Compile Include="FixedBase.cs" />
     <Compile Include="FixedSGAMain.cs" />
     <Compile Include="HeuristicLabFixedOperatorsPlugin.cs" />
