Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs	(revision 11608)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs	(revision 11609)
@@ -254,5 +254,5 @@
 
       layerVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Layer", new IntValue(0)));
-      layerVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection()));
+      //layerVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection()));
       layerVariableCreator.Successor = layerSolutionsCreator;
 
@@ -275,5 +275,5 @@
       initializeGlobalEvaluatedSolutions.Successor = resultsCollector;
 
-      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
       resultsCollector.Successor = mainLoop;
 
@@ -375,5 +375,4 @@
       MainLoop.LayerUpdator.SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
       MainLoop.LayerUpdator.SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
-
     }
     private void ParameterizeMainLoop() {
@@ -387,4 +386,5 @@
       MainLoop.EldersEmigrator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
       MainLoop.EldersEmigrator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+      MainLoop.LayerUpdator.SolutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
     }
     private void ParameterizeSelectors() {
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs	(revision 11608)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs	(revision 11609)
@@ -74,9 +74,9 @@
 
       var variableCreator = new VariableCreator() { Name = "Initialize" };
-      var resultsCollector = new ResultsCollector();
-      var initAnalyzerPlaceholder = new Placeholder() { Name = "Analyzer (Placeholder)" };
       var initLayerAnalyzerProcessor = new SubScopesProcessor();
       var layerVariableCreator = new VariableCreator() { Name = "Initialize Layer" };
       var initLayerAnalyzerPlaceholder = new Placeholder() { Name = "LayerAnalyzer (Placeholder)" };
+      var initAnalyzerPlaceholder = new Placeholder() { Name = "Analyzer (Placeholder)" };
+      var resultsCollector = new ResultsCollector();
       var matingPoolCreator = new MatingPoolCreator() { Name = "Create Mating Pools" };
       var matingPoolProcessor = new UniformSubScopesProcessor();
@@ -97,15 +97,8 @@
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastRefresh", new IntValue(0)));
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("OpenLayers", new IntValue(1)));
-      variableCreator.Successor = resultsCollector;
-
-      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
-      resultsCollector.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("LayerResults", "Result set for each layer", "Results"));
-      resultsCollector.Successor = initAnalyzerPlaceholder;
-
-      initAnalyzerPlaceholder.OperatorParameter.ActualName = AnalyzerParameter.Name;
-      initAnalyzerPlaceholder.Successor = initLayerAnalyzerProcessor;
+      variableCreator.Successor = initLayerAnalyzerProcessor;
 
       initLayerAnalyzerProcessor.Operators.Add(layerVariableCreator);
-      initLayerAnalyzerProcessor.Successor = matingPoolCreator;
+      initLayerAnalyzerProcessor.Successor = initAnalyzerPlaceholder;
 
       layerVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("LayerEvaluatedSolutions"));
@@ -115,4 +108,13 @@
       initLayerAnalyzerPlaceholder.OperatorParameter.ActualName = LayerAnalyzerParameter.Name;
       initLayerAnalyzerPlaceholder.Successor = null;
+
+      initAnalyzerPlaceholder.OperatorParameter.ActualName = AnalyzerParameter.Name;
+      initAnalyzerPlaceholder.Successor = resultsCollector;
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      resultsCollector.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("LayerResults", "Result set for each layer", "Results"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("OpenLayers"));
+      resultsCollector.CopyValue = new BoolValue(false);
+      resultsCollector.Successor = matingPoolCreator;
 
       matingPoolCreator.Successor = matingPoolProcessor;
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersSelector.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersSelector.cs	(revision 11608)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersSelector.cs	(revision 11609)
@@ -65,9 +65,9 @@
       int layer = LayerParameter.ActualValue.Value;
 
-      if (layer >= numberOfLayers) // is max layer?
+      if (layer >= numberOfLayers - 1) // is max layer?
         return new IScope[0];
 
       int limit = ageLimits[layer];
-      var elders =
+      var eldersQuery =
         from scope in scopes
         let age = ((IntValue)scope.Variables["Age"].Value).Value
@@ -75,5 +75,11 @@
         select scope;
 
