Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsGeneticAlgorithmMainLoop.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsGeneticAlgorithmMainLoop.cs	(revision 12161)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsGeneticAlgorithmMainLoop.cs	(revision 12162)
@@ -96,5 +96,4 @@
       var clearMatingPool = new SubScopesRemover() { Name = "Clear WorkingScope" };
       var tryMoveUp = new AlpsSsMover() { Name = "Try Move Up" };
-      var removeWorkingScope = new LeftReducer() { Name = "Remove Working Scope" };
       var incrementEvaluations = new IntCounter() { Name = "incr. EvaluatedSolutions" };
       var incrIterations = new IntCounter() { Name = "Incr. Iterations" };
@@ -207,7 +206,5 @@
       clearMatingPool.Successor = createRandomIndividual;
 
-      tryMoveUp.Successor = removeWorkingScope;
-
-      removeWorkingScope.Successor = incrementEvaluations;
+      tryMoveUp.Successor = incrementEvaluations;
 
       incrementEvaluations.Increment = new IntValue(1);
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsMover.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsMover.cs	(revision 12161)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsMover.cs	(revision 12162)
@@ -20,5 +20,4 @@
 #endregion
 
-using System;
 using System.Linq;
 using HeuristicLab.Common;
@@ -35,4 +34,7 @@
   [StorableClass]
   public class AlpsSsMover : SingleSuccessorOperator, IStochasticOperator {
+    private ILookupParameter<IntValue> LayerParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["Layer"]; }
+    }
     private ILookupParameter<IntValue> TargetIndexParameter {
       get { return (ILookupParameter<IntValue>)Parameters["TargetIndex"]; }
@@ -43,4 +45,10 @@
     private ILookupParameter<IntValue> NumberOfLayersParameter {
       get { return (ILookupParameter<IntValue>)Parameters["NumberOfLayers"]; }
+    }
+    private ILookupParameter<IScope> WorkingScopeParameter {
+      get { return (ILookupParameter<IScope>)Parameters["WorkingScope"]; }
+    }
+    private ILookupParameter<IScope> LayersParameter {
+      get { return (ILookupParameter<IScope>)Parameters["Layers"]; }
     }
     public ILookupParameter<IRandom> RandomParameter {
@@ -59,58 +67,49 @@
     public AlpsSsMover()
       : base() {
+      Parameters.Add(new LookupParameter<IntValue>("Layer"));
       Parameters.Add(new LookupParameter<IntValue>("TargetIndex"));
       Parameters.Add(new LookupParameter<IntValue>("PopulationSize"));
       Parameters.Add(new LookupParameter<IntValue>("NumberOfLayers"));
+      Parameters.Add(new LookupParameter<IScope>("WorkingScope"));
+      Parameters.Add(new LookupParameter<IScope>("Layers"));
       Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
     }
 
+    private int n;
+    private int m;
+    private IScope layers;
+    private IRandom rand;
     public override IOperation Apply() {
-      int i = ((IntValue)ExecutionContext.Scope.Variables["Layer"].Value).Value;
+      int i = LayerParameter.ActualValue.Value;
       int j = TargetIndexParameter.ActualValue.Value;
-      int n = NumberOfLayersParameter.ActualValue.Value;
-      int m = PopulationSizeParameter.ActualValue.Value;
-      var random = RandomParameter.ActualValue;
+      n = NumberOfLayersParameter.ActualValue.Value;
+      m = PopulationSizeParameter.ActualValue.Value;
+      rand = RandomParameter.ActualValue;
 
-      var layer = ExecutionContext.Scope.SubScopes[0];
-      var newIndividual = ExecutionContext.Scope.SubScopes[1];
-      var gs = ExecutionContext.Scope.Parent;
+      layers = LayersParameter.ActualValue;
+      var newIndividual = (IScope)WorkingScopeParameter.ActualValue.Clone();
+      newIndividual.Name = j.ToString();
 
-      if (i < n) {
-        TryMoveUp(gs, newIndividual, layer, i, j, n, m, random);
-        layer.SubScopes[j] = newIndividual;
-        newIndividual.Name = j.ToString();
-      }
+      TryMoveUp(i, j);
+      var currentLayer = layers.SubScopes[i];
+      currentLayer.SubScopes[j] = newIndividual;
 
       return base.Apply();
     }
+    private void TryMoveUp(int i, int j) {
+      var currentLayer = layers.SubScopes[i];
+      var currentIndividual = currentLayer.SubScopes[j];
+      if (i < n - 1) {
+        var nextLayer = layers.SubScopes[i + 1];
+        int? k = FindReplaceable(nextLayer, currentIndividual);
 
-    private void TryMoveUp(IScope gs, IScope individual, IScope layer, int i, int j, int n, int m, IRandom random) {
-      if (i < n) {
-        if (gs.SubScopes.Count <= i + 1) {
-          var newLayer = new Scope((i + 1).ToString());
-          newLayer.Variables.Add(new Variable("Layer", new IntValue(i + 1)));
-          newLayer.Variables.Add(new Variable("LayerPopulationSize", new IntValue(1)));
-          gs.SubScopes.Add(newLayer);
-        }
-
-        var higherLayer = gs.SubScopes[i + 1];
-        var replaceIndex = FindReplaceable(higherLayer, individual, random, m);
-        if (replaceIndex.HasValue) {
-          var replacedIndividual = layer.SubScopes[j];
-          if (replaceIndex.Value >= higherLayer.SubScopes.Count) {
-            higherLayer.SubScopes.Add(replacedIndividual);
-          } else {
-            TryMoveUp(gs, higherLayer.SubScopes[j], higherLayer, i + 1, replaceIndex.Value, n, m, random);
-            // TODO higherlayer[j] does not exist
-            higherLayer.SubScopes[replaceIndex.Value] = replacedIndividual;
-          }
+        if (k.HasValue) {
+          TryMoveUp(i + 1, k.Value);
+          nextLayer.SubScopes[k.Value] = currentIndividual;
         }
       }
     }
-
-    private int? FindReplaceable(IScope layer, IScope individual, IRandom random, int m) {
-      if (layer.SubScopes.Count < m)
-        return layer.SubScopes.Count;
-      return Enumerable.Range(0, layer.SubScopes.Count).SampleRandom(random);
+    private int? FindReplaceable(IScope layer, IScope individual) {
+      return Enumerable.Range(0, layer.SubScopes.Count).SampleRandom(rand);
     }
   }
