Index: branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LastScopeCloner.cs
===================================================================
--- branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerCreator.cs	(revision 13096)
+++ branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LastScopeCloner.cs	(revision 13124)
@@ -22,87 +22,55 @@
 using System;
 using System.Linq;
-using HeuristicLab.Analysis;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Data;
 using HeuristicLab.Operators;
-using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
 namespace HeuristicLab.Algorithms.ALPS {
-  [Item("LayerCreator", "An operator which creates a new layer by cloning the current oldest one.")]
+  [Item("LastScopeCloner", "An operator that creates a new scope by cloning the current last one.")]
   [StorableClass]
-  public sealed class LayerCreator : SingleSuccessorOperator {
-    private ILookupParameter<IntValue> OpenLayersParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["OpenLayers"]; }
-    }
-    public OperatorParameter NewLayerOperatorParameter {
-      get { return (OperatorParameter)Parameters["NewLayerOperator"]; }
+  public sealed class LastScopeCloner : SingleSuccessorOperator {
+    public OperatorParameter NewScopeOperatorParameter {
+      get { return (OperatorParameter)Parameters["NewScopeOperator"]; }
     }
 
-    public IOperator NewLayerOperator {
-      get { return NewLayerOperatorParameter.Value; }
-      set { NewLayerOperatorParameter.Value = value; }
+    public IOperator NewScopeOperator {
+      get { return NewScopeOperatorParameter.Value; }
+      set { NewScopeOperatorParameter.Value = value; }
     }
 
     [StorableConstructor]
-    private LayerCreator(bool deserializing) : base(deserializing) { }
+    private LastScopeCloner(bool deserializing) : base(deserializing) { }
 
-    private LayerCreator(LayerCreator original, Cloner cloner)
+    private LastScopeCloner(LastScopeCloner original, Cloner cloner)
       : base(original, cloner) {
     }
-    public LayerCreator()
-      : base() {
-      Parameters.Add(new LookupParameter<IntValue>("OpenLayers"));
-      Parameters.Add(new OperatorParameter("NewLayerOperator"));
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LastScopeCloner(this, cloner);
     }
 
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new LayerCreator(this, cloner);
+    public LastScopeCloner()
+      : base() {
+      Parameters.Add(new OperatorParameter("NewScopeOperator", "An Operator that is performed on the new scope."));
     }
 
     public override IOperation Apply() {
-      var layersScope = ExecutionContext.Scope.SubScopes;
-      if (layersScope.Count < 1)
+      var scopes = ExecutionContext.Scope.SubScopes;
+      if (scopes.Count < 1)
         throw new ArgumentException("At least one layer must exist.");
 
-      var newLayer = (IScope)layersScope.Last().Clone();
+      var newScope = (IScope)scopes.Last().Clone();
 
-      int number;
-      if (int.TryParse(newLayer.Name, out number))
-        newLayer.Name = (number + 1).ToString();
+      int scopeNumber;
+      if (int.TryParse(newScope.Name, out scopeNumber))
+        newScope.Name = (scopeNumber + 1).ToString();
 
-      layersScope.Add(newLayer);
+      scopes.Add(newScope);
 
-      // Set new layer number
-      newLayer.Variables["Layer"].Value = new IntValue(OpenLayersParameter.ActualValue.Value);
-
-      // Decrement ages, because MainOperator is goint to increment it
-      foreach (var solution in newLayer.SubScopes)
-        ((DoubleValue)solution.Variables["Age"].Value).Value -= 1;
-
-      // Reset existing values in the results to NaN to symbolize that no layer existed during that duration
-      var results = (ResultCollection)newLayer.Variables["LayerResults"].Value;
-      ResetResults(results);
 
       var next = new OperationCollection(base.Apply());
-      next.Insert(0, ExecutionContext.CreateChildOperation(NewLayerOperator, newLayer));
+      next.Insert(0, ExecutionContext.CreateChildOperation(NewScopeOperator, newScope));
       return next;
-    }
-
-    private void ResetResults(ResultCollection results) {
-      var values = results.Select(r => r.Value);
-
-      // Reset all values within results in results
-      foreach (var resultsCollection in values.OfType<ResultCollection>())
-        ResetResults(resultsCollection);
-
-      // Reset values
-      foreach (var dataTable in values.OfType<DataTable>()) {
-        foreach (var row in dataTable.Rows)
-          for (int i = 0; i < row.Values.Count; i++)
-            row.Values[i] = double.NaN;
-      }
     }
   }
