Index: trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs	(revision 5356)
+++ trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs	(revision 5366)
@@ -239,13 +239,5 @@
     }
     private IslandOffspringSelectionGeneticAlgorithmMainLoop MainLoop {
-      get {
-        return (IslandOffspringSelectionGeneticAlgorithmMainLoop)(
-          (ResultsCollector)(
-            (UniformSubScopesProcessor)(
-              (VariableCreator)IslandProcessor.Successor
-            ).Successor
-          ).Successor
-        ).Successor;
-      }
+      get { return FindMainLoop(IslandProcessor.Successor); }
     }
     [Storable]
@@ -625,4 +617,11 @@
       Analyzer.Operators.Add(selectionPressureAnalyzer);
     }
+    private IslandOffspringSelectionGeneticAlgorithmMainLoop FindMainLoop(IOperator start) {
+      IOperator mainLoop = start;
+      while (mainLoop != null && !(mainLoop is IslandOffspringSelectionGeneticAlgorithmMainLoop))
+        mainLoop = ((SingleSuccessorOperator)mainLoop).Successor;
+      if (mainLoop == null) return null;
+      else return (IslandOffspringSelectionGeneticAlgorithmMainLoop)mainLoop;
+    }
     #endregion
   }
Index: trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs	(revision 5356)
+++ trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs	(revision 5366)
@@ -191,11 +191,5 @@
     }
     private OffspringSelectionGeneticAlgorithmMainLoop MainLoop {
-      get {
-        return (OffspringSelectionGeneticAlgorithmMainLoop)(
-          (ResultsCollector)(
-            (SubScopesCounter)SolutionsCreator.Successor
-          ).Successor
-        ).Successor;
-      }
+      get { return FindMainLoop(SolutionsCreator.Successor); }
     }
     [Storable]
@@ -469,4 +463,11 @@
       Analyzer.Operators.Add(selectionPressureAnalyzer);
     }
+    private OffspringSelectionGeneticAlgorithmMainLoop FindMainLoop(IOperator start) {
+      IOperator mainLoop = start;
+      while (mainLoop != null && !(mainLoop is OffspringSelectionGeneticAlgorithmMainLoop))
+        mainLoop = ((SingleSuccessorOperator)mainLoop).Successor;
+      if (mainLoop == null) return null;
+      else return (OffspringSelectionGeneticAlgorithmMainLoop)mainLoop;
+    }
     #endregion
   }
Index: trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs	(revision 5356)
+++ trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs	(revision 5366)
@@ -215,13 +215,5 @@
     }
     private SASEGASAMainLoop MainLoop {
-      get {
-        return (SASEGASAMainLoop)(
-          (ResultsCollector)(
-            (UniformSubScopesProcessor)(
-              (VariableCreator)VillageProcessor.Successor
-            ).Successor
-          ).Successor
-        ).Successor;
-      }
+      get { return FindMainLoop(VillageProcessor.Successor); }
     }
     [Storable]
@@ -563,4 +555,11 @@
       Analyzer.Operators.Add(selectionPressureAnalyzer);
     }
+    private SASEGASAMainLoop FindMainLoop(IOperator start) {
+      IOperator mainLoop = start;
+      while (mainLoop != null && !(mainLoop is SASEGASAMainLoop))
+        mainLoop = ((SingleSuccessorOperator)mainLoop).Successor;
+      if (mainLoop == null) return null;
+      else return (SASEGASAMainLoop)mainLoop;
+    }
     #endregion
   }