-      return elders.ToArray();
+      var elders = eldersQuery.ToArray();
+
+      if (!CopySelected.Value)
+        foreach (var elder in elders)
+          scopes.Remove(elder);
+
+      return elders;
     }
   }
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/HeuristicLab.Algorithms.ALPS-3.3.csproj
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/HeuristicLab.Algorithms.ALPS-3.3.csproj	(revision 11608)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/HeuristicLab.Algorithms.ALPS-3.3.csproj	(revision 11609)
@@ -84,4 +84,5 @@
     <Compile Include="EldersSelector.cs" />
     <Compile Include="LastSubScopeCloner.cs" />
+    <Compile Include="LayerCreator.cs" />
     <Compile Include="LayerUpdator.cs" />
     <Compile Include="MatingPoolCreator.cs" />
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LastSubScopeCloner.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LastSubScopeCloner.cs	(revision 11608)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LastSubScopeCloner.cs	(revision 11609)
@@ -57,4 +57,8 @@
       var clone = (IScope)lastSubScope.Clone(new Cloner());
 
+      int number;
+      if (int.TryParse(clone.Name, out number))
+        clone.Name = (number + 1).ToString();
+
       scopes.Add(clone);
 
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerCreator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerCreator.cs	(revision 11609)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerCreator.cs	(revision 11609)
@@ -0,0 +1,91 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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 HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+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 oldest one and setting the variables accordingly.")]
+  [StorableClass]
+  public sealed class LayerCreator : SingleSuccessorOperator {
+
+    /*private static readonly ISet<string> SavedVariables = new HashSet<string>{
+      "LocalRandom", "Layer", "LayerEvaluatedSolutions", "NumSubScopes"
+    };*/
+
+    private ILookupParameter<IntValue> OpenLayersParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["OpenLayers"]; }
+    }
+
+    [StorableConstructor]
+    private LayerCreator(bool deserializing) : base(deserializing) { }
+
+    private LayerCreator(LayerCreator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public LayerCreator()
+      : base() {
+      Parameters.Add(new LookupParameter<IntValue>("OpenLayers"));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LayerCreator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var scopes = ExecutionContext.Scope.SubScopes;
+      if (scopes.Count < 1)
+        throw new ArgumentException("At least one sub-scope must exist.");
+
+      var lastSubScope = scopes.Last();
+      var clone = (IScope)lastSubScope.Clone(new Cloner());
+
+      int number;
+      if (int.TryParse(clone.Name, out number))
+        clone.Name = (number + 1).ToString();
+
+      scopes.Add(clone);
+
+      clone.Variables["Layer"].Value = new IntValue(OpenLayersParameter.ActualValue.Value);
+      foreach (var solution in clone.SubScopes)
+        ((IntValue)solution.Variables["Age"].Value).Value -= 1; // Decrement age, because MainOperator is goint to increment it
+      //foreach (var variable in clone.Variables.Where(v => !SavedVariables.Contains(v.Name)))
+      //  variable.Value = null;
+
+      //HACK: delete old values from quality table
+      /*var rows = ((DataTable)clone.Variables["Qualities"].Value).Rows;
+      var last = rows.Last();
+      rows.Clear();
+      rows.Add(last);*/
+
+      return base.Apply();
+    }
+
+  }
+}
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerUpdator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerUpdator.cs	(revision 11608)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerUpdator.cs	(revision 11609)
@@ -56,8 +56,12 @@
       var openNewLayerCalculator = new OpenNewLayerCalculator();
       var openNewLayerBranch = new ConditionalBranch() { Name = "OpenNewLayer?" };
-      var layerCloner = new LastSubScopeCloner() { Name = "Copy Lower Layer" };
+      //var layerCloner = new LastSubScopeCloner() { Name = "Copy Lower Layer" };
+      var layerCreator = new LayerCreator() { Name = "Create new Layer" };
       var incrOpenLayers = new IntCounter() { Name = "Incr. OpenLayers" };
