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 12096)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/HeuristicLab.Algorithms.ALPS-3.3.csproj	(revision 12097)
@@ -145,6 +145,4 @@
     <Compile Include="LayerUpdator.cs" />
     <Compile Include="MatingPoolCreator.cs" />
-    <Compile Include="NumberOfSelectedSubScopesCalculator.cs" />
-    <Compile Include="OpenNewLayerCalculator.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 12096)
+++ /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerUpdator.cs	(revision 12097)
@@ -53,14 +53,13 @@
       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 maxLayerReached = new Comparator() { Name = "MaxLayersReached = OpenLayers >= NumberOfLayers" };
+      var maxLayerReachedBranch = new ConditionalBranch() { Name = "MaxLayersReached?" };
+      var openNewLayerCalculator = new ExpressionCalculator() { Name = "OpenNewLayer = Generations >= AgeLimits[OpenLayers - 1]" };
       var openNewLayerBranch = new ConditionalBranch() { Name = "OpenNewLayer?" };
-      //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 newLayerSelector = new RightSelector();
-      var newLayerProsessor = new SubScopesProcessor();
+      var newLayerProsessor = new SubScopesProcessor() { Name = "NewLayerProcessor" };
       var newLayerLayerProcessor = new LayerUniformSubScopesProcessor();
       var newLayerReducer = new MergingReducer();
@@ -71,5 +70,5 @@
       var newResultCollectionAssigner = new Assigner() { Name = "Empty Results" };
       var regenerateLayerZeroSelector = new LeftSelector();
-      var regenerateLayerZeroProsessor = new SubScopesProcessor();
+      var regenerateLayerZeroProsessor = new SubScopesProcessor() { Name = "LayerZeroProcessor" };
       var regenerateLayerZeroLayerProsessor = new LayerUniformSubScopesProcessor();
       var regenerateLayerZeroReducer = new MergingReducer();
@@ -95,17 +94,26 @@
 
       updateLayersBranch.ConditionParameter.ActualName = "UpdateLayers";
-      updateLayersBranch.TrueBranch = openNewLayerCalculator;
+      updateLayersBranch.TrueBranch = maxLayerReached;
 
-      //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";
+      maxLayerReached.LeftSideParameter.ActualName = "OpenLayers";
+      maxLayerReached.RightSideParameter.ActualName = "NumberOfLayers";
+      maxLayerReached.ResultParameter.ActualName = "MaxLayerReached";
+      maxLayerReached.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      maxLayerReached.Successor = maxLayerReachedBranch;
+
+      maxLayerReachedBranch.ConditionParameter.ActualName = "MaxLayerReached";
+      maxLayerReachedBranch.FalseBranch = openNewLayerCalculator;
+      maxLayerReachedBranch.Successor = regenerateLayerZeroSelector;
+
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntArray>("AgeLimits"));
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>("NumberOfLayers"));
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>("OpenLayers"));
+      openNewLayerCalculator.ExpressionResultParameter.ActualName = "OpenNewLayer";
+      openNewLayerCalculator.ExpressionParameter.Value = new StringValue("Generations 1 + AgeLimits OpenLayers 1 - [] >");
       openNewLayerCalculator.Successor = openNewLayerBranch;
 
       openNewLayerBranch.ConditionParameter.ActualName = "OpenNewLayer";
       openNewLayerBranch.TrueBranch = layerCreator;
-      openNewLayerBranch.Successor = regenerateLayerZeroSelector;
 
       layerCreator.Successor = newLayerSelector;
@@ -135,5 +143,4 @@
       incrEvaluatedSolutionsForNewLayer.ValueParameter.ActualName = "EvaluatedSolutions";
       incrEvaluatedSolutionsForNewLayer.AccumulateParameter.Value = new BoolValue(true);
-      //incrEvaluatedSolutionsForNewLayer.Successor = newResultCollectionAssigner;
       incrEvaluatedSolutionsForNewLayer.Successor = mainOperator;
 
Index: anches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/OpenNewLayerCalculator.cs
===================================================================
--- /branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/OpenNewLayerCalculator.cs	(revision 12096)
+++ 	(revision )
@@ -1,80 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2015 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 ILookupParameter<BoolValue> OpenNewLayerParameter {
-      get { return (ILookupParameter<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 LookupParameter<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.ActualValue = new BoolValue(openLayers < numberOfLayers && generations >= ageLimits[openLayers - 1]);
-
-      return base.Apply();
-    }
-  }
-}
