Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs	(revision 11585)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs	(revision 11586)
@@ -217,5 +217,5 @@
       Parameters.Add(new ValueParameter<AgingScheme>("AgingScheme", "The aging scheme for setting the age-limits for the layers.", new AgingScheme(AgingSchemes.Polynomial)));
       Parameters.Add(new ValueParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers", new IntValue(5)));
-      Parameters.Add(new ValueParameter<IntArray>("AgeLimits", new IntArray(new[] { 1, 20, 45, 80, 125 })) { Hidden = true });
+      Parameters.Add(new ValueParameter<IntArray>("AgeLimits", new IntArray(new[] { 5, 20, 45, 80, 125 })) { Hidden = true });
       Parameters.Add(new ValueParameter<ReductionOperation>("AgeInheritance", "The operator for determining the age of an offspring based the parents' age.", new ReductionOperation(ReductionOperations.Max)) { Hidden = true });
       Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
@@ -373,4 +373,7 @@
       SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
       SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+      MainLoop.EldersEmigrator.SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      MainLoop.EldersEmigrator.SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+
     }
     private void ParameterizeMainLoop() {
@@ -382,4 +385,6 @@
       MainLoop.MainOperator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
       MainLoop.MainOperator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+      MainLoop.EldersEmigrator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+      MainLoop.EldersEmigrator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
     }
     private void ParameterizeSelectors() {
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs	(revision 11585)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs	(revision 11586)
@@ -38,45 +38,6 @@
   public sealed class AlpsGeneticAlgorithmMainLoop : AlgorithmOperator {
     #region Parameter Properties
-    public ILookupParameter<IRandom> RandomParameter {
-      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
-    }
-    /*public ILookupParameter<BoolValue> MaximizationParameter {
-      get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; }
-    }
-    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
-      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
-    }
-    public ILookupParameter<DoubleValue> BestKnownQualityParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
-    }
-    public ILookupParameter<IOperator> EvaluatorParameter {
-      get { return (ILookupParameter<IOperator>)Parameters["Evaluator"]; }
-    }*/
-    public ILookupParameter<IntValue> PopulationSizeParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["PopulationSize"]; }
-    }
     public ILookupParameter<IntValue> MaximumGenerationsParameter {
       get { return (ILookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
-    }
-    public ILookupParameter<IOperator> SelectorParameter {
-      get { return (ILookupParameter<IOperator>)Parameters["Selector"]; }
-    }
-    public ILookupParameter<IOperator> CrossoverParameter {
-      get { return (ILookupParameter<IOperator>)Parameters["Crossover"]; }
-    }
-    public ILookupParameter<PercentValue> MutationProbabilityParameter {
-      get { return (ILookupParameter<PercentValue>)Parameters["MutationProbability"]; }
-    }
-    public ILookupParameter<IOperator> MutatorParameter {
-      get { return (ILookupParameter<IOperator>)Parameters["Mutator"]; }
-    }
-    public ILookupParameter<IntValue> ElitesParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["Elites"]; }
-    }
-    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
-      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
-    }
-    public ILookupParameter<ResultCollection> ResultsParameter {
-      get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; }
     }
     public ILookupParameter<IOperator> AnalyzerParameter {
@@ -91,4 +52,7 @@
       get { return OperatorGraph.Iterate().OfType<GeneticAlgorithmMainLoop>().First(); }
     }
+    public EldersEmigrator EldersEmigrator {
+      get { return OperatorGraph.Iterate().OfType<EldersEmigrator>().First(); }
+    }
 
     [StorableConstructor]