+      var newLayerResultsCollector = new ResultsCollector() { Name = "Collect new Layer Results" };
       var newLayerProsessor = new LastSubScopeProcessor();
       var layerInitializer = new Assigner() { Name = "Init Layer" };
+      var correctAgeProcessor = new UniformSubScopesProcessor() { Name = "Hack: Decrement Age" };
+      var correctAgeDecrementor = new IntCounter() { Name = "Age = Age - 1" };
       var incrEvaluatedSolutionsForNewLayer = new SubScopesCounter() { Name = "Update EvaluatedSolutions" };
       var newResultCollectionAssigner = new Assigner() { Name = "Empty Results" };
@@ -94,19 +98,28 @@
 
       openNewLayerBranch.ConditionParameter.ActualName = "OpenNewLayer";
-      openNewLayerBranch.TrueBranch = layerCloner;
+      openNewLayerBranch.TrueBranch = layerCreator;
       openNewLayerBranch.Successor = regenerateLayerZeroProsessor;
 
-      layerCloner.Successor = newLayerProsessor;
+      //layerCloner.Successor = newLayerProsessor;
+      layerCreator.Successor = newLayerProsessor;
 
-      newLayerProsessor.Operator = layerInitializer;
+      //newLayerProsessor.Operator = layerInitializer;
+      newLayerProsessor.Operator = incrEvaluatedSolutionsForNewLayer;
       newLayerProsessor.Successor = incrOpenLayers;
 
       layerInitializer.LeftSideParameter.ActualName = "Layer";
       layerInitializer.RightSideParameter.ActualName = "OpenLayers";
-      layerInitializer.Successor = incrEvaluatedSolutionsForNewLayer;
+      layerInitializer.Successor = correctAgeProcessor;
+
+      correctAgeProcessor.Operator = correctAgeDecrementor;
+      correctAgeProcessor.Successor = incrEvaluatedSolutionsForNewLayer;
+
+      correctAgeDecrementor.Increment = new IntValue(-1);
+      correctAgeDecrementor.ValueParameter.ActualName = "Age";
 
       incrEvaluatedSolutionsForNewLayer.ValueParameter.ActualName = "EvaluatedSolutions";
       incrEvaluatedSolutionsForNewLayer.AccumulateParameter.Value = new BoolValue(true);
-      incrEvaluatedSolutionsForNewLayer.Successor = newResultCollectionAssigner;
+      //incrEvaluatedSolutionsForNewLayer.Successor = newResultCollectionAssigner;
+      incrEvaluatedSolutionsForNewLayer.Successor = mainOperator;
 
       newResultCollectionAssigner.LeftSideParameter.ActualName = "Results";
@@ -117,5 +130,9 @@
       incrOpenLayers.ValueParameter.ActualName = "OpenLayers";
       incrOpenLayers.Increment = new IntValue(1);
-      incrOpenLayers.Successor = null;
+      incrOpenLayers.Successor = newLayerResultsCollector;
+
+      newLayerResultsCollector.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("LayerResults", "Result set for each layer", "Results"));
+      newLayerResultsCollector.CopyValue = new BoolValue(false);
+      newLayerResultsCollector.Successor = null;
 
       regenerateLayerZeroProsessor.Operator = subScopesRemover;
@@ -137,5 +154,5 @@
 
       resetGenSlr.LeftSideParameter.ActualName = "GenerationsSinceLastRefresh";
-      resetGenSlr.RightSideParameter.Value = new IntValue(1);
+      resetGenSlr.RightSideParameter.Value = new IntValue(0);
       resetGenSlr.Successor = null;
     }
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MatingPoolCreator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MatingPoolCreator.cs	(revision 11608)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MatingPoolCreator.cs	(revision 11609)
@@ -45,5 +45,5 @@
       var subPopulations = ExecutionContext.Scope.SubScopes;
 
-      for (int i = subPopulations.Count - 1; i > 0; i++) {
+      for (int i = subPopulations.Count - 1; i > 0; i--) {
         var currentSubPopulation = subPopulations[i].SubScopes;
         var prevSubPopulation = subPopulations[i - 1].SubScopes;