@@ -102,18 +66,5 @@
     public AlpsGeneticAlgorithmMainLoop()
       : base() {
-      Parameters.Add(new LookupParameter<IRandom>("Random", "A pseudo random number generator."));
-      /*Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
-      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
-      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
-      Parameters.Add(new LookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions."));*/
-      Parameters.Add(new LookupParameter<IntValue>("PopulationSize", "The size of the population of solutions."));
       Parameters.Add(new LookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations that the algorithm should process."));
-      Parameters.Add(new LookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
-      Parameters.Add(new LookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
-      Parameters.Add(new LookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
-      Parameters.Add(new LookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
-      Parameters.Add(new LookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
-      Parameters.Add(new LookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
-      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The results collection to store the results."));
       Parameters.Add(new LookupParameter<IOperator>("Analyzer", "The operator used to the analyze all individuals."));
       Parameters.Add(new LookupParameter<IOperator>("LayerAnalyzer", "The operator used to analyze each layer."));
@@ -126,10 +77,10 @@
       var matingPoolCreator = new MatingPoolCreator() { Name = "Create Mating Pools" };
       var matingPoolProcessor = new UniformSubScopesProcessor();
-      var mainOperator = PrepareGeneticAlgorithmMainLoop();
+      var mainOperator = CreatePreparedGeneticAlgorithmMainLoop();
       var layerAnalyzerPlaceholder = new Placeholder() { Name = "LayerAnalyzer (Placeholder)" };
       var generationsIcrementor = new IntCounter() { Name = "Increment Generations" };
       var evaluatedSolutionsReducer = new DataReducer() { Name = "Increment EvaluatedSolutions" };
       var eldersEmigrator = new EldersEmigrator() { Name = "Emigrate Elders" };
-      var layerUpdator = new CombinedOperator() { Name = "Update Layers" };
+      var layerUpdator = new LayerUpdator(mainOperator) { Name = "Update Layers" };
       var analyzerPlaceholder = new Placeholder() { Name = "Analyzer (Placeholder)" };
       var generationsComparator = new Comparator() { Name = "Generations >= MaximumGenerations" };
@@ -140,4 +91,5 @@
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastRefresh", new IntValue(0)));
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("OpenLayers", new IntValue(1)));
       variableCreator.Successor = resultsCollector;
 
@@ -193,5 +145,5 @@
     }
 
-    private GeneticAlgorithmMainLoop PrepareGeneticAlgorithmMainLoop() {
+    private GeneticAlgorithmMainLoop CreatePreparedGeneticAlgorithmMainLoop() {
       var mainLoop = new GeneticAlgorithmMainLoop();
       var selector = mainLoop.OperatorGraph.Iterate().OfType<Placeholder>().First(o => o.OperatorParameter.ActualName == "Selector");
@@ -228,8 +180,4 @@
         stochasticBranch.RandomParameter.ActualName = "LocalRandom";
 
-      // Remove unnessesary subtrees
-      //foreach (var @operator in mainLoop.OperatorGraph.Operators.OfType<SingleSuccessorOperator>().Where(o => o.Successor == selector))
-      //  @operator.Successor = null;
-
       return mainLoop;
     }
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersEmigrator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersEmigrator.cs	(revision 11585)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersEmigrator.cs	(revision 11586)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -32,5 +33,16 @@
   [Item("EldersEmigrator", "Moves Individuals which are too old for its current layer up to the next layer.")]
   [StorableClass]
-  public class EldersEmigrator : AlgorithmOperator {
+  public sealed class EldersEmigrator : AlgorithmOperator {
+
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+
+    public SolutionsCreator SolutionsCreator {
+      get { return OperatorGraph.Iterate().OfType<SolutionsCreator>().First(); }
+    }
 
     [StorableConstructor]
@@ -44,4 +56,7 @@
     public EldersEmigrator()
       : base() {
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
+
       var selectorProsessor = new UniformSubScopesProcessor();
       var eldersSelector = new EldersSelector();
@@ -50,5 +65,7 @@
       var mergingReducer = new MergingReducer();
       var subScopesCounter = new SubScopesCounter();
-      var countCalculator = new ExpressionCalculator() { Name = "Count = Min(NumSubScopes, PopulationSize)" };
+      // TODO: if expression calculator supports int, use expression calculator
+      var countCalculator = new MergingReducerCalculator() { Name = "NumSubScopes = Min(NumSubScopes, PopulationSize)" };
+      //var countCalculator = new ExpressionCalculator() { Name = "NumSubScopes = Min(NumSubScopes, PopulationSize)" };
       var bestSelector = new BestSelector();
       var rightReducer = new RightReducer();
@@ -73,11 +90,13 @@
       subScopesCounter.Successor = countCalculator;
 
-      countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize"));
-      countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("NumSubScopes"));
-      countCalculator.ExpressionParameter.Value = new StringValue("NumSubScopes PopulationSize NumSubScopes < PopulationSize if");
-      countCalculator.ExpressionResultParameter.ActualName = "Count";
+      //countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize"));
+      //countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("NumSubScopes"));
+      //countCalculator.ExpressionParameter.Value = new StringValue("NumSubScopes PopulationSize NumSubScopes PopulationSize < if");
+      //countCalculator.ExpressionResultParameter.ActualName = "NumSubScopes";
       countCalculator.Successor = bestSelector;
 
-      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "Count";
+      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "NumSubScopes";
+      bestSelector.QualityParameter.ActualName = QualityParameter.Name;
+      bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
       bestSelector.Successor = rightReducer;
 
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersSelector.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersSelector.cs	(revision 11585)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersSelector.cs	(revision 11586)
@@ -33,5 +33,5 @@
   [Item("EldersSelector", "Select all individuals which are to old for their current layer.")]
   [StorableClass]
-  public class EldersSelector : SingleObjectiveSelector {
+  public sealed class EldersSelector : SingleObjectiveSelector {
 
     private ILookupParameter<IntArray> AgeLimitsParameter {
@@ -40,4 +40,7 @@
     private ILookupParameter<IntValue> NumberOfLayersParameter {
       get { return (ILookupParameter<IntValue>)Parameters["NumberOfLayers"]; }
+    }
+    private ILookupParameter<IntValue> LayerParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["Layer"]; }
     }
 
@@ -53,4 +56,6 @@
       : base() {
       Parameters.Add(new LookupParameter<IntArray>("AgeLimits"));
+      Parameters.Add(new LookupParameter<IntValue>("NumberOfLayers"));
+      Parameters.Add(new LookupParameter<IntValue>("Layer"));
     }
 
@@ -58,8 +63,7 @@
       var ageLimits = AgeLimitsParameter.ActualValue;
       int numberOfLayers = NumberOfLayersParameter.ActualValue.Value;
+      int layer = LayerParameter.ActualValue.Value;
 
-      int layer = ((IntValue)CurrentScope.Variables["Layer"]).Value;
-
-      if (layer >= numberOfLayers)
+      if (layer >= numberOfLayers) // is max layer?
         return new IScope[0];
 
@@ -67,5 +71,5 @@
       var elders =
         from scope in scopes
-        let age = ((IntValue)scope.Variables["Age"]).Value
+        let age = ((IntValue)scope.Variables["Age"].Value).Value
         where age > limit
         select scope;
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 11585)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/HeuristicLab.Algorithms.ALPS-3.3.csproj	(revision 11586)
@@ -83,5 +83,8 @@
     <Compile Include="EldersEmigrator.cs" />
     <Compile Include="EldersSelector.cs" />
+    <Compile Include="LayerUpdator.cs" />
     <Compile Include="MatingPoolCreator.cs" />
+    <Compile Include="OpenNewLayerCalculator.cs" />
+    <Compile Include="MergingReducerCalculator.cs" />
     <Compile Include="Plugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerUpdator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerUpdator.cs	(revision 11586)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerUpdator.cs	(revision 11586)
@@ -0,0 +1,132 @@
+﻿#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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.ALPS {
+  [Item("LayerUpdator", "Operator which manages the reseeding and creation of layers.")]
+  [StorableClass]
+  public class LayerUpdator : AlgorithmOperator {
+
+    [StorableConstructor]
+    private LayerUpdator(bool deserializing)
+      : base(deserializing) { }
+    private LayerUpdator(LayerUpdator original, Cloner cloner)
+      : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LayerUpdator(this, cloner);
+    }
+    public LayerUpdator(IOperator mainOperator)
+      : base() {
+      var incGenSlr = new IntCounter() { Name = "Incr. GenerationsSinceLastRefresh" };
+      var genSlrEqAgeGap = new Comparator() { Name = "GenerationsSinceLastRefresh >= AgeGap" };
+      var updateLayersBranch = new ConditionalBranch() { Name = "UpdateLayers?" };
+      // TODO: if expression calculator supports array indexing, use expression calculator
+      //var openNewLayerCalculator = new ExpressionCalculator();
+      var openNewLayerCalculator = new OpenNewLayerCalculator();
+      var openNewLayerBranch = new ConditionalBranch() { Name = "OpenNewLayer?" };
+      var incrOpenLayers = new IntCounter() { Name = "Incr. OpenLayers" };
+      var layerScopeCreator = new SubScopesCreator();
+      var newLayerProsessor = new LastSubScopeProcessor();
+      var localRandomCreator = new LocalRandomCreator();
+      var layerVariableCreator = new Assigner() { Name = "Init Layer" };
+      var copyPrevSubScope = new CombinedOperator() { Name = "Copy lower layer" };
+      //var mainOperator = new CombinedOperator() { Name = "Create Offsprings" };
+      var regenerateLayerZeroProsessor = new FirstSubScopeProcessor();
+      var subScopesRemover = new SubScopesRemover();
+      var solutionsCreator = new SolutionsCreator();
+      var initializeAgeProsessor = new UniformSubScopesProcessor();
+      var initializeAge = new VariableCreator() { Name = "Initialize Age" };
+      var incrEvaluatedSolutions = new SubScopesCounter() { Name = "Update EvaluatedSolutions" };
+      var resetGenSlr = new Assigner() { Name = "Reset GenerationsSinceLastRefresh" };
+
+      OperatorGraph.InitialOperator = incGenSlr;
+
+      incGenSlr.ValueParameter.ActualName = "GenerationsSinceLastRefresh";
+      incGenSlr.Increment = new IntValue(1);
+      incGenSlr.Successor = genSlrEqAgeGap;
+
+      genSlrEqAgeGap.LeftSideParameter.ActualName = "GenerationsSinceLastRefresh";
+      genSlrEqAgeGap.RightSideParameter.ActualName = "AgeGap";
+      genSlrEqAgeGap.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      genSlrEqAgeGap.ResultParameter.ActualName = "UpdateLayers";
+      genSlrEqAgeGap.Successor = updateLayersBranch;
+
+      updateLayersBranch.ConditionParameter.ActualName = "Updatelayers";
+      updateLayersBranch.TrueBranch = openNewLayerCalculator;
+
+      //openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      //openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>("AgeGap"));
+      //openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>("OpenLayers"));
+      //openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>("NumberOfLayers"));
+      //openNewLayerCalculator.ExpressionParameter.Value = new StringValue("Generations AgeLimits [] OpenedLayers 1 - 1 + = false OpenLayers NumberOfLayers < if");
+      //openNewLayerCalculator.ExpressionResultParameter.ActualName = "OpenNewLayer";
+      openNewLayerCalculator.Successor = openNewLayerBranch;
+
+      openNewLayerBranch.ConditionParameter.ActualName = "OpenNewLayer";
+      openNewLayerBranch.TrueBranch = incrOpenLayers;
+      openNewLayerBranch.Successor = regenerateLayerZeroProsessor;
+
+      incrOpenLayers.ValueParameter.ActualName = "OpenLayers";
+      incrOpenLayers.Increment = new IntValue(1);
+      incrOpenLayers.Successor = layerScopeCreator;
+
+      layerScopeCreator.NumberOfSubScopesParameter.Value = new IntValue(1);
+      layerScopeCreator.Successor = newLayerProsessor;
+
+      newLayerProsessor.Operator = localRandomCreator;
+
+      localRandomCreator.Successor = layerVariableCreator;
+
+      layerVariableCreator.LeftSideParameter.ActualName = "Layer";
+      layerVariableCreator.RightSideParameter.ActualName = "Layer";
+      layerVariableCreator.Successor = copyPrevSubScope;
+
+      copyPrevSubScope.Successor = mainOperator;
+
+      regenerateLayerZeroProsessor.Operator = subScopesRemover;
+      regenerateLayerZeroProsessor.Successor = resetGenSlr;
+
+      subScopesRemover.Successor = solutionsCreator;
+
+      solutionsCreator.Successor = initializeAgeProsessor;
+
+      initializeAgeProsessor.Operator = initializeAge;
+      initializeAgeProsessor.Successor = incrEvaluatedSolutions;
+
+      initializeAge.CollectedValues.Add(new ValueParameter<IntValue>("Age", new IntValue(0)));
+      initializeAge.Successor = null;
+
+      incrEvaluatedSolutions.ValueParameter.ActualName = "EvaluatedSolutions";
+      incrEvaluatedSolutions.Successor = null;
+
+      resetGenSlr.LeftSideParameter.ActualName = "GenerationsSinceLastRefresh";
+      resetGenSlr.RightSideParameter.Value = new IntValue(1);
+      resetGenSlr.Successor = null;
+    }
+  }
+}
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MatingPoolCreator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MatingPoolCreator.cs	(revision 11585)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MatingPoolCreator.cs	(revision 11586)
@@ -20,5 +20,4 @@
 #endregion
 
-using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -46,12 +45,12 @@
       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 = i > 0 ? subPopulations[i - 1].SubScopes : Enumerable.Empty<IScope>();
+        var prevSubPopulation = subPopulations[i - 1].SubScopes;
 
-        foreach (var individual in prevSubPopulation) {
+        foreach (var individual in prevSubPopulation)
           currentSubPopulation.Add(individual);
-        }
       }
+
       return base.Apply();
     }
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MergingReducerCalculator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MergingReducerCalculator.cs	(revision 11586)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MergingReducerCalculator.cs	(revision 11586)
@@ -0,0 +1,64 @@
+﻿#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 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("MergingReducerCalculator", "")]
+  [StorableClass]
+  public class MergingReducerCalculator : SingleSuccessorOperator {
+    private ILookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    private ILookupParameter<IntValue> NumSubScopesParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["NumSubScopes"]; }
+    }
+
+    [StorableConstructor]
+    private MergingReducerCalculator(bool deserializing)
+      : base(deserializing) { }
+    private MergingReducerCalculator(MergingReducerCalculator original, Cloner cloner)
+      : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MergingReducerCalculator(this, cloner);
+    }
+    public MergingReducerCalculator()
+      : base() {
+      Parameters.Add(new LookupParameter<IntValue>("PopulationSize"));
+      Parameters.Add(new LookupParameter<IntValue>("NumSubScopes"));
+    }
+
+    public override IOperation Apply() {
+      int populationSize = PopulationSizeParameter.ActualValue.Value;
+      int numSubScopes = NumSubScopesParameter.ActualValue.Value;
+
+      NumSubScopesParameter.ActualValue.Value = Math.Min(populationSize, numSubScopes);
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/OpenNewLayerCalculator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/OpenNewLayerCalculator.cs	(revision 11586)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/OpenNewLayerCalculator.cs	(revision 11586)
@@ -0,0 +1,80 @@
+﻿#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 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("OpenNewLayerCalculator", "")]
+  [StorableClass]
+  public class OpenNewLayerCalculator : SingleSuccessorOperator {
+
+    private ILookupParameter<IntArray> AgeLimitsParameter {
+      get { return (ILookupParameter<IntArray>)Parameters["AgeLimits"]; }
+    }
+    private ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["Generations"]; }
+    }
+    private ILookupParameter<IntValue> NumberOfLayersParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["NumberOfLayers"]; }
+    }
+    private ILookupParameter<IntValue> OpenLayersParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["OpenLayers"]; }
+    }
+    private IValueParameter<BoolValue> OpenNewLayerParameter {
+      get { return (IValueParameter<BoolValue>)Parameters["OpenNewLayer"]; }
+    }
+
+    [StorableConstructor]
+    private OpenNewLayerCalculator(bool deserializing)
+      : base(deserializing) { }
+    private OpenNewLayerCalculator(OpenNewLayerCalculator original, Cloner cloner)
+      : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new OpenNewLayerCalculator(this, cloner);
+    }
+    public OpenNewLayerCalculator()
+      : base() {
+      Parameters.Add(new LookupParameter<IntArray>("AgeLimits"));
+      Parameters.Add(new LookupParameter<IntValue>("Generations"));
+      Parameters.Add(new LookupParameter<IntValue>("NumberOfLayers"));
+      Parameters.Add(new LookupParameter<IntValue>("OpenLayers"));
+      Parameters.Add(new ValueParameter<BoolValue>("OpenNewLayer"));
+    }
+
+    public override IOperation Apply() {
+      var ageLimits = AgeLimitsParameter.ActualValue;
+      int generations = GenerationsParameter.ActualValue.Value;
+      int numberOfLayers = NumberOfLayersParameter.ActualValue.Value;
+      int openLayers = OpenLayersParameter.ActualValue.Value;
+      var openNewLayer = OpenNewLayerParameter;
+
+      openNewLayer.Value = new BoolValue(openLayers < numberOfLayers && generations >= ageLimits[openLayers - 1]);
+
+      return base.Apply();
+    }
+  }
+}
Index: /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/ShiftToRightMigrator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/ShiftToRightMigrator.cs	(revision 11585)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/ShiftToRightMigrator.cs	(revision 11586)
@@ -29,7 +29,7 @@
 
 namespace HeuristicLab.Algorithms.ALPS {
-  [Item("ShiftToRightMigrator", "Migrates the selected sub scopes by shifting it to the next(right) subscope.")]
+  [Item("ShiftToRightMigrator", "Migrates the selected sub scopes by shifting them to the next(right) subscope.")]
   [StorableClass]
-  public class ShiftToRightMigrator : SingleSuccessorOperator, IMigrator {
+  public sealed class ShiftToRightMigrator : SingleSuccessorOperator, IMigrator {
 
     [StorableConstructor]
@@ -59,7 +59,6 @@
       emigrantsList.RemoveAt(emigrantsList.Count - 1);
 
-      for (int i = 0; i < scope.SubScopes.Count; i++) {
+      for (int i = 0; i < scope.SubScopes.Count; i++)
         scope.SubScopes[i].SubScopes.Add(emigrantsList[i]);
-      }
 
       return base.Apply();
Index: /branches/ALPS/HeuristicLab.Operators/3.3/FirstSubScopeProcessor.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Operators/3.3/FirstSubScopeProcessor.cs	(revision 11586)
+++ /branches/ALPS/HeuristicLab.Operators/3.3/FirstSubScopeProcessor.cs	(revision 11586)
@@ -0,0 +1,65 @@
+﻿#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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Operators {
+  [Item("FirstSubScopeProsessor", "An operator which applies a specified operator on the first sub-scope.")]
+  public class FirstSubScopeProcessor : SingleSuccessorOperator {
+    private OperatorParameter OperatorParameter {
+      get { return (OperatorParameter)Parameters["Operator"]; }
+    }
+
+    public IOperator Operator {
+      get { return OperatorParameter.Value; }
+      set { OperatorParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    private FirstSubScopeProcessor(bool deserializing) : base(deserializing) { }
+    private FirstSubScopeProcessor(FirstSubScopeProcessor original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public FirstSubScopeProcessor()
+      : base() {
+      Parameters.Add(new OperatorParameter("Operator", "The operator which should be applied on all sub-scopes of the current scope."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new FirstSubScopeProcessor(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 next = new OperationCollection(base.Apply());
+      next.Insert(0, ExecutionContext.CreateOperation(Operator, scopes.First()));
+      return next;
+    }
+  }
+}
Index: /branches/ALPS/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj
===================================================================
--- /branches/ALPS/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj	(revision 11585)
+++ /branches/ALPS/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj	(revision 11586)
@@ -113,4 +113,6 @@
     <Compile Include="CheckedMultiOperator.cs" />
     <Compile Include="CombinedOperator.cs" />
+    <Compile Include="LastSubScopeProcessor.cs" />
+    <Compile Include="FirstSubScopeProcessor.cs" />
     <Compile Include="Operator.InstrumentedOperatorWrapper.cs" />
     <None Include="Plugin.cs.frame" />
Index: /branches/ALPS/HeuristicLab.Operators/3.3/LastSubScopeProcessor.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Operators/3.3/LastSubScopeProcessor.cs	(revision 11586)
+++ /branches/ALPS/HeuristicLab.Operators/3.3/LastSubScopeProcessor.cs	(revision 11586)
@@ -0,0 +1,65 @@
+﻿#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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Operators {
+  [Item("LastSubScopeProsessor", "An operator which applies a specified operator on the last sub-scope.")]
+  public class LastSubScopeProcessor : SingleSuccessorOperator {
+    private OperatorParameter OperatorParameter {
+      get { return (OperatorParameter)Parameters["Operator"]; }
+    }
+
+    public IOperator Operator {
+      get { return OperatorParameter.Value; }
+      set { OperatorParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    private LastSubScopeProcessor(bool deserializing) : base(deserializing) { }
+    private LastSubScopeProcessor(LastSubScopeProcessor original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public LastSubScopeProcessor()
+      : base() {
+      Parameters.Add(new OperatorParameter("Operator", "The operator which should be applied on all sub-scopes of the current scope."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LastSubScopeProcessor(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 next = new OperationCollection(base.Apply());
+      next.Insert(0, ExecutionContext.CreateOperation(Operator, scopes.Last()));
+      return next;
+    }
+  }
+}
Index: /branches/ALPS/HeuristicLab.Optimization.Operators/3.3/ExpressionCalculator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Optimization.Operators/3.3/ExpressionCalculator.cs	(revision 11585)
+++ /branches/ALPS/HeuristicLab.Optimization.Operators/3.3/ExpressionCalculator.cs	(revision 11586)
@@ -78,4 +78,6 @@
 predicates:
   ==, <, >, isnull, not
+array index:
+  []
 stack manipulation:
   drop swap dup
