Index: branches/3057_DynamicALPS/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSASolution.cs
===================================================================
--- branches/3057_DynamicALPS/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSASolution.cs	(revision 17438)
+++ branches/3057_DynamicALPS/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSASolution.cs	(revision 17479)
@@ -115,8 +115,14 @@
     {
       Qualities = (double[])original.Qualities.Clone();
-      Constraints = (double[])original.Qualities.Clone();
-      HypervolumeContribution = (double[])original.HypervolumeContribution.Clone();       // kf, sms-emoa
-      NondominanceRanking = (int[])original.NondominanceRanking.Clone();                  // kf, sms-emoa
-      Individual = (IItem)original.Individual.Clone(cloner);
+      Constraints = (double[])original.Constraints.Clone();
+      if (original.HypervolumeContribution != null) {
+        HypervolumeContribution = (double[])original.HypervolumeContribution.Clone();       // kf, sms-emoa
+      }
+      if (original.NondominanceRanking != null) {
+        NondominanceRanking = (int[])original.NondominanceRanking.Clone();                  // kf, sms-emoa
+      }
+      if (original.Individual != null) {
+        Individual = (IItem)original.Individual.Clone(cloner);
+      }
     }
 
Index: branches/3057_DynamicALPS/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithm.cs
===================================================================
--- branches/3057_DynamicALPS/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithm.cs	(revision 17438)
+++ branches/3057_DynamicALPS/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithm.cs	(revision 17479)
@@ -120,5 +120,6 @@
 
       // IMPROVE: ........
-      int[] ageGapArray = new int[] { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
+      //                              1   2   4   8   16  32  64  128 256 512
+      int[] ageGapArray = new int[] { 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240 };
       int[] numberDiscard = new int[10];
 
@@ -126,4 +127,5 @@
 
       activeLayer = new bool[nLayerALPS];
+      layerCrossoverProbability = new double[nLayerALPS];
       int[][] ageMatrix = new int[nLayerALPS][];      // layer * population size
 
@@ -132,8 +134,4 @@
       // cancellation token for the inner operations which should not be immediately cancelled
       var innerToken = new CancellationToken();
-
-
-      // run some analyzer on each layer (for now calculate scatter plots )
-      List<Tuple<int, ScatterPlotAnalyzer>> layerAnalyzers;
 
 
@@ -143,4 +141,5 @@
       layerJointPopulation = new IDynamicALPSSolution[nLayerALPS][];
       layerDiscardPopulation = new IDynamicALPSSolution[nLayerALPS][];
+      layerDiscardIndivdual = new IDynamicALPSSolution[nLayerALPS];
 
 
@@ -148,8 +147,11 @@
       // BUG: The size of offspring should vary in different layers!!!!
       layerOffspringPopulation[counterLayerALPS] = new IDynamicALPSSolution[lambda];
+      // layerDiscardPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize];  // for the previous version, is used to store the individuals whose age is older than the age gap
       layerDiscardPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize];
       population.CopyTo(layerPopulation[counterLayerALPS], 0);
 
       activeLayer[counterLayerALPS] = true;
+      layerCrossoverProbability[counterLayerALPS] = 0;
+      var test = UseAverageAge.Value;
       for (int i = 0; i < nLayerALPS; i++) {
         if (i == 0) {
@@ -158,24 +160,72 @@
         else { activeLayer[i] = false; }
         numberDiscard[i] = 0;
+        layerCrossoverProbability[i] = CrossoverProbability.Value;
       }
-
+      int bottomLayerIDX = 0;
+      int godScope = 0;
       // Mainloop 
       while (evaluatedSolutions < maximumEvaluatedSolutions && !cancellationToken.IsCancellationRequested) {
         for (int i = 0; i < nLayerALPS; i++) {            // loop for every layer
           int discardedIndividualIndex = 0;
-          if (activeLayer[i] == true) {                   // check the layer is active or not. 
-            evaluatedSolutions = SMSEMOA(populationSize, lambda, i);
+          var currentLayerIDX = i;
+          var nextLayerIDX = i + 1;
+          if (nextLayerIDX == nLayerALPS) {
+            nextLayerIDX = bottomLayerIDX;
+            godScope = 1;
+          }
+          else { godScope = 0; }
+
+
+          if (activeLayer[currentLayerIDX] == true) {                   // check the current layer is active or not. 
+            evaluatedSolutions = SMSEMOA(populationSize, lambda, currentLayerIDX);                  // get the offspring -- layerJointPopulation
             if (evaluatedSolutions >= maximumEvaluatedSolutions) { break; }           // check evaluation budget
-            ageMatrix[i] = layerJointPopulation[i].Select(x => x.Age).ToArray();      // get age info of the current layer joint population 
-            if (ageMatrix[i].Max() > ageGapArray[i]) {    // mature: moving 
-              discardedIndividualIndex = ageMatrix[i].ToList().IndexOf(ageMatrix[i].Max());   // BUG when two individual has the same maximal age???? NOT POSSBILE IN SMS-EMOA 
-              layerDiscardPopulation[i][numberDiscard[i]] = layerJointPopulation[i][discardedIndividualIndex];                    // move the individual to the next layer 
-              layerJointPopulation[i].Where((x, idx) => idx != discardedIndividualIndex).ToArray().CopyTo(layerPopulation[i], 0); // discard the indivudal in the current layer  
-              numberDiscard[i] += 1;
-              if (activeLayer[i + 1] == false) {   // next layer is not active  // bug, if i == number of layer,  out of range .
-                if (numberDiscard[i] == populationSize) {
-                  InitializeLayer(i + 1, populationSize, lambda);  // initilizae the layerPopulation for the next layer && ACTIVE FLAGE
-                  layerDiscardPopulation[i].CopyTo(layerPopulation[i + 1], 0);
-                  numberDiscard[i] = 0;
+            ageMatrix[currentLayerIDX] = layerJointPopulation[currentLayerIDX].Select(x => x.Age).ToArray();      // get age info of the current layer joint population 
+            #region version 1: use average to initialize the layer population
+            if (UseAverageAge.Value == true) {
+              if (activeLayer[nextLayerIDX] == false) {// next layer is not active yet
+                if (ageMatrix[currentLayerIDX].Average() > ageGapArray[currentLayerIDX]) {    // the next layer is initialized 
+                  InitializeLayer(nextLayerIDX, populationSize, lambda);  // initilizae the layerPopulation for the next layer && ACTIVE FLAGE
+                  layerJointPopulation[currentLayerIDX].CopyTo(layerJointPopulation[nextLayerIDX], 0);
+                  SmetricSelection(lambda, nextLayerIDX);                //   layerpopulation is updated here, 
+                }
+                else {// the next layer is not initialized 
+                  SmetricSelection(lambda, currentLayerIDX);
+                }
+              }
+              else { // next layer is active 
+                if (activeLayer.All(x => x) && godScope == 1) {  // all the layers are active and the current layer is the top layer, move the discarded individual from the top to bottom, and reset the age
+                  SmetricSelection(lambda, currentLayerIDX);
+                  layerPopulation[bottomLayerIDX].CopyTo(layerJointPopulation[bottomLayerIDX], 0);
+                  layerDiscardIndivdual[currentLayerIDX].Age = 0;
+                  layerJointPopulation[bottomLayerIDX][populationSize] = layerDiscardIndivdual[currentLayerIDX];
+                  SmetricSelection(lambda, bottomLayerIDX);
+                }
+                else {
+                  if (ageMatrix[currentLayerIDX].Max() > ageGapArray[currentLayerIDX]) {      // moving 
+                    discardedIndividualIndex = ageMatrix[currentLayerIDX].ToList().IndexOf(ageMatrix[currentLayerIDX].Max());
+                    layerPopulation[nextLayerIDX].CopyTo(layerJointPopulation[nextLayerIDX], 0);
+                    layerJointPopulation[currentLayerIDX].Where((x, idx) => idx == discardedIndividualIndex).ToArray().CopyTo(layerJointPopulation[nextLayerIDX], populationSize);
+                    SmetricSelection(lambda, nextLayerIDX); // AGE and HVC 
+                    layerJointPopulation[currentLayerIDX].Where((x, idx) => idx != discardedIndividualIndex).ToArray().CopyTo(layerPopulation[currentLayerIDX], 0);  // dicard the individual in the current layer
+                  }
+                  else {   // next layer is active, but the age is not mature.
+                    SmetricSelection(lambda, currentLayerIDX);
+                  }
+                }
+              }
+              #endregion
+            }
+            else { 
+            #region version 2: use individual age to to initialize the next layer
+            if (ageMatrix[currentLayerIDX].Max() > ageGapArray[currentLayerIDX]) {    // mature: moving 
+              discardedIndividualIndex = ageMatrix[currentLayerIDX].ToList().IndexOf(ageMatrix[currentLayerIDX].Max());   // BUG when two individual has the same maximal age???? NOT POSSBILE IN SMS-EMOA 
+              layerDiscardPopulation[currentLayerIDX][numberDiscard[currentLayerIDX]] = layerJointPopulation[currentLayerIDX][discardedIndividualIndex];                    // move the individual to the next layer 
+              layerJointPopulation[currentLayerIDX].Where((x, idx) => idx != discardedIndividualIndex).ToArray().CopyTo(layerPopulation[currentLayerIDX], 0); // discard the indivudal in the current layer  
+              numberDiscard[currentLayerIDX] += 1;
+              if (activeLayer[nextLayerIDX] == false) {   // next layer is not active  // bug, if i == number of layer,  out of range .
+                if (numberDiscard[currentLayerIDX] == populationSize) {
+                  InitializeLayer(nextLayerIDX, populationSize, lambda);  // initilizae the layerPopulation for the next layer && ACTIVE FLAGE
+                  layerDiscardPopulation[currentLayerIDX].CopyTo(layerPopulation[nextLayerIDX], 0);
+                  numberDiscard[currentLayerIDX] = 0;
                 }
                 else {
@@ -184,17 +234,29 @@
               }
               else {  // next layer is active
-                layerPopulation[i+1].CopyTo(layerJointPopulation[i + 1], 0);
-                layerJointPopulation[i].Where((x, idx) => idx == discardedIndividualIndex).ToArray().CopyTo(layerJointPopulation[i + 1], populationSize);
-                SmetricSelection(lambda, i + 1); // AGE and HVC 
-                numberDiscard[i] = 0;
+                layerPopulation[nextLayerIDX].CopyTo(layerJointPopulation[nextLayerIDX], 0);
+                layerJointPopulation[currentLayerIDX].Where((x, idx) => idx == discardedIndividualIndex).ToArray().CopyTo(layerJointPopulation[nextLayerIDX], populationSize);
+                SmetricSelection(lambda, nextLayerIDX); // AGE and HVC 
+                numberDiscard[currentLayerIDX] = 0;
               }
             }
-            layerPopulation[i].CopyTo(population, 0);  // BUG: should copy all the active layers to population.
+            layerPopulation[currentLayerIDX].CopyTo(population, 0);  // BUG: should copy all the active layers to population.
+              #endregion
+            }
           }
           else {
             // Some thing wrong? lol nothing wrong here ^_^
           }
-        }
-
+
+
+        }
+
+
+
+
+        int numberOfActiveLayer = activeLayer.Where(c => c).Count();
+        population = new IDynamicALPSSolution[populationSize * numberOfActiveLayer];
+        for (int i = 0; i < numberOfActiveLayer; i++) {
+          layerPopulation[i].CopyTo(population, i * populationSize);
+        }
 
 
@@ -203,5 +265,5 @@
         ExecuteOperation(executionContext, innerToken, analyze);
         // update Pareto-front approximation sets
-        UpdateParetoFronts();
+        // UpdateParetoFronts();
         // Show some results in the GUI.
         Results.AddOrUpdateResult("IdealPoint", new DoubleArray(IdealPoint));
@@ -209,7 +271,23 @@
         Results.AddOrUpdateResult("Evaluated Solutions", new IntValue(evaluatedSolutions));
 
-        var allLayerResults = new ResultCollection();
-        Results.AddOrUpdateResult("LayerResults", allLayerResults);
-        
+
+
+
+
+
+        // see if we already have a result collection for the layer results, and reuse that one
+        ResultCollection allLayerResults;
+        if (Results.TryGetValue("LayerResults", out IResult allLayerResultsResult)) {
+          allLayerResults = (ResultCollection)allLayerResultsResult.Value;
+        }
+        else {
+          allLayerResults = new ResultCollection();
+          Results.AddOrUpdateResult("LayerResults", allLayerResults);
+        }
+
+
+
+
+
         // run layer analyzers
         for (int i = 0; i < activeLayer.Length; ++i) {
@@ -217,31 +295,109 @@
           var scope = new Scope($"Layer {i}");
           var layer = layerPopulation[i];
-          var layerResults = new ResultCollection();
-          allLayerResults.Add(new Result(scope.Name, layerResults));
-
-          var problem = (MultiObjectiveTestFunctionProblem)Problem;
-          //scope.Variables.Add(new Variable("Individuals", new ItemArray<IScope>(layer.Select(x => (IScope)x.Individual))));
-          //scope.Variables.Add(new Variable("Qualities", new ItemArray<DoubleArray>(layer.Select(x => new DoubleArray(x.Qualities)))));
-          scope.SubScopes.AddRange(layer.Select(x => (IScope)x.Individual));
-          scope.Variables.Add(new Variable("Results", layerResults));
-          scope.Variables.Add(new Variable("TestFunction", problem.TestFunction));
-          var scatterPlotAnalyzer = new ScatterPlotAnalyzer();
-          scatterPlotAnalyzer.IndividualsParameter.ActualName = "RealVector";
-          var scattetPlotAnalyzerContext = executionContext.CreateChildOperation(scatterPlotAnalyzer, scope);
-          ExecuteOperation(executionContext, CancellationToken.None, scattetPlotAnalyzerContext);
-          scope.SubScopes.Clear();
-          scope.Variables.Clear();
+          var tmp = UpdateParetoFronts(layer, IdealPoint);
+
+          // update the results in a way that avoids creating a new result collection at each iteration
+          if (allLayerResults.TryGetValue(scope.Name, out IResult lRes)) {
+            var lr = (ResultCollection)lRes.Value;
+            foreach (var result in tmp) {
+              lr.AddOrUpdateResult(result.Name, result.Value);
+            }
+          }
+          else {
+            allLayerResults.AddOrUpdateResult(scope.Name, tmp);
+          }
+
+          var layerResults = (ResultCollection)allLayerResults[scope.Name].Value;
+
+          //var layerQualities = new ItemArray<DoubleArray>(layer.Select(x => new DoubleArray(x.Qualities)));
+          // var layerSolutions = new ItemArray<IItem>(layer.Select(x => (IItem)x.Individual.Clone()));
+
+          // only store the decision vectors
+          var layerSolutions = new ItemArray<IItem>(layer.Select(x => (IItem)((IScope)x.Individual).Variables["RealVector"].Value.Clone()));
+
+          var layerAges = new ItemArray<IntValue>(layer.Select(x => new IntValue(x.Age)));
+          //layerResults.AddOrUpdateResult("Objective values", layerQualities);
+          layerResults.AddOrUpdateResult("Decision vectors", layerSolutions);
+          layerResults.AddOrUpdateResult("Age", layerAges);
+
+          var tableObjectives = new DataTable("Objective values");
+          for (int j = 0; j < IdealPoint.Length; ++j) {
+            var row = new DataRow($"Objective {j + 1}");
+            row.Values.AddRange(layer.Select(x => x.Qualities[j]));
+            tableObjectives.Rows.Add(row);
+          }
+          layerResults.AddOrUpdateResult("Objective values", tableObjectives);
+
+
+          // historical HV 
+          DataTable hyperVolumeHistory;
+          if (layerResults.TryGetValue("Layer Hypervolume History", out IResult res)) {
+            hyperVolumeHistory = (DataTable)res.Value;
+          }
+          else {
+            hyperVolumeHistory = new DataTable("Layer Hypervolume History");
+            var hrow = new DataRow($"Layer {i}");
+            hrow.VisualProperties = new DataRowVisualProperties {
+              StartIndexZero = false,
+            };
+            hyperVolumeHistory.Rows.Add(hrow);
+            layerResults.AddOrUpdateResult("Layer Hypervolume History", hyperVolumeHistory);
+          }
+          //var front = layer.Select(x => x.Qualities);
+          var reference = ReferencePoint.ToArray();
+          //var hv = double.MinValue;
+
+          var layerQualities = layer.Select(x => x.Qualities).ToArray();
+          var layerPF = DominationCalculator<IDynamicALPSSolution>.CalculateBestParetoFront(layer, layerQualities, maximization);
+          var nondominatedLayer = NonDominatedSelect.GetDominatingVectors(layerPF.Select(x => x.Item2), reference, maximization, false);
+          var layerHV = nondominatedLayer.Any() ? Hypervolume.Calculate(nondominatedLayer, reference, maximization) : 0;
+          hyperVolumeHistory.Rows[$"Layer {i}"].Values.Add(layerHV);
+
+
+          // historical crossover probability 
+          DataTable crossoverProbabilityHistory;
+          if (layerResults.TryGetValue("CrossoverProbability History", out IResult resPm)) {
+            crossoverProbabilityHistory = (DataTable)resPm.Value;
+          }
+          else {
+            crossoverProbabilityHistory = new DataTable("CrossoverProbability History");
+            var hrowPm = new DataRow($"Layer {i}");
+            hrowPm.VisualProperties = new DataRowVisualProperties {
+              StartIndexZero = false,
+            };
+            crossoverProbabilityHistory.Rows.Add(hrowPm);
+            layerResults.AddOrUpdateResult("CrossoverProbability History", crossoverProbabilityHistory);
+          }
+          crossoverProbabilityHistory.Rows[$"Layer {i}"].Values.Add(layerCrossoverProbability[i]);
+
+
+
+          if (i == 1) {
+            DataTable wholeLayerHypervolumeHistrory;
+            var qualities = population.Select(x => x.Qualities).ToArray();
+            var pf = DominationCalculator<IDynamicALPSSolution>.CalculateBestParetoFront(population, qualities, maximization);
+            var nondominatedWhole = NonDominatedSelect.GetDominatingVectors(pf.Select(x => x.Item2), reference, maximization, false);
+            var hvWhole = nondominatedWhole.Any() ? Hypervolume.Calculate(nondominatedWhole, reference, maximization) : 0;
+            if (layerResults.TryGetValue("Hypervolume of the entire layers -- History", out IResult resHVWhole)) {
+              wholeLayerHypervolumeHistrory = (DataTable)resHVWhole.Value;
+            }
+            else {
+              wholeLayerHypervolumeHistrory = new DataTable("Hypervolume of the entire layers -- History");
+              var hrowWhole = new DataRow($"Layer {i}");
+              hrowWhole.VisualProperties = new DataRowVisualProperties {
+                StartIndexZero = false,
+              };
+              wholeLayerHypervolumeHistrory.Rows.Add(hrowWhole);
+              layerResults.AddOrUpdateResult("Hypervolume of the entire layers -- History", wholeLayerHypervolumeHistrory);
+            }
+            wholeLayerHypervolumeHistrory.Rows[$"Layer {i}"].Values.Add(hvWhole);
+          }
+          else {
+          }
+
         }
 
         // Update globalScope
         globalScope.SubScopes.Replace(population.Select(x => (IScope)x.Individual));
-
-
-        //// intilize the population for the next layer
-        //counterLayerALPS += 1;
-        //layerPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize];
-        //layerPopulation[counterLayerALPS-1].CopyTo(layerPopulation[counterLayerALPS], 0); // DETELTE DUBGU 
-        //// BUG lambda should be different~~~~!!!!
-        //layerOffspringPopulation[counterLayerALPS] = new IDynamicALPSSolution[lambda];
       }
     }
Index: branches/3057_DynamicALPS/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithmBase.cs
===================================================================
--- branches/3057_DynamicALPS/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithmBase.cs	(revision 17438)
+++ branches/3057_DynamicALPS/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithmBase.cs	(revision 17479)
@@ -87,5 +87,12 @@
 
     [Storable]
+    protected double[] layerCrossoverProbability;
+
+    [Storable]
     protected IDynamicALPSSolution[][] layerDiscardPopulation;
+
+    [Storable]
+    protected IDynamicALPSSolution[] layerDiscardIndivdual;
+    
 
     [Storable]
@@ -116,8 +123,13 @@
     protected ExecutionState executionState;
 
-    private DoubleArray ReferencePoint {
+    protected DoubleArray ReferencePoint {
       get {
-        var problem = (MultiObjectiveTestFunctionProblem)Problem;
-        return problem.ReferencePoint;
+        if (Problem is MultiObjectiveTestFunctionProblem) {
+          var problem = (MultiObjectiveTestFunctionProblem)Problem;
+          return problem.ReferencePoint;
+        }
+        else {
+          return null;
+        }
       }
     }
@@ -136,4 +148,6 @@
     private const string RandomParameterName = "Random";
     private const string AnalyzerParameterName = "Analyzer";
+    
+    
     // MOEA-D parameters
     //private const string NeighbourSizeParameterName = "NeighbourSize";
@@ -147,4 +161,5 @@
     private const string ALPSLayersParameterName = "ALPSLayers";   // The number of offspring size 
     private const string ALPSAgeGapParameterName = "ALPSAgeGap";   // The number of offspring size 
+    private const string InitializeLayerPopulationMethodName = "InitializationLayerPopulations";
 
 
@@ -199,4 +214,9 @@
     }
 
+    private IValueParameter<BoolValue> ALPSInitialzeLayerPopulationParameter {
+      get { return (IValueParameter<BoolValue>)Parameters[InitializeLayerPopulationMethodName]; }
+    }
+    
+
     private IValueParameter<IntValue> ResultPopulationSizeParameter {
       get { return (IValueParameter<IntValue>)Parameters[ResultPopulationSizeParameterName]; }
@@ -258,4 +278,8 @@
       get { return ALPSAgeGapParameter.Value; }
       set { ALPSAgeGapParameter.Value = value; }
+    }
+    public BoolValue UseAverageAge {
+      get { return ALPSInitialzeLayerPopulationParameter.Value; }
+      set { ALPSInitialzeLayerPopulationParameter.Value = value; }
     }
 
@@ -316,4 +340,5 @@
       Parameters.Add(new ValueParameter<IntValue>(MaximumEvaluatedSolutionsParameterName, "The maximum number of evaluated solutions (approximately).", new IntValue(100_000)));
       Parameters.Add(new ValueParameter<IRandom>(RandomParameterName, new FastRandom()));
+      Parameters.Add(new ValueParameter<BoolValue>(InitializeLayerPopulationMethodName, "Whether use average age to initialize the layer population or not. If not, move the older individuals to layer populations", new BoolValue(true)));
 
       // SMS-EMOA, kf
@@ -532,4 +557,6 @@
       var qualities = wholePopulation.Select(x => x.Qualities).ToArray();
 
+      var maxPoint = Enumerable.Range(0, IdealPoint.Length).Select(idx => qualities.Max(q => q[idx])).ToArray();
+
       var maximization = Enumerable.Repeat(false, IdealPoint.Length).ToArray(); // Minimization or maximization ????
       var pf2 = DominationCalculator<IDynamicALPSSolution>.CalculateAllParetoFronts(wholePopulation, qualities, maximization, out int[] ranking);
@@ -550,5 +577,18 @@
         // TODO: This can be use for dynamic reference point strategy later. Kaifeng , 02/2020
         // smetric = Hypervolume.Calculate(lastLayer.Select(x => x.Item2), Enumerable.Repeat(11d, NadirPoint.Length).ToArray(), maximization);
-        var reference = ReferencePoint.ToArray();
+
+        var reference = Enumerable.Repeat(double.MaxValue, maximization.Length).ToArray(); // TODO Dynamic Reference point for each layer. Maximum * 1.1
+                                                                                           //if (nLayerALPS != 0) {
+        for (int i = 0; i < reference.Length; i++) {
+          reference[i] = 1.1 * maxPoint[i];
+          if (reference[i] > 10000) {
+            reference[i] = 9999;          // set a upper bound for the reference point
+          }
+        }
+        //}
+        //else {
+        //  reference = ReferencePoint.ToArray();
+        //}
+
         var nondominated = NonDominatedSelect.GetDominatingVectors(lastLayer.Select(x => x.Item2), reference, maximization, false);
         smetric = nondominated.Any() ? Hypervolume.Calculate(nondominated, reference, maximization) : int.MinValue;
@@ -565,13 +605,30 @@
           tempHV = 0;
         }
+
         discardIndex = Array.IndexOf(hvc, hvc.Min());
+        //layerDiscardPopulation[nLayerALPS] = pf2[numberOfLayer - 1][discardIndex].Item1.ToArray();
+        layerDiscardIndivdual[nLayerALPS] = pf2[numberOfLayer - 1].Select(x => x.Item1).ToArray()[discardIndex];
         pf2[numberOfLayer - 1].RemoveAt(discardIndex);
       }
       else {
         // TODO: This should be updated when $lambda > 1$
+        discardIndex = pf2.Count() - 1;
+        layerDiscardIndivdual[nLayerALPS] = pf2[discardIndex].Select(x => x.Item1).ToArray()[0];
         pf2.RemoveAt(pf2.Count() - 1);
         numberOfLayer = numberOfLayer - 1;
+        
       }
       layerPopulation[nLayerALPS] = pf2.SelectMany(x => x.Select(y => y.Item1)).ToArray();
+      
+    }
+
+    public static double SampleGaussian(IRandom random, double mean, double stddev) {
+      // The method requires sampling from a uniform random of (0,1]
+      // but Random.NextDouble() returns a sample of [0,1).
+      double x1 = 1 - random.NextDouble();
+      double x2 = 1 - random.NextDouble();
+
+      double y1 = Math.Sqrt(-2.0 * Math.Log(x1)) * Math.Cos(2.0 * Math.PI * x2);
+      return y1 * stddev + mean;
     }
 
@@ -581,5 +638,5 @@
       var maximumEvaluatedSolutions = MaximumEvaluatedSolutions.Value;
       var crossover = Crossover;
-      var crossoverProbability = CrossoverProbability.Value;
+      var crossoverProbability = layerCrossoverProbability[0];
       var mutator = Mutator;
       var mutationProbability = MutationProbability.Value;
@@ -604,4 +661,17 @@
       s1.Parent = s2.Parent = globalScope;
       IScope childScope = null;
+
+      // crossoverProbability = crossoverProbability - 0.02* counterLayerALPS;
+      //var test = SampleGaussian(rand, 0, 1);
+
+      //crossoverProbability = 1 / (1 + Math.Exp(-0.02 * SampleGaussian(rand, 0, 1)) * (1 - crossoverProbability) / crossoverProbability);
+
+      if (crossoverProbability < 0.5)
+        crossoverProbability = 0.5;
+      else if(crossoverProbability > 0.95)
+      {
+        crossoverProbability = 0.95;
+      }
+      layerCrossoverProbability[counterLayerALPS] = crossoverProbability;
 
       // crossover
@@ -617,5 +687,5 @@
       else { // MUTATION   POLISHI
         if (childScope == null) {
-          offSpringAge = ages[mates[0]] + 1;
+          offSpringAge = ages[mates[0]];
         }
         else {
@@ -624,4 +694,5 @@
         var opMutation = executionContext.CreateChildOperation(mutator, childScope);
         ExecuteOperation(executionContext, innerToken, opMutation);
+        offSpringAge = offSpringAge + 1;
       }
       if (childScope != null) { // Evaluate the childScope
@@ -663,13 +734,14 @@
 
 
-
-    // Update the Pareto-front approximation set and scatter the solutions in PF approximation set. 
-    protected void UpdateParetoFronts() {
+      // Update the Pareto-front approximation set and scatter the solutions in PF approximation set. 
+      protected ResultCollection UpdateParetoFronts(IDynamicALPSSolution[] solutions, double[] IdealPoint) {
+ 
+
       //var qualities = population.Select(x => Enumerable.Range(0, NadirPoint.Length).Select(i => x.Qualities[i] / NadirPoint[i]).ToArray()).ToArray();
-      var qualities = population.Select(x => x.Qualities).ToArray();
+      var qualities = solutions.Select(x => x.Qualities).ToArray();
       var maximization = Enumerable.Repeat(false, IdealPoint.Length).ToArray();                             // DynamicALPS minimizes everything internally
-      var pf = DominationCalculator<IDynamicALPSSolution>.CalculateBestParetoFront(population, qualities, maximization);
-
-      var pf2 = DominationCalculator<IDynamicALPSSolution>.CalculateAllParetoFronts(population, qualities, maximization, out int[] ranking);
+      var pf = DominationCalculator<IDynamicALPSSolution>.CalculateBestParetoFront(solutions, qualities, maximization);
+
+      var pf2 = DominationCalculator<IDynamicALPSSolution>.CalculateAllParetoFronts(solutions, qualities, maximization, out int[] ranking);
       var n = (int)EnumerableExtensions.BinomialCoefficient(IdealPoint.Length, 2);
 
@@ -687,5 +759,17 @@
       //               True:  maximization problem 
       //               False: minimization problem
-      var reference = ReferencePoint.ToArray();
+      var reference = Enumerable.Repeat(double.MaxValue, maximization.Length).ToArray();
+      if (ReferencePoint is null) {     // KF, 20200217 -- fix no reference point on real-world applications. If No reference points in Algorithms, use 1.1 \times max objective values as the reference point
+        for (int i = 0; i < reference.Length; i++) {
+          reference[i] = 1.1 * reference[i];
+          if (reference[i] > 10000) {
+            reference[i] = 9999;          // set a upper bound for the reference point
+          }
+        }
+      }
+      else {
+        reference = ReferencePoint.ToArray();
+      }
+
       var nondominated = NonDominatedSelect.GetDominatingVectors(pf.Select(x => x.Item2), reference, maximization, false);
       hypervolumes[0, 0] = nondominated.Any() ? Hypervolume.Calculate(nondominated, reference, maximization) : int.MinValue;
@@ -696,12 +780,13 @@
 
       var elementNames = new List<string>() { "Pareto Front" };
-
-      ResultCollection results;
-      if (Results.ContainsKey("Hypervolume Analysis")) {
-        results = (ResultCollection)Results["Hypervolume Analysis"].Value;
+      var results = new ResultCollection();
+
+      ResultCollection innerResults;
+      if (results.ContainsKey("Hypervolume Analysis")) {
+        innerResults = (ResultCollection)results["Hypervolume Analysis"].Value;
       }
       else {
-        results = new ResultCollection();
-        Results.AddOrUpdateResult("Hypervolume Analysis", results);
+        innerResults = new ResultCollection();
+        results.AddOrUpdateResult("Hypervolume Analysis", innerResults);
       }
 
@@ -712,16 +797,16 @@
         if (error != OnlineCalculatorError.None) { r = double.NaN; }
         var resultName = "Pareto Front Analysis ";
-        if (!results.ContainsKey(resultName)) {
+        if (!innerResults.ContainsKey(resultName)) {
           sp = new ScatterPlot() {
-            VisualProperties = {
-              XAxisMinimumAuto = false, XAxisMinimumFixedValue = 0d, XAxisMaximumAuto = false, XAxisMaximumFixedValue = 1d,
-              YAxisMinimumAuto = false, YAxisMinimumFixedValue = 0d, YAxisMaximumAuto = false, YAxisMaximumFixedValue = 1d
-            }
+            //VisualProperties = {
+            //  XAxisMinimumAuto = true, XAxisMinimumFixedValue = 0d, XAxisMaximumAuto = false, XAxisMaximumFixedValue = 1d,
+            //  YAxisMinimumAuto = true, YAxisMinimumFixedValue = 0d, YAxisMaximumAuto = false, YAxisMaximumFixedValue = 1d
+            //}
           };
           sp.Rows.Add(new ScatterPlotDataRow(resultName, "", points) { VisualProperties = { PointSize = 8 } });
-          results.AddOrUpdateResult(resultName, sp);
+          innerResults.AddOrUpdateResult(resultName, sp);
         }
         else {
-          sp = (ScatterPlot)results[resultName].Value;
+          sp = (ScatterPlot)innerResults[resultName].Value;
           sp.Rows[resultName].Points.Replace(points);
         }
@@ -751,5 +836,5 @@
           var pf2dPoints = pf2d.Select(x => new Point2D<double>(x.Item2[0], x.Item2[1]));
 
-          if (!results.ContainsKey(resultName)) {
+          if (!innerResults.ContainsKey(resultName)) {
             sp = new ScatterPlot() {
               VisualProperties = {
@@ -760,8 +845,8 @@
             sp.Rows.Add(new ScatterPlotDataRow("Pareto Front", "", points) { VisualProperties = visualProperties });
             sp.Rows.Add(new ScatterPlotDataRow($"Pareto Front [{c[0]}, {c[1]}]", "", pf2dPoints) { VisualProperties = { PointSize = 10, Color = Color.OrangeRed } });
-            results.AddOrUpdateResult(resultName, sp);
+            innerResults.AddOrUpdateResult(resultName, sp);
           }
           else {
-            sp = (ScatterPlot)results[resultName].Value;
+            sp = (ScatterPlot)innerResults[resultName].Value;
             sp.Rows["Pareto Front"].Points.Replace(points);
             sp.Rows[$"Pareto Front [{c[0]}, {c[1]}]"].Points.Replace(pf2dPoints);
@@ -773,5 +858,7 @@
       }
       hypervolumes.RowNames = elementNames;
-      results.AddOrUpdateResult("Hypervolumes", hypervolumes);
+      innerResults.AddOrUpdateResult("Hypervolumes", hypervolumes);
+
+      return results;
     }
 
Index: branches/3057_DynamicALPS/TestProblems/MPB.txt.txt
===================================================================
--- branches/3057_DynamicALPS/TestProblems/MPB.txt.txt	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/MPB.txt.txt	(revision 17479)
@@ -0,0 +1,1 @@
+ID: 2989_MovingPeaksBenchmark
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/.gitignore
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/.gitignore	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/.gitignore	(revision 17479)
@@ -0,0 +1,349 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/Build.cmd
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/Build.cmd	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/Build.cmd	(revision 17479)
@@ -0,0 +1,104 @@
+@ECHO OFF
+
+SET CLEANBEFOREBUILD=
+
+SET SELECTED=
+SET CONFIGURATION=
+SET PLATFORM=
+
+IF "%~1"=="" GOTO :prompt_solution
+
+SET SELECTED=%1
+IF NOT EXIST %SELECTED% (
+  ECHO Solution file %SELECTED% could not be found.
+  GOTO :end
+)
+ECHO Building solution %SELECTED% ...
+GOTO :config_selection
+
+:prompt_solution
+SET /A COUNT=0
+FOR /F "tokens=*" %%A IN ('dir /B *.sln') DO (
+  CALL :forloopbody "%%A"
+)
+
+IF "%COUNT%"=="1" (
+  SET SELECTED=%SOLUTIONS.1%
+  ECHO Building %SOLUTIONS.1% as it is the only solution that was found ...
+  GOTO :config_selection
+)
+
+ECHO Found the following solutions:
+FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO ECHO %%A = %%B
+ECHO.
+SET /P SOLUTIONINDEX=Which solution to build? Type the number: 
+
+SET SELECTED=""
+FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO (
+  IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B
+)
+
+IF %SELECTED%=="" GOTO :eof
+
+:config_selection
+IF "%~2"==""  GOTO :prompt_config
+
+SET CONFIGURATION=%~2
+ECHO Building configuration %CONFIGURATION% ...
+GOTO :platform_selection
+
+:prompt_config
+SET /P CONFIGURATION=Which configuration to build [Release]: 
+IF "%CONFIGURATION%"=="" SET CONFIGURATION=Release
+
+:platform_selection
+IF "%~3"=="" GOTO :prompt_platform
+  
+SET PLATFORM=%~3
+ECHO Building platform %PLATFORM% ...
+GOTO :clean
+
+:prompt_platform
+SET /P PLATFORM=Which platform to build [Any CPU]: 
+IF "%PLATFORM%"=="" SET PLATFORM=Any CPU
+
+:clean
+IF "%~4"=="" GOTO :prompt_clean
+
+SET CLEANBEFOREBUILD=%~4
+GOTO :main
+
+:prompt_clean
+SET /P CLEANBEFOREBUILD=Would you like to clean before building [n]: 
+IF "%CLEANBEFOREBUILD%"=="" SET CLEANBEFOREBUILD=n
+
+:main
+REM First find the path to the msbuild.exe by performing a registry query
+FOR /F "tokens=1,3 delims=	 " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"') DO (
+  IF "%%A"=="MSBuildToolsPath" SET MSBUILDPATH=%%B)
+
+REM Then execute msbuild to clean and build the solution
+REM Disable that msbuild creates a cache file of the solution
+SET MSBuildUseNoSolutionCache=1
+REM Run msbuild to clean and then build
+IF "%CLEANBEFOREBUILD%" NEQ "n" (
+  ECHO Cleaning ...
+  %MSBUILDPATH%msbuild.exe %SELECTED% /target:Clean /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /m:2 /nologo /verbosity:q /clp:ErrorsOnly
+)
+ECHO Building ...
+%MSBUILDPATH%msbuild.exe %SELECTED% /target:Build /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /m:2 /nologo /verbosity:q /clp:ErrorsOnly
+
+ECHO.
+ECHO DONE.
+
+:end
+
+PAUSE
+
+GOTO :eof
+
+REM This workaround is necessary so that COUNT gets reevaluated
+:forloopbody
+SET /A COUNT+=1
+SET SOLUTIONS.%COUNT%=%1
+GOTO :eof
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS.sln
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS.sln	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS.sln	(revision 17479)
@@ -0,0 +1,25 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29001.49
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.OESRALPS", "HeuristicLab.Algorithms.OESRALPS\HeuristicLab.Algorithms.OESRALPS.csproj", "{7309A53A-8D55-4CDA-B58F-4C08852D954A}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7309A53A-8D55-4CDA-B58F-4C08852D954A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7309A53A-8D55-4CDA-B58F-4C08852D954A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7309A53A-8D55-4CDA-B58F-4C08852D954A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7309A53A-8D55-4CDA-B58F-4C08852D954A}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {EFC32165-CCC9-43D8-8504-E94E506F3F32}
+	EndGlobalSection
+EndGlobal
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AgingScheme.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AgingScheme.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AgingScheme.cs	(revision 17479)
@@ -0,0 +1,83 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Data;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+    /// <summary>
+    /// Defines the growth of age limits for the layers.
+    /// </summary>
+    /// [Guid("")]
+    [StorableType("929B3D03-A85A-4162-8D32-09E3576B7286")]
+  public enum AgingScheme {
+    Linear,
+    Fibonacci,
+    Polynomial,
+    Exponential
+  }
+
+  /// <summary>
+  /// Helper for calculating the age limits for a AgingScheme and a given AgeGap.
+  /// </summary>
+  public static class AgingSchemeCalculator {
+    public static IntArray CalculateAgeLimits(this AgingScheme scheme, int ageGap, int numberOfLayers) {
+      IEnumerable<int> schemeGenerator;
+      switch (scheme) {
+        case AgingScheme.Linear: schemeGenerator = LinearAgingScheme(); break;
+        case AgingScheme.Fibonacci: schemeGenerator = FibonacciAgingScheme(); break;
+        case AgingScheme.Polynomial: schemeGenerator = PolynomialAgingScheme(2); break;
+        case AgingScheme.Exponential: schemeGenerator = ExponentialAgingScheme(2); break;
+        default: throw new NotSupportedException("Aging Scheme " + scheme + " is not supported.");
+      }
+
+      return new IntArray(schemeGenerator.Select(a => a * ageGap).Take(numberOfLayers).ToArray());
+    }
+
+    #region Scheme definitions
+    // 1 2 3 4 5 6 7 ...
+    private static IEnumerable<int> LinearAgingScheme() {
+      for (int i = 0; ; i++)
+        yield return i + 1;
+    }
+    // 1 2 3 5 8 13 21 ...
+    private static IEnumerable<int> FibonacciAgingScheme() {
+      for (int i = 1, next = 2, temp; ; temp = next, next = i + next, i = temp)
+        yield return i;
+    }
+    // (n^2): 1 2 4 9 16 25 36 ...
+    private static IEnumerable<int> PolynomialAgingScheme(double exp) {
+      yield return 1;
+      yield return 2;
+      for (int i = 2; ; i++)
+        yield return (int)Math.Pow(i, exp);
+    }
+    // 1 2 4 8 16 32 64 ...
+    private static IEnumerable<int> ExponentialAgingScheme(double @base) {
+      for (int i = 0; ; i++)
+        yield return (int)Math.Pow(@base, i);
+    }
+    #endregion
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsGeneticAlgorithm.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsGeneticAlgorithm.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsGeneticAlgorithm.cs	(revision 17479)
@@ -0,0 +1,794 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression;
+using HeuristicLab.Analysis;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Random;
+using HeuristicLab.Selection;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace HeuristicLab.Algorithms.OESRALPS
+{
+    [Item("OEALPS Genetic Algorithm", "A genetic algorithm within an open ended age-layered population structure as described in Gregory S. Hornby. 2006. ALPS: the age-layered population structure for reducing the problem of premature convergence. In Proceedings of the 8th annual conference on Genetic and evolutionary computation (GECCO '06). 815-822.")]
+  [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 160)]
+  [StorableType("8AE34CC4-9099-41C1-8DBE-E14B6B23FC08")]
+    public sealed class AlpsGeneticAlgorithm : HeuristicOptimizationEngineAlgorithm, IStorableContent {
+    public string Filename { get; set; }
+
+    private const string TerminateSlidingWindowParameterName = "TerminateSlidingWindow";
+
+    #region Problem Properties
+    public override Type ProblemType {
+      get { return typeof(ISingleObjectiveHeuristicOptimizationProblem); }
+    }
+    public new ISingleObjectiveHeuristicOptimizationProblem Problem {
+      get { return (ISingleObjectiveHeuristicOptimizationProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+    #endregion
+
+    #region Parameter Properties
+    private IValueParameter<IntValue> SeedParameter {
+      get { return (IValueParameter<IntValue>)Parameters["Seed"]; }
+    }
+    private IValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (IValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
+    }
+
+    private IFixedValueParameter<MultiAnalyzer> AnalyzerParameter {
+      get { return (IFixedValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
+    }
+    private IFixedValueParameter<MultiAnalyzer> LayerAnalyzerParameter {
+      get { return (IFixedValueParameter<MultiAnalyzer>)Parameters["LayerAnalyzer"]; }
+    }
+
+    private IValueParameter<IntValue> NumberOfLayersParameter {
+      get { return (IValueParameter<IntValue>)Parameters["NumberOfLayers"]; }
+    }
+    private IValueParameter<IntValue> PopulationSizeParameter {
+      get { return (IValueParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+
+    public IConstrainedValueParameter<ISelector> SelectorParameter {
+      get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
+    }
+    public IConstrainedValueParameter<ICrossover> CrossoverParameter {
+      get { return (IConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
+    }
+    public IConstrainedValueParameter<IManipulator> MutatorParameter {
+      get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
+    }
+    private IValueParameter<PercentValue> MutationProbabilityParameter {
+      get { return (IValueParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    private IValueParameter<IntValue> ElitesParameter {
+      get { return (IValueParameter<IntValue>)Parameters["Elites"]; }
+    }
+    private IFixedValueParameter<BoolValue> ReevaluateElitesParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; }
+    }
+    private IValueParameter<BoolValue> PlusSelectionParameter {
+      get { return (IValueParameter<BoolValue>)Parameters["PlusSelection"]; }
+    }
+
+    private IValueParameter<EnumValue<AgingScheme>> AgingSchemeParameter {
+      get { return (IValueParameter<EnumValue<AgingScheme>>)Parameters["AgingScheme"]; }
+    }
+    private IValueParameter<IntValue> AgeGapParameter {
+      get { return (IValueParameter<IntValue>)Parameters["AgeGap"]; }
+    }
+    private IValueParameter<DoubleValue> AgeInheritanceParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters["AgeInheritance"]; }
+    }
+    private IValueParameter<IntArray> AgeLimitsParameter {
+      get { return (IValueParameter<IntArray>)Parameters["AgeLimits"]; }
+    }
+
+    private IValueParameter<IntValue> MatingPoolRangeParameter {
+      get { return (IValueParameter<IntValue>)Parameters["MatingPoolRange"]; }
+    }
+    private IValueParameter<BoolValue> ReduceToPopulationSizeParameter {
+      get { return (IValueParameter<BoolValue>)Parameters["ReduceToPopulationSize"]; }
+    }
+
+    private IValueParameter<MultiTerminator> TerminatorParameter {
+      get { return (IValueParameter<MultiTerminator>)Parameters["Terminator"]; }
+    }
+
+    public IFixedValueParameter<MultiAnalyzer> SlidingWindowParameter {
+      get { return (IFixedValueParameter<MultiAnalyzer>)Parameters["SlidingWindow"]; }
+    }
+
+    public ILookupParameter<BoolValue> TerminateSlidingWindowParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[TerminateSlidingWindowParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public IntValue Seed {
+      get { return SeedParameter.Value; }
+      set { SeedParameter.Value = value; }
+    }
+    public BoolValue SetSeedRandomly {
+      get { return SetSeedRandomlyParameter.Value; }
+      set { SetSeedRandomlyParameter.Value = value; }
+    }
+
+    public MultiAnalyzer Analyzer {
+      get { return AnalyzerParameter.Value; }
+    }
+    public MultiAnalyzer LayerAnalyzer {
+      get { return LayerAnalyzerParameter.Value; }
+    }
+
+    public IntValue NumberOfLayers {
+      get { return NumberOfLayersParameter.Value; }
+      set { NumberOfLayersParameter.Value = value; }
+    }
+    public IntValue PopulationSize {
+      get { return PopulationSizeParameter.Value; }
+      set { PopulationSizeParameter.Value = value; }
+    }
+
+    public ISelector Selector {
+      get { return SelectorParameter.Value; }
+      set { SelectorParameter.Value = value; }
+    }
+    public ICrossover Crossover {
+      get { return CrossoverParameter.Value; }
+      set { CrossoverParameter.Value = value; }
+    }
+    public IManipulator Mutator {
+      get { return MutatorParameter.Value; }
+      set { MutatorParameter.Value = value; }
+    }
+    public PercentValue MutationProbability {
+      get { return MutationProbabilityParameter.Value; }
+      set { MutationProbabilityParameter.Value = value; }
+    }
+    public IntValue Elites {
+      get { return ElitesParameter.Value; }
+      set { ElitesParameter.Value = value; }
+    }
+    public bool ReevaluteElites {
+      get { return ReevaluateElitesParameter.Value.Value; }
+      set { ReevaluateElitesParameter.Value.Value = value; }
+    }
+    public bool PlusSelection {
+      get { return PlusSelectionParameter.Value.Value; }
+      set { PlusSelectionParameter.Value.Value = value; }
+    }
+
+    public EnumValue<AgingScheme> AgingScheme {
+      get { return AgingSchemeParameter.Value; }
+      set { AgingSchemeParameter.Value = value; }
+    }
+    public IntValue AgeGap {
+      get { return AgeGapParameter.Value; }
+      set { AgeGapParameter.Value = value; }
+    }
+    public DoubleValue AgeInheritance {
+      get { return AgeInheritanceParameter.Value; }
+      set { AgeInheritanceParameter.Value = value; }
+    }
+    public IntArray AgeLimits {
+      get { return AgeLimitsParameter.Value; }
+      set { AgeLimitsParameter.Value = value; }
+    }
+
+    public IntValue MatingPoolRange {
+      get { return MatingPoolRangeParameter.Value; }
+      set { MatingPoolRangeParameter.Value = value; }
+    }
+
+    public MultiTerminator Terminators {
+      get { return TerminatorParameter.Value; }
+    }
+
+    public int MaximumGenerations {
+      get { return generationsTerminator.Threshold.Value; }
+      set { generationsTerminator.Threshold.Value = value; }
+    }
+    public MultiAnalyzer SlidingWindow {
+        get { return SlidingWindowParameter.Value; }
+    }
+
+    #endregion
+
+    #region Helper Properties
+    private SolutionsCreator SolutionsCreator {
+      get { return OperatorGraph.Iterate().OfType<SolutionsCreator>().First(); }
+    }
+    private AlpsGeneticAlgorithmMainLoop MainLoop {
+      get { return OperatorGraph.Iterate().OfType<AlpsGeneticAlgorithmMainLoop>().First(); }
+    }
+    #endregion
+
+    #region Preconfigured Analyzers
+    [Storable]
+    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
+    [Storable]
+    private BestAverageWorstQualityAnalyzer layerQualityAnalyzer;
+    [Storable]
+    private OldestAverageYoungestAgeAnalyzer ageAnalyzer;
+    [Storable]
+    private OldestAverageYoungestAgeAnalyzer layerAgeAnalyzer;
+    [Storable]
+    private AgeDistributionAnalyzer ageDistributionAnalyzer;
+    [Storable]
+    private AgeDistributionAnalyzer layerAgeDistributionAnalyzer;
+
+    [Storable]
+    private SymbolicRegressionGenerationalSlidingWindowAnalyzer generationalSlidingWindowAnalyzer;
+    [Storable]
+    private SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer offspringSelectionSlidingWindowAnalyze;
+    [Storable]
+    private SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer overfittingSelectionSlidingWindowAnalyzer;
+    [Storable]
+    private SymbolicRegressionAdaptiveSlidingWindowAnalyzer generationalAdaptiveSlidingWindowAnalyzer;
+
+    #endregion
+
+    #region Preconfigured Terminators
+    [Storable]
+    private ComparisonTerminator<IntValue> generationsTerminator;
+    [Storable]
+    private ComparisonTerminator<IntValue> evaluationsTerminator;
+    [Storable]
+    private SingleObjectiveQualityTerminator qualityTerminator;
+    [Storable]
+    private ExecutionTimeTerminator executionTimeTerminator;
+    [Storable]
+    private ComparisonTerminator<BoolValue> slidingWindowTerminator;
+    #endregion
+
+    #region Constructors
+    [StorableConstructor]
+    private AlpsGeneticAlgorithm(StorableConstructorFlag _) : base(_) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>;
+      if (optionalMutatorParameter != null) {
+        Parameters.Remove(optionalMutatorParameter);
+        Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
+        foreach (var m in optionalMutatorParameter.ValidValues)
+          MutatorParameter.ValidValues.Add(m);
+        if (optionalMutatorParameter.Value == null) MutationProbability.Value = 0; // to guarantee that the old configuration results in the same behavior
+        else Mutator = optionalMutatorParameter.Value;
+        optionalMutatorParameter.ValidValues.Clear(); // to avoid dangling references to the old parameter its valid values are cleared
+      }
+      #endregion
+      Initialize();
+    }
+    private AlpsGeneticAlgorithm(AlpsGeneticAlgorithm original, Cloner cloner)
+      : base(original, cloner) {
+      qualityAnalyzer = cloner.Clone(original.qualityAnalyzer);
+      layerQualityAnalyzer = cloner.Clone(original.layerQualityAnalyzer);
+      ageAnalyzer = cloner.Clone(original.ageAnalyzer);
+      layerAgeAnalyzer = cloner.Clone(original.layerAgeAnalyzer);
+      ageDistributionAnalyzer = cloner.Clone(original.ageDistributionAnalyzer);
+      layerAgeDistributionAnalyzer = cloner.Clone(original.layerAgeDistributionAnalyzer);
+      generationsTerminator = cloner.Clone(original.generationsTerminator);
+      evaluationsTerminator = cloner.Clone(original.evaluationsTerminator);
+      qualityTerminator = cloner.Clone(original.qualityTerminator);
+      executionTimeTerminator = cloner.Clone(original.executionTimeTerminator);
+      slidingWindowTerminator = cloner.Clone(original.slidingWindowTerminator);
+      generationalSlidingWindowAnalyzer = cloner.Clone(original.generationalSlidingWindowAnalyzer);
+      offspringSelectionSlidingWindowAnalyze = cloner.Clone(original.offspringSelectionSlidingWindowAnalyze);
+      overfittingSelectionSlidingWindowAnalyzer = cloner.Clone(original.overfittingSelectionSlidingWindowAnalyzer);
+      generationalAdaptiveSlidingWindowAnalyzer = cloner.Clone(original.generationalAdaptiveSlidingWindowAnalyzer);
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AlpsGeneticAlgorithm(this, cloner);
+    }
+    public AlpsGeneticAlgorithm()
+      : base() {
+      #region Add parameters
+      Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
+      Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+
+      Parameters.Add(new FixedValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze all individuals from all layers combined.", new MultiAnalyzer()));
+      Parameters.Add(new FixedValueParameter<MultiAnalyzer>("LayerAnalyzer", "The operator used to analyze each layer.", new MultiAnalyzer()));
+
+      Parameters.Add(new ValueParameter<IntValue>("NumberOfLayers", "The number of layers.", new IntValue(1000)));
+      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer.", new IntValue(100)));
+
+      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new ValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.25)));
+      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
+      Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true });
+      Parameters.Add(new ValueParameter<BoolValue>("PlusSelection", "Include the parents in the selection of the invividuals for the next generation.", new BoolValue(false)));
+
+      Parameters.Add(new ValueParameter<EnumValue<AgingScheme>>("AgingScheme", "The aging scheme for setting the age-limits for the layers.", new EnumValue<AgingScheme>(OESRALPS.AgingScheme.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(15)));
+      Parameters.Add(new ValueParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent.", new DoubleValue(1.0)) { Hidden = true });
+      Parameters.Add(new ValueParameter<IntArray>("AgeLimits", "The maximum age an individual is allowed to reach in a certain layer.", new IntArray(new int[0])) { Hidden = true });
+
+      Parameters.Add(new ValueParameter<IntValue>("MatingPoolRange", "The range of layers used for creating a mating pool. (1 = current + previous layer)", new IntValue(1)) { Hidden = true });
+      Parameters.Add(new ValueParameter<BoolValue>("ReduceToPopulationSize", "Reduce the CurrentPopulationSize after elder migration to PopulationSize", new BoolValue(true)) { Hidden = true });
+
+      Parameters.Add(new ValueParameter<MultiTerminator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop.", new MultiTerminator()));
+      
+      Parameters.Add(new FixedValueParameter<MultiAnalyzer>("SlidingWindow", "Operator which moves a sliding window over the training data.", new MultiAnalyzer()));   
+      
+      Parameters.Add(new ValueParameter<BoolValue>(TerminateSlidingWindowParameterName, "Indicates if the sliding window has reached the end of the training data set", new BoolValue(false)) { Hidden = true });
+      #endregion
+
+      #region Create operators
+      var globalRandomCreator = new RandomCreator();
+      var layer0Creator = new SubScopesCreator() { Name = "Create Layer Zero" };
+      var layer0Processor = new SubScopesProcessor();
+      var localRandomCreator = new LocalRandomCreator();
+      var initializeIterations = new VariableCreator() { Name = "Initialize Iterations" };
+      var layerSolutionsCreator = new SolutionsCreator();
+      var initializeAgeProcessor = new UniformSubScopesProcessor();
+      var initializeAge = new VariableCreator() { Name = "Initialize Age" };
+      var initializeCurrentPopulationSize = new SubScopesCounter() { Name = "Initialize CurrentPopulationCounter" };
+      var initializeLocalEvaluatedSolutions = new Assigner() { Name = "Initialize LayerEvaluatedSolutions" };
+      var initializeGlobalEvaluatedSolutions = new DataReducer() { Name = "Initialize EvaluatedSolutions" };
+      var resultsCollector = new ResultsCollector();
+      var mainLoop = new AlpsGeneticAlgorithmMainLoop();
+      #endregion
+
+      #region Create and parameterize operator graph
+      OperatorGraph.InitialOperator = globalRandomCreator;
+
+      globalRandomCreator.RandomParameter.ActualName = "GlobalRandom";
+      globalRandomCreator.SeedParameter.Value = null;
+      globalRandomCreator.SeedParameter.ActualName = SeedParameter.Name;
+      globalRandomCreator.SetSeedRandomlyParameter.Value = null;
+      globalRandomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
+      globalRandomCreator.Successor = layer0Creator;
+
+      layer0Creator.NumberOfSubScopesParameter.Value = new IntValue(1);
+      layer0Creator.Successor = layer0Processor;
+
+      layer0Processor.Operators.Add(localRandomCreator);
+      layer0Processor.Successor = initializeGlobalEvaluatedSolutions;
+
+      localRandomCreator.Successor = layerSolutionsCreator;
+
+      layerSolutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
+      layerSolutionsCreator.Successor = initializeAgeProcessor;
+
+      initializeAgeProcessor.Operator = initializeAge;
+      initializeAgeProcessor.Successor = initializeCurrentPopulationSize;
+
+      initializeCurrentPopulationSize.ValueParameter.ActualName = "CurrentPopulationSize";
+      initializeCurrentPopulationSize.Successor = initializeLocalEvaluatedSolutions;
+
+      initializeAge.CollectedValues.Add(new ValueParameter<DoubleValue>("Age", new DoubleValue(0)));
+      initializeAge.Successor = null;
+
+      initializeLocalEvaluatedSolutions.LeftSideParameter.ActualName = "LayerEvaluatedSolutions";
+      initializeLocalEvaluatedSolutions.RightSideParameter.ActualName = "CurrentPopulationSize";
+      initializeLocalEvaluatedSolutions.Successor = null;
+
+      initializeGlobalEvaluatedSolutions.ReductionOperation.Value.Value = ReductionOperations.Sum;
+      initializeGlobalEvaluatedSolutions.TargetOperation.Value.Value = ReductionOperations.Assign;
+      initializeGlobalEvaluatedSolutions.ParameterToReduce.ActualName = "LayerEvaluatedSolutions";
+      initializeGlobalEvaluatedSolutions.TargetParameter.ActualName = "EvaluatedSolutions";
+      initializeGlobalEvaluatedSolutions.Successor = resultsCollector;
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
+      resultsCollector.Successor = mainLoop;
+
+      mainLoop.GlobalRandomParameter.ActualName = "GlobalRandom";
+      mainLoop.LocalRandomParameter.ActualName = localRandomCreator.LocalRandomParameter.Name;
+      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
+      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
+      mainLoop.LayerAnalyzerParameter.ActualName = LayerAnalyzerParameter.Name;
+      mainLoop.NumberOfLayersParameter.ActualName = NumberOfLayersParameter.Name;
+      mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
+      mainLoop.CurrentPopulationSizeParameter.ActualName = "CurrentPopulationSize";
+      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
+      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
+      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
+      mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
+      mainLoop.PlusSelectionParameter.ActualName = PlusSelectionParameter.Name;
+      mainLoop.AgeParameter.ActualName = "Age";
+      mainLoop.AgeGapParameter.ActualName = AgeGapParameter.Name;
+      mainLoop.AgeInheritanceParameter.ActualName = AgeInheritanceParameter.Name;
+      mainLoop.AgeLimitsParameter.ActualName = AgeLimitsParameter.Name;
+      mainLoop.MatingPoolRangeParameter.ActualName = MatingPoolRangeParameter.Name;
+      mainLoop.ReduceToPopulationSizeParameter.ActualName = ReduceToPopulationSizeParameter.Name;
+      mainLoop.TerminatorParameter.ActualName = TerminatorParameter.Name;
+      mainLoop.SlidingWindowParameter.ActualName = SlidingWindowParameter.Name;
+      #endregion
+
+      #region Set selectors
+      foreach (var selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(s => !(s is IMultiObjectiveSelector)).OrderBy(s => Name))
+        SelectorParameter.ValidValues.Add(selector);
+      var defaultSelector = SelectorParameter.ValidValues.OfType<GeneralizedRankSelector>().FirstOrDefault();
+      if (defaultSelector != null) {
+        defaultSelector.PressureParameter.Value = new DoubleValue(4.0);
+        SelectorParameter.Value = defaultSelector;
+      }
+      #endregion
+
+      #region Create analyzers
+      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+      layerQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+      ageAnalyzer = new OldestAverageYoungestAgeAnalyzer();
+      layerAgeAnalyzer = new OldestAverageYoungestAgeAnalyzer();
+      ageDistributionAnalyzer = new AgeDistributionAnalyzer();
+      layerAgeDistributionAnalyzer = new AgeDistributionAnalyzer();
+      generationalSlidingWindowAnalyzer = new SymbolicRegressionGenerationalSlidingWindowAnalyzer();
+      offspringSelectionSlidingWindowAnalyze = new SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer();
+      overfittingSelectionSlidingWindowAnalyzer = new SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer();
+      generationalAdaptiveSlidingWindowAnalyzer = new SymbolicRegressionAdaptiveSlidingWindowAnalyzer();
+      #endregion
+
+      #region Create terminators
+      generationsTerminator = new ComparisonTerminator<IntValue>("Generations", ComparisonType.Less, new IntValue(1000)) { Name = "Generations" };
+      evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, new IntValue(int.MaxValue)) { Name = "Evaluations" };
+      qualityTerminator = new SingleObjectiveQualityTerminator() { Name = "Quality" };
+      executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5)));
+      slidingWindowTerminator = new ComparisonTerminator<BoolValue>(TerminateSlidingWindowParameterName, ComparisonType.NotEqual, new BoolValue(true)) { Name = "Terminate sliding window" };
+      #endregion
+
+      #region Parameterize
+      UpdateAnalyzers();
+      ParameterizeAnalyzers();
+
+      ParameterizeSelectors();
+
+      UpdateTerminators();
+
+      ParameterizeAgeLimits();
+      #endregion
+
+      Initialize();
+    }
+    #endregion
+
+    #region Events
+    public override void Prepare() {
+      if (Problem != null)
+        base.Prepare();
+    }
+    protected override void OnProblemChanged() {
+      base.OnProblemChanged();
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      foreach (var @operator in Problem.Operators.OfType<IOperator>())
+        ParameterizeStochasticOperator(@operator);
+      ParameterizeStochasticOperatorForLayer(Problem.Evaluator);
+
+      ParameterizeIterationBasedOperators();
+
+      ParameterizeSolutionsCreator();
+      ParameterizeMainLoop();
+      ParameterizeAnalyzers();
+      ParameterizeSelectors();
+      ParameterizeTerminators();
+      
+      Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+
+      UpdateAnalyzers();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateTerminators();
+    }
+
+    protected override void RegisterProblemEvents() {
+      base.RegisterProblemEvents();
+      var maximizationParameter = (IValueParameter<BoolValue>)Problem.MaximizationParameter;
+      if (maximizationParameter != null) maximizationParameter.ValueChanged += new EventHandler(MaximizationParameter_ValueChanged);
+    }
+    protected override void DeregisterProblemEvents() {
+      var maximizationParameter = (IValueParameter<BoolValue>)Problem.MaximizationParameter;
+      if (maximizationParameter != null) maximizationParameter.ValueChanged -= new EventHandler(MaximizationParameter_ValueChanged);
+      base.DeregisterProblemEvents();
+    }
+
+    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
+      base.Problem_SolutionCreatorChanged(sender, e);
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+
+      Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+
+      ParameterizeSolutionsCreator();
+      ParameterizeAnalyzers();
+    }
+    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
+      base.Problem_EvaluatorChanged(sender, e);
+      ParameterizeStochasticOperatorForLayer(Problem.Evaluator);
+
+      UpdateAnalyzers();
+
+      ParameterizeSolutionsCreator();
+      ParameterizeMainLoop();
+      ParameterizeSelectors();
+    }
+    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
+      base.Problem_OperatorsChanged(sender, e);
+      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
+      ParameterizeStochasticOperatorForLayer(Problem.Evaluator);
+      ParameterizeIterationBasedOperators();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateTerminators();
+    }
+    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeMainLoop();
+      ParameterizeAnalyzers();
+      ParameterizeSelectors();
+    }
+    private void MaximizationParameter_ValueChanged(object sender, EventArgs e) {
+      ParameterizeTerminators();
+    }
+    private void QualityAnalyzer_CurrentBestQualityParameter_NameChanged(object sender, EventArgs e) {
+      ParameterizeTerminators();
+    }
+
+    private void AgeGapParameter_ValueChanged(object sender, EventArgs e) {
+      AgeGap.ValueChanged += AgeGap_ValueChanged;
+      ParameterizeAgeLimits();
+    }
+    private void AgeGap_ValueChanged(object sender, EventArgs e) {
+      ParameterizeAgeLimits();
+    }
+    private void AgingSchemeParameter_ValueChanged(object sender, EventArgs e) {
+      AgingScheme.ValueChanged += AgingScheme_ValueChanged;
+      ParameterizeAgeLimits();
+    }
+    private void AgingScheme_ValueChanged(object sender, EventArgs e) {
+      ParameterizeAgeLimits();
+    }
+    private void NumberOfLayersParameter_ValueChanged(object sender, EventArgs e) {
+      NumberOfLayers.ValueChanged += NumberOfLayers_ValueChanged;
+      ParameterizeAgeLimits();
+    }
+    private void NumberOfLayers_ValueChanged(object sender, EventArgs e) {
+      ParameterizeAgeLimits();
+    }
+
+    private void AnalyzerOperators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IAnalyzer>> e) {
+      foreach (var analyzer in e.Items) {
+        foreach (var parameter in analyzer.Value.Parameters.OfType<IScopeTreeLookupParameter>()) {
+          parameter.Depth = 2;
+        }
+      }
+    }
+    private void LayerAnalyzerOperators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IAnalyzer>> e) {
+      foreach (var analyzer in e.Items) {
+        IParameter resultParameter;
+        if (analyzer.Value.Parameters.TryGetValue("Results", out resultParameter)) {
+          var lookupParameter = resultParameter as ILookupParameter;
+          if (lookupParameter != null)
+            lookupParameter.ActualName = "LayerResults";
+        }
+        foreach (var parameter in analyzer.Value.Parameters.OfType<IScopeTreeLookupParameter>()) {
+          parameter.Depth = 1;
+        }
+      }
+    }
+    #endregion
+
+    #region Parameterization
+    private void Initialize() {
+      if (Problem != null)
+        Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+
+      NumberOfLayersParameter.ValueChanged += NumberOfLayersParameter_ValueChanged;
+      NumberOfLayers.ValueChanged += NumberOfLayers_ValueChanged;
+
+      Analyzer.Operators.ItemsAdded += AnalyzerOperators_ItemsAdded;
+      LayerAnalyzer.Operators.ItemsAdded += LayerAnalyzerOperators_ItemsAdded;
+
+      AgeGapParameter.ValueChanged += AgeGapParameter_ValueChanged;
+      AgeGap.ValueChanged += AgeGap_ValueChanged;
+      AgingSchemeParameter.ValueChanged += AgingSchemeParameter_ValueChanged;
+      AgingScheme.ValueChanged += AgingScheme_ValueChanged;
+
+      qualityAnalyzer.CurrentBestQualityParameter.NameChanged += new EventHandler(QualityAnalyzer_CurrentBestQualityParameter_NameChanged);
+    }
+    private void ParameterizeSolutionsCreator() {
+      SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+    }
+    private void ParameterizeMainLoop() {
+      MainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+    }
+    private void ParameterizeAnalyzers() {
+      qualityAnalyzer.ResultsParameter.ActualName = "Results";
+      qualityAnalyzer.ResultsParameter.Hidden = true;
+      qualityAnalyzer.QualityParameter.Depth = 2;
+      layerQualityAnalyzer.ResultsParameter.ActualName = "LayerResults";
+      layerQualityAnalyzer.ResultsParameter.Hidden = true;
+      layerQualityAnalyzer.QualityParameter.Depth = 1;
+      if (Problem != null) {
+        qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+        qualityAnalyzer.MaximizationParameter.Hidden = true;
+        qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+        qualityAnalyzer.QualityParameter.Hidden = true;
+        qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+        qualityAnalyzer.BestKnownQualityParameter.Hidden = true;
+        layerQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+        layerQualityAnalyzer.MaximizationParameter.Hidden = true;
+        layerQualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+        layerQualityAnalyzer.QualityParameter.Hidden = true;
+        layerQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+        layerQualityAnalyzer.BestKnownQualityParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeSelectors() {
+      foreach (var selector in SelectorParameter.ValidValues) {
+        selector.CopySelected = new BoolValue(true);
+        selector.NumberOfSelectedSubScopesParameter.Hidden = true;
+        ParameterizeStochasticOperatorForLayer(selector);
+      }
+      if (Problem != null) {
+        foreach (var selector in SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>()) {
+          selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+          selector.MaximizationParameter.Hidden = true;
+          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+          selector.QualityParameter.Hidden = true;
+        }
+      }
+    }
+    private void ParameterizeTerminators() {
+      qualityTerminator.Parameterize(qualityAnalyzer.CurrentBestQualityParameter, Problem);
+    }
+    private void ParameterizeIterationBasedOperators() {
+      if (Problem != null) {
+        foreach (var @operator in Problem.Operators.OfType<IIterationBasedOperator>()) {
+          @operator.IterationsParameter.ActualName = "Generations";
+          @operator.IterationsParameter.Hidden = true;
+          @operator.MaximumIterationsParameter.ActualName = generationsTerminator.ThresholdParameter.Name;
+          @operator.MaximumIterationsParameter.Hidden = true;
+        }
+      }
+    }
+    private void ParameterizeAgeLimits() {
+      var scheme = AgingScheme.Value;
+      int ageGap = AgeGap.Value;
+      int numberOfLayers = NumberOfLayers.Value;
+      AgeLimits = scheme.CalculateAgeLimits(ageGap, numberOfLayers);
+    }
+
+    private void ParameterizeStochasticOperator(IOperator @operator) {
+      var stochasticOperator = @operator as IStochasticOperator;
+      if (stochasticOperator != null) {
+        stochasticOperator.RandomParameter.ActualName = "GlobalRandom";
+        stochasticOperator.RandomParameter.Hidden = true;
+      }
+    }
+
+    private void ParameterizeStochasticOperatorForLayer(IOperator @operator) {
+      var stochasticOperator = @operator as IStochasticOperator;
+      if (stochasticOperator != null) {
+        stochasticOperator.RandomParameter.ActualName = "LocalRandom";
+        stochasticOperator.RandomParameter.Hidden = true;
+      }
+    }
+
+    #endregion
+
+    #region Updates
+    private void UpdateAnalyzers() {
+      Analyzer.Operators.Clear();
+      LayerAnalyzer.Operators.Clear();
+      SlidingWindow.Operators.Clear();
+
+      Analyzer.Operators.Add(qualityAnalyzer, qualityAnalyzer.EnabledByDefault);
+      Analyzer.Operators.Add(ageAnalyzer, ageAnalyzer.EnabledByDefault);
+      Analyzer.Operators.Add(ageDistributionAnalyzer, ageDistributionAnalyzer.EnabledByDefault);
+      LayerAnalyzer.Operators.Add(layerQualityAnalyzer, false);
+      LayerAnalyzer.Operators.Add(layerAgeAnalyzer, false);
+      LayerAnalyzer.Operators.Add(layerAgeDistributionAnalyzer, false);
+      LayerAnalyzer.Operators.Add(new SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer() { UpdateAlways = true }, true);
+      LayerAnalyzer.Operators.Add(new SymbolicRregressionSingleObjectiveLayerQualityAnalyzer(), true);
+      LayerAnalyzer.Operators.Add(new SymbolicRegressionSingleObjectiveOverfittingSlidingWindowAnalyzer(), false);
+      LayerAnalyzer.Operators.Add(new SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer(), true);
+
+
+      SlidingWindow.Operators.Add(generationalSlidingWindowAnalyzer);
+      SlidingWindow.Operators.Add(offspringSelectionSlidingWindowAnalyze, false);
+      SlidingWindow.Operators.Add(overfittingSelectionSlidingWindowAnalyzer, false);
+      SlidingWindow.Operators.Add(generationalAdaptiveSlidingWindowAnalyzer, false);
+     
+      if (Problem != null) {
+        foreach (var analyzer in Problem.Operators.OfType<IAnalyzer>()) {
+          Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault);
+          LayerAnalyzer.Operators.Add((IAnalyzer)analyzer.Clone(), false);
+        }
+      }
+    }
+    private void UpdateCrossovers() {
+      var oldCrossover = CrossoverParameter.Value;
+      var defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault();
+      CrossoverParameter.ValidValues.Clear();
+      foreach (var crossover in Problem.Operators.OfType<ICrossover>().OrderBy(c => c.Name)) {
+        ParameterizeStochasticOperatorForLayer(crossover);
+        CrossoverParameter.ValidValues.Add(crossover);
+      }
+      if (oldCrossover != null) {
+        var crossover = CrossoverParameter.ValidValues.FirstOrDefault(c => c.GetType() == oldCrossover.GetType());
+        if (crossover != null)
+          CrossoverParameter.Value = crossover;
+        else
+          oldCrossover = null;
+      }
+      if (oldCrossover == null && defaultCrossover != null)
+        CrossoverParameter.Value = defaultCrossover;
+    }
+    private void UpdateMutators() {
+      IManipulator oldMutator = MutatorParameter.Value;
+      MutatorParameter.ValidValues.Clear();
+      IManipulator defaultMutator = Problem.Operators.OfType<IManipulator>().FirstOrDefault();
+
+      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) {
+        ParameterizeStochasticOperatorForLayer(mutator);
+        MutatorParameter.ValidValues.Add(mutator);
+      }
+
+      if (oldMutator != null) {
+        IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType());
+        if (mutator != null) MutatorParameter.Value = mutator;
+        else oldMutator = null;
+      }
+
+      if (oldMutator == null && defaultMutator != null)
+        MutatorParameter.Value = defaultMutator;
+    }
+    private void UpdateTerminators() {
+      var newTerminators = new Dictionary<ITerminator, bool> {
+        {generationsTerminator, Terminators.Operators.Contains(generationsTerminator) && Terminators.Operators.ItemChecked(generationsTerminator)},
+        {evaluationsTerminator, Terminators.Operators.Contains(evaluationsTerminator) && Terminators.Operators.ItemChecked(evaluationsTerminator)},
+        {qualityTerminator, Terminators.Operators.Contains(qualityTerminator) && Terminators.Operators.ItemChecked(qualityTerminator) },
+        {executionTimeTerminator, Terminators.Operators.Contains(executionTimeTerminator) && Terminators.Operators.ItemChecked(executionTimeTerminator)},
+        {slidingWindowTerminator, !Terminators.Operators.Contains(slidingWindowTerminator) || Terminators.Operators.ItemChecked(slidingWindowTerminator)}
+      };
+      if (Problem != null) {
+        foreach (var terminator in Problem.Operators.OfType<ITerminator>())
+          newTerminators.Add(terminator, !Terminators.Operators.Contains(terminator) || Terminators.Operators.ItemChecked(terminator));
+      }
+
+      Terminators.Operators.Clear();
+
+      foreach (var newTerminator in newTerminators)
+        Terminators.Operators.Add(newTerminator.Key, newTerminator.Value);
+    }
+    #endregion
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsGeneticAlgorithmMainLoop.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsGeneticAlgorithmMainLoop.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsGeneticAlgorithmMainLoop.cs	(revision 17479)
@@ -0,0 +1,443 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+using HeuristicLab.Selection;
+using HeuristicLab.Algorithms.OESRALPS.SlidingWindow.Operator;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Algorithms.OESRALPS.Analyzers;
+using System.Linq;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+
+  [Item("AlpsGeneticAlgorithmMainLoop", "An open ended ALPS genetic algorithm main loop operator.")]
+  [StorableType("87678F8F-29BE-4A80-8976-084EE6C7041B")]
+    public sealed class AlpsGeneticAlgorithmMainLoop : AlgorithmOperator {
+    #region Parameter Properties
+    public IValueLookupParameter<IRandom> GlobalRandomParameter {
+      get { return (IValueLookupParameter<IRandom>)Parameters["GlobalRandom"]; }
+    }
+    public IValueLookupParameter<IRandom> LocalRandomParameter {
+      get { return (IValueLookupParameter<IRandom>)Parameters["LocalRandom"]; }
+    }
+
+    public IValueLookupParameter<IOperator> EvaluatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
+    }
+    public IValueLookupParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
+    }
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+
+    public ILookupParameter<IOperator> AnalyzerParameter {
+      get { return (ILookupParameter<IOperator>)Parameters["Analyzer"]; }
+    }
+    public ILookupParameter<IOperator> LayerAnalyzerParameter {
+      get { return (ILookupParameter<IOperator>)Parameters["LayerAnalyzer"]; }
+    }
+
+    public IValueLookupParameter<IntValue> NumberOfLayersParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfLayers"]; }
+    }
+    public IValueLookupParameter<IntValue> PopulationSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    public ILookupParameter<IntValue> CurrentPopulationSizeParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["CurrentPopulationSize"]; }
+    }
+
+    public IValueLookupParameter<IOperator> SelectorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Selector"]; }
+    }
+    public IValueLookupParameter<IOperator> CrossoverParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Crossover"]; }
+    }
+    public IValueLookupParameter<IOperator> MutatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Mutator"]; }
+    }
+    public IValueLookupParameter<PercentValue> MutationProbabilityParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    public IValueLookupParameter<IntValue> ElitesParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["Elites"]; }
+    }
+    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
+    }
+    public IValueLookupParameter<BoolValue> PlusSelectionParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["PlusSelection"]; }
+    }
+
+    public IScopeTreeLookupParameter<DoubleValue> AgeParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; }
+    }
+    public IValueLookupParameter<IntValue> AgeGapParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["AgeGap"]; }
+    }
+    public IValueLookupParameter<DoubleValue> AgeInheritanceParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["AgeInheritance"]; }
+    }
+    public IValueLookupParameter<IntArray> AgeLimitsParameter {
+      get { return (IValueLookupParameter<IntArray>)Parameters["AgeLimits"]; }
+    }
+
+    public IValueLookupParameter<IntValue> MatingPoolRangeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["MatingPoolRange"]; }
+    }
+    public IValueLookupParameter<BoolValue> ReduceToPopulationSizeParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["ReduceToPopulationSize"]; }
+    }
+
+    public IValueLookupParameter<IOperator> TerminatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Terminator"]; }
+    }
+
+    public IValueLookupParameter<IOperator> SlidingWindowParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["SlidingWindow"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private AlpsGeneticAlgorithmMainLoop(StorableConstructorFlag _) : base(_) { }
+    private AlpsGeneticAlgorithmMainLoop(AlpsGeneticAlgorithmMainLoop original, Cloner cloner)
+      : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AlpsGeneticAlgorithmMainLoop(this, cloner);
+    }
+    public AlpsGeneticAlgorithmMainLoop()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IRandom>("GlobalRandom", "A pseudo random number generator."));
+      Parameters.Add(new ValueLookupParameter<IRandom>("LocalRandom", "A pseudo random number generator."));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze all individuals from all layers combined."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("LayerAnalyzer", "The operator used to analyze each layer."));
+
+      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfLayers", "The number of layers."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer."));
+      Parameters.Add(new LookupParameter<IntValue>("CurrentPopulationSize", "The current size of the population."));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("PlusSelection", "Include the parents in the selection of the invividuals for the next generation."));
+
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The age of individuals."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent."));
+      Parameters.Add(new ValueLookupParameter<IntArray>("AgeLimits", "The maximum age an individual is allowed to reach in a certain layer."));
+
+      Parameters.Add(new ValueLookupParameter<IntValue>("MatingPoolRange", "The range of sub - populations used for creating a mating pool. (1 = current + previous sub-population)"));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("ReduceToPopulationSize", "Reduce the CurrentPopulationSize after elder migration to PopulationSize"));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop"));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("SlidingWindow", "Operator which moves a sliding window over the training data."));
+
+      var variableCreator = new VariableCreator() { Name = "Initialize" };
+      var slidingWindow = new Placeholder() { Name = "Sliding Window (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() { Name = "Process Mating Pools" };
+      var initializeLayer = new Assigner() { Name = "Reset LayerEvaluatedSolutions" };
+      var mainOperator = new AlpsGeneticAlgorithmMainOperator();
+      var generationsIcrementor = new IntCounter() { Name = "Increment Generations" };
+      var evaluatedSolutionsReducer = new DataReducer() { Name = "Increment EvaluatedSolutions" };
+      var eldersEmigrator = CreateEldersEmigrator();
+      var layerOpener = CreateLayerOpener();
+      var layerReseeder = CreateReseeder();
+      var layerAnalyzerProcessor = new UniformSubScopesProcessor();
+      var layerAnalyzerPlaceholder = new Placeholder() { Name = "LayerAnalyzer (Placeholder)" };
+      var analyzerPlaceholder = new Placeholder() { Name = "Analyzer (Placeholder)" };
+      var termination = new TerminationOperator();
+
+      OperatorGraph.InitialOperator = variableCreator;
+
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("OpenLayers", new IntValue(1)));
+      variableCreator.Successor = initLayerAnalyzerProcessor;
+
+      initLayerAnalyzerProcessor.Operators.Add(layerVariableCreator);
+      initLayerAnalyzerProcessor.Successor = initAnalyzerPlaceholder;
+
+      layerVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Layer", new IntValue(0)));
+      layerVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("LayerResults"));
+      layerVariableCreator.Successor = initLayerAnalyzerPlaceholder;
+
+      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", "LayerResults"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("OpenLayers"));
+      resultsCollector.CopyValue = new BoolValue(false);
+      resultsCollector.Successor = slidingWindow;
+
+      slidingWindow.OperatorParameter.ActualName = SlidingWindowParameter.Name;
+      slidingWindow.Successor = matingPoolCreator;
+
+      matingPoolCreator.MatingPoolRangeParameter.Value = null;
+      matingPoolCreator.MatingPoolRangeParameter.ActualName = MatingPoolRangeParameter.Name;
+      matingPoolCreator.Successor = matingPoolProcessor;
+
+      matingPoolProcessor.Parallel.Value = true;
+      matingPoolProcessor.Operator = initializeLayer;
+      matingPoolProcessor.Successor = generationsIcrementor;
+
+      initializeLayer.LeftSideParameter.ActualName = "LayerEvaluatedSolutions";
+      initializeLayer.RightSideParameter.Value = new IntValue(0);
+      initializeLayer.Successor = mainOperator;
+
+      mainOperator.RandomParameter.ActualName = LocalRandomParameter.Name;
+      mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
+      mainOperator.EvaluatedSolutionsParameter.ActualName = "LayerEvaluatedSolutions";
+      mainOperator.QualityParameter.ActualName = QualityParameter.Name;
+      mainOperator.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      mainOperator.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
+      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
+      mainOperator.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      mainOperator.MutatorParameter.ActualName = MutatorParameter.ActualName;
+      mainOperator.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      mainOperator.ElitesParameter.ActualName = ElitesParameter.Name;
+      mainOperator.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
+      mainOperator.PlusSelectionParameter.ActualName = PlusSelectionParameter.Name;
+      mainOperator.AgeParameter.ActualName = AgeParameter.Name;
+      mainOperator.AgeInheritanceParameter.ActualName = AgeInheritanceParameter.Name;
+      mainOperator.AgeIncrementParameter.Value = new DoubleValue(1.0);
+      mainOperator.Successor = null;
+
+      generationsIcrementor.ValueParameter.ActualName = "Generations";
+      generationsIcrementor.Increment = new IntValue(1);
+      generationsIcrementor.Successor = evaluatedSolutionsReducer;
+
+      evaluatedSolutionsReducer.ParameterToReduce.ActualName = "LayerEvaluatedSolutions";
+      evaluatedSolutionsReducer.TargetParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      evaluatedSolutionsReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum);
+      evaluatedSolutionsReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Sum);
+      evaluatedSolutionsReducer.Successor = eldersEmigrator;
+
+      eldersEmigrator.Successor = layerOpener;
+
+      layerOpener.Successor = layerReseeder;
+
+      layerReseeder.Successor = layerAnalyzerProcessor;
+
+      layerAnalyzerProcessor.Operator = layerAnalyzerPlaceholder;
+      layerAnalyzerProcessor.Successor = analyzerPlaceholder;
+
+      layerAnalyzerPlaceholder.OperatorParameter.ActualName = LayerAnalyzerParameter.Name;
+
+      analyzerPlaceholder.OperatorParameter.ActualName = AnalyzerParameter.Name;
+      analyzerPlaceholder.Successor = termination;
+
+      termination.TerminatorParameter.ActualName = TerminatorParameter.Name;
+      termination.ContinueBranch = slidingWindow;
+    }
+
+    private CombinedOperator CreateEldersEmigrator() {
+      var eldersEmigrator = new CombinedOperator() { Name = "Emigrate Elders" };
+      var selectorProsessor = new UniformSubScopesProcessor();
+      var eldersSelector = new EldersSelector();
+      var shiftToRightMigrator = new UnidirectionalRingMigrator() { Name = "Shift elders to next layer" };
+      var mergingProsessor = new UniformSubScopesProcessor();
+      var mergingReducer = new MergingReducer();
+      var subScopesCounter = new SubScopesCounter();
+      var reduceToPopulationSizeBranch = new ConditionalBranch() { Name = "ReduceToPopulationSize?" };
+      var countCalculator = new ExpressionCalculator() { Name = "CurrentPopulationSize = Min(CurrentPopulationSize, PopulationSize)" };
+      var bestSelector = new BestSelector();
+      var rightReducer = new RightReducer();
+
+      eldersEmigrator.OperatorGraph.InitialOperator = selectorProsessor;
+
+      selectorProsessor.Operator = eldersSelector;
+      selectorProsessor.Successor = shiftToRightMigrator;
+
+      eldersSelector.AgeParameter.ActualName = AgeParameter.Name;
+      eldersSelector.AgeLimitsParameter.ActualName = AgeLimitsParameter.Name;
+      eldersSelector.NumberOfLayersParameter.ActualName = NumberOfLayersParameter.Name;
+      eldersSelector.LayerParameter.ActualName = "Layer";
+      eldersSelector.Successor = null;
+
+      shiftToRightMigrator.ClockwiseMigrationParameter.Value = new BoolValue(true);
+      shiftToRightMigrator.Successor = mergingProsessor;
+
+      mergingProsessor.Operator = mergingReducer;
+
+      mergingReducer.Successor = subScopesCounter;
+
+      subScopesCounter.ValueParameter.ActualName = CurrentPopulationSizeParameter.Name;
+      subScopesCounter.AccumulateParameter.Value = new BoolValue(false);
+      subScopesCounter.Successor = reduceToPopulationSizeBranch;
+
+      reduceToPopulationSizeBranch.ConditionParameter.ActualName = ReduceToPopulationSizeParameter.Name;
+      reduceToPopulationSizeBranch.TrueBranch = countCalculator;
+
+      countCalculator.CollectedValues.Add(new LookupParameter<IntValue>(PopulationSizeParameter.Name));
+      countCalculator.CollectedValues.Add(new LookupParameter<IntValue>(CurrentPopulationSizeParameter.Name));
+      countCalculator.ExpressionParameter.Value = new StringValue("CurrentPopulationSize PopulationSize CurrentPopulationSize PopulationSize < if toint");
+      countCalculator.ExpressionResultParameter.ActualName = CurrentPopulationSizeParameter.Name;
+      countCalculator.Successor = bestSelector;
+
+      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = CurrentPopulationSizeParameter.Name;
+      bestSelector.CopySelected = new BoolValue(false);
+      bestSelector.Successor = rightReducer;
+
+      return eldersEmigrator;
+    }
+
+    private CombinedOperator CreateLayerOpener() {
+      var layerOpener = new CombinedOperator() { Name = "Open new Layer if needed" };
+      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 layerCreator = new LastLayerCloner() { Name = "Create Layer" };
+      var updateLayerNumber = new Assigner() { Name = "Layer = OpenLayers" };
+      var historyWiper = new ResultsHistoryWiper() { Name = "Clear History in Results" };
+      var createChildrenViaCrossover = new AlpsGeneticAlgorithmMainOperator();
+      var incrEvaluatedSolutionsForNewLayer = new SubScopesCounter() { Name = "Update EvaluatedSolutions" };
+      var incrOpenLayers = new IntCounter() { Name = "Incr. OpenLayers" };
+      var newLayerResultsCollector = new ResultsCollector() { Name = "Collect new Layer Results" };
+
+      layerOpener.OperatorGraph.InitialOperator = maxLayerReached;
+
+      maxLayerReached.LeftSideParameter.ActualName = "OpenLayers";
+      maxLayerReached.RightSideParameter.ActualName = NumberOfLayersParameter.Name;
+      maxLayerReached.ResultParameter.ActualName = "MaxLayerReached";
+      maxLayerReached.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      maxLayerReached.Successor = maxLayerReachedBranch;
+
+      maxLayerReachedBranch.ConditionParameter.ActualName = "MaxLayerReached";
+      maxLayerReachedBranch.FalseBranch = openNewLayerCalculator;
+
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntArray>(AgeLimitsParameter.Name));
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>(NumberOfLayersParameter.Name));
+      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;
+
+      layerCreator.NewLayerOperator = updateLayerNumber;
+      layerCreator.Successor = incrOpenLayers;
+
+      updateLayerNumber.LeftSideParameter.ActualName = "Layer";
+      updateLayerNumber.RightSideParameter.ActualName = "OpenLayers";
+      updateLayerNumber.Successor = historyWiper;
+
+      historyWiper.ResultsParameter.ActualName = "LayerResults";
+      historyWiper.Successor = createChildrenViaCrossover;
+
+      // Maybe use only crossover and no elitism instead of "default operator"
+      createChildrenViaCrossover.RandomParameter.ActualName = LocalRandomParameter.Name;
+      createChildrenViaCrossover.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
+      createChildrenViaCrossover.EvaluatedSolutionsParameter.ActualName = "LayerEvaluatedSolutions";
+      createChildrenViaCrossover.QualityParameter.ActualName = QualityParameter.Name;
+      createChildrenViaCrossover.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      createChildrenViaCrossover.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
+      createChildrenViaCrossover.SelectorParameter.ActualName = SelectorParameter.Name;
+      createChildrenViaCrossover.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      createChildrenViaCrossover.MutatorParameter.ActualName = MutatorParameter.Name;
+      createChildrenViaCrossover.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      createChildrenViaCrossover.ElitesParameter.ActualName = ElitesParameter.Name;
+      createChildrenViaCrossover.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
+      createChildrenViaCrossover.PlusSelectionParameter.ActualName = PlusSelectionParameter.Name;
+      createChildrenViaCrossover.AgeParameter.ActualName = AgeParameter.Name;
+      createChildrenViaCrossover.AgeInheritanceParameter.ActualName = AgeInheritanceParameter.Name;
+      createChildrenViaCrossover.AgeIncrementParameter.Value = new DoubleValue(0.0);
+      createChildrenViaCrossover.Successor = incrEvaluatedSolutionsForNewLayer;
+
+      incrEvaluatedSolutionsForNewLayer.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      incrEvaluatedSolutionsForNewLayer.AccumulateParameter.Value = new BoolValue(true);
+
+      incrOpenLayers.ValueParameter.ActualName = "OpenLayers";
+      incrOpenLayers.Increment = new IntValue(1);
+      incrOpenLayers.Successor = newLayerResultsCollector;
+
+      newLayerResultsCollector.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("LayerResults", "Result set for each layer", "LayerResults"));
+      newLayerResultsCollector.CopyValue = new BoolValue(false);
+      newLayerResultsCollector.Successor = null;
+
+      return layerOpener;
+    }
+
+    private CombinedOperator CreateReseeder() {
+      var reseeder = new CombinedOperator() { Name = "Reseed Layer Zero if needed" };
+      var reseedingController = new ReseedingController() { Name = "Reseeding needed (Generation % AgeGap == 0)?" };
+      var removeIndividuals = new SubScopesRemover();
+      var createIndividuals = new SolutionsCreator();
+      var initializeAgeProsessor = new UniformSubScopesProcessor();
+      var initializeAge = new VariableCreator() { Name = "Initialize Age" };
+      var incrEvaluatedSolutionsAfterReseeding = new SubScopesCounter() { Name = "Update EvaluatedSolutions" };
+
+      reseeder.OperatorGraph.InitialOperator = reseedingController;
+
+      reseedingController.GenerationsParameter.ActualName = "Generations";
+      reseedingController.AgeGapParameter.ActualName = AgeGapParameter.Name;
+      reseedingController.FirstLayerOperator = removeIndividuals;
+      reseedingController.Successor = null;
+
+      removeIndividuals.Successor = createIndividuals;
+
+      createIndividuals.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
+      createIndividuals.Successor = initializeAgeProsessor;
+
+      initializeAgeProsessor.Operator = initializeAge;
+      initializeAgeProsessor.Successor = incrEvaluatedSolutionsAfterReseeding;
+
+      initializeAge.CollectedValues.Add(new ValueParameter<DoubleValue>(AgeParameter.Name, new DoubleValue(0)));
+
+      incrEvaluatedSolutionsAfterReseeding.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      incrEvaluatedSolutionsAfterReseeding.AccumulateParameter.Value = new BoolValue(true);
+
+      return reseeder;
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsGeneticAlgorithmMainOperator.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsGeneticAlgorithmMainOperator.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsGeneticAlgorithmMainOperator.cs	(revision 17479)
@@ -0,0 +1,240 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HEAL.Attic;
+using HeuristicLab.Selection;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("AlpsGeneticAlgorithmMainOperator", "An operator that represents the core of an open ended ALPS genetic algorithm.")]
+  [StorableType("E7C1281A-3413-442E-AC85-67B67AF5E509")]
+    public sealed class AlpsGeneticAlgorithmMainOperator : AlgorithmOperator {
+    #region Parameter properties
+    public IValueLookupParameter<IRandom> RandomParameter {
+      get { return (IValueLookupParameter<IRandom>)Parameters["GlobalRandom"]; }
+    }
+
+    public IValueLookupParameter<IOperator> EvaluatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
+    }
+    public IValueLookupParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
+    }
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+
+    public IValueLookupParameter<IntValue> PopulationSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    public IValueLookupParameter<IOperator> SelectorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Selector"]; }
+    }
+    public IValueLookupParameter<IOperator> CrossoverParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Crossover"]; }
+    }
+    public IValueLookupParameter<IOperator> MutatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Mutator"]; }
+    }
+    public IValueLookupParameter<PercentValue> MutationProbabilityParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    public IValueLookupParameter<IntValue> ElitesParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["Elites"]; }
+    }
+    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
+    }
+    public IValueLookupParameter<BoolValue> PlusSelectionParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["PlusSelection"]; }
+    }
+
+    public IScopeTreeLookupParameter<DoubleValue> AgeParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; }
+    }
+    public IValueLookupParameter<DoubleValue> AgeInheritanceParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["AgeInheritance"]; }
+    }
+    public IValueLookupParameter<DoubleValue> AgeIncrementParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["AgeIncrement"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private AlpsGeneticAlgorithmMainOperator(StorableConstructorFlag _) : base(_) { }
+    private AlpsGeneticAlgorithmMainOperator(AlpsGeneticAlgorithmMainOperator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AlpsGeneticAlgorithmMainOperator(this, cloner);
+    }
+    public AlpsGeneticAlgorithmMainOperator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IRandom>("GlobalRandom", "A pseudo random number generator."));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
+
+      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("PlusSelection", "Include the parents in the selection of the invividuals for the next generation."));
+
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The age of individuals."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("AgeIncrement", "The value the age the individuals is incremented if they survives a generation."));
+
+
+      var numberOfSelectedParentsCalculator = new ExpressionCalculator() { Name = "NumberOfSelectedParents = 2 * (PopulationSize - (PlusSelection ? 0 : Elites))" };
+      var selector = new Placeholder() { Name = "Selector (Placeholder)" };
+      var subScopesProcessor1 = new SubScopesProcessor();
+      var childrenCreator = new ChildrenCreator();
+      var uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
+      var crossover = new Placeholder() { Name = "Crossover (Placeholder)" };
+      var stochasticBranch = new StochasticBranch() { Name = "MutationProbability" };
+      var mutator = new Placeholder() { Name = "Mutator (Placeholder)" };
+      var ageCalculator = new WeightingReducer() { Name = "Calculate Age" };
+      var subScopesRemover = new SubScopesRemover();
+      var uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
+      var evaluator = new Placeholder() { Name = "Evaluator (Placeholder)" };
+      var subScopesCounter = new SubScopesCounter() { Name = "Increment EvaluatedSolutions" };
+      var replacementBranch = new ConditionalBranch() { Name = "PlusSelection?" };
+      var replacementMergingReducer = new MergingReducer();
+      var replacementBestSelector = new BestSelector();
+      var replacementRightReducer = new RightReducer();
+      var subScopesProcessor2 = new SubScopesProcessor();
+      var bestSelector = new BestSelector();
+      var rightReducer = new RightReducer();
+      var mergingReducer = new MergingReducer();
+      var reevaluateElitesBranch = new ConditionalBranch() { Name = "Reevaluate elites ?" };
+      var incrementAgeProcessor = new UniformSubScopesProcessor();
+      var ageIncrementor = new DoubleCounter() { Name = "Increment Age" };
+
+      OperatorGraph.InitialOperator = numberOfSelectedParentsCalculator;
+
+      numberOfSelectedParentsCalculator.CollectedValues.Add(new LookupParameter<IntValue>(PopulationSizeParameter.Name));
+      numberOfSelectedParentsCalculator.CollectedValues.Add(new LookupParameter<IntValue>(ElitesParameter.Name));
+      numberOfSelectedParentsCalculator.CollectedValues.Add(new LookupParameter<BoolValue>(PlusSelectionParameter.Name));
+      numberOfSelectedParentsCalculator.ExpressionResultParameter.ActualName = "NumberOfSelectedSubScopes";
+      numberOfSelectedParentsCalculator.ExpressionParameter.Value = new StringValue("PopulationSize 0 Elites PlusSelection if - 2 * toint");
+      numberOfSelectedParentsCalculator.Successor = selector;
+
+      selector.OperatorParameter.ActualName = SelectorParameter.Name;
+      selector.Successor = subScopesProcessor1;
+
+      subScopesProcessor1.Operators.Add(new EmptyOperator());
+      subScopesProcessor1.Operators.Add(childrenCreator);
+      subScopesProcessor1.Successor = replacementBranch;
+
+      childrenCreator.ParentsPerChild = new IntValue(2);
+      childrenCreator.Successor = uniformSubScopesProcessor1;
+
+      uniformSubScopesProcessor1.Operator = crossover;
+      uniformSubScopesProcessor1.Successor = uniformSubScopesProcessor2;
+
+      crossover.OperatorParameter.ActualName = CrossoverParameter.Name;
+      crossover.Successor = stochasticBranch;
+
+      stochasticBranch.ProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      stochasticBranch.RandomParameter.ActualName = RandomParameter.Name;
+      stochasticBranch.FirstBranch = mutator;
+      stochasticBranch.SecondBranch = null;
+      stochasticBranch.Successor = ageCalculator;
+
+      mutator.OperatorParameter.ActualName = MutatorParameter.Name;
+      mutator.Successor = null;
+
+      ageCalculator.ParameterToReduce.ActualName = AgeParameter.Name;
+      ageCalculator.TargetParameter.ActualName = AgeParameter.Name;
+      ageCalculator.WeightParameter.ActualName = AgeInheritanceParameter.Name;
+      ageCalculator.Successor = subScopesRemover;
+
+      subScopesRemover.RemoveAllSubScopes = true;
+      subScopesRemover.Successor = null;
+
+      uniformSubScopesProcessor2.Parallel.Value = true;
+      uniformSubScopesProcessor2.Operator = evaluator;
+      uniformSubScopesProcessor2.Successor = subScopesCounter;
+
+      evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;
+      evaluator.Successor = null;
+
+      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      subScopesCounter.AccumulateParameter.Value = new BoolValue(true);
+      subScopesCounter.Successor = null;
+
+      replacementBranch.ConditionParameter.ActualName = PlusSelectionParameter.Name;
+      replacementBranch.TrueBranch = replacementMergingReducer;
+      replacementBranch.FalseBranch = subScopesProcessor2;
+      replacementBranch.Successor = incrementAgeProcessor;
+
+      replacementMergingReducer.Successor = replacementBestSelector;
+
+      replacementBestSelector.NumberOfSelectedSubScopesParameter.ActualName = PopulationSizeParameter.Name;
+      replacementBestSelector.CopySelected = new BoolValue(false);
+      replacementBestSelector.Successor = replacementRightReducer;
+
+      replacementRightReducer.Successor = reevaluateElitesBranch;
+
+      subScopesProcessor2.Operators.Add(bestSelector);
+      subScopesProcessor2.Operators.Add(new EmptyOperator());
+      subScopesProcessor2.Successor = mergingReducer;
+
+      bestSelector.CopySelected = new BoolValue(false);
+      bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name;
+      bestSelector.QualityParameter.ActualName = QualityParameter.Name;
+      bestSelector.Successor = rightReducer;
+
+      rightReducer.Successor = reevaluateElitesBranch;
+
+      mergingReducer.Successor = null;
+
+      reevaluateElitesBranch.ConditionParameter.ActualName = ReevaluateElitesParameter.Name;
+      reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor2;
+      reevaluateElitesBranch.FalseBranch = null;
+      reevaluateElitesBranch.Successor = null;
+
+
+      incrementAgeProcessor.Operator = ageIncrementor;
+      incrementAgeProcessor.Successor = null;
+
+      ageIncrementor.ValueParameter.ActualName = AgeParameter.Name;
+      ageIncrementor.IncrementParameter.Value = null;
+      ageIncrementor.IncrementParameter.ActualName = AgeIncrementParameter.Name;
+      ageIncrementor.Successor = null;
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelectionGeneticAlgorithm.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelectionGeneticAlgorithm.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelectionGeneticAlgorithm.cs	(revision 17479)
@@ -0,0 +1,857 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.Analyzers;
+using HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression;
+using HeuristicLab.Algorithms.OESRALPS.SlidingWindow.Operator;
+using HeuristicLab.Analysis;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Random;
+using HeuristicLab.Selection;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("OERSALPS OffspringSelection Genetic Algorithm", "An offspring selection genetic algorithm within an open ended age-layered population structure.")]
+  [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 162)]
+  [StorableType("6ECED646-9DDE-4172-839F-696EF93948A8")]
+    public sealed class AlpsOffspringSelectionGeneticAlgorithm : HeuristicOptimizationEngineAlgorithm, IStorableContent {
+    public string Filename { get; set; }
+
+    private const string TerminateSlidingWindowParameterName = "TerminateSlidingWindow";
+
+    #region Problem Properties
+    public override Type ProblemType {
+      get { return typeof(ISingleObjectiveHeuristicOptimizationProblem); }
+    }
+    public new ISingleObjectiveHeuristicOptimizationProblem Problem {
+      get { return (ISingleObjectiveHeuristicOptimizationProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+    #endregion
+
+    #region Parameter Properties
+    private IFixedValueParameter<IntValue> SeedParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["Seed"]; }
+    }
+    private IFixedValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
+    }
+
+    private IFixedValueParameter<MultiAnalyzer> AnalyzerParameter {
+      get { return (IFixedValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
+    }
+    private IFixedValueParameter<MultiAnalyzer> LayerAnalyzerParameter {
+      get { return (IFixedValueParameter<MultiAnalyzer>)Parameters["LayerAnalyzer"]; }
+    }
+
+    private IFixedValueParameter<IntValue> NumberOfLayersParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["NumberOfLayers"]; }
+    }
+    private IFixedValueParameter<IntValue> PopulationSizeParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+
+    public IConstrainedValueParameter<ISelector> SelectorParameter {
+      get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
+    }
+    public IConstrainedValueParameter<ICrossover> CrossoverParameter {
+      get { return (IConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
+    }
+    public IConstrainedValueParameter<IManipulator> MutatorParameter {
+      get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
+    }
+    private IFixedValueParameter<PercentValue> MutationProbabilityParameter {
+      get { return (IFixedValueParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    private IFixedValueParameter<IntValue> ElitesParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["Elites"]; }
+    }
+    private IFixedValueParameter<BoolValue> ReevaluateElitesParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; }
+    }
+
+    private IFixedValueParameter<DoubleValue> SuccessRatioParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters["SuccessRatio"]; }
+    }
+    private IFixedValueParameter<DoubleValue> ComparisonFactorParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
+    }
+    private IFixedValueParameter<DoubleValue> MaximumSelectionPressureParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
+    }
+    private IFixedValueParameter<BoolValue> OffspringSelectionBeforeMutationParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; }
+    }
+    private IFixedValueParameter<IntValue> SelectedParentsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["SelectedParents"]; }
+    }
+    private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
+    }
+
+    private IFixedValueParameter<EnumValue<AgingScheme>> AgingSchemeParameter {
+      get { return (IFixedValueParameter<EnumValue<AgingScheme>>)Parameters["AgingScheme"]; }
+    }
+    private IFixedValueParameter<IntValue> AgeGapParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["AgeGap"]; }
+    }
+    private IFixedValueParameter<DoubleValue> AgeInheritanceParameter {
+      get { return (IFixedValueParameter<DoubleValue>)Parameters["AgeInheritance"]; }
+    }
+    private IFixedValueParameter<IntArray> AgeLimitsParameter {
+      get { return (IFixedValueParameter<IntArray>)Parameters["AgeLimits"]; }
+    }
+
+    private IFixedValueParameter<IntValue> MatingPoolRangeParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters["MatingPoolRange"]; }
+    }
+    private IFixedValueParameter<BoolValue> ReduceToPopulationSizeParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters["ReduceToPopulationSize"]; }
+    }
+
+    private IFixedValueParameter<MultiTerminator> TerminatorParameter {
+      get { return (IFixedValueParameter<MultiTerminator>)Parameters["Terminator"]; }
+    }
+    public IFixedValueParameter<MultiAnalyzer> SlidingWindowParameter {
+      get { return (IFixedValueParameter<MultiAnalyzer>)Parameters["SlidingWindow"]; }
+    }
+    public ILookupParameter<BoolValue> TerminateSlidingWindowParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[TerminateSlidingWindowParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public int Seed {
+      get { return SeedParameter.Value.Value; }
+      set { SeedParameter.Value.Value = value; }
+    }
+    public bool SetSeedRandomly {
+      get { return SetSeedRandomlyParameter.Value.Value; }
+      set { SetSeedRandomlyParameter.Value.Value = value; }
+    }
+
+    public MultiAnalyzer Analyzer {
+      get { return AnalyzerParameter.Value; }
+    }
+    public MultiAnalyzer LayerAnalyzer {
+      get { return LayerAnalyzerParameter.Value; }
+    }
+
+    public int NumberOfLayers {
+      get { return NumberOfLayersParameter.Value.Value; }
+      set { NumberOfLayersParameter.Value.Value = value; }
+    }
+    public int PopulationSize {
+      get { return PopulationSizeParameter.Value.Value; }
+      set { PopulationSizeParameter.Value.Value = value; }
+    }
+
+    public ISelector Selector {
+      get { return SelectorParameter.Value; }
+      set { SelectorParameter.Value = value; }
+    }
+    public ICrossover Crossover {
+      get { return CrossoverParameter.Value; }
+      set { CrossoverParameter.Value = value; }
+    }
+    public IManipulator Mutator {
+      get { return MutatorParameter.Value; }
+      set { MutatorParameter.Value = value; }
+    }
+    public double MutationProbability {
+      get { return MutationProbabilityParameter.Value.Value; }
+      set { MutationProbabilityParameter.Value.Value = value; }
+    }
+    public int Elites {
+      get { return ElitesParameter.Value.Value; }
+      set { ElitesParameter.Value.Value = value; }
+    }
+    public bool ReevaluteElites {
+      get { return ReevaluateElitesParameter.Value.Value; }
+      set { ReevaluateElitesParameter.Value.Value = value; }
+    }
+
+    public double SuccessRatio {
+      get { return SuccessRatioParameter.Value.Value; }
+      set { SuccessRatioParameter.Value.Value = value; }
+    }
+    public double ComparisonFactor {
+      get { return ComparisonFactorParameter.Value.Value; }
+      set { ComparisonFactorParameter.Value.Value = value; }
+    }
+    public double MaximumSelectionPressure {
+      get { return MaximumSelectionPressureParameter.Value.Value; }
+      set { MaximumSelectionPressureParameter.Value.Value = value; }
+    }
+    public bool OffspringSelectionBeforeMutation {
+      get { return OffspringSelectionBeforeMutationParameter.Value.Value; }
+      set { OffspringSelectionBeforeMutationParameter.Value.Value = value; }
+    }
+    public int SelectedParents {
+      get { return SelectedParentsParameter.Value.Value; }
+      set { SelectedParentsParameter.Value.Value = value; }
+    }
+    public bool FillPopulationWithParents {
+      get { return FillPopulationWithParentsParameter.Value.Value; }
+      set { FillPopulationWithParentsParameter.Value.Value = value; }
+    }
+
+    public AgingScheme AgingScheme {
+      get { return AgingSchemeParameter.Value.Value; }
+      set { AgingSchemeParameter.Value.Value = value; }
+    }
+    public int AgeGap {
+      get { return AgeGapParameter.Value.Value; }
+      set { AgeGapParameter.Value.Value = value; }
+    }
+    public double AgeInheritance {
+      get { return AgeInheritanceParameter.Value.Value; }
+      set { AgeInheritanceParameter.Value.Value = value; }
+    }
+    public IntArray AgeLimits {
+      get { return AgeLimitsParameter.Value; }
+      set {
+        AgeLimits.Length = value.Length;
+        for (int i = 0; i < value.Length; i++)
+          AgeLimits[i] = value[i];
+      }
+    }
+
+    public int MatingPoolRange {
+      get { return MatingPoolRangeParameter.Value.Value; }
+      set { MatingPoolRangeParameter.Value.Value = value; }
+    }
+
+    public MultiTerminator Terminators {
+      get { return TerminatorParameter.Value; }
+    }
+
+    public int MaximumGenerations {
+      get { return generationsTerminator.Threshold.Value; }
+      set { generationsTerminator.Threshold.Value = value; }
+    }
+
+    public MultiAnalyzer SlidingWindow {
+        get { return SlidingWindowParameter.Value; }
+    }
+    #endregion
+
+    #region Helper Properties
+    private SolutionsCreator SolutionsCreator {
+      get { return OperatorGraph.Iterate().OfType<SolutionsCreator>().First(); }
+    }
+    private AlpsOffspringSelectionGeneticAlgorithmMainLoop MainLoop {
+      get { return OperatorGraph.Iterate().OfType<AlpsOffspringSelectionGeneticAlgorithmMainLoop>().First(); }
+    }
+    #endregion
+
+    #region Preconfigured Analyzers
+    [Storable]
+    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
+    [Storable]
+    private BestAverageWorstQualityAnalyzer layerQualityAnalyzer;
+    [Storable]
+    private OldestAverageYoungestAgeAnalyzer ageAnalyzer;
+    [Storable]
+    private OldestAverageYoungestAgeAnalyzer layerAgeAnalyzer;
+    [Storable]
+    private AgeDistributionAnalyzer ageDistributionAnalyzer;
+    [Storable]
+    private AgeDistributionAnalyzer layerAgeDistributionAnalyzer;
+    [Storable]
+    private ValueAnalyzer selectionPressureAnalyzer;
+    [Storable]
+    private ValueAnalyzer layerSelectionPressureAnalyzer;
+    [Storable]
+    private ValueAnalyzer currentSuccessRatioAnalyzer;
+
+    [Storable]
+    private SymbolicRegressionGenerationalSlidingWindowAnalyzer generationalSlidingWindowAnalyzer;
+    [Storable]
+    private SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer offspringSelectionSlidingWindowAnalyze;
+    [Storable]
+    private SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer overfittingSelectionSlidingWindowAnalyzer;
+    [Storable]
+    private SymbolicRegressionAdaptiveSlidingWindowAnalyzer generationalAdaptiveSlidingWindowAnalyzer;
+    #endregion
+
+    #region Preconfigured Terminators
+    [Storable]
+    private ComparisonTerminator<IntValue> generationsTerminator;
+    [Storable]
+    private ComparisonTerminator<IntValue> evaluationsTerminator;
+    [Storable]
+    private SingleObjectiveQualityTerminator qualityTerminator;
+    [Storable]
+    private ExecutionTimeTerminator executionTimeTerminator;
+    [Storable]
+    private ComparisonTerminator<BoolValue> slidingWindowTerminator;
+    #endregion
+
+    #region Constructors
+    [StorableConstructor]
+    private AlpsOffspringSelectionGeneticAlgorithm(StorableConstructorFlag _) : base(_) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>;
+      if (optionalMutatorParameter != null) {
+        Parameters.Remove(optionalMutatorParameter);
+        Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
+        foreach (var m in optionalMutatorParameter.ValidValues)
+          MutatorParameter.ValidValues.Add(m);
+        if (optionalMutatorParameter.Value == null) MutationProbability = 0; // to guarantee that the old configuration results in the same behavior
+        else Mutator = optionalMutatorParameter.Value;
+        optionalMutatorParameter.ValidValues.Clear(); // to avoid dangling references to the old parameter its valid values are cleared
+      }
+      #endregion
+      Initialize();
+    }
+    private AlpsOffspringSelectionGeneticAlgorithm(AlpsOffspringSelectionGeneticAlgorithm original, Cloner cloner)
+      : base(original, cloner) {
+      qualityAnalyzer = cloner.Clone(original.qualityAnalyzer);
+      layerQualityAnalyzer = cloner.Clone(original.layerQualityAnalyzer);
+      ageAnalyzer = cloner.Clone(original.ageAnalyzer);
+      layerAgeAnalyzer = cloner.Clone(original.layerAgeAnalyzer);
+      ageDistributionAnalyzer = cloner.Clone(original.ageDistributionAnalyzer);
+      layerAgeDistributionAnalyzer = cloner.Clone(original.layerAgeDistributionAnalyzer);
+      selectionPressureAnalyzer = cloner.Clone(original.selectionPressureAnalyzer);
+      layerSelectionPressureAnalyzer = cloner.Clone(original.layerSelectionPressureAnalyzer);
+      currentSuccessRatioAnalyzer = cloner.Clone(original.currentSuccessRatioAnalyzer);
+      generationsTerminator = cloner.Clone(original.generationsTerminator);
+      evaluationsTerminator = cloner.Clone(original.evaluationsTerminator);
+      qualityTerminator = cloner.Clone(original.qualityTerminator);
+      executionTimeTerminator = cloner.Clone(original.executionTimeTerminator);
+      slidingWindowTerminator = cloner.Clone(original.slidingWindowTerminator);
+      generationalSlidingWindowAnalyzer = cloner.Clone(original.generationalSlidingWindowAnalyzer);
+      offspringSelectionSlidingWindowAnalyze = cloner.Clone(original.offspringSelectionSlidingWindowAnalyze);
+      overfittingSelectionSlidingWindowAnalyzer = cloner.Clone(original.overfittingSelectionSlidingWindowAnalyzer);
+      generationalAdaptiveSlidingWindowAnalyzer = cloner.Clone(original.generationalAdaptiveSlidingWindowAnalyzer);
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AlpsOffspringSelectionGeneticAlgorithm(this, cloner);
+    }
+    public AlpsOffspringSelectionGeneticAlgorithm()
+      : base() {
+      #region Add parameters
+      Parameters.Add(new FixedValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
+      Parameters.Add(new FixedValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+
+      Parameters.Add(new FixedValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze all individuals from all layers combined.", new MultiAnalyzer()));
+      Parameters.Add(new FixedValueParameter<MultiAnalyzer>("LayerAnalyzer", "The operator used to analyze each layer.", new MultiAnalyzer()));
+
+      Parameters.Add(new FixedValueParameter<IntValue>("NumberOfLayers", "The number of layers.", new IntValue(10)));
+      Parameters.Add(new FixedValueParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer.", new IntValue(100)));
+
+      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new FixedValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.05)));
+      Parameters.Add(new FixedValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
+      Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true });
+
+      Parameters.Add(new FixedValueParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.", new DoubleValue(1)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>("ComparisonFactor", "The comparison factor is used to determine whether the offspring should be compared to the better parent, the worse parent or a quality value linearly interpolated between them. It is in the range [0;1].", new DoubleValue(1)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.", new DoubleValue(100)));
+      Parameters.Add(new FixedValueParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<IntValue>("SelectedParents", "How much parents should be selected each time the offspring selection step is performed until the population is filled. This parameter should be about the same or twice the size of PopulationSize for smaller problems, and less for large problems.", new IntValue(200)));
+      Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true });
+
+      Parameters.Add(new FixedValueParameter<EnumValue<AgingScheme>>("AgingScheme", "The aging scheme for setting the age-limits for the layers.", new EnumValue<AgingScheme>(OESRALPS.AgingScheme.Polynomial)));
+      Parameters.Add(new FixedValueParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers.", new IntValue(20)));
+      Parameters.Add(new FixedValueParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent.", new DoubleValue(1.0)) { Hidden = true });
+      Parameters.Add(new FixedValueParameter<IntArray>("AgeLimits", "The maximum age an individual is allowed to reach in a certain layer.", new IntArray(new int[0])) { Hidden = true });
+
+      Parameters.Add(new FixedValueParameter<IntValue>("MatingPoolRange", "The range of layers used for creating a mating pool. (1 = current + previous layer)", new IntValue(1)) { Hidden = true });
+      Parameters.Add(new FixedValueParameter<BoolValue>("ReduceToPopulationSize", "Reduce the CurrentPopulationSize after elder migration to PopulationSize", new BoolValue(true)) { Hidden = true });
+
+      Parameters.Add(new FixedValueParameter<MultiTerminator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop.", new MultiTerminator()));
+      
+      Parameters.Add(new FixedValueParameter<MultiAnalyzer>("SlidingWindow", "Operator which moves a sliding window over the training data."));   
+      
+      Parameters.Add(new ValueParameter<BoolValue>(TerminateSlidingWindowParameterName, "Indicates if the sliding window has reached the end of the training data set", new BoolValue(false)) { Hidden = true });
+      #endregion
+
+      #region Create operators
+      var globalRandomCreator = new RandomCreator();
+      var layer0Creator = new SubScopesCreator() { Name = "Create Layer Zero" };
+      var layer0Processor = new SubScopesProcessor();
+      var localRandomCreator = new LocalRandomCreator();
+      var layerSolutionsCreator = new SolutionsCreator();
+      var initializeAgeProcessor = new UniformSubScopesProcessor();
+      var initializeAge = new VariableCreator() { Name = "Initialize Age" };
+      var initializeCurrentPopulationSize = new SubScopesCounter() { Name = "Initialize CurrentPopulationCounter" };
+      var initializeLocalEvaluatedSolutions = new Assigner() { Name = "Initialize LayerEvaluatedSolutions" };
+      var initializeGlobalEvaluatedSolutions = new DataReducer() { Name = "Initialize EvaluatedSolutions" };
+      var resultsCollector = new ResultsCollector();
+      var mainLoop = new AlpsOffspringSelectionGeneticAlgorithmMainLoop();
+      #endregion
+
+      #region Create and parameterize operator graph
+      OperatorGraph.InitialOperator = globalRandomCreator;
+
+      globalRandomCreator.RandomParameter.ActualName = "GlobalRandom";
+      globalRandomCreator.SeedParameter.Value = null;
+      globalRandomCreator.SeedParameter.ActualName = SeedParameter.Name;
+      globalRandomCreator.SetSeedRandomlyParameter.Value = null;
+      globalRandomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
+      globalRandomCreator.Successor = layer0Creator;
+
+      layer0Creator.NumberOfSubScopesParameter.Value = new IntValue(1);
+      layer0Creator.Successor = layer0Processor;
+
+      layer0Processor.Operators.Add(localRandomCreator);
+      layer0Processor.Successor = initializeGlobalEvaluatedSolutions;
+
+      localRandomCreator.Successor = layerSolutionsCreator;
+
+      layerSolutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
+      layerSolutionsCreator.Successor = initializeAgeProcessor;
+
+      initializeAgeProcessor.Operator = initializeAge;
+      initializeAgeProcessor.Successor = initializeCurrentPopulationSize;
+
+      initializeCurrentPopulationSize.ValueParameter.ActualName = "CurrentPopulationSize";
+      initializeCurrentPopulationSize.Successor = initializeLocalEvaluatedSolutions;
+
+      initializeAge.CollectedValues.Add(new ValueParameter<DoubleValue>("Age", new DoubleValue(0)));
+      initializeAge.Successor = null;
+
+      initializeLocalEvaluatedSolutions.LeftSideParameter.ActualName = "LayerEvaluatedSolutions";
+      initializeLocalEvaluatedSolutions.RightSideParameter.ActualName = "CurrentPopulationSize";
+      initializeLocalEvaluatedSolutions.Successor = null;
+
+      initializeGlobalEvaluatedSolutions.ReductionOperation.Value.Value = ReductionOperations.Sum;
+      initializeGlobalEvaluatedSolutions.TargetOperation.Value.Value = ReductionOperations.Assign;
+      initializeGlobalEvaluatedSolutions.ParameterToReduce.ActualName = "LayerEvaluatedSolutions";
+      initializeGlobalEvaluatedSolutions.TargetParameter.ActualName = "EvaluatedSolutions";
+      initializeGlobalEvaluatedSolutions.Successor = resultsCollector;
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
+      resultsCollector.Successor = mainLoop;
+
+      mainLoop.GlobalRandomParameter.ActualName = "GlobalRandom";
+      mainLoop.LocalRandomParameter.ActualName = localRandomCreator.LocalRandomParameter.Name;
+      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
+      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
+      mainLoop.LayerAnalyzerParameter.ActualName = LayerAnalyzerParameter.Name;
+      mainLoop.NumberOfLayersParameter.ActualName = NumberOfLayersParameter.Name;
+      mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
+      mainLoop.CurrentPopulationSizeParameter.ActualName = "CurrentPopulationSize";
+      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
+      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
+      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
+      mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
+      mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
+      mainLoop.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
+      mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
+      mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
+      mainLoop.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
+      mainLoop.AgeParameter.ActualName = "Age";
+      mainLoop.AgeGapParameter.ActualName = AgeGapParameter.Name;
+      mainLoop.AgeInheritanceParameter.ActualName = AgeInheritanceParameter.Name;
+      mainLoop.AgeLimitsParameter.ActualName = AgeLimitsParameter.Name;
+      mainLoop.MatingPoolRangeParameter.ActualName = MatingPoolRangeParameter.Name;
+      mainLoop.ReduceToPopulationSizeParameter.ActualName = ReduceToPopulationSizeParameter.Name;
+      mainLoop.TerminatorParameter.ActualName = TerminatorParameter.Name;
+      mainLoop.SlidingWindowParameter.ActualName = SlidingWindowParameter.Name;
+      #endregion
+
+      #region Set operators
+      foreach (var selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(s => !(s is IMultiObjectiveSelector)).OrderBy(s => Name))
+        SelectorParameter.ValidValues.Add(selector);
+      var defaultSelector = SelectorParameter.ValidValues.OfType<GeneralizedRankSelector>().FirstOrDefault();
+      if (defaultSelector != null) {
+        defaultSelector.PressureParameter.Value = new DoubleValue(4.0);
+        SelectorParameter.Value = defaultSelector;
+      }
+      #endregion
+
+      #region Create analyzers
+      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+      layerQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+      ageAnalyzer = new OldestAverageYoungestAgeAnalyzer();
+      layerAgeAnalyzer = new OldestAverageYoungestAgeAnalyzer();
+      ageDistributionAnalyzer = new AgeDistributionAnalyzer();
+      layerAgeDistributionAnalyzer = new AgeDistributionAnalyzer();
+      selectionPressureAnalyzer = new ValueAnalyzer();
+      layerSelectionPressureAnalyzer = new ValueAnalyzer();
+      currentSuccessRatioAnalyzer = new ValueAnalyzer();
+      generationalSlidingWindowAnalyzer = new SymbolicRegressionGenerationalSlidingWindowAnalyzer();
+      offspringSelectionSlidingWindowAnalyze = new SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer();
+      overfittingSelectionSlidingWindowAnalyzer = new SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer();
+      generationalAdaptiveSlidingWindowAnalyzer = new SymbolicRegressionAdaptiveSlidingWindowAnalyzer();
+      #endregion
+
+      #region Create terminators
+      generationsTerminator = new ComparisonTerminator<IntValue>("Generations", ComparisonType.Less, new IntValue(1000)) { Name = "Generations" };
+      evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, new IntValue(int.MaxValue)) { Name = "Evaluations" };
+      qualityTerminator = new SingleObjectiveQualityTerminator() { Name = "Quality" };
+      executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5)));
+      slidingWindowTerminator = new ComparisonTerminator<BoolValue>(TerminateSlidingWindowParameterName, ComparisonType.NotEqual, new BoolValue(true)) { Name = "Terminate sliding window" };
+      #endregion
+
+      #region Parameterize
+      UpdateAnalyzers();
+      ParameterizeAnalyzers();
+
+      ParameterizeSelectors();
+
+      UpdateTerminators();
+
+      ParameterizeAgeLimits();
+      #endregion
+
+      Initialize();
+    }
+    #endregion
+
+    #region Events
+    public override void Prepare() {
+      if (Problem != null)
+        base.Prepare();
+    }
+    protected override void OnProblemChanged() {
+      base.OnProblemChanged();
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      foreach (var @operator in Problem.Operators.OfType<IOperator>())
+        ParameterizeStochasticOperator(@operator);
+      ParameterizeStochasticOperatorForLayer(Problem.Evaluator);
+
+      ParameterizeIterationBasedOperators();
+
+      ParameterizeSolutionsCreator();
+      ParameterizeMainLoop();
+      ParameterizeAnalyzers();
+      ParameterizeSelectors();
+      ParameterizeTerminators();
+
+      Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+
+      UpdateAnalyzers();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateTerminators();
+    }
+
+    protected override void RegisterProblemEvents() {
+      base.RegisterProblemEvents();
+      var maximizationParameter = (IValueParameter<BoolValue>)Problem.MaximizationParameter;
+      if (maximizationParameter != null) maximizationParameter.ValueChanged += new EventHandler(MaximizationParameter_ValueChanged);
+    }
+    protected override void DeregisterProblemEvents() {
+      var maximizationParameter = (IValueParameter<BoolValue>)Problem.MaximizationParameter;
+      if (maximizationParameter != null) maximizationParameter.ValueChanged -= new EventHandler(MaximizationParameter_ValueChanged);
+      base.DeregisterProblemEvents();
+    }
+
+    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
+      base.Problem_SolutionCreatorChanged(sender, e);
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+
+      Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+
+      ParameterizeSolutionsCreator();
+      ParameterizeAnalyzers();
+    }
+    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
+      base.Problem_EvaluatorChanged(sender, e);
+      ParameterizeStochasticOperatorForLayer(Problem.Evaluator);
+
+      UpdateAnalyzers();
+
+      ParameterizeSolutionsCreator();
+      ParameterizeMainLoop();
+      ParameterizeSelectors();
+    }
+    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
+      base.Problem_OperatorsChanged(sender, e);
+      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
+      ParameterizeStochasticOperatorForLayer(Problem.Evaluator);
+      ParameterizeIterationBasedOperators();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateTerminators();
+    }
+    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeMainLoop();
+      ParameterizeAnalyzers();
+      ParameterizeSelectors();
+    }
+    private void MaximizationParameter_ValueChanged(object sender, EventArgs e) {
+      ParameterizeTerminators();
+    }
+    private void QualityAnalyzer_CurrentBestQualityParameter_NameChanged(object sender, EventArgs e) {
+      ParameterizeTerminators();
+    }
+
+    private void AgeGap_ValueChanged(object sender, EventArgs e) {
+      ParameterizeAgeLimits();
+    }
+    private void AgingScheme_ValueChanged(object sender, EventArgs e) {
+      ParameterizeAgeLimits();
+    }
+    private void NumberOfLayers_ValueChanged(object sender, EventArgs e) {
+      ParameterizeAgeLimits();
+    }
+
+    private void AnalyzerOperators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IAnalyzer>> e) {
+      foreach (var analyzer in e.Items) {
+        foreach (var parameter in analyzer.Value.Parameters.OfType<IScopeTreeLookupParameter>()) {
+          parameter.Depth = 2;
+        }
+      }
+    }
+    private void LayerAnalyzerOperators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IAnalyzer>> e) {
+      foreach (var analyzer in e.Items) {
+        IParameter resultParameter;
+        if (analyzer.Value.Parameters.TryGetValue("Results", out resultParameter)) {
+          var lookupParameter = resultParameter as ILookupParameter;
+          if (lookupParameter != null)
+            lookupParameter.ActualName = "LayerResults";
+        }
+        foreach (var parameter in analyzer.Value.Parameters.OfType<IScopeTreeLookupParameter>()) {
+          parameter.Depth = 1;
+        }
+      }
+    }
+    #endregion
+
+    #region Parameterization
+    private void Initialize() {
+      if (Problem != null)
+        Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+
+      NumberOfLayersParameter.Value.ValueChanged += NumberOfLayers_ValueChanged;
+
+      Analyzer.Operators.ItemsAdded += AnalyzerOperators_ItemsAdded;
+      LayerAnalyzer.Operators.ItemsAdded += LayerAnalyzerOperators_ItemsAdded;
+
+      AgeGapParameter.Value.ValueChanged += AgeGap_ValueChanged;
+      AgingSchemeParameter.Value.ValueChanged += AgingScheme_ValueChanged;
+
+      qualityAnalyzer.CurrentBestQualityParameter.NameChanged += QualityAnalyzer_CurrentBestQualityParameter_NameChanged;
+    }
+    private void ParameterizeSolutionsCreator() {
+      SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+    }
+    private void ParameterizeMainLoop() {
+      MainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+    }
+    private void ParameterizeAnalyzers() {
+      qualityAnalyzer.ResultsParameter.ActualName = "Results";
+      qualityAnalyzer.ResultsParameter.Hidden = true;
+      qualityAnalyzer.QualityParameter.Depth = 2;
+      layerQualityAnalyzer.ResultsParameter.ActualName = "LayerResults";
+      layerQualityAnalyzer.ResultsParameter.Hidden = true;
+      layerQualityAnalyzer.QualityParameter.Depth = 1;
+      selectionPressureAnalyzer.Name = "SelectionPressure Analyzer";
+      selectionPressureAnalyzer.ResultsParameter.ActualName = "Results";
+      selectionPressureAnalyzer.ValueParameter.ActualName = "SelectionPressure";
+      selectionPressureAnalyzer.ValueParameter.Depth = 1;
+      selectionPressureAnalyzer.ValuesParameter.ActualName = "Selection Pressure History";
+      layerSelectionPressureAnalyzer.Name = "SelectionPressure Analyzer";
+      layerSelectionPressureAnalyzer.ResultsParameter.ActualName = "LayerResults";
+      layerSelectionPressureAnalyzer.ValueParameter.ActualName = "SelectionPressure";
+      layerSelectionPressureAnalyzer.ValueParameter.Depth = 0;
+      layerSelectionPressureAnalyzer.ValuesParameter.ActualName = "Selection Pressure History";
+      currentSuccessRatioAnalyzer.Name = "CurrentSuccessRatio Analyzer";
+      currentSuccessRatioAnalyzer.ResultsParameter.ActualName = "Results";
+      currentSuccessRatioAnalyzer.ValueParameter.ActualName = "CurrentSuccessRatio";
+      currentSuccessRatioAnalyzer.ValueParameter.Depth = 1;
+      currentSuccessRatioAnalyzer.ValuesParameter.ActualName = "Success Ratio History";
+      if (Problem != null) {
+        qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+        qualityAnalyzer.MaximizationParameter.Hidden = true;
+        qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+        qualityAnalyzer.QualityParameter.Hidden = true;
+        qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+        qualityAnalyzer.BestKnownQualityParameter.Hidden = true;
+        layerQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+        layerQualityAnalyzer.MaximizationParameter.Hidden = true;
+        layerQualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+        layerQualityAnalyzer.QualityParameter.Hidden = true;
+        layerQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+        layerQualityAnalyzer.BestKnownQualityParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeSelectors() {
+      foreach (var selector in SelectorParameter.ValidValues) {
+        selector.CopySelected = new BoolValue(true);
+        selector.NumberOfSelectedSubScopesParameter.Hidden = true;
+        selector.NumberOfSelectedSubScopesParameter.ActualName = SelectedParentsParameter.Name;
+        ParameterizeStochasticOperatorForLayer(selector);
+      }
+      if (Problem != null) {
+        foreach (var selector in SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>()) {
+          selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+          selector.MaximizationParameter.Hidden = true;
+          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+          selector.QualityParameter.Hidden = true;
+        }
+      }
+    }
+    private void ParameterizeTerminators() {
+      qualityTerminator.Parameterize(qualityAnalyzer.CurrentBestQualityParameter, Problem);
+    }
+    private void ParameterizeIterationBasedOperators() {
+      if (Problem != null) {
+        foreach (var @operator in Problem.Operators.OfType<IIterationBasedOperator>()) {
+          @operator.IterationsParameter.ActualName = "Generations";
+          @operator.IterationsParameter.Hidden = true;
+          @operator.MaximumIterationsParameter.ActualName = generationsTerminator.ThresholdParameter.Name;
+          @operator.MaximumIterationsParameter.Hidden = true;
+        }
+      }
+    }
+    private void ParameterizeAgeLimits() {
+      AgeLimits = AgingScheme.CalculateAgeLimits(AgeGap, NumberOfLayers);
+    }
+
+    private void ParameterizeStochasticOperator(IOperator @operator) {
+      var stochasticOperator = @operator as IStochasticOperator;
+      if (stochasticOperator != null) {
+        stochasticOperator.RandomParameter.ActualName = "GlobalRandom";
+        stochasticOperator.RandomParameter.Hidden = true;
+      }
+    }
+
+    private void ParameterizeStochasticOperatorForLayer(IOperator @operator) {
+      var stochasticOperator = @operator as IStochasticOperator;
+      if (stochasticOperator != null) {
+        stochasticOperator.RandomParameter.ActualName = "LocalRandom";
+        stochasticOperator.RandomParameter.Hidden = true;
+      }
+    }
+
+    #endregion
+
+    #region Updates
+    private void UpdateAnalyzers() {
+      Analyzer.Operators.Clear();
+      LayerAnalyzer.Operators.Clear();
+      SlidingWindow.Operators.Clear();
+
+      Analyzer.Operators.Add(qualityAnalyzer, qualityAnalyzer.EnabledByDefault);
+      Analyzer.Operators.Add(ageAnalyzer, ageAnalyzer.EnabledByDefault);
+      Analyzer.Operators.Add(ageDistributionAnalyzer, ageDistributionAnalyzer.EnabledByDefault);
+      Analyzer.Operators.Add(selectionPressureAnalyzer, false);
+      selectionPressureAnalyzer.ValueParameter.Depth = 1; // Adding analyzer sets depth to 2
+      Analyzer.Operators.Add(currentSuccessRatioAnalyzer, false);
+      currentSuccessRatioAnalyzer.ValueParameter.Depth = 1; // Adding analyzer sets depth to 2
+      LayerAnalyzer.Operators.Add(layerQualityAnalyzer, false);
+      LayerAnalyzer.Operators.Add(layerAgeAnalyzer, false);
+      LayerAnalyzer.Operators.Add(layerAgeDistributionAnalyzer, false);
+      LayerAnalyzer.Operators.Add(layerSelectionPressureAnalyzer, false);
+      layerSelectionPressureAnalyzer.ValueParameter.Depth = 0; // Adding layer-analyzer sets depth to 1
+      LayerAnalyzer.Operators.Add(new SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer() { UpdateAlways = true }, true);
+      LayerAnalyzer.Operators.Add(new SymbolicRregressionSingleObjectiveLayerQualityAnalyzer(), true);
+      LayerAnalyzer.Operators.Add(new SymbolicRegressionSingleObjectiveOverfittingSlidingWindowAnalyzer(), false);
+      LayerAnalyzer.Operators.Add(new SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer(), true);
+      
+      SlidingWindow.Operators.Add(generationalSlidingWindowAnalyzer);
+      SlidingWindow.Operators.Add(offspringSelectionSlidingWindowAnalyze, false);
+      SlidingWindow.Operators.Add(overfittingSelectionSlidingWindowAnalyzer, false);
+      SlidingWindow.Operators.Add(generationalAdaptiveSlidingWindowAnalyzer, false);
+
+      if (Problem != null) {
+        foreach (var analyzer in Problem.Operators.OfType<IAnalyzer>()) {
+          Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault);
+          LayerAnalyzer.Operators.Add((IAnalyzer)analyzer.Clone(), false);
+        }
+      }
+    }
+    private void UpdateCrossovers() {
+      var oldCrossover = CrossoverParameter.Value;
+      var defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault();
+      CrossoverParameter.ValidValues.Clear();
+      foreach (var crossover in Problem.Operators.OfType<ICrossover>().OrderBy(c => c.Name)) {
+        ParameterizeStochasticOperatorForLayer(crossover);
+        CrossoverParameter.ValidValues.Add(crossover);
+      }
+      if (oldCrossover != null) {
+        var crossover = CrossoverParameter.ValidValues.FirstOrDefault(c => c.GetType() == oldCrossover.GetType());
+        if (crossover != null)
+          CrossoverParameter.Value = crossover;
+        else
+          oldCrossover = null;
+      }
+      if (oldCrossover == null && defaultCrossover != null)
+        CrossoverParameter.Value = defaultCrossover;
+    }
+    private void UpdateMutators() {
+      IManipulator oldMutator = MutatorParameter.Value;
+      MutatorParameter.ValidValues.Clear();
+      IManipulator defaultMutator = Problem.Operators.OfType<IManipulator>().FirstOrDefault();
+
+      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) {
+        ParameterizeStochasticOperatorForLayer(mutator);
+        MutatorParameter.ValidValues.Add(mutator);
+      }
+
+      if (oldMutator != null) {
+        IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType());
+        if (mutator != null) MutatorParameter.Value = mutator;
+        else oldMutator = null;
+      }
+
+      if (oldMutator == null && defaultMutator != null)
+        MutatorParameter.Value = defaultMutator;
+    }
+    private void UpdateTerminators() {
+      var newTerminators = new Dictionary<ITerminator, bool> {
+       {generationsTerminator, Terminators.Operators.Contains(generationsTerminator) && Terminators.Operators.ItemChecked(generationsTerminator)},
+        {evaluationsTerminator, Terminators.Operators.Contains(evaluationsTerminator) && Terminators.Operators.ItemChecked(evaluationsTerminator)},
+        {qualityTerminator, Terminators.Operators.Contains(qualityTerminator) && Terminators.Operators.ItemChecked(qualityTerminator) },
+        {executionTimeTerminator, Terminators.Operators.Contains(executionTimeTerminator) && Terminators.Operators.ItemChecked(executionTimeTerminator)},
+        {slidingWindowTerminator, !Terminators.Operators.Contains(slidingWindowTerminator) || Terminators.Operators.ItemChecked(slidingWindowTerminator)}
+      };
+      if (Problem != null) {
+        foreach (var terminator in Problem.Operators.OfType<ITerminator>())
+          newTerminators.Add(terminator, !Terminators.Operators.Contains(terminator) || Terminators.Operators.ItemChecked(terminator));
+      }
+
+      Terminators.Operators.Clear();
+
+      foreach (var newTerminator in newTerminators)
+        Terminators.Operators.Add(newTerminator.Key, newTerminator.Value);
+    }
+    #endregion
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelectionGeneticAlgorithmMainLoop.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelectionGeneticAlgorithmMainLoop.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelectionGeneticAlgorithmMainLoop.cs	(revision 17479)
@@ -0,0 +1,479 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+using HeuristicLab.Selection;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+
+  [Item("AlpsOffspringSelectionGeneticAlgorithmMainLoop", "An open ended ALPS offspring selection genetic algorithm main loop operator.")]
+  [StorableType("E5D9E222-34C6-4511-BA34-74A65FCCC429")]
+
+    public sealed class AlpsOffspringSelectionGeneticAlgorithmMainLoop : AlgorithmOperator {
+    #region Parameter Properties
+    public IValueLookupParameter<IRandom> GlobalRandomParameter {
+      get { return (IValueLookupParameter<IRandom>)Parameters["GlobalRandom"]; }
+    }
+    public IValueLookupParameter<IRandom> LocalRandomParameter {
+      get { return (IValueLookupParameter<IRandom>)Parameters["LocalRandom"]; }
+    }
+
+    public IValueLookupParameter<IOperator> EvaluatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
+    }
+    public IValueLookupParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
+    }
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+
+    public ILookupParameter<IOperator> AnalyzerParameter {
+      get { return (ILookupParameter<IOperator>)Parameters["Analyzer"]; }
+    }
+    public ILookupParameter<IOperator> LayerAnalyzerParameter {
+      get { return (ILookupParameter<IOperator>)Parameters["LayerAnalyzer"]; }
+    }
+
+    public IValueLookupParameter<IntValue> NumberOfLayersParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfLayers"]; }
+    }
+    public IValueLookupParameter<IntValue> PopulationSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    public ILookupParameter<IntValue> CurrentPopulationSizeParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["CurrentPopulationSize"]; }
+    }
+
+    public IValueLookupParameter<IOperator> SelectorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Selector"]; }
+    }
+    public IValueLookupParameter<IOperator> CrossoverParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Crossover"]; }
+    }
+    public IValueLookupParameter<IOperator> MutatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Mutator"]; }
+    }
+    public IValueLookupParameter<PercentValue> MutationProbabilityParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    public IValueLookupParameter<IntValue> ElitesParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["Elites"]; }
+    }
+    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
+    }
+
+    public IValueLookupParameter<DoubleValue> SuccessRatioParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
+    }
+    public ILookupParameter<DoubleValue> ComparisonFactorParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
+    }
+    public IValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
+    }
+    public IValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; }
+    }
+    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
+    }
+
+    public IScopeTreeLookupParameter<DoubleValue> AgeParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; }
+    }
+    public IValueLookupParameter<IntValue> AgeGapParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["AgeGap"]; }
+    }
+    public IValueLookupParameter<DoubleValue> AgeInheritanceParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["AgeInheritance"]; }
+    }
+    public IValueLookupParameter<IntArray> AgeLimitsParameter {
+      get { return (IValueLookupParameter<IntArray>)Parameters["AgeLimits"]; }
+    }
+
+    public IValueLookupParameter<IntValue> MatingPoolRangeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["MatingPoolRange"]; }
+    }
+    public IValueLookupParameter<BoolValue> ReduceToPopulationSizeParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["ReduceToPopulationSize"]; }
+    }
+
+    public IValueLookupParameter<IOperator> TerminatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Terminator"]; }
+    }
+
+    public IValueLookupParameter<IOperator> SlidingWindowParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["SlidingWindow"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private AlpsOffspringSelectionGeneticAlgorithmMainLoop(StorableConstructorFlag _) : base(_) { }
+    private AlpsOffspringSelectionGeneticAlgorithmMainLoop(AlpsOffspringSelectionGeneticAlgorithmMainLoop original, Cloner cloner)
+      : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AlpsOffspringSelectionGeneticAlgorithmMainLoop(this, cloner);
+    }
+    public AlpsOffspringSelectionGeneticAlgorithmMainLoop()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IRandom>("GlobalRandom", "A pseudo random number generator."));
+      Parameters.Add(new ValueLookupParameter<IRandom>("LocalRandom", "A pseudo random number generator."));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze all individuals from all layers combined."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("LayerAnalyzer", "The operator used to analyze each layer."));
+
+      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfLayers", "The number of layers."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer."));
+      Parameters.Add(new LookupParameter<IntValue>("CurrentPopulationSize", "The current size of the population."));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
+
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactor", "The comparison factor is used to determine whether the offspring should be compared to the better parent, the worse parent or a quality value linearly interpolated between them. It is in the range [0;1]."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
+
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The age of individuals."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent."));
+      Parameters.Add(new ValueLookupParameter<IntArray>("AgeLimits", "The maximum age an individual is allowed to reach in a certain layer."));
+
+      Parameters.Add(new ValueLookupParameter<IntValue>("MatingPoolRange", "The range of sub - populations used for creating a mating pool. (1 = current + previous sub-population)"));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("ReduceToPopulationSize", "Reduce the CurrentPopulationSize after elder migration to PopulationSize"));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop"));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("SlidingWindow", "Operator which moves a sliding window over the training data."));
+
+
+      var variableCreator = new VariableCreator() { Name = "Initialize" };
+      var slidingWindow = new Placeholder() { Name = "Sliding Window (Placeholder)" };
+      var initLayerAnalyzerProcessor = new SubScopesProcessor();
+      var layerVariableCreator = new VariableCreator() { Name = "Initialize Layer" };
+      var initLayerAnalyzerPlaceholder = new Placeholder() { Name = "LayerAnalyzer (Placeholder)" };
+      var layerResultCollector = new ResultsCollector() { Name = "Collect layer results" };
+      var initAnalyzerPlaceholder = new Placeholder() { Name = "Analyzer (Placeholder)" };
+      var resultsCollector = new ResultsCollector();
+      var matingPoolCreator = new MatingPoolCreator() { Name = "Create Mating Pools" };
+      var matingPoolProcessor = new UniformSubScopesProcessor() { Name = "Process Mating Pools" };
+      var initializeLayer = new Assigner() { Name = "Reset LayerEvaluatedSolutions" };
+      var mainOperator = new AlpsOffspringSelectionGeneticAlgorithmMainOperator();
+      var generationsIcrementor = new IntCounter() { Name = "Increment Generations" };
+      var evaluatedSolutionsReducer = new DataReducer() { Name = "Increment EvaluatedSolutions" };
+      var eldersEmigrator = CreateEldersEmigrator();
+      var layerOpener = CreateLayerOpener();
+      var layerReseeder = CreateReseeder();
+      var layerAnalyzerProcessor = new UniformSubScopesProcessor();
+      var layerAnalyzerPlaceholder = new Placeholder() { Name = "LayerAnalyzer (Placeholder)" };
+      var analyzerPlaceholder = new Placeholder() { Name = "Analyzer (Placeholder)" };
+      var termination = new TerminationOperator();
+
+      OperatorGraph.InitialOperator = variableCreator;
+
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("OpenLayers", new IntValue(1)));
+      variableCreator.Successor = initLayerAnalyzerProcessor;
+
+      initLayerAnalyzerProcessor.Operators.Add(layerVariableCreator);
+      initLayerAnalyzerProcessor.Successor = initAnalyzerPlaceholder;
+
+      layerVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Layer", new IntValue(0)));
+      layerVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("LayerResults"));
+      layerVariableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0)));
+      layerVariableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("CurrentSuccessRatio", new DoubleValue(0)));
+      layerVariableCreator.Successor = initLayerAnalyzerPlaceholder;
+
+      initLayerAnalyzerPlaceholder.OperatorParameter.ActualName = LayerAnalyzerParameter.Name;
+      initLayerAnalyzerPlaceholder.Successor = layerResultCollector;
+
+      layerResultCollector.ResultsParameter.ActualName = "LayerResults";
+      layerResultCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", "Displays the rising selection pressure during a generation.", "SelectionPressure"));
+      layerResultCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Success Ratio", "Indicates how many successful children were already found during a generation (relative to the population size).", "CurrentSuccessRatio"));
+      layerResultCollector.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", "LayerResults"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("OpenLayers"));
+      resultsCollector.CopyValue = new BoolValue(false);
+      resultsCollector.Successor = slidingWindow;
+
+      slidingWindow.OperatorParameter.ActualName = SlidingWindowParameter.Name;
+      slidingWindow.Successor = matingPoolCreator;
+
+      matingPoolCreator.MatingPoolRangeParameter.Value = null;
+      matingPoolCreator.MatingPoolRangeParameter.ActualName = MatingPoolRangeParameter.Name;
+      matingPoolCreator.Successor = matingPoolProcessor;
+
+      matingPoolProcessor.Parallel.Value = true;
+      matingPoolProcessor.Operator = initializeLayer;
+      matingPoolProcessor.Successor = generationsIcrementor;
+
+      initializeLayer.LeftSideParameter.ActualName = "LayerEvaluatedSolutions";
+      initializeLayer.RightSideParameter.Value = new IntValue(0);
+      initializeLayer.Successor = mainOperator;
+
+      mainOperator.RandomParameter.ActualName = LocalRandomParameter.Name;
+      mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
+      mainOperator.EvaluatedSolutionsParameter.ActualName = "LayerEvaluatedSolutions";
+      mainOperator.QualityParameter.ActualName = QualityParameter.Name;
+      mainOperator.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      mainOperator.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
+      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
+      mainOperator.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      mainOperator.MutatorParameter.ActualName = MutatorParameter.ActualName;
+      mainOperator.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      mainOperator.ElitesParameter.ActualName = ElitesParameter.Name;
+      mainOperator.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
+      mainOperator.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
+      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
+      mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio";
+      mainOperator.SelectionPressureParameter.ActualName = "SelectionPressure";
+      mainOperator.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
+      mainOperator.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
+      mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
+      mainOperator.AgeParameter.ActualName = AgeParameter.Name;
+      mainOperator.AgeInheritanceParameter.ActualName = AgeInheritanceParameter.Name;
+      mainOperator.AgeIncrementParameter.Value = new DoubleValue(1.0);
+      mainOperator.Successor = null;
+
+      generationsIcrementor.ValueParameter.ActualName = "Generations";
+      generationsIcrementor.Increment = new IntValue(1);
+      generationsIcrementor.Successor = evaluatedSolutionsReducer;
+
+      evaluatedSolutionsReducer.ParameterToReduce.ActualName = "LayerEvaluatedSolutions";
+      evaluatedSolutionsReducer.TargetParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      evaluatedSolutionsReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum);
+      evaluatedSolutionsReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Sum);
+      evaluatedSolutionsReducer.Successor = eldersEmigrator;
+
+      eldersEmigrator.Successor = layerOpener;
+
+      layerOpener.Successor = layerReseeder;
+
+      layerReseeder.Successor = layerAnalyzerProcessor;
+
+      layerAnalyzerProcessor.Operator = layerAnalyzerPlaceholder;
+      layerAnalyzerProcessor.Successor = analyzerPlaceholder;
+
+      layerAnalyzerPlaceholder.OperatorParameter.ActualName = LayerAnalyzerParameter.Name;
+
+      analyzerPlaceholder.OperatorParameter.ActualName = AnalyzerParameter.Name;
+      analyzerPlaceholder.Successor = termination;
+
+      termination.TerminatorParameter.ActualName = TerminatorParameter.Name;
+      termination.ContinueBranch = slidingWindow;
+    }
+
+    private CombinedOperator CreateEldersEmigrator() {
+      var eldersEmigrator = new CombinedOperator() { Name = "Emigrate Elders" };
+      var selectorProsessor = new UniformSubScopesProcessor();
+      var eldersSelector = new EldersSelector();
+      var shiftToRightMigrator = new UnidirectionalRingMigrator() { Name = "Shift elders to next layer" };
+      var mergingProsessor = new UniformSubScopesProcessor();
+      var mergingReducer = new MergingReducer();
+      var subScopesCounter = new SubScopesCounter();
+      var reduceToPopulationSizeBranch = new ConditionalBranch() { Name = "ReduceToPopulationSize?" };
+      var countCalculator = new ExpressionCalculator() { Name = "CurrentPopulationSize = Min(CurrentPopulationSize, PopulationSize)" };
+      var bestSelector = new BestSelector();
+      var rightReducer = new RightReducer();
+
+      eldersEmigrator.OperatorGraph.InitialOperator = selectorProsessor;
+
+      selectorProsessor.Operator = eldersSelector;
+      selectorProsessor.Successor = shiftToRightMigrator;
+
+      eldersSelector.AgeParameter.ActualName = AgeParameter.Name;
+      eldersSelector.AgeLimitsParameter.ActualName = AgeLimitsParameter.Name;
+      eldersSelector.NumberOfLayersParameter.ActualName = NumberOfLayersParameter.Name;
+      eldersSelector.LayerParameter.ActualName = "Layer";
+      eldersSelector.Successor = null;
+
+      shiftToRightMigrator.ClockwiseMigrationParameter.Value = new BoolValue(true);
+      shiftToRightMigrator.Successor = mergingProsessor;
+
+      mergingProsessor.Operator = mergingReducer;
+
+      mergingReducer.Successor = subScopesCounter;
+
+      subScopesCounter.ValueParameter.ActualName = CurrentPopulationSizeParameter.Name;
+      subScopesCounter.AccumulateParameter.Value = new BoolValue(false);
+      subScopesCounter.Successor = reduceToPopulationSizeBranch;
+
+      reduceToPopulationSizeBranch.ConditionParameter.ActualName = ReduceToPopulationSizeParameter.Name;
+      reduceToPopulationSizeBranch.TrueBranch = countCalculator;
+
+      countCalculator.CollectedValues.Add(new LookupParameter<IntValue>(PopulationSizeParameter.Name));
+      countCalculator.CollectedValues.Add(new LookupParameter<IntValue>(CurrentPopulationSizeParameter.Name));
+      countCalculator.ExpressionParameter.Value = new StringValue("CurrentPopulationSize PopulationSize CurrentPopulationSize PopulationSize < if toint");
+      countCalculator.ExpressionResultParameter.ActualName = CurrentPopulationSizeParameter.Name;
+      countCalculator.Successor = bestSelector;
+
+      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = CurrentPopulationSizeParameter.Name;
+      bestSelector.CopySelected = new BoolValue(false);
+      bestSelector.Successor = rightReducer;
+
+      return eldersEmigrator;
+    }
+
+    private CombinedOperator CreateLayerOpener() {
+      var layerOpener = new CombinedOperator() { Name = "Open new Layer if needed" };
+      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 layerCreator = new LastLayerCloner() { Name = "Create Layer" };
+      var updateLayerNumber = new Assigner() { Name = "Layer = OpenLayers" };
+      var historyWiper = new ResultsHistoryWiper() { Name = "Clear History in Results" };
+      var createChildrenViaCrossover = new AlpsOffspringSelectionGeneticAlgorithmMainOperator();
+      var incrEvaluatedSolutionsForNewLayer = new SubScopesCounter() { Name = "Update EvaluatedSolutions" };
+      var incrOpenLayers = new IntCounter() { Name = "Incr. OpenLayers" };
+      var newLayerResultsCollector = new ResultsCollector() { Name = "Collect new Layer Results" };
+
+      layerOpener.OperatorGraph.InitialOperator = maxLayerReached;
+
+      maxLayerReached.LeftSideParameter.ActualName = "OpenLayers";
+      maxLayerReached.RightSideParameter.ActualName = NumberOfLayersParameter.Name;
+      maxLayerReached.ResultParameter.ActualName = "MaxLayerReached";
+      maxLayerReached.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      maxLayerReached.Successor = maxLayerReachedBranch;
+
+      maxLayerReachedBranch.ConditionParameter.ActualName = "MaxLayerReached";
+      maxLayerReachedBranch.FalseBranch = openNewLayerCalculator;
+
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntArray>(AgeLimitsParameter.Name));
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      openNewLayerCalculator.CollectedValues.Add(new LookupParameter<IntValue>(NumberOfLayersParameter.Name));
+      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;
+
+      layerCreator.NewLayerOperator = updateLayerNumber;
+      layerCreator.Successor = incrOpenLayers;
+
+      updateLayerNumber.LeftSideParameter.ActualName = "Layer";
+      updateLayerNumber.RightSideParameter.ActualName = "OpenLayers";
+      updateLayerNumber.Successor = historyWiper;
+
+      historyWiper.ResultsParameter.ActualName = "LayerResults";
+      historyWiper.Successor = createChildrenViaCrossover;
+
+      // Maybe use only crossover and no elitism instead of "default operator"
+      createChildrenViaCrossover.RandomParameter.ActualName = LocalRandomParameter.Name;
+      createChildrenViaCrossover.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
+      createChildrenViaCrossover.EvaluatedSolutionsParameter.ActualName = "LayerEvaluatedSolutions";
+      createChildrenViaCrossover.QualityParameter.ActualName = QualityParameter.Name;
+      createChildrenViaCrossover.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      createChildrenViaCrossover.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
+      createChildrenViaCrossover.SelectorParameter.ActualName = SelectorParameter.Name;
+      createChildrenViaCrossover.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      createChildrenViaCrossover.MutatorParameter.ActualName = MutatorParameter.ActualName;
+      createChildrenViaCrossover.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      createChildrenViaCrossover.ElitesParameter.ActualName = ElitesParameter.Name;
+      createChildrenViaCrossover.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
+      createChildrenViaCrossover.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
+      createChildrenViaCrossover.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
+      createChildrenViaCrossover.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio";
+      createChildrenViaCrossover.SelectionPressureParameter.ActualName = "SelectionPressure";
+      createChildrenViaCrossover.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
+      createChildrenViaCrossover.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
+      createChildrenViaCrossover.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
+      createChildrenViaCrossover.AgeParameter.ActualName = AgeParameter.Name;
+      createChildrenViaCrossover.AgeInheritanceParameter.ActualName = AgeInheritanceParameter.Name;
+      createChildrenViaCrossover.AgeIncrementParameter.Value = new DoubleValue(0.0);
+      createChildrenViaCrossover.Successor = incrEvaluatedSolutionsForNewLayer;
+
+      incrEvaluatedSolutionsForNewLayer.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      incrEvaluatedSolutionsForNewLayer.AccumulateParameter.Value = new BoolValue(true);
+
+      incrOpenLayers.ValueParameter.ActualName = "OpenLayers";
+      incrOpenLayers.Increment = new IntValue(1);
+      incrOpenLayers.Successor = newLayerResultsCollector;
+
+      newLayerResultsCollector.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("LayerResults", "Result set for each layer", "LayerResults"));
+      newLayerResultsCollector.CopyValue = new BoolValue(false);
+      newLayerResultsCollector.Successor = null;
+
+      return layerOpener;
+    }
+
+    private CombinedOperator CreateReseeder() {
+      var reseeder = new CombinedOperator() { Name = "Reseed Layer Zero if needed" };
+      var reseedingController = new ReseedingController() { Name = "Reseeding needed (Generation % AgeGap == 0)?" };
+      var removeIndividuals = new SubScopesRemover();
+      var createIndividuals = new SolutionsCreator();
+      var initializeAgeProsessor = new UniformSubScopesProcessor();
+      var initializeAge = new VariableCreator() { Name = "Initialize Age" };
+      var incrEvaluatedSolutionsAfterReseeding = new SubScopesCounter() { Name = "Update EvaluatedSolutions" };
+
+      reseeder.OperatorGraph.InitialOperator = reseedingController;
+
+      reseedingController.GenerationsParameter.ActualName = "Generations";
+      reseedingController.AgeGapParameter.ActualName = AgeGapParameter.Name;
+      reseedingController.FirstLayerOperator = removeIndividuals;
+      reseedingController.Successor = null;
+
+      removeIndividuals.Successor = createIndividuals;
+
+      createIndividuals.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
+      createIndividuals.Successor = initializeAgeProsessor;
+
+      initializeAgeProsessor.Operator = initializeAge;
+      initializeAgeProsessor.Successor = incrEvaluatedSolutionsAfterReseeding;
+
+      initializeAge.CollectedValues.Add(new ValueParameter<DoubleValue>(AgeParameter.Name, new DoubleValue(0)));
+
+      incrEvaluatedSolutionsAfterReseeding.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      incrEvaluatedSolutionsAfterReseeding.AccumulateParameter.Value = new BoolValue(true);
+
+      return reseeder;
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelectionGeneticAlgorithmMainOperator.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelectionGeneticAlgorithmMainOperator.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelectionGeneticAlgorithmMainOperator.cs	(revision 17479)
@@ -0,0 +1,409 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Selection;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  /// <summary>
+  /// An operator which represents the main loop of an offspring selection genetic algorithm.
+  /// </summary>
+  [Item("AlpsOffspringSelectionGeneticAlgorithmMainOperator", "An operator that represents the core of an alps offspring selection genetic algorithm.")]
+  [StorableType("9DBE8B6D-4390-4792-B1DC-0B7910601D46")]
+    public sealed class AlpsOffspringSelectionGeneticAlgorithmMainOperator : AlgorithmOperator {
+    #region Parameter properties
+    public IValueLookupParameter<IRandom> RandomParameter {
+      get { return (IValueLookupParameter<IRandom>)Parameters["GlobalRandom"]; }
+    }
+    public IValueLookupParameter<IOperator> EvaluatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
+    }
+    public ILookupParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
+    }
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+
+    public ILookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+
+    public IValueLookupParameter<IOperator> SelectorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Selector"]; }
+    }
+    public IValueLookupParameter<IOperator> CrossoverParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Crossover"]; }
+    }
+    public IValueLookupParameter<IOperator> MutatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Mutator"]; }
+    }
+    public IValueLookupParameter<PercentValue> MutationProbabilityParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    public IValueLookupParameter<IntValue> ElitesParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["Elites"]; }
+    }
+    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
+    }
+
+    public ILookupParameter<DoubleValue> ComparisonFactorParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
+    }
+    public ILookupParameter<DoubleValue> CurrentSuccessRatioParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["CurrentSuccessRatio"]; }
+    }
+    public IValueLookupParameter<DoubleValue> SuccessRatioParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
+    }
+    public ILookupParameter<DoubleValue> SelectionPressureParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["SelectionPressure"]; }
+    }
+    public IValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
+    }
+    public IValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; }
+    }
+    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
+    }
+
+    public IScopeTreeLookupParameter<DoubleValue> AgeParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; }
+    }
+    public IValueLookupParameter<DoubleValue> AgeInheritanceParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["AgeInheritance"]; }
+    }
+    public IValueLookupParameter<DoubleValue> AgeIncrementParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["AgeIncrement"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private AlpsOffspringSelectionGeneticAlgorithmMainOperator(StorableConstructorFlag _) : base(_) { }
+    private AlpsOffspringSelectionGeneticAlgorithmMainOperator(AlpsOffspringSelectionGeneticAlgorithmMainOperator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AlpsOffspringSelectionGeneticAlgorithmMainOperator(this, cloner);
+    }
+    public AlpsOffspringSelectionGeneticAlgorithmMainOperator()
+      : base() {
+      Initialize();
+    }
+
+    private void Initialize() {
+      Parameters.Add(new ValueLookupParameter<IRandom>("GlobalRandom", "A pseudo random number generator."));
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
+      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
+
+      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
+
+      Parameters.Add(new LookupParameter<DoubleValue>("ComparisonFactor", "The comparison factor is used to determine whether the offspring should be compared to the better parent, the worse parent or a quality value linearly interpolated between them. It is in the range [0;1]."));
+      Parameters.Add(new LookupParameter<DoubleValue>("CurrentSuccessRatio", "The current success ratio."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved."));
+      Parameters.Add(new LookupParameter<DoubleValue>("SelectionPressure", "The actual selection pressure."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
+
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The age of individuals."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("AgeIncrement", "The value the age the individuals is incremented if they survives a generation."));
+
+
+      var selector = new Placeholder();
+      var subScopesProcessor1 = new SubScopesProcessor();
+      var childrenCreator = new ChildrenCreator();
+      var osBeforeMutationBranch = new ConditionalBranch();
+      var uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
+      var crossover1 = new Placeholder();
+      var uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
+      var evaluator1 = new Placeholder();
+      var subScopesCounter1 = new SubScopesCounter();
+      var qualityComparer1 = new WeightedParentsQualityComparator();
+      var ageCalculator1 = new WeightingReducer() { Name = "Calculate Age" };
+      var subScopesRemover1 = new SubScopesRemover();
+      var uniformSubScopesProcessor3 = new UniformSubScopesProcessor();
+      var mutationBranch1 = new StochasticBranch();
+      var mutator1 = new Placeholder();
+      var variableCreator1 = new VariableCreator();
+      var variableCreator2 = new VariableCreator();
+      var conditionalSelector = new ConditionalSelector();
+      var subScopesProcessor2 = new SubScopesProcessor();
+      var uniformSubScopesProcessor4 = new UniformSubScopesProcessor();
+      var evaluator2 = new Placeholder();
+      var subScopesCounter2 = new SubScopesCounter();
+      var mergingReducer1 = new MergingReducer();
+      var uniformSubScopesProcessor5 = new UniformSubScopesProcessor();
+      var crossover2 = new Placeholder();
+      var mutationBranch2 = new StochasticBranch();
+      var mutator2 = new Placeholder();
+      var uniformSubScopesProcessor6 = new UniformSubScopesProcessor();
+      var evaluator3 = new Placeholder();
+      var subScopesCounter3 = new SubScopesCounter();
+      var qualityComparer2 = new WeightedParentsQualityComparator();
+      var ageCalculator2 = new WeightingReducer() { Name = "Calculate Age" };
+      var subScopesRemover2 = new SubScopesRemover();
+      var offspringSelector = new AlpsOffspringSelector();
+      var subScopesProcessor3 = new SubScopesProcessor();
+      var bestSelector = new BestSelector();
+      var worstSelector = new WorstSelector();
+      var rightReducer = new RightReducer();
+      var leftReducer = new LeftReducer();
+      var mergingReducer2 = new MergingReducer();
+      var reevaluateElitesBranch = new ConditionalBranch();
+      var uniformSubScopesProcessor7 = new UniformSubScopesProcessor();
+      var evaluator4 = new Placeholder();
+      var subScopesCounter4 = new SubScopesCounter();
+      var incrementAgeProcessor = new UniformSubScopesProcessor();
+      var ageIncrementor = new DoubleCounter() { Name = "Increment Age" };
+
+
+      OperatorGraph.InitialOperator = selector;
+
+      selector.Name = "Selector (placeholder)";
+      selector.OperatorParameter.ActualName = SelectorParameter.Name;
+      selector.Successor = subScopesProcessor1;
+
+      subScopesProcessor1.Operators.Add(new EmptyOperator());
+      subScopesProcessor1.Operators.Add(childrenCreator);
+      subScopesProcessor1.Successor = offspringSelector;
+
+      childrenCreator.ParentsPerChild = new IntValue(2);
+      childrenCreator.Successor = osBeforeMutationBranch;
+
+      osBeforeMutationBranch.Name = "Apply OS before mutation?";
+      osBeforeMutationBranch.ConditionParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
+      osBeforeMutationBranch.TrueBranch = uniformSubScopesProcessor1;
+      osBeforeMutationBranch.FalseBranch = uniformSubScopesProcessor5;
+      osBeforeMutationBranch.Successor = null;
+
+      uniformSubScopesProcessor1.Operator = crossover1;
+      uniformSubScopesProcessor1.Successor = uniformSubScopesProcessor2;
+
+      crossover1.Name = "Crossover (placeholder)";
+      crossover1.OperatorParameter.ActualName = CrossoverParameter.Name;
+      crossover1.Successor = null;
+
+      uniformSubScopesProcessor2.Parallel.Value = true;
+      uniformSubScopesProcessor2.Operator = evaluator1;
+      uniformSubScopesProcessor2.Successor = subScopesCounter1;
+
+      evaluator1.Name = "Evaluator (placeholder)";
+      evaluator1.OperatorParameter.ActualName = EvaluatorParameter.Name;
+      evaluator1.Successor = qualityComparer1;
+
+      subScopesCounter1.Name = "Increment EvaluatedSolutions";
+      subScopesCounter1.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      subScopesCounter1.Successor = uniformSubScopesProcessor3;
+
+      uniformSubScopesProcessor3.Operator = mutationBranch1;
+      uniformSubScopesProcessor3.Successor = conditionalSelector;
+
+      qualityComparer1.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
+      qualityComparer1.LeftSideParameter.ActualName = QualityParameter.Name;
+      qualityComparer1.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      qualityComparer1.RightSideParameter.ActualName = QualityParameter.Name;
+      qualityComparer1.ResultParameter.ActualName = "SuccessfulOffspring";
+      qualityComparer1.Successor = ageCalculator1;
+
+      ageCalculator1.ParameterToReduce.ActualName = AgeParameter.Name;
+      ageCalculator1.TargetParameter.ActualName = AgeParameter.Name;
+      ageCalculator1.WeightParameter.ActualName = AgeInheritanceParameter.Name;
+      ageCalculator1.Successor = subScopesRemover1;
+
+      subScopesRemover1.RemoveAllSubScopes = true;
+      subScopesRemover1.Successor = null;
+
+      mutationBranch1.ProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      mutationBranch1.RandomParameter.ActualName = RandomParameter.Name;
+      mutationBranch1.FirstBranch = mutator1;
+      mutationBranch1.SecondBranch = variableCreator2;
+      mutationBranch1.Successor = null;
+
+      mutator1.Name = "Mutator (placeholder)";
+      mutator1.OperatorParameter.ActualName = MutatorParameter.Name;
+      mutator1.Successor = variableCreator1;
+
+      variableCreator1.Name = "MutatedOffspring = true";
+      variableCreator1.CollectedValues.Add(new ValueParameter<BoolValue>("MutatedOffspring", null, new BoolValue(true)) { GetsCollected = false });
+      variableCreator1.Successor = null;
+
+      variableCreator2.Name = "MutatedOffspring = false";
+      variableCreator2.CollectedValues.Add(new ValueParameter<BoolValue>("MutatedOffspring", null, new BoolValue(false)) { GetsCollected = false });
+      variableCreator2.Successor = null;
+
+      conditionalSelector.ConditionParameter.ActualName = "MutatedOffspring";
+      conditionalSelector.ConditionParameter.Depth = 1;
+      conditionalSelector.CopySelected.Value = false;
+      conditionalSelector.Successor = subScopesProcessor2;
+
+      subScopesProcessor2.Operators.Add(new EmptyOperator());
+      subScopesProcessor2.Operators.Add(uniformSubScopesProcessor4);
+      subScopesProcessor2.Successor = mergingReducer1;
+
+      mergingReducer1.Successor = null;
+
+      uniformSubScopesProcessor4.Parallel.Value = true;
+      uniformSubScopesProcessor4.Operator = evaluator2;
+      uniformSubScopesProcessor4.Successor = subScopesCounter2;
+
+      evaluator2.Name = "Evaluator (placeholder)";
+      evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name;
+      evaluator2.Successor = null;
+
+      subScopesCounter2.Name = "Increment EvaluatedSolutions";
+      subScopesCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      subScopesCounter2.Successor = null;
+
+      uniformSubScopesProcessor5.Operator = crossover2;
+      uniformSubScopesProcessor5.Successor = uniformSubScopesProcessor6;
+
+      crossover2.Name = "Crossover (placeholder)";
+      crossover2.OperatorParameter.ActualName = CrossoverParameter.Name;
+      crossover2.Successor = mutationBranch2;
+
+      mutationBranch2.ProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      mutationBranch2.RandomParameter.ActualName = RandomParameter.Name;
+      mutationBranch2.FirstBranch = mutator2;
+      mutationBranch2.SecondBranch = null;
+      mutationBranch2.Successor = null;
+
+      mutator2.Name = "Mutator (placeholder)";
+      mutator2.OperatorParameter.ActualName = MutatorParameter.Name;
+      mutator2.Successor = null;
+
+      uniformSubScopesProcessor6.Parallel.Value = true;
+      uniformSubScopesProcessor6.Operator = evaluator3;
+      uniformSubScopesProcessor6.Successor = subScopesCounter3;
+
+      evaluator3.Name = "Evaluator (placeholder)";
+      evaluator3.OperatorParameter.ActualName = EvaluatorParameter.Name;
+      evaluator3.Successor = qualityComparer2;
+
+      subScopesCounter3.Name = "Increment EvaluatedSolutions";
+      subScopesCounter3.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+
+      qualityComparer2.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
+      qualityComparer2.LeftSideParameter.ActualName = QualityParameter.Name;
+      qualityComparer2.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      qualityComparer2.RightSideParameter.ActualName = QualityParameter.Name;
+      qualityComparer2.ResultParameter.ActualName = "SuccessfulOffspring";
+      qualityComparer2.Successor = ageCalculator2;
+
+      ageCalculator2.ParameterToReduce.ActualName = AgeParameter.Name;
+      ageCalculator2.TargetParameter.ActualName = AgeParameter.Name;
+      ageCalculator2.WeightParameter.ActualName = AgeInheritanceParameter.Name;
+      ageCalculator2.Successor = subScopesRemover2;
+
+      subScopesRemover2.RemoveAllSubScopes = true;
+      subScopesRemover2.Successor = null;
+
+      subScopesCounter3.Successor = null;
+
+      offspringSelector.CurrentSuccessRatioParameter.ActualName = CurrentSuccessRatioParameter.Name;
+      offspringSelector.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
+      offspringSelector.SelectionPressureParameter.ActualName = SelectionPressureParameter.Name;
+      offspringSelector.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
+      offspringSelector.OffspringPopulationParameter.ActualName = "OffspringPopulation";
+      offspringSelector.OffspringPopulationWinnersParameter.ActualName = "OffspringPopulationWinners";
+      offspringSelector.SuccessfulOffspringParameter.ActualName = "SuccessfulOffspring";
+      offspringSelector.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
+      offspringSelector.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
+      offspringSelector.OffspringCreator = selector;
+      offspringSelector.Successor = subScopesProcessor3;
+
+      subScopesProcessor3.Operators.Add(bestSelector);
+      subScopesProcessor3.Operators.Add(worstSelector);
+      subScopesProcessor3.Successor = mergingReducer2;
+
+      bestSelector.CopySelected = new BoolValue(false);
+      bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name;
+      bestSelector.QualityParameter.ActualName = QualityParameter.Name;
+      bestSelector.Successor = rightReducer;
+
+      rightReducer.Successor = reevaluateElitesBranch;
+
+      reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites";
+      reevaluateElitesBranch.Name = "Reevaluate elites ?";
+      reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor7;
+      reevaluateElitesBranch.FalseBranch = null;
+      reevaluateElitesBranch.Successor = null;
+
+      uniformSubScopesProcessor7.Parallel.Value = true;
+      uniformSubScopesProcessor7.Operator = evaluator4;
+      uniformSubScopesProcessor7.Successor = subScopesCounter4;
+
+      evaluator4.Name = "Evaluator (placeholder)";
+      evaluator4.OperatorParameter.ActualName = EvaluatorParameter.Name;
+
+      subScopesCounter4.Name = "Increment EvaluatedSolutions";
+      subScopesCounter4.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      subScopesCounter4.Successor = null;
+
+      worstSelector.CopySelected = new BoolValue(false);
+      worstSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      worstSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name;
+      worstSelector.QualityParameter.ActualName = QualityParameter.Name;
+      worstSelector.Successor = leftReducer;
+
+      leftReducer.Successor = null;
+
+      mergingReducer2.Successor = incrementAgeProcessor;
+
+      incrementAgeProcessor.Operator = ageIncrementor;
+      incrementAgeProcessor.Successor = null;
+
+      ageIncrementor.ValueParameter.ActualName = AgeParameter.Name;
+      ageIncrementor.IncrementParameter.Value = null;
+      ageIncrementor.IncrementParameter.ActualName = AgeIncrementParameter.Name;
+      ageIncrementor.Successor = null;
+    }
+
+    public override IOperation Apply() {
+      if (CrossoverParameter.ActualValue == null)
+        return null;
+      return base.Apply();
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelector.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelector.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/AlpsOffspringSelector.cs	(revision 17479)
@@ -0,0 +1,192 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("AlpsOffspringSelector", "Selects among the offspring population those that are designated successful and discards the unsuccessful offspring, except for some lucky losers. It expects the parent scopes to be below the first sub-scope, and offspring scopes to be below the second sub-scope separated again in two sub-scopes, the first with the failed offspring and the second with successful offspring.")]
+  [StorableType("EE7F1D99-2AFA-4EFB-A92D-B70450F75172")]
+    public class AlpsOffspringSelector : SingleSuccessorOperator {
+    public IValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
+    }
+    public IValueLookupParameter<DoubleValue> SuccessRatioParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
+    }
+    public ILookupParameter<DoubleValue> SelectionPressureParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["SelectionPressure"]; }
+    }
+    public ILookupParameter<DoubleValue> CurrentSuccessRatioParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["CurrentSuccessRatio"]; }
+    }
+    public ILookupParameter<ItemList<IScope>> OffspringPopulationParameter {
+      get { return (ILookupParameter<ItemList<IScope>>)Parameters["OffspringPopulation"]; }
+    }
+    public ILookupParameter<IntValue> OffspringPopulationWinnersParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["OffspringPopulationWinners"]; }
+    }
+    public IScopeTreeLookupParameter<BoolValue> SuccessfulOffspringParameter {
+      get { return (IScopeTreeLookupParameter<BoolValue>)Parameters["SuccessfulOffspring"]; }
+    }
+    public OperatorParameter OffspringCreatorParameter {
+      get { return (OperatorParameter)Parameters["OffspringCreator"]; }
+    }
+    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
+    }
+    public ILookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+
+    public IOperator OffspringCreator {
+      get { return OffspringCreatorParameter.Value; }
+      set { OffspringCreatorParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    protected AlpsOffspringSelector(StorableConstructorFlag _) : base(_) { }
+    protected AlpsOffspringSelector(AlpsOffspringSelector original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AlpsOffspringSelector(this, cloner);
+    }
+    public AlpsOffspringSelector()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure which prematurely terminates the offspring selection step."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful offspring that has to be produced."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("SelectionPressure", "The amount of selection pressure currently necessary to fulfill the success ratio."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentSuccessRatio", "The current success ratio indicates how much of the successful offspring have already been generated."));
+      Parameters.Add(new LookupParameter<ItemList<IScope>>("OffspringPopulation", "Temporary store of the offspring population."));
+      Parameters.Add(new LookupParameter<IntValue>("OffspringPopulationWinners", "Temporary store the number of successful offspring in the offspring population."));
+      Parameters.Add(new ScopeTreeLookupParameter<BoolValue>("SuccessfulOffspring", "True if the offspring was more successful than its parents.", 2));
+      Parameters.Add(new OperatorParameter("OffspringCreator", "The operator used to create new offspring."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer."));
+    }
+
+    public override IOperation Apply() {
+      double maxSelPress = MaximumSelectionPressureParameter.ActualValue.Value;
+      double successRatio = SuccessRatioParameter.ActualValue.Value;
+      bool fillPopulationWithParents = false;
+      if (FillPopulationWithParentsParameter.ActualValue != null)
+        fillPopulationWithParents = FillPopulationWithParentsParameter.ActualValue.Value;
+      IScope scope = ExecutionContext.Scope;
+      IScope parents = scope.SubScopes[0];
+      IScope offspring = scope.SubScopes[1];
+      int populationSize = PopulationSizeParameter.ActualValue.Value;
+
+      // retrieve actual selection pressure and success ratio
+      DoubleValue selectionPressure = SelectionPressureParameter.ActualValue;
+      if (selectionPressure == null) {
+        selectionPressure = new DoubleValue(0);
+        SelectionPressureParameter.ActualValue = selectionPressure;
+      }
+      DoubleValue currentSuccessRatio = CurrentSuccessRatioParameter.ActualValue;
+      if (currentSuccessRatio == null) {
+        currentSuccessRatio = new DoubleValue(0);
+        CurrentSuccessRatioParameter.ActualValue = currentSuccessRatio;
+      }
+
+      // retrieve next population
+      ItemList<IScope> population = OffspringPopulationParameter.ActualValue;
+      IntValue successfulOffspring;
+      if (population == null) {
+        population = new ItemList<IScope>();
+        OffspringPopulationParameter.ActualValue = population;
+        selectionPressure.Value = 0; // initialize selection pressure for this round
+        currentSuccessRatio.Value = 0; // initialize current success ratio for this round
+        successfulOffspring = new IntValue(0);
+        OffspringPopulationWinnersParameter.ActualValue = successfulOffspring;
+      } else successfulOffspring = OffspringPopulationWinnersParameter.ActualValue;
+
+      int worseOffspringNeeded = (int)((1 - successRatio) * populationSize) - (population.Count - successfulOffspring.Value);
+      int successfulOffspringAdded = 0;
+
+      // implement the ActualValue fetch here - otherwise the parent scope would also be included, given that there may be 1000 or more parents, this is quite unnecessary
+      string tname = SuccessfulOffspringParameter.TranslatedName;
+      double tmpSelPress = selectionPressure.Value, tmpSelPressInc = 1.0 / populationSize;
+      for (int i = 0; i < offspring.SubScopes.Count; i++) {
+        // fetch value
+        IVariable tmpVar;
+        if (!offspring.SubScopes[i].Variables.TryGetValue(tname, out tmpVar)) throw new InvalidOperationException(Name + ": Could not determine if an offspring was successful or not.");
+        BoolValue tmp = (tmpVar.Value as BoolValue);
+        if (tmp == null) throw new InvalidOperationException(Name + ": The variable that indicates whether an offspring is successful or not must contain a BoolValue.");
+
+        // add to population
+        if (tmp.Value) {
+          IScope currentOffspring = offspring.SubScopes[i];
+          offspring.SubScopes.Remove(currentOffspring);
+          i--;
+          population.Add(currentOffspring);
+          successfulOffspringAdded++;
+        } else if (worseOffspringNeeded > 0 || tmpSelPress >= maxSelPress) {
+          IScope currentOffspring;
+          if (!fillPopulationWithParents || worseOffspringNeeded > 0) {
+            currentOffspring = offspring.SubScopes[i];
+            offspring.SubScopes.Remove(currentOffspring);
+            i--;
+            worseOffspringNeeded--;
+          } else {
+            currentOffspring = parents.SubScopes[i];
+          }
+          population.Add(currentOffspring);
+        }
+        tmpSelPress += tmpSelPressInc;
+        if (population.Count == populationSize) break;
+      }
+      successfulOffspring.Value += successfulOffspringAdded;
+
+      // calculate actual selection pressure and success ratio
+      selectionPressure.Value = tmpSelPress;
+      currentSuccessRatio.Value = successfulOffspring.Value / ((double)populationSize);
+
+      // check if enough children have been generated
+      if (((selectionPressure.Value < maxSelPress) && (currentSuccessRatio.Value < successRatio)) ||
+          (population.Count < populationSize)) {
+        // more children required -> reduce left and start children generation again
+        scope.SubScopes.Remove(parents);
+        scope.SubScopes.Remove(offspring);
+        while (parents.SubScopes.Count > 0) {
+          IScope parent = parents.SubScopes[0];
+          parents.SubScopes.RemoveAt(0);
+          scope.SubScopes.Add(parent);
+        }
+
+        IOperator moreOffspring = OffspringCreatorParameter.ActualValue as IOperator;
+        if (moreOffspring == null) throw new InvalidOperationException(Name + ": More offspring are required, but no operator specified for creating them.");
+        return ExecutionContext.CreateOperation(moreOffspring);
+      } else {
+        // enough children generated
+        offspring.SubScopes.Clear();
+        offspring.SubScopes.AddRange(population);
+
+        scope.Variables.Remove(OffspringPopulationParameter.TranslatedName);
+        scope.Variables.Remove(OffspringPopulationWinnersParameter.TranslatedName);
+        return base.Apply();
+      }
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/AgeDistributionAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/AgeDistributionAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/AgeDistributionAnalyzer.cs	(revision 17479)
@@ -0,0 +1,136 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  // Based on QualityDistributionAnalyzer
+  [Item("AgeDistributionAnalyzer", "Analyzes the distribution of the ages in that it adds a Histogram of them into the result collection.")]
+  [StorableType("714CE0E4-A88F-44A1-A2D0-92F4D8252C04")]
+  public sealed class AgeDistributionAnalyzer : SingleSuccessorOperator, IAnalyzer, IIterationBasedOperator {
+
+    #region Parameter Properties
+    public IScopeTreeLookupParameter<DoubleValue> AgeParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; }
+    }
+    public IValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
+    }
+    private IValueParameter<StringValue> HistogramNameParameter {
+      get { return (IValueParameter<StringValue>)Parameters["HistogramName"]; }
+    }
+    private IValueParameter<BoolValue> StoreHistoryParameter {
+      get { return (IValueParameter<BoolValue>)Parameters["StoreHistory"]; }
+    }
+    public ILookupParameter<IntValue> IterationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["Generations"]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["MaximumIterations"]; }
+    }
+    #endregion
+
+    public bool EnabledByDefault { get { return false; } }
+
+    public string HistogramName {
+      get { return HistogramNameParameter.Value.Value; }
+      set { HistogramNameParameter.Value.Value = value; }
+    }
+    public bool StoreHistory {
+      get { return StoreHistoryParameter.Value.Value; }
+      set { StoreHistoryParameter.Value.Value = value; }
+    }
+
+    [StorableConstructor]
+    private AgeDistributionAnalyzer(StorableConstructorFlag _) : base(_) { }
+    private AgeDistributionAnalyzer(AgeDistributionAnalyzer original, Cloner cloner)
+      : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AgeDistributionAnalyzer(this, cloner);
+    }
+    public AgeDistributionAnalyzer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The value which represents the age of a solution."));
+      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection where the analysis values should be stored."));
+      Parameters.Add(new FixedValueParameter<StringValue>("HistogramName", "The name of the histogram that gets injected in to the results collection.", new StringValue("Age Distribution")));
+      Parameters.Add(new FixedValueParameter<BoolValue>("StoreHistory", "True if the history should be stored in addition to the current distribution", new BoolValue(false)));
+      Parameters.Add(new LookupParameter<IntValue>("Generations", "Optional: A value indicating the current iteration."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "Unused", new IntValue(-1)));
+
+      AgeParameter.Hidden = true;
+      ResultsParameter.Hidden = true;
+      IterationsParameter.Hidden = true;
+      MaximumIterationsParameter.Hidden = true;
+    }
+
+    public override IOperation Apply() {
+      DataTable ageDistribution = null;
+      ResultCollection results = ResultsParameter.ActualValue;
+      string description = "Shows the age distributions in the current population.";
+      if (results.ContainsKey(HistogramName)) {
+        ageDistribution = results[HistogramName].Value as DataTable;
+      } else {
+        ageDistribution = new DataTable("Population Age Distribution", description);
+        ageDistribution.VisualProperties.XAxisTitle = AgeParameter.ActualName;
+        ageDistribution.VisualProperties.YAxisTitle = "Frequency";
+        results.Add(new Result(HistogramName, description, ageDistribution));
+      }
+      DataRow row;
+      if (!ageDistribution.Rows.TryGetValue("AgeDistribution", out row)) {
+        row = new DataRow("AgeDistribution");
+        row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
+        ageDistribution.Rows.Add(row);
+      }
+      var ages = AgeParameter.ActualValue;
+      row.Values.Replace(ages.Select(x => x.Value));
+
+      if (StoreHistory) {
+        string historyResultName = HistogramName + " History";
+        DataTableHistory adHistory = null;
+        if (results.ContainsKey(historyResultName)) {
+          adHistory = results[historyResultName].Value as DataTableHistory;
+        } else {
+          adHistory = new DataTableHistory();
+          results.Add(new Result(historyResultName, adHistory));
+        }
+        DataTable table = (DataTable)ageDistribution.Clone();
+        IntValue iteration = IterationsParameter.ActualValue;
+        if (iteration != null) {
+          string iterationName = IterationsParameter.ActualName;
+          if (iterationName.EndsWith("s")) iterationName = iterationName.Remove(iterationName.Length - 1);
+          string appendix = " at " + iterationName + " " + iteration.Value.ToString();
+          table.Name += appendix;
+          table.Rows["AgeDistribution"].VisualProperties.DisplayName += appendix;
+        }
+        adHistory.Add(table);
+      }
+      return base.Apply();
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/GenerationalSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/GenerationalSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/GenerationalSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,71 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.SlidingWindow.Operator;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [Item("GenerationalSlidingWindowAnalyzer", "Analyzer which moves a sliding window every n-th generation over the training partition.")]
+    [StorableType("3E8EA052-3A86-4610-BA18-E3FE78DAD22F")]
+    public abstract class GenerationalSlidingWindowAnalyzer<T, U> : SlidingWindowAnalyzer<T, U>, IGenerationalSlidingWindowOperator
+        where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+        where U : class, IDataAnalysisProblemData
+    {
+        private const string GenerationsIntervalParameterName = "GenerationInterval";
+        private const string GenerationsIntervalStartParameterName = "GenerationIntervalStart";
+
+        #region parameter properties
+        public IFixedValueParameter<IntValue> GenerationsIntervalParameter {
+            get { return (IFixedValueParameter<IntValue>)Parameters[GenerationsIntervalParameterName]; }
+        }
+        public IFixedValueParameter<IntValue> GenerationsIntervalStartParameter {
+            get { return (IFixedValueParameter<IntValue>)Parameters[GenerationsIntervalStartParameterName]; }
+        }
+        #endregion
+
+        #region properties
+        public IntValue GenerationsInterval { get { return GenerationsIntervalParameter.Value; } }
+        public IntValue GenerationsIntervalStart { get { return GenerationsIntervalStartParameter.Value; } }
+        #endregion
+
+        [StorableConstructor]
+        protected GenerationalSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        protected GenerationalSlidingWindowAnalyzer(GenerationalSlidingWindowAnalyzer<T, U> original, Cloner cloner) : base(original, cloner) { }
+        public GenerationalSlidingWindowAnalyzer()
+          : base()
+        {
+            Parameters.Add(new FixedValueParameter<IntValue>(GenerationsIntervalParameterName, "The number of generations to pass for a window move.", new IntValue(1)));
+            Parameters.Add(new FixedValueParameter<IntValue>(GenerationsIntervalStartParameterName, "The number of generations to pass before the first window move.", new IntValue(0)));
+
+            MinimumIterationsUntilNextMoveParameter.Value = GenerationsIntervalParameter.Value;
+            MinimumIterationsUntilNextMoveParameter.Hidden = true;
+        }
+        
+        public override IOperation Apply()
+        {
+            if (TrainingPartitionParameter.ActualValue == null
+                || IsIterationIntervalPassed())
+                return OnMoveWindow();
+
+            return base.Apply();
+        }
+
+        protected IOperation GetBaseOperation()
+        {
+            return base.Apply();
+        }
+
+        protected bool IsIterationIntervalPassed() {
+            return (IterationsParameter.ActualValue.Value - GenerationsIntervalStart.Value) % GenerationsInterval.Value == 0;
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/ISlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/ISlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/ISlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,20 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.SlidingWindow.Operator;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [StorableType("136DA11B-0AC1-49A8-B4D9-DCE73BDB7114")]
+    public interface ISlidingWindowAnalyzer : 
+        ISymbolicDataAnalysisSingleObjectiveAnalyzer, ISlidingWindowOperator
+    {
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/LayerQualityAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/LayerQualityAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/LayerQualityAnalyzer.cs	(revision 17479)
@@ -0,0 +1,67 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [Item("LayerQualityAnalyzer", "An operator that analyzes the validation and training best solution for single objective problems on a layer.")]
+    [StorableType("31E292AA-95B2-4FA4-8544-CF2025B65822")]
+    public abstract class LayerQualityAnalyzer : SymbolicDataAnalysisSingleObjectiveAnalyzer
+    {
+        protected const string TrainingBestSolutionsParameterName = "Best training solution";
+        protected const string TrainingBestSolutionQualitiesParameterName = "Best training solution quality";
+
+        private const string ValidationBestSolutionParameterName = "Best validation solution";
+        private const string ValidationBestSolutionQualityParameterName = "Best validation solution quality";
+
+        private const string LayerBestSolutionChartName = "Layer best solution chart";
+
+        [StorableConstructor]
+        protected LayerQualityAnalyzer(StorableConstructorFlag _) : base(_) { }
+        protected LayerQualityAnalyzer(LayerQualityAnalyzer original, Cloner cloner)
+          : base(original, cloner)
+        {
+        }
+
+        protected LayerQualityAnalyzer() : base()
+        {
+        }
+
+        public override IOperation Apply()
+        {
+            var results = ResultCollection;
+            if (!results.ContainsKey(TrainingBestSolutionsParameterName)
+                || !results.ContainsKey(ValidationBestSolutionParameterName))
+                return base.Apply();
+
+            #region Add Parameter
+            if (!results.ContainsKey(LayerBestSolutionChartName))
+                results.Add(new Result(LayerBestSolutionChartName, new DataTable(LayerBestSolutionChartName)));
+
+            var layerQualityTable = (DataTable)results[LayerBestSolutionChartName].Value;
+
+            if (!layerQualityTable.Rows.ContainsKey(TrainingBestSolutionQualitiesParameterName))
+                layerQualityTable.Rows.Add(new DataRow(TrainingBestSolutionQualitiesParameterName));
+            if (!layerQualityTable.Rows.ContainsKey(ValidationBestSolutionQualityParameterName))
+                layerQualityTable.Rows.Add(new DataRow(ValidationBestSolutionQualityParameterName));
+            #endregion
+
+            layerQualityTable.Rows[TrainingBestSolutionQualitiesParameterName].Values.Add(((DoubleValue)results[TrainingBestSolutionQualitiesParameterName].Value).Value);
+            layerQualityTable.Rows[ValidationBestSolutionQualityParameterName].Values.Add(((DoubleValue)results[ValidationBestSolutionQualityParameterName].Value).Value);
+            
+            return base.Apply();
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OffspringSelectionSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OffspringSelectionSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OffspringSelectionSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,82 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [Item("OffspringSelectionSlidingWindowAnalyzer", "An operator that analyzes the offspring selection pressure and moves a sliding window if the threshold is exceeded.")]
+    [StorableType("75E112AA-95B2-4BA4-8544-CF2025A65822")]
+    public abstract class OffspringSelectionSlidingWindowAnalyzer<T, U> : SlidingWindowAnalyzer<T, U>
+        where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+        where U : class, IDataAnalysisProblemData
+    { 
+        private const string SelectionPressureParameterName = "SelectionPressure";
+        private const string SelectionPressureThresholdParameterName = "SelectionPressureThreshold";
+
+        #region parameter properties
+        public IScopeTreeLookupParameter<DoubleValue> SelectionPressureParameter {
+            get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[SelectionPressureParameterName]; }
+        }
+        public IFixedValueParameter<DoubleValue> SelectionPressureThresholdParameter {
+            get { return (IFixedValueParameter<DoubleValue>)Parameters[SelectionPressureThresholdParameterName]; }
+        }
+        #endregion
+
+        #region properties
+        public DoubleValue SelectionPressureThreshold {
+            get { return SelectionPressureThresholdParameter.Value; }
+        }
+        public ItemArray<DoubleValue> SelectionPressure {
+            get { return SelectionPressureParameter.ActualValue; }
+        }
+        #endregion
+
+        [StorableConstructor]
+        protected OffspringSelectionSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        protected OffspringSelectionSlidingWindowAnalyzer(OffspringSelectionSlidingWindowAnalyzer<T, U> original, Cloner cloner) : base(original, cloner) { }
+        public OffspringSelectionSlidingWindowAnalyzer()
+        {
+            Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(SelectionPressureParameterName, "Offspring selection pressure."));
+            Parameters.Add(new FixedValueParameter<DoubleValue>(SelectionPressureThresholdParameterName, "Offspring selection pressure threshold.", new DoubleValue(20)));
+        }
+
+        public override IOperation Apply()
+        {
+            if (TrainingPartitionParameter.ActualValue == null
+                || IsSelectionPressureThresholdExceeded())
+                return OnMoveWindow();
+             
+            return base.Apply();
+        }
+
+        private bool IsSelectionPressureThresholdExceeded()
+        {
+            // Selection pressure on each layer higher
+            // TODO consider maximum Selection Pressure
+            var AgeLimits = 
+                AgingScheme
+                .Linear
+                .CalculateAgeLimits((int)SelectionPressureThreshold.Value, SelectionPressure.Count());
+
+            // TODO think of a suitable strategy, 
+            // leave out first layer or check only last iterations before moving to next layer
+            for (int i = 0; i < SelectionPressure.Count(); i++)
+            {
+                if (SelectionPressure[i].Value > AgeLimits[i])
+                    return true;                
+            }
+
+            return false;    
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OldestAverageYoungestAgeAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OldestAverageYoungestAgeAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OldestAverageYoungestAgeAnalyzer.cs	(revision 17479)
@@ -0,0 +1,137 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("OldestAverageYoungestAgeAnalyzer", "An operator which calculates the current oldest, average and youngest age in the scope tree.")]
+  [StorableType("1AE2C4EF-BFCB-439C-AD5E-00E7740FD3D4")]
+  public sealed class OldestAverageYoungestAgeAnalyzer : AlgorithmOperator, IAnalyzer {
+    #region Parameter properties
+    public IScopeTreeLookupParameter<DoubleValue> AgeParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; }
+    }
+    public IValueLookupParameter<DoubleValue> CurrentOldestAgeParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["CurrentOldestAge"]; }
+    }
+    public IValueLookupParameter<DoubleValue> CurrentAverageAgeParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["CurrentAverageAge"]; }
+    }
+    public IValueLookupParameter<DoubleValue> CurrentYoungestAgeParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["CurrentYoungestAge"]; }
+    }
+    public IValueLookupParameter<DataTable> AgesParameter {
+      get { return (IValueLookupParameter<DataTable>)Parameters["Ages"]; }
+    }
+    public IValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
+    }
+    #endregion
+
+    #region Properties
+    public bool EnabledByDefault {
+      get { return false; }
+    }
+    private OldestAverageYoungestAgeCalculator OldestAverageYoungestAgeCalculator {
+      get { return (OldestAverageYoungestAgeCalculator)OperatorGraph.InitialOperator; }
+    }
+    #endregion
+
+    #region Storing & Cloning
+    [StorableConstructor]
+    private OldestAverageYoungestAgeAnalyzer(StorableConstructorFlag _) : base(_) { }
+    private OldestAverageYoungestAgeAnalyzer(OldestAverageYoungestAgeAnalyzer original, Cloner cloner)
+      : base(original, cloner) {
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new OldestAverageYoungestAgeAnalyzer(this, cloner);
+    }
+    #endregion
+    public OldestAverageYoungestAgeAnalyzer()
+      : base() {
+      #region Create parameters
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The value which represents the age of a solution."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentOldestAge", "The oldest age value found in the current population."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentAverageAge", "The average age value of all solutions in the current population."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentYoungestAge", "The youngest age value found in the current population."));
+      Parameters.Add(new ValueLookupParameter<DataTable>("Ages", "The data table to store the current oldest, current average, current youngest age value."));
+      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection where the analysis values should be stored."));
+
+      CurrentOldestAgeParameter.Hidden = true;
+      CurrentAverageAgeParameter.Hidden = true;
+      CurrentYoungestAgeParameter.Hidden = true;
+      AgesParameter.Hidden = true;
+      #endregion
+
+      #region Create operators
+      var oldestAverageYoungestAgeCalculator = new OldestAverageYoungestAgeCalculator();
+      var dataTableValuesCollector = new DataTableValuesCollector();
+      var resultsCollector = new ResultsCollector();
+
+      oldestAverageYoungestAgeCalculator.AverageAgeParameter.ActualName = CurrentAverageAgeParameter.Name;
+      oldestAverageYoungestAgeCalculator.OldestAgeParameter.ActualName = CurrentOldestAgeParameter.Name;
+      oldestAverageYoungestAgeCalculator.AgeParameter.ActualName = AgeParameter.Name;
+      oldestAverageYoungestAgeCalculator.AgeParameter.Depth = AgeParameter.Depth;
+      oldestAverageYoungestAgeCalculator.YoungestAgeParameter.ActualName = CurrentYoungestAgeParameter.Name;
+
+      dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentOldestAge", null, CurrentOldestAgeParameter.Name));
+      dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentAverageAge", null, CurrentAverageAgeParameter.Name));
+      dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("CurrentYoungestAge", null, CurrentYoungestAgeParameter.Name));
+      dataTableValuesCollector.DataTableParameter.ActualName = AgesParameter.Name;
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(AgesParameter.Name));
+      resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
+      #endregion
+
+      #region Create operator graph
+      OperatorGraph.InitialOperator = oldestAverageYoungestAgeCalculator;
+      oldestAverageYoungestAgeCalculator.Successor = dataTableValuesCollector;
+      dataTableValuesCollector.Successor = resultsCollector;
+      resultsCollector.Successor = null;
+      #endregion
+
+      Initialize();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      Initialize();
+    }
+
+    private void Initialize() {
+      AgeParameter.DepthChanged += new EventHandler(AgeParameter_DepthChanged);
+    }
+
+    private void AgeParameter_DepthChanged(object sender, EventArgs e) {
+      OldestAverageYoungestAgeCalculator.AgeParameter.Depth = AgeParameter.Depth;
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OldestAverageYoungestAgeCalculator.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OldestAverageYoungestAgeCalculator.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OldestAverageYoungestAgeCalculator.cs	(revision 17479)
@@ -0,0 +1,91 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Parameters;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("OldestAverageYoungestAgeCalculator", "An operator which calculates the oldest, average and youngest age of solutions in the scope tree.")]
+  [StorableType("DF4FA02E-C328-4A6E-9096-5BFADFA9F5D4")]
+  public sealed class OldestAverageYoungestAgeCalculator : SingleSuccessorOperator {
+    public IScopeTreeLookupParameter<DoubleValue> AgeParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; }
+    }
+    public IValueLookupParameter<DoubleValue> OldestAgeParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["OldestAge"]; }
+    }
+    public IValueLookupParameter<DoubleValue> AverageAgeParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["AverageAge"]; }
+    }
+    public IValueLookupParameter<DoubleValue> YoungestAgeParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["YoungestAge"]; }
+    }
+
+    #region Storing & Cloning
+    [StorableConstructor]
+    private OldestAverageYoungestAgeCalculator(StorableConstructorFlag _) : base(_) { }
+    private OldestAverageYoungestAgeCalculator(OldestAverageYoungestAgeCalculator original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new OldestAverageYoungestAgeCalculator(this, cloner);
+    }
+    #endregion
+
+    public OldestAverageYoungestAgeCalculator()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The value contained in the scope tree which represents the solution age."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("OldestAge", "The age value of the oldest solution."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("AverageAge", "The average age of all solutions."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("YoungestAge", "The age value of the youngest solution."));
+
+      OldestAgeParameter.Hidden = true;
+      AverageAgeParameter.Hidden = true;
+      YoungestAgeParameter.Hidden = true;
+    }
+
+    public override IOperation Apply() {
+      var ages = AgeParameter.ActualValue;
+
+      if (ages.Length > 0) {
+        double min = double.MaxValue, max = double.MinValue, sum = 0;
+        for (int i = 0; i < ages.Length; i++) {
+          if (ages[i].Value < min) min = ages[i].Value;
+          if (ages[i].Value > max) max = ages[i].Value;
+          sum += ages[i].Value;
+        }
+
+        var oldest = OldestAgeParameter.ActualValue;
+        if (oldest == null) OldestAgeParameter.ActualValue = new DoubleValue(max);
+        else oldest.Value = max;
+        var average = AverageAgeParameter.ActualValue;
+        if (average == null) AverageAgeParameter.ActualValue = new DoubleValue(sum / ages.Length);
+        else average.Value = sum / ages.Length;
+        var youngest = YoungestAgeParameter.ActualValue;
+        if (youngest == null) YoungestAgeParameter.ActualValue = new DoubleValue(min);
+        else youngest.Value = min;
+      }
+      return base.Apply();
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OverfittingSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OverfittingSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/OverfittingSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,80 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [Item("OverfittingSlidingWindowAnalyzer", "An operator that analyzes the correlation of training and validation fitness of symbolic regression models and moves a sliding window if the thresholds are exceeded.")]
+    [StorableType("75E112AA-91B2-4BA4-8544-CF2025A65822")]
+    public abstract class OverfittingSlidingWindowAnalyzer<T, U> : SlidingWindowAnalyzer<T, U>
+        where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+        where U : class, IDataAnalysisProblemData
+    {
+        private const string OverfittingParameterName = "IsOverfitting";
+        
+        #region parameter properties
+        public IScopeTreeLookupParameter<BoolValue> OverfittingParameter {
+            get { return (IScopeTreeLookupParameter<BoolValue>)Parameters[OverfittingParameterName]; }
+        }
+        #endregion
+
+        #region properties
+        public ItemArray<BoolValue> Overfitting {
+            get { return OverfittingParameter.ActualValue; }
+        }
+        #endregion
+
+        [StorableConstructor]
+        protected OverfittingSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        protected OverfittingSlidingWindowAnalyzer(OverfittingSlidingWindowAnalyzer<T, U> original, Cloner cloner) : base(original, cloner) { }
+        public OverfittingSlidingWindowAnalyzer()
+        {
+            Parameters.Add(new ScopeTreeLookupParameter<BoolValue>(OverfittingParameterName, "Boolean indicator for overfitting."));
+        }
+
+        public override IOperation Apply()
+        {
+            if (TrainingPartitionParameter.ActualValue == null
+                || IsSystemOverfitting())
+                return OnMoveWindow();
+
+            return base.Apply();
+        }
+
+        private bool IsSystemOverfitting()
+        {
+            // TODO think of a suitable strategy
+            return Overfitting.Any()
+                && IsMajorityOverfitting();
+                //&& IsOverfittingMoreThanTwo();
+        }
+
+        private bool IsMajorityOverfitting()
+        {
+            var skipFirstLayerNumb = 2;
+            return Overfitting
+                .Skip(skipFirstLayerNumb)
+                .Where(overfit => overfit.Value)
+                .Count() > Math.Ceiling((Overfitting.Count() - skipFirstLayerNumb) / 2.0);
+        }
+
+        private bool IsOverfittingMoreThanTwo()
+        {
+            var skipFirstLayerNumb = 2;
+            return Overfitting
+                .Skip(skipFirstLayerNumb)
+                .Where(overfit => overfit.Value)
+                .Count() > 2;
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionAdaptiveSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionAdaptiveSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionAdaptiveSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,148 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.DriftDetection;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
+{
+    [Item("SymbolicRegressionGenerationalAdaptiveSlidingWindowAnalyzer", "Symbolic Regression Analyzer which moves a sliding window every n-th generation over the training partition and adapts the window size, when a change is detected.")]
+    [StorableType("936D341B-0AC1-49A8-B4D9-DCE13BDB7114")]
+    public sealed class SymbolicRegressionAdaptiveSlidingWindowAnalyzer : SlidingWindowAnalyzer<ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>
+    {
+        private const string LayerResultsParameterName = "LayerResults";
+
+        private const string DriftDetectedParameterName = "Drift Detected";
+        private const string AdwinWindowSizeParameterName = "ADWIN Window Size";
+
+        private const string SlidingWindowSizeChart = "Adaptive Sliding Window Size";
+
+        private const string DeltaParameterName = "Delta";
+
+        [Storable]
+        private ADWINWrapper adwin;
+
+        #region parameter properties
+        public IScopeTreeLookupParameter<ResultCollection> LayerResultsParameterParameter {
+            get { return (IScopeTreeLookupParameter<ResultCollection>)Parameters[LayerResultsParameterName]; }
+        }
+        public IFixedValueParameter<DoubleValue> DeltaParameter {
+            get { return (IFixedValueParameter<DoubleValue>)Parameters[DeltaParameterName]; }
+        }
+        #endregion
+
+        [StorableConstructor]
+        private SymbolicRegressionAdaptiveSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        private SymbolicRegressionAdaptiveSlidingWindowAnalyzer(SymbolicRegressionAdaptiveSlidingWindowAnalyzer original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicRegressionAdaptiveSlidingWindowAnalyzer()
+          : base()
+        {
+            Parameters.Add(new ScopeTreeLookupParameter<ResultCollection>(LayerResultsParameterName, "Results of all Layers.") { Depth = 1 });
+            Parameters.Add(new FixedValueParameter<DoubleValue>(DeltaParameterName, "The confidence value for hypothesis test.", new DoubleValue(0.1)));
+
+            SlidingWindowSize.Value = 100;
+            SlidingWindowStepWidth.Value = (int)(SlidingWindowSize.Value * 0.1);
+
+            SlidingWindowSizeParameter.Hidden = true;
+            SlidingWindowStepWidthParameter.Hidden = true;
+
+            adwin = new ADWINWrapper(DeltaParameter.Value.Value, 200, 20, 20);
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionAdaptiveSlidingWindowAnalyzer(this, cloner);
+        }
+
+        public override IOperation Apply()
+        {
+            #region DataTable Parameters
+            var results = ResultCollection;
+            if (!results.ContainsKey(SlidingWindowSizeChart))
+                results.Add(new Result(SlidingWindowSizeChart, new DataTable(SlidingWindowSizeChart)));
+
+            var slidingWindowSizeChart = (DataTable)results[SlidingWindowSizeChart].Value;
+
+            if (!slidingWindowSizeChart.Rows.ContainsKey(AdwinWindowSizeParameterName))
+                slidingWindowSizeChart.Rows.Add(new DataRow(AdwinWindowSizeParameterName));
+            if (!slidingWindowSizeChart.Rows.ContainsKey(DriftDetectedParameterName))
+                slidingWindowSizeChart.Rows.Add(new DataRow(DriftDetectedParameterName) { VisualProperties = { SecondYAxis = true } });
+            #endregion
+
+            if (TrainingPartitionParameter.ActualValue == null 
+                || ValidationPartitionParameter == null) { 
+                adwin = new ADWINWrapper(DeltaParameter.Value.Value, 200, 20, 20);
+                SlidingWindowSize.Value = 100;
+                SlidingWindowStepWidth.Value = (int)(SlidingWindowSize.Value * 0.1);
+                TerminateSlidingWindowParameter.ActualValue.Value = false;
+                InitializeSlidingWindow(StartSlidingWindow.Value, SlidingWindowSize.Value);
+                return base.Apply();
+            }
+            if (!IsMinimumIterationIntervalPassed())
+                return base.Apply();
+
+            #region set up evaluation
+            var growingTerm = 1 + (int)(SlidingWindowSize.Value * 0.10); //1 + (int)(SlidingWindowStepWidth.Value * 0.5);
+            if (ValidationPartitionParameter.ActualValue.End >= ProblemData.TestPartition.Start)
+            {
+                TerminateSlidingWindowParameter.ActualValue.Value = true;
+                return base.Apply();
+            }
+            else if (ValidationPartitionParameter.ActualValue.End > ProblemData.TestPartition.Start - growingTerm)
+            {
+                growingTerm = ProblemData.TestPartition.Start - ValidationPartitionParameter.ActualValue.End;
+            }
+            
+            IntRange rangeToEvaluate;
+            if (adwin.NumElementsProcessed == 0)
+                rangeToEvaluate = new IntRange(adwin.Count,
+                    ValidationPartitionParameter.ActualValue.End + growingTerm + 1);
+            else
+                rangeToEvaluate =
+                    new IntRange(adwin.Count,
+                    ValidationPartitionParameter.ActualValue.End + growingTerm);
+
+            var rows = Enumerable.Range(rangeToEvaluate.Start, rangeToEvaluate.Size);
+            #endregion
+            
+            var changeDetected = false;
+            var targetValues = ProblemDataParameter.ActualValue.Dataset.GetDoubleValues(ProblemDataParameter.ActualValue.TargetVariable, rows);
+
+            IList<double> changeBuffer = new List<double>();
+            IList<double> windowSizeBuffer = new List<double>();
+
+            var targetValuesEnumerator = targetValues.GetEnumerator();
+            while (!changeDetected && targetValuesEnumerator.MoveNext())
+            {
+                changeDetected |= adwin.AddElement(targetValuesEnumerator.Current);
+                //changeBuffer.Add(changeDetected ? 1 : 0);
+                //windowSizeBuffer.Add(adwin.WindowSize);
+            }
+
+            InitializeSlidingWindow(
+                adwin.Count - adwin.WindowSize,
+                adwin.WindowSize);
+
+            SlidingWindowSize.Value = adwin.WindowSize;
+            SlidingWindowStepWidth.Value = (int)(SlidingWindowSize.Value * 0.1);
+
+            //slidingWindowSizeChart.Rows[DriftDetectedParameterName].Values.AddRange(changeBuffer);
+            //slidingWindowSizeChart.Rows[AdwinWindowSizeParameterName].Values.AddRange(windowSizeBuffer);
+            results[SlidingWindowSizeChart].Value = slidingWindowSizeChart;
+
+            return base.Apply();
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionGenerationalSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionGenerationalSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionGenerationalSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,30 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
+{
+    [Item("SymbolicRegressionGenerationalSlidingWindowAnalyzer", "Symbolic Regression Analyzer which moves a sliding window every n-th generation over the training partition.")]
+    [StorableType("3E8EA052-3116-4610-BA18-E3FE78DAD22F")]
+    public sealed class SymbolicRegressionGenerationalSlidingWindowAnalyzer : GenerationalSlidingWindowAnalyzer<ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>
+    {
+        [StorableConstructor]
+        private SymbolicRegressionGenerationalSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        private SymbolicRegressionGenerationalSlidingWindowAnalyzer(SymbolicRegressionGenerationalSlidingWindowAnalyzer original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicRegressionGenerationalSlidingWindowAnalyzer()
+          : base()
+        {
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionGenerationalSlidingWindowAnalyzer(this, cloner);
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,31 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
+{
+    [Item("SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer", "An operator that analyzes the offspring selection pressure and moves a sliding window if the threshold is exceeded.")]
+    [StorableType("75E2AAAA-95B2-4FA4-8544-CC2021B65820")]
+    public class SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer 
+        : OffspringSelectionSlidingWindowAnalyzer<ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>
+    {
+        [StorableConstructor]
+        private SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        private SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer(SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer()
+          : base()
+        {
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer(this, cloner);
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionOverfittingSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionOverfittingSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionOverfittingSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,31 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
+{
+    [Item("SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer", "An operator that analyzes the correlation of training and validation fitness of symbolic regression models and moves a sliding window if the thresholds are exceeded.")]
+    [StorableType("7BE112AA-94B2-4BA4-8544-AF2025A65122")]
+    public sealed class SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer 
+        : OverfittingSlidingWindowAnalyzer<ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>
+    {
+        [StorableConstructor]
+        private SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        private SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer(SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer()
+          : base()
+        {
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer(this, cloner);
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveLayerOverfittingSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveLayerOverfittingSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveLayerOverfittingSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,33 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
+{
+    [Item("SymbolicRegressionSingleObjectiveOverfittingSlidingWindowAnalyzer", "Calculates and tracks correlation of training and validation fitness of symbolic regression models.")]
+    [StorableType("75E2AAA3-95B2-4FA4-8554-CF2025B67729")]
+    public sealed class SymbolicRegressionSingleObjectiveOverfittingSlidingWindowAnalyzer 
+        : SymbolicDataAnalysisSingleObjectiveOverfittingAnalyzer<ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>
+    {
+        [StorableConstructor]
+        private SymbolicRegressionSingleObjectiveOverfittingSlidingWindowAnalyzer(StorableConstructorFlag _)
+               : base(_) { }
+        private SymbolicRegressionSingleObjectiveOverfittingSlidingWindowAnalyzer(SymbolicRegressionSingleObjectiveOverfittingSlidingWindowAnalyzer original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicRegressionSingleObjectiveOverfittingSlidingWindowAnalyzer()
+          : base()
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionSingleObjectiveOverfittingSlidingWindowAnalyzer(this, cloner);
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,55 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
+{
+    [Item("SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer", "An operator that analyzes the training best symbolic regression solution for single objective symbolic regression problems.")]
+    [StorableType("85786F8E-A81D-4909-9A66-620669A0C7FB")]
+    public sealed class SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer 
+        : SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer<ISymbolicRegressionSolution, ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>,
+        ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator
+    {
+        private const string ProblemDataParameterName = "ProblemData";
+        private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+        private const string EstimationLimitsParameterName = "EstimationLimits";
+
+        #region parameter properties
+        public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
+            get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+        }
+        #endregion
+
+        [StorableConstructor]
+        private SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        private SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer(SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer()
+          : base()
+        {
+            Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model."));
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer(this, cloner);
+        }
+
+        protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality)
+        {
+            var model = new SymbolicRegressionModel(ProblemDataParameter.ActualValue.TargetVariable, (ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper);
+            if (ApplyLinearScalingParameter.ActualValue.Value) model.Scale(ProblemDataParameter.ActualValue);
+            return new SymbolicRegressionSolution(model, (IRegressionProblemData)ProblemDataParameter.ActualValue.Clone());
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,226 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+#region License Information
+/* HeuristicLab
+    * Copyright (C) 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 HEAL.Attic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Parameters;
+using HeuristicLab.Common;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Random;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
+{
+    /// <summary>
+    /// An operator that analyzes the validation best symbolic regression solution for single objective symbolic regression problems.
+    /// </summary>
+    [Item("SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer", "An operator that analyzes the validation best symbolic regression solution for single objective symbolic regression problems.")]
+    [StorableType("75E2AFFF-95B2-4FA4-8544-CF202A665890")]
+    public class SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer 
+        : SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer<ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>,
+        ISymbolicDataAnalysisBoundedOperator
+    {
+        private const string EstimationLimitsParameterName = "EstimationLimits";
+        private const string ValidationBestSolutionParameterName = "Best validation solution";
+        private const string ValidationBestSolutionQualityParameterName = "Best validation solution quality";
+        private const string ValidationBestSolutionGenerationParameterName = "Best validation solution generation";
+        private const string UpdateAlwaysParameterName = "Always update best solution";
+        private const string IterationsParameterName = "Generations";
+        private const string MaximumIterationsParameterName = "Maximum Iterations";
+
+        #region parameter properties
+        public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
+            get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+        }
+        public ILookupParameter<ISymbolicRegressionSolution> ValidationBestSolutionParameter {
+            get { return (ILookupParameter<ISymbolicRegressionSolution>)Parameters[ValidationBestSolutionParameterName]; }
+        }
+        public ILookupParameter<DoubleValue> ValidationBestSolutionQualityParameter {
+            get { return (ILookupParameter<DoubleValue>)Parameters[ValidationBestSolutionQualityParameterName]; }
+        }
+        public ILookupParameter<IntValue> ValidationBestSolutionGenerationParameter {
+            get { return (ILookupParameter<IntValue>)Parameters[ValidationBestSolutionGenerationParameterName]; }
+        }
+        public IFixedValueParameter<BoolValue> UpdateAlwaysParameter {
+            get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; }
+        }
+        public ILookupParameter<IntValue> IterationsParameter {
+            get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; }
+        }
+        public IValueLookupParameter<IntValue> MaximumIterationsParameter {
+            get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; }
+        }
+        #endregion
+
+        #region properties
+        public ISymbolicRegressionSolution ValidationBestSolution {
+            get { return ValidationBestSolutionParameter.ActualValue; }
+            set { ValidationBestSolutionParameter.ActualValue = value; }
+        }
+        public DoubleValue ValidationBestSolutionQuality {
+            get { return ValidationBestSolutionQualityParameter.ActualValue; }
+            set { ValidationBestSolutionQualityParameter.ActualValue = value; }
+        }
+        public BoolValue UpdateAlways {
+            get { return UpdateAlwaysParameter.Value; }
+        }
+        #endregion
+
+        [StorableConstructor]
+        private SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        private SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer(SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer()
+            : base()
+        {
+            Parameters.Add(new LookupParameter<ISymbolicRegressionSolution>(ValidationBestSolutionParameterName, "The validation best symbolic data analyis solution."));
+            Parameters.Add(new LookupParameter<DoubleValue>(ValidationBestSolutionQualityParameterName, "The quality of the validation best symbolic data analysis solution."));
+            Parameters.Add(new LookupParameter<IntValue>(ValidationBestSolutionGenerationParameterName, "The generation in which the best validation solution was found."));
+            Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best validation solution should always be updated regardless of its quality.", new BoolValue(true)));
+            Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
+            Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
+            UpdateAlwaysParameter.Hidden = true;
+            Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model."));
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer(this, cloner);
+        }
+
+        protected ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality)
+        {
+            var model = new SymbolicRegressionModel(ProblemDataParameter.ActualValue.TargetVariable, (ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper);
+            if (ApplyLinearScalingParameter.ActualValue.Value) model.Scale(ProblemDataParameter.ActualValue);
+            return new SymbolicRegressionSolution(model, (IRegressionProblemData)ProblemDataParameter.ActualValue.Clone());
+        }
+
+        protected override IEnumerable<int> GenerateRowsToEvaluate()
+        {
+            if (ValidationPartitionParameter.ActualValue == null
+                || TestPartitionParameter.ActualValue == null)
+                return base.GenerateRowsToEvaluate();
+
+            int seed = RandomParameter.ActualValue.Next();
+            int samplesStart = ValidationPartitionParameter.ActualValue.Start;
+            int samplesEnd = ValidationPartitionParameter.ActualValue.End;
+            int testPartitionStart = TestPartitionParameter.ActualValue.Start;
+            int testPartitionEnd = TestPartitionParameter.ActualValue.End;
+
+            if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value.");
+            int count = (int)((samplesEnd - samplesStart) * RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value);
+            if (count == 0) count = 1;
+            return RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count)
+                .Where(i => i < testPartitionStart && i < ProblemDataParameter.ActualValue.Dataset.Rows);
+        }
+
+        public override IOperation Apply()
+        {
+            IEnumerable<int> rows = GenerateRowsToEvaluate();
+            if (!rows.Any()) return base.Apply();
+
+            #region find best tree
+            var evaluator = EvaluatorParameter.ActualValue;
+            var problemData = ProblemDataParameter.ActualValue;
+            double bestValidationQuality = Maximization.Value ? double.NegativeInfinity : double.PositiveInfinity;
+            ISymbolicExpressionTree bestTree = null;
+            ISymbolicExpressionTree[] tree = SymbolicExpressionTree.ToArray();
+
+            // sort is ascending and we take the first n% => order so that best solutions are smallest
+            // sort order is determined by maximization parameter
+            double[] trainingQuality;
+            if (Maximization.Value)
+            {
+                // largest values must be sorted first
+                trainingQuality = Quality.Select(x => -x.Value).ToArray();
+            }
+            else
+            {
+                // smallest values must be sorted first
+                trainingQuality = Quality.Select(x => x.Value).ToArray();
+            }
+
+            // sort trees by training qualities
+            Array.Sort(trainingQuality, tree);
+
+            // number of best training solutions to validate (at least 1)
+            int topN = (int)Math.Max(tree.Length * PercentageOfBestSolutionsParameter.ActualValue.Value, 1);
+
+            IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator);
+            // evaluate best n training trees on validiation set
+            var quality = tree
+              .Take(topN)
+              .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
+              .ToArray();
+
+            for (int i = 0; i < quality.Length; i++)
+            {
+                if (IsBetter(quality[i], bestValidationQuality, Maximization.Value))
+                {
+                    bestValidationQuality = quality[i];
+                    bestTree = tree[i];
+                }
+            }
+            #endregion
+
+            var results = ResultCollection;
+            if (bestTree != null && (UpdateAlways.Value || ValidationBestSolutionQuality == null ||
+              IsBetter(bestValidationQuality, ValidationBestSolutionQuality.Value, Maximization.Value)))
+            {
+                ValidationBestSolution = CreateSolution(bestTree, bestValidationQuality);
+                ValidationBestSolutionQuality = new DoubleValue(bestValidationQuality);
+                if (IterationsParameter.ActualValue != null)
+                    ValidationBestSolutionGenerationParameter.ActualValue = new IntValue(IterationsParameter.ActualValue.Value);
+
+                if (!results.ContainsKey(ValidationBestSolutionParameter.Name))
+                {
+                    results.Add(new Result(ValidationBestSolutionParameter.Name, ValidationBestSolutionParameter.Description, ValidationBestSolution));
+                    results.Add(new Result(ValidationBestSolutionQualityParameter.Name, ValidationBestSolutionQualityParameter.Description, ValidationBestSolutionQuality));
+                    if (ValidationBestSolutionGenerationParameter.ActualValue != null)
+                        results.Add(new Result(ValidationBestSolutionGenerationParameter.Name, ValidationBestSolutionGenerationParameter.Description, ValidationBestSolutionGenerationParameter.ActualValue));
+                }
+                else
+                {
+                    results[ValidationBestSolutionParameter.Name].Value = ValidationBestSolution;
+                    results[ValidationBestSolutionQualityParameter.Name].Value = ValidationBestSolutionQuality;
+                    if (ValidationBestSolutionGenerationParameter.ActualValue != null)
+                        results[ValidationBestSolutionGenerationParameter.Name].Value = ValidationBestSolutionGenerationParameter.ActualValue;
+                }
+            }
+            return base.Apply();
+        }
+        private bool IsBetter(double lhs, double rhs, bool maximization)
+        {
+            if (maximization) return lhs > rhs;
+            else return lhs < rhs;
+        }
+    }
+}
+
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,50 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.SlidingWindow.Operator;
+using HeuristicLab.Analysis;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using HeuristicLab.Random;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
+{
+    [Item("SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer", "An operator that analyzes the validation best symbolic regression solution for single objective symbolic regression problems considering each age layer.")]
+    [StorableType("75E2A19A-95B2-4FA4-8544-CF2325B65820")]
+    public class SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer
+        : SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer<ISymbolicRegressionSolution, ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>
+    {
+
+        [StorableConstructor]
+        protected SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer(StorableConstructorFlag _)
+            : base(_) { }
+        protected SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer(SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer()
+          : base()
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer(this, cloner);
+        }
+
+        protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality)
+        {
+            var model = new SymbolicRegressionModel(ProblemDataParameter.ActualValue.TargetVariable, (ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper);
+            if (ApplyLinearScalingParameter.ActualValue.Value) model.Scale(ProblemDataParameter.ActualValue);
+            return new SymbolicRegressionSolution(model, (IRegressionProblemData)ProblemDataParameter.ActualValue.Clone());
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRregressionSingleObjectiveLayerQualityAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRregressionSingleObjectiveLayerQualityAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRregressionSingleObjectiveLayerQualityAnalyzer.cs	(revision 17479)
@@ -0,0 +1,40 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
+{
+    [Item("SymbolicRregressionSingleObjectiveLayerQualityAnalyzer", "An operator that analyzes the validation and training best symbolic regression solution for single objective symbolic regression problems considering each age layer.")]
+    [StorableType("75E292AA-95B2-4FA4-8544-CF2025A65822")]
+    public sealed class SymbolicRregressionSingleObjectiveLayerQualityAnalyzer
+        : LayerQualityAnalyzer
+    {
+        [StorableConstructor]
+        private SymbolicRregressionSingleObjectiveLayerQualityAnalyzer(StorableConstructorFlag _) : base(_) { }
+        private SymbolicRregressionSingleObjectiveLayerQualityAnalyzer(SymbolicRregressionSingleObjectiveLayerQualityAnalyzer original, Cloner cloner)
+          : base(original, cloner)
+        {
+        }
+
+        public SymbolicRregressionSingleObjectiveLayerQualityAnalyzer() : base()
+        {
+        }
+
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRregressionSingleObjectiveLayerQualityAnalyzer(this, cloner);
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,264 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.Evaluators;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [Item("SlidingWindowAnalyzer", "An analyzer which implements a sliding window.")]
+    [StorableType("136DA41B-0AC1-49A8-B419-DCE93BDB7114")]
+    public abstract class SlidingWindowAnalyzer<T, U> : SymbolicDataAnalysisSingleObjectiveAnalyzer,
+        ISlidingWindowAnalyzer, IIterationBasedOperator
+        where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+        where U : class, IDataAnalysisProblemData
+    {
+        private const string ProblemDataParameterName = "ProblemData";
+        private const string EvaluatorParameterName = "Evaluator";
+
+        private const string SlidingWindowSizeParameterName = "SlidingWindowSize";
+        private const string SlidingWindowStepWidthParameterName = "SlidingWindowStepWidth";
+        private const string StartSlidingWindowParameterName = "StartSlidingWindow";
+        private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
+
+        private const string TrainingPartitionParameterName = "TrainingPartition";
+        private const string TestPartitionParameterName = "TestPartition";
+        private const string ValidationPartitionParameterName = "ValidationPartition";
+
+        private const string IterationsParameterName = "Generations";
+        private const string MaximumIterationsParameterName = "MaximumIterations";
+        private const string MinimumIterationsUntilNextMoveParameterName = "MinimumIterationsUntilNextMove";
+
+        private const string LastSlidingWindowMoveIterationParameterName = "LastSlidingWindowMoveIteration";
+
+        private const string PredefinedTestsetParameterName = "PredefinedTestset";
+
+        private const string TerminateSlidingWindowParameterName = "TerminateSlidingWindow";
+
+        protected const double TrainingToValidationRatio = 2.0 / 3.0;
+
+        #region parameter properties
+        public ILookupParameter<U> ProblemDataParameter {
+            get { return (ILookupParameter<U>)Parameters[ProblemDataParameterName]; }
+        }
+        public IFixedValueParameter<IntValue> SlidingWindowSizeParameter {
+            get { return (IFixedValueParameter<IntValue>)Parameters[SlidingWindowSizeParameterName]; }
+        }
+        public IFixedValueParameter<IntValue> SlidingWindowStepWidthParameter {
+            get { return (IFixedValueParameter<IntValue>)Parameters[SlidingWindowStepWidthParameterName]; }
+        }
+        public IFixedValueParameter<IntValue> StartSlidingWindowParameter {
+            get { return (IFixedValueParameter<IntValue>)Parameters[StartSlidingWindowParameterName]; }
+        }
+        public ILookupParameter<IntRange> FitnessCalculationPartitionParameter {
+            get { return (ILookupParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }
+        }
+        public IValueLookupParameter<IntRange> TrainingPartitionParameter {
+            get { return (IValueLookupParameter<IntRange>)Parameters[TrainingPartitionParameterName]; }
+        }
+        public IValueLookupParameter<IntRange> ValidationPartitionParameter {
+            get { return (IValueLookupParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
+        }
+        public IValueLookupParameter<IntRange> TestPartitionParameter {
+            get { return (IValueLookupParameter<IntRange>)Parameters[TestPartitionParameterName]; }
+        }
+        public ILookupParameter<T> EvaluatorParameter {
+            get { return (ILookupParameter<T>)Parameters[EvaluatorParameterName]; }
+        }
+        public IValueParameter<IntValue> MinimumIterationsUntilNextMoveParameter {
+            get { return (IValueParameter<IntValue>)Parameters[MinimumIterationsUntilNextMoveParameterName]; }
+        }
+        public ILookupParameter<IntValue> IterationsParameter {
+            get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; }
+        }
+        public IValueLookupParameter<IntValue> MaximumIterationsParameter {
+            get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; }
+        }
+        public IValueLookupParameter<IntValue> LastSlidingWindowMoveIterationParameter {
+            get { return (IValueLookupParameter<IntValue>)Parameters[LastSlidingWindowMoveIterationParameterName]; }
+        }
+        public IFixedValueParameter<BoolValue> PredefinedTestsetParameter {
+            get { return (IFixedValueParameter<BoolValue>)Parameters[PredefinedTestsetParameterName]; }
+        }
+        public ILookupParameter<BoolValue> TerminateSlidingWindowParameter {
+            get { return (ILookupParameter<BoolValue>)Parameters[TerminateSlidingWindowParameterName]; }
+        }
+        #endregion
+
+        #region properties
+        public U ProblemData { get { return ProblemDataParameter.ActualValue; } }
+        public IntValue SlidingWindowSize { get { return SlidingWindowSizeParameter.Value; } }
+        public IntValue SlidingWindowStepWidth { get { return SlidingWindowStepWidthParameter.Value; } }
+        public IntValue StartSlidingWindow { get { return StartSlidingWindowParameter.Value; } }
+        public IntRange FitnessCalculationPartition { get { return FitnessCalculationPartitionParameter.ActualValue; } }
+        public IntValue Iterations { get { return IterationsParameter.ActualValue; } }
+        public IntValue MaximumIterations { get { return MaximumIterationsParameter.Value; } }
+        public BoolValue PredefinedTestset {
+            get { return PredefinedTestsetParameter.Value; }
+        }
+        public IntRange TrainingPartition { get { return TrainingPartitionParameter.ActualValue; } }
+
+        public IntRange TestPartition { get { return TestPartitionParameter.ActualValue; } }
+
+        #endregion
+
+        [StorableConstructor]
+        protected SlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        protected SlidingWindowAnalyzer(SlidingWindowAnalyzer<T, U> original, Cloner cloner) : base(original, cloner) { }
+        public SlidingWindowAnalyzer()
+          : base()
+        {
+            Parameters.Add(new LookupParameter<U>(ProblemDataParameterName, "The problem data."));
+            Parameters.Add(new LookupParameter<T>(EvaluatorParameterName, ""));
+
+            Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowSizeParameterName, "The sliding window size.", new IntValue(400)));
+            Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowStepWidthParameterName, "The number of steps by which the sliding window is moved.", new IntValue(10)));
+            Parameters.Add(new FixedValueParameter<IntValue>(StartSlidingWindowParameterName, "The starting position of the sliding window.", new IntValue(0)));
+            Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName, "The current sliding window position or range."));
+
+            Parameters.Add(new ValueLookupParameter<IntRange>(TrainingPartitionParameterName, "The current training sliding window position or range."));
+            Parameters.Add(new ValueLookupParameter<IntRange>(ValidationPartitionParameterName, "The current validation sliding window position or range."));
+            Parameters.Add(new ValueLookupParameter<IntRange>(TestPartitionParameterName, "The current test sliding window position or range."));
+
+            Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
+            Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
+
+            Parameters.Add(new ValueParameter<IntValue>(MinimumIterationsUntilNextMoveParameterName, "The minimum number of iterations that have to pass before the next sliding window move.", new IntValue(1)));
+
+            Parameters.Add(new ValueLookupParameter<IntValue>(LastSlidingWindowMoveIterationParameterName, "Iteration the sliding window has been moved the last time.") { Hidden = true });
+
+            Parameters.Add(new FixedValueParameter<BoolValue>(PredefinedTestsetParameterName, "Indicates if a predefined split between training and test data is available.", new BoolValue(true)));
+
+            Parameters.Add(new LookupParameter<BoolValue>(TerminateSlidingWindowParameterName, "Indicates if sliding window reached end of training data."));
+        }
+
+        public event EventHandler MoveWindow;
+
+        public IOperation OnMoveWindow()
+        {
+            if (TrainingPartition == null)
+            {
+                TerminateSlidingWindowParameter.ActualValue.Value = false;
+                InitializeSlidingWindow(StartSlidingWindow.Value, SlidingWindowSize.Value);
+                return base.Apply();
+            }
+
+            if (ValidationPartitionParameter.ActualValue.End + SlidingWindowStepWidth.Value
+                > ProblemData.TestPartition.Start)
+            {
+                TerminateSlidingWindowParameter.ActualValue.Value = true;
+                return base.Apply();
+            }
+
+            if(!IsMinimumIterationIntervalPassed())
+                return base.Apply();
+
+            TrainingPartition.Start += SlidingWindowStepWidth.Value;
+            TrainingPartition.End += SlidingWindowStepWidth.Value;
+
+            if (!PredefinedTestsetParameter.Value.Value)
+            {
+                TestPartitionParameter.ActualValue.Start += SlidingWindowStepWidth.Value;
+                TestPartitionParameter.ActualValue.End += SlidingWindowStepWidth.Value;
+            }
+
+            ValidationPartitionParameter.ActualValue.Start += SlidingWindowStepWidth.Value;
+            ValidationPartitionParameter.ActualValue.End += SlidingWindowStepWidth.Value;
+
+            FitnessCalculationPartitionParameter.ActualValue.Start = TrainingPartition.Start;
+            FitnessCalculationPartitionParameter.ActualValue.End = TrainingPartition.End;
+
+            LastSlidingWindowMoveIterationParameter.ActualValue.Value = IterationsParameter.ActualValue.Value;
+
+            VisualizeSlidingWindow();
+
+            // Reevaluate all individuals with new sliding window
+            UniformSubScopesProcessor subScopesProcessor = new UniformSubScopesProcessor();
+            subScopesProcessor.Operator = EvaluatorParameter.ActualValue;
+            subScopesProcessor.Depth.Value = 2;
+            var operation = ExecutionContext.CreateChildOperation(subScopesProcessor);
+            var successor = base.Apply();
+
+            MoveWindow?.Invoke(this, EventArgs.Empty);
+
+            return new OperationCollection() { operation, successor };
+        }
+
+        protected void InitializeSlidingWindow(int startSlidingWindow, int slidingWindowSize)
+        {
+            if (startSlidingWindow + slidingWindowSize > ProblemData.Dataset.Rows)
+                return;
+
+            LastSlidingWindowMoveIterationParameter.ActualValue = new IntValue(IterationsParameter.ActualValue.Value);
+
+            // Training partition is 66 percent of window size
+            TrainingPartitionParameter.ActualValue
+                = new IntRange(
+                    startSlidingWindow,
+                    startSlidingWindow + (int)(slidingWindowSize * TrainingToValidationRatio)
+                    );
+
+            if (PredefinedTestsetParameter.Value.Value)
+            {
+                // Validation partition is 33.3 percent of window size
+                ValidationPartitionParameter.ActualValue.Start = TrainingPartitionParameter.ActualValue.End;
+                ValidationPartitionParameter.ActualValue.End = TrainingPartitionParameter.ActualValue.Start + slidingWindowSize;              
+            }
+            else
+            {
+                // Test partition is 16.6 percent of window size
+                TestPartitionParameter.ActualValue
+                = new IntRange(
+                TrainingPartitionParameter.ActualValue.End,
+                TrainingPartitionParameter.ActualValue.End + (int)((slidingWindowSize - TrainingPartitionParameter.ActualValue.End) * 0.5)
+                );
+
+                // Validation partition is 16.6 percent of window size
+                ValidationPartitionParameter.ActualValue.Start = TestPartitionParameter.ActualValue.End;
+                ValidationPartitionParameter.ActualValue.End = TrainingPartitionParameter.ActualValue.Start + slidingWindowSize;
+            }
+
+            FitnessCalculationPartitionParameter.ActualValue.Start = TrainingPartitionParameter.ActualValue.Start;
+            FitnessCalculationPartitionParameter.ActualValue.End = TrainingPartitionParameter.ActualValue.End;
+
+            VisualizeSlidingWindow();
+
+            return;
+        }
+
+        protected void VisualizeSlidingWindow()
+        {
+            var results = ResultCollection;
+            if (!results.ContainsKey(TrainingPartitionParameterName))
+                results.Add(new Result(TrainingPartitionParameterName, TrainingPartitionParameter.ActualValue));
+            else
+                results[TrainingPartitionParameterName].Value = TrainingPartitionParameter.ActualValue;
+
+            if (!results.ContainsKey(TestPartitionParameterName))
+                results.Add(new Result(TestPartitionParameterName, TestPartitionParameter.ActualValue));
+            else
+                results[TestPartitionParameterName].Value = TestPartitionParameter.ActualValue;
+
+            if (!results.ContainsKey(ValidationPartitionParameterName))
+                results.Add(new Result(ValidationPartitionParameterName, ValidationPartitionParameter.ActualValue));
+            else
+                results[ValidationPartitionParameterName].Value = ValidationPartitionParameter.ActualValue;
+        }
+
+        protected bool IsMinimumIterationIntervalPassed()
+        {
+            return IterationsParameter.ActualValue.Value - LastSlidingWindowMoveIterationParameter.ActualValue.Value
+                >= MinimumIterationsUntilNextMoveParameter.Value.Value;
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer.cs	(revision 17479)
@@ -0,0 +1,98 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Random;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [Item("SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for single objective symbolic data analysis problems.")]
+    [StorableType("DD82C026-CF68-40D7-A798-77EA61272AA9")]
+    public abstract class SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer<T, U> : SymbolicDataAnalysisSingleObjectiveAnalyzer,
+        ISymbolicDataAnalysisValidationAnalyzer<T, U>, IStochasticOperator
+        where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+        where U : class, IDataAnalysisProblemData
+    {
+        private const string RandomParameterName = "GlobalRandom";
+        private const string ProblemDataParameterName = "ProblemData";
+        private const string EvaluatorParameterName = "Evaluator";
+        private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+        private const string ValidationPartitionParameterName = "ValidationPartition";
+        private const string TestPartitionParameterName = "TestPartition";
+        private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples";
+        private const string PercentageOfBestSolutionsParameterName = "PercentageOfBestSolutions";
+
+        #region parameter properties
+        public ILookupParameter<IRandom> RandomParameter {
+            get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+        }
+        public ILookupParameter<U> ProblemDataParameter {
+            get { return (ILookupParameter<U>)Parameters[ProblemDataParameterName]; }
+        }
+        public ILookupParameter<T> EvaluatorParameter {
+            get { return (ILookupParameter<T>)Parameters[EvaluatorParameterName]; }
+        }
+        public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+            get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+        }
+        public IValueLookupParameter<IntRange> ValidationPartitionParameter {
+            get { return (IValueLookupParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
+        }
+        public IValueLookupParameter<IntRange> TestPartitionParameter {
+            get { return (IValueLookupParameter<IntRange>)Parameters[TestPartitionParameterName]; }
+        }
+        public IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
+            get { return (IValueLookupParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
+        }
+        public IValueLookupParameter<PercentValue> PercentageOfBestSolutionsParameter {
+            get { return (IValueLookupParameter<PercentValue>)Parameters[PercentageOfBestSolutionsParameterName]; }
+        }
+        #endregion
+
+        [StorableConstructor]
+        protected SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer(StorableConstructorFlag _) : base(_) { }
+        protected SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer(SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer<T, U> original, Cloner cloner)
+          : base(original, cloner)
+        {
+        }
+
+        protected SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer() : base()
+        {
+            Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator."));
+            Parameters.Add(new LookupParameter<U>(ProblemDataParameterName, "The problem data of the symbolic data analysis problem."));
+            Parameters.Add(new LookupParameter<T>(EvaluatorParameterName, "The operator to use for fitness evaluation on the validation partition."));
+            Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter for symbolic data analysis expression trees."));
+            Parameters.Add(new ValueLookupParameter<IntRange>(ValidationPartitionParameterName, "The validation partition."));
+            Parameters.Add(new ValueLookupParameter<IntRange>(TestPartitionParameterName, "The test partition."));
+            Parameters.Add(new ValueLookupParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index."));
+            Parameters.Add(new ValueLookupParameter<PercentValue>(PercentageOfBestSolutionsParameterName, "The percentage of the top solutions which should be analyzed.", new PercentValue(0.25)));
+        }
+
+        protected virtual IEnumerable<int> GenerateRowsToEvaluate()
+        {
+            if (ValidationPartitionParameter.ActualValue == null)
+                return Enumerable.Empty<int>();
+
+            int seed = RandomParameter.ActualValue.Next();
+            int samplesStart = ValidationPartitionParameter.ActualValue.Start;
+            int samplesEnd = ValidationPartitionParameter.ActualValue.End;
+            int testPartitionStart = ProblemDataParameter.ActualValue.TestPartition.Start;
+            int testPartitionEnd = ProblemDataParameter.ActualValue.TestPartition.End;
+
+            if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value.");
+            int count = (int)((samplesEnd - samplesStart) * RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value);
+            if (count == 0) count = 1;
+            return RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count)
+              .Where(i => i < testPartitionStart && i < ProblemDataParameter.ActualValue.Dataset.Rows);
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveOverfittingSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveOverfittingSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveOverfittingSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,126 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Analysis;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [Item("SymbolicDataAnalysisSingleObjectiveOverfittingAnalyzer", "Calculates and tracks correlation of training and validation fitness of symbolic regression models.")]
+    [StorableType("AE1F0B73-BEB1-47AF-8ECF-DBCFA32AA5B9")]
+    public abstract class SymbolicDataAnalysisSingleObjectiveOverfittingAnalyzer<T, U>
+        : SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer<T, U>
+        where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+        where U : class, IDataAnalysisProblemData
+    {
+        private const string TrainingValidationCorrelationParameterName = "Training and validation fitness correlation";
+        private const string TrainingValidationCorrelationTableParameterName = "Training and validation fitness correlation table";
+        private const string LowerCorrelationThresholdParameterName = "LowerCorrelationThreshold";
+        private const string UpperCorrelationThresholdParameterName = "UpperCorrelationThreshold";
+        private const string OverfittingParameterName = "IsOverfitting";
+
+        #region parameter properties
+        public ILookupParameter<DoubleValue> TrainingValidationQualityCorrelationParameter {
+            get { return (ILookupParameter<DoubleValue>)Parameters[TrainingValidationCorrelationParameterName]; }
+        }
+        public ILookupParameter<DataTable> TrainingValidationQualityCorrelationTableParameter {
+            get { return (ILookupParameter<DataTable>)Parameters[TrainingValidationCorrelationTableParameterName]; }
+        }
+        public IValueLookupParameter<DoubleValue> LowerCorrelationThresholdParameter {
+            get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerCorrelationThresholdParameterName]; }
+        }
+        public IValueLookupParameter<DoubleValue> UpperCorrelationThresholdParameter {
+            get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperCorrelationThresholdParameterName]; }
+        }
+        public ILookupParameter<BoolValue> OverfittingParameter {
+            get { return (ILookupParameter<BoolValue>)Parameters[OverfittingParameterName]; }
+        }
+        #endregion
+
+        [StorableConstructor]
+        protected SymbolicDataAnalysisSingleObjectiveOverfittingAnalyzer(StorableConstructorFlag _) : base(_) { }
+        protected SymbolicDataAnalysisSingleObjectiveOverfittingAnalyzer(SymbolicDataAnalysisSingleObjectiveOverfittingAnalyzer<T, U> original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicDataAnalysisSingleObjectiveOverfittingAnalyzer()
+          : base()
+        {
+            Parameters.Add(new LookupParameter<DoubleValue>(TrainingValidationCorrelationParameterName, "Correlation of training and validation fitnesses"));
+            Parameters.Add(new LookupParameter<DataTable>(TrainingValidationCorrelationTableParameterName, "Data table of training and validation fitness correlation values over the whole run."));
+            Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerCorrelationThresholdParameterName, "Lower threshold for correlation value that marks the boundary from non-overfitting to overfitting.", new DoubleValue(0.65)));
+            Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperCorrelationThresholdParameterName, "Upper threshold for correlation value that marks the boundary from overfitting to non-overfitting.", new DoubleValue(0.75)));
+            Parameters.Add(new LookupParameter<BoolValue>(OverfittingParameterName, "Boolean indicator for overfitting."));
+        }
+
+        public override IOperation Apply()
+        {
+            IEnumerable<int> rows = GenerateRowsToEvaluate();
+            if (!rows.Any()) return base.Apply();
+
+            double[] trainingQuality = QualityParameter.ActualValue.Select(x => x.Value).ToArray();
+            var problemData = ProblemDataParameter.ActualValue;
+            var evaluator = EvaluatorParameter.ActualValue;
+
+            // evaluate on validation partition
+            IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator);
+            double[] validationQuality = SymbolicExpressionTree
+              .Select(t => evaluator.Evaluate(childContext, t, problemData, rows))
+              .ToArray();
+
+            double r = 0.0;
+            try
+            {
+                r = alglib.spearmancorr2(trainingQuality, validationQuality);
+            }
+            catch (alglib.alglibexception)
+            {
+                r = 0.0;
+            }
+
+            var results = ResultCollection;
+            #region Add Parameters
+            if (!results.ContainsKey(TrainingValidationQualityCorrelationTableParameter.Name))
+                ResultCollectionParameter.ActualValue.Add(new Result(TrainingValidationQualityCorrelationTableParameter.Name, TrainingValidationQualityCorrelationTableParameter.Description, typeof(DataTable)));
+            if (!results.ContainsKey(OverfittingParameter.Name))
+                results.Add(new Result(OverfittingParameter.Name, OverfittingParameter.Description, typeof(BoolValue)));
+            #endregion
+
+            TrainingValidationQualityCorrelationParameter.ActualValue = new DoubleValue(r);
+
+            if (TrainingValidationQualityCorrelationTableParameter.ActualValue == null)
+            {
+                var dataTable = new DataTable(TrainingValidationQualityCorrelationTableParameter.Name, TrainingValidationQualityCorrelationTableParameter.Description);
+                dataTable.Rows.Add(new DataRow(TrainingValidationQualityCorrelationParameter.Name, TrainingValidationQualityCorrelationParameter.Description));
+                dataTable.Rows[TrainingValidationQualityCorrelationParameter.Name].VisualProperties.StartIndexZero = true;
+                TrainingValidationQualityCorrelationTableParameter.ActualValue = dataTable;
+            }
+
+            TrainingValidationQualityCorrelationTableParameter.ActualValue.Rows[TrainingValidationQualityCorrelationParameter.Name].Values.Add(r);
+
+            if (OverfittingParameter.ActualValue != null && OverfittingParameter.ActualValue.Value)
+            {
+                // overfitting == true
+                // => r must reach the upper threshold to switch back to non-overfitting state
+                OverfittingParameter.ActualValue = new BoolValue(r < UpperCorrelationThresholdParameter.ActualValue.Value);
+            }
+            else
+            {
+                // overfitting == false 
+                // => r must drop below lower threshold to switch to overfitting state
+                OverfittingParameter.ActualValue = new BoolValue(r < LowerCorrelationThresholdParameter.ActualValue.Value);
+            }
+
+            results[TrainingValidationQualityCorrelationTableParameter.Name].Value = TrainingValidationQualityCorrelationTableParameter.ActualValue;
+            results[OverfittingParameter.Name].Value = OverfittingParameter.ActualValue;
+
+            return base.Apply();
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer.cs	(revision 17479)
@@ -0,0 +1,237 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [Item("SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer", "An operator that analyzes the training best symbolic data analysis solution for single objective symbolic data analysis problems.")]
+    [StorableType("DD82C026-CF68-40D7-A898-77EA61272DE9")]
+    public abstract class SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer<S, T, U> 
+        : SymbolicDataAnalysisSingleObjectiveAnalyzer, IIterationBasedOperator
+        where S : class, ISymbolicDataAnalysisSolution
+        where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+        where U : class, IDataAnalysisProblemData
+    {
+        private const string TrainingBestSolutionParameterName = "Best training solution";
+        private const string TrainingBestSolutionQualityParameterName = "Best training solution quality";
+        private const string TrainingBestSolutionGenerationParameterName = "Best training solution generation";
+        private const string TrainingBestSolutionsHistoryParameterName = "Best training solutions history";
+        private const string UpdateAlwaysParameterName = "Always update best solution";
+        private const string IterationsParameterName = "Generations";
+        private const string MaximumIterationsParameterName = "Maximum Iterations";
+        private const string StoreHistoryParameterName = "Store History";
+
+        private const string TrainingPartitionParameterName = "TrainingPartition";
+
+        private const string RandomParameterName = "GlobalRandom";
+        private const string ProblemDataParameterName = "ProblemData";
+        private const string EvaluatorParameterName = "Evaluator";
+        private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+
+        private bool isTrainingEventInitialized = false;
+        private bool reevaluateTrainingResult = false;
+
+        #region parameter properties
+        public ILookupParameter<S> TrainingBestSolutionParameter {
+            get { return (ILookupParameter<S>)Parameters[TrainingBestSolutionParameterName]; }
+        }
+        public ILookupParameter<DoubleValue> TrainingBestSolutionQualityParameter {
+            get { return (ILookupParameter<DoubleValue>)Parameters[TrainingBestSolutionQualityParameterName]; }
+        }
+        public ILookupParameter<IntValue> TrainingBestSolutionGenerationParameter {
+            get { return (ILookupParameter<IntValue>)Parameters[TrainingBestSolutionGenerationParameterName]; }
+        }
+        public ILookupParameter<ItemList<S>> TrainingBestSolutionsHistoryParameter {
+            get { return (ILookupParameter<ItemList<S>>)Parameters[TrainingBestSolutionsHistoryParameterName]; }
+        }
+        public IFixedValueParameter<BoolValue> UpdateAlwaysParameter {
+            get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; }
+        }
+        public ILookupParameter<IntValue> IterationsParameter {
+            get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; }
+        }
+        public IValueLookupParameter<IntValue> MaximumIterationsParameter {
+            get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; }
+        }
+
+        public IFixedValueParameter<BoolValue> StoreHistoryParameter {
+            get { return (IFixedValueParameter<BoolValue>)Parameters[StoreHistoryParameterName]; }
+        }
+        public IValueLookupParameter<IntRange> TrainingPartitionParameter {
+            get { return (IValueLookupParameter<IntRange>)Parameters[TrainingPartitionParameterName]; }
+        }
+        public ILookupParameter<IRandom> RandomParameter {
+            get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+        }
+        public ILookupParameter<U> ProblemDataParameter {
+            get { return (ILookupParameter<U>)Parameters[ProblemDataParameterName]; }
+        }
+        public ILookupParameter<T> EvaluatorParameter {
+            get { return (ILookupParameter<T>)Parameters[EvaluatorParameterName]; }
+        }
+        public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+            get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+        }
+        #endregion
+
+        #region properties
+        public S TrainingBestSolution {
+            get { return TrainingBestSolutionParameter.ActualValue; }
+            set { TrainingBestSolutionParameter.ActualValue = value; }
+        }
+        public DoubleValue TrainingBestSolutionQuality {
+            get { return TrainingBestSolutionQualityParameter.ActualValue; }
+            set { TrainingBestSolutionQualityParameter.ActualValue = value; }
+        }
+        public bool UpdateAlways {
+            get { return UpdateAlwaysParameter.Value.Value; }
+            set { UpdateAlwaysParameter.Value.Value = value; }
+        }
+
+        public bool StoreHistory {
+            get { return StoreHistoryParameter.Value.Value; }
+            set { StoreHistoryParameter.Value.Value = value; }
+        }
+        #endregion
+
+        [StorableConstructor]
+        protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
+        protected SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer(SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer()
+          : base()
+        {
+            Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator."));
+            Parameters.Add(new LookupParameter<U>(ProblemDataParameterName, "The problem data of the symbolic data analysis problem."));
+            Parameters.Add(new LookupParameter<T>(EvaluatorParameterName, "The operator to use for fitness evaluation on the validation partition."));
+            Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter for symbolic data analysis expression trees."));
+
+            Parameters.Add(new LookupParameter<S>(TrainingBestSolutionParameterName, "The best training symbolic data analyis solution."));
+            Parameters.Add(new LookupParameter<DoubleValue>(TrainingBestSolutionQualityParameterName, "The quality of the training best symbolic data analysis solution."));
+            Parameters.Add(new LookupParameter<IntValue>(TrainingBestSolutionGenerationParameterName, "The generation in which the best training solution was found."));
+            Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best training solution should always be updated regardless of its quality.", new BoolValue(true)));
+            Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
+            Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
+            Parameters.Add(new FixedValueParameter<BoolValue>(StoreHistoryParameterName, "Flag that determines whether all encountered best solutions should be stored as results.", new BoolValue(false)));
+            Parameters.Add(new LookupParameter<ItemList<S>>(TrainingBestSolutionsHistoryParameterName, "The history of the best training symbolic data analysis solutions."));
+
+            Parameters.Add(new ValueLookupParameter<IntRange>(TrainingPartitionParameterName, "The current training sliding window position or range."));
+            UpdateAlwaysParameter.Hidden = true;
+        }
+
+        public override IOperation Apply()
+        {
+            var results = ResultCollection;
+            #region create results
+            if (!results.ContainsKey(TrainingBestSolutionParameter.Name))
+                results.Add(new Result(TrainingBestSolutionParameter.Name, TrainingBestSolutionParameter.Description, typeof(S)));
+            if (!results.ContainsKey(TrainingBestSolutionQualityParameter.Name))
+                results.Add(new Result(TrainingBestSolutionQualityParameter.Name, TrainingBestSolutionQualityParameter.Description, typeof(DoubleValue)));
+            if (!results.ContainsKey(TrainingBestSolutionGenerationParameter.Name) && IterationsParameter.ActualValue != null)
+                results.Add(new Result(TrainingBestSolutionGenerationParameter.Name, TrainingBestSolutionGenerationParameter.Description, typeof(IntValue)));
+            if (StoreHistory && !results.ContainsKey(TrainingBestSolutionsHistoryParameter.Name))
+            {
+                results.Add(new Result(TrainingBestSolutionsHistoryParameter.Name, TrainingBestSolutionsHistoryParameter.Description, typeof(ItemList<S>)));
+                TrainingBestSolutionsHistoryParameter.ActualValue = new ItemList<S>();
+                results[TrainingBestSolutionsHistoryParameter.Name].Value = TrainingBestSolutionsHistoryParameter.ActualValue;
+            }
+            #endregion
+
+            if (TrainingPartitionParameter.ActualValue != null && !isTrainingEventInitialized) {
+                TrainingPartitionParameter.ActualValue.ValueChanged += TrainingPartition_ValueChanged;
+                isTrainingEventInitialized = true;
+            }
+
+            #region find best tree
+            double bestQuality = Maximization.Value ? double.NegativeInfinity : double.PositiveInfinity;
+            ISymbolicExpressionTree bestTree = null;
+            ISymbolicExpressionTree[] tree = SymbolicExpressionTree.ToArray();
+            double[] quality = Quality.Select(x => x.Value).ToArray();
+            for (int i = 0; i < tree.Length; i++)
+            {
+                if (IsBetter(quality[i], bestQuality, Maximization.Value))
+                {
+                    bestQuality = quality[i];
+                    bestTree = tree[i];
+                }
+            }
+            #endregion
+
+            if (TrainingPartitionParameter.ActualValue != null && (UpdateAlways || (reevaluateTrainingResult
+                && TrainingBestSolutionQuality != null 
+                && TrainingPartitionParameter.ActualValue != null)))
+            {
+                var evaluator = EvaluatorParameter.ActualValue;
+                var problemData = ProblemDataParameter.ActualValue;
+
+                IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator);
+                var currentValidationBestSolution = (S)results[TrainingBestSolutionParameterName].Value;
+                TrainingBestSolutionQuality.Value =
+                    evaluator.Evaluate(
+                        childContext, 
+                        currentValidationBestSolution.Model.SymbolicExpressionTree, 
+                        problemData,
+                        Enumerable.Range(
+                            TrainingPartitionParameter.ActualValue.Start, 
+                            TrainingPartitionParameter.ActualValue.End - TrainingPartitionParameter.ActualValue.Start
+                        ));
+                results[TrainingBestSolutionQualityParameter.Name].Value = TrainingBestSolutionQuality;
+                results[TrainingBestSolutionGenerationParameter.Name].Value = IterationsParameter.ActualValue;
+                reevaluateTrainingResult = false;
+            }
+
+            if (bestTree != null && (UpdateAlways || TrainingBestSolutionQuality == null ||
+              IsBetter(bestQuality, TrainingBestSolutionQuality.Value, Maximization.Value)))
+            {
+                TrainingBestSolution = CreateSolution(bestTree, bestQuality);
+                TrainingBestSolutionQuality = new DoubleValue(bestQuality);
+
+                if (IterationsParameter.ActualValue != null)
+                    TrainingBestSolutionGenerationParameter.ActualValue = new IntValue(IterationsParameter.ActualValue.Value);
+
+                results[TrainingBestSolutionParameter.Name].Value = TrainingBestSolution;
+                results[TrainingBestSolutionQualityParameter.Name].Value = TrainingBestSolutionQuality;
+                if (TrainingBestSolutionGenerationParameter.ActualValue != null)
+                    results[TrainingBestSolutionGenerationParameter.Name].Value = TrainingBestSolutionGenerationParameter.ActualValue;
+
+                if (StoreHistory)
+                {
+                    TrainingBestSolutionsHistoryParameter.ActualValue.Add(TrainingBestSolution);
+                }
+            }
+
+            UniformSubScopesProcessor subScopesProcessor = new UniformSubScopesProcessor();
+            subScopesProcessor.Operator = EvaluatorParameter.ActualValue;
+            subScopesProcessor.Depth.Value = 1;
+            var operation = ExecutionContext.CreateChildOperation(subScopesProcessor);
+            var successor = base.Apply();
+
+            return new OperationCollection() { operation, successor };
+        }
+
+        private void TrainingPartition_ValueChanged(object sender, EventArgs e)
+        {
+            reevaluateTrainingResult = true;
+        }
+
+        protected abstract S CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality);
+
+        private bool IsBetter(double lhs, double rhs, bool maximization)
+        {
+            if (maximization) return lhs > rhs;
+            else return lhs < rhs;
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer.cs	(revision 17479)
@@ -0,0 +1,422 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.Evaluators;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Random;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Analyzers
+{
+    [Item("SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic data analysis solution for single objective symbolic data analysis problems.")]
+    [StorableType("CD82C026-CF68-40D7-A898-77EA61972DE9")]
+    public abstract class SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer<S, T, U> 
+        : SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer<T, U>, IIterationBasedOperator
+    where S : class, ISymbolicDataAnalysisSolution
+    where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
+    where U : class, IDataAnalysisProblemData
+    {
+        private const string ValidationBestSolutionParameterName = "Best validation solution";
+        private const string ValidationBestSolutionQualityParameterName = "Best validation solution quality";
+        private const string ValidationBestSolutionGenerationParameterName = "Best validation solution generation";
+
+        private const string TrainingBestSolutionParameterName = "Best training solution";
+        private const string TrainingBestSolutionQualityParameterName = "Best training solution quality";
+        private const string TrainingBestSolutionGenerationParameterName = "Best training solution generation";
+
+        private const string UpdateAlwaysParameterName = "Always update best solution";
+        private const string IterationsParameterName = "Generations";
+        private const string MaximumIterationsParameterName = "Maximum Iterations";
+
+        protected const string LayerResultsParameterName = "LayerResults";
+        protected const string EstimationLimitsParameterName = "EstimationLimits";
+
+        protected const string LayerOfBestValidationSolutionParameterName = "Layer (Validation)";
+        protected const string LayerOfBestTrainingSolutionParameterName = "Layer (Training)";
+        
+        protected const string LayerOfBestSolutionDescription = "The layer in which the best solution has been found.";
+        private const string ValidationBestSolutionTableParameterName = "Best solution chart";
+
+        private const string OpenLayersParameterName = "OpenLayers";
+
+        private const string ErrorMeasureChart = "Error Measure of best solution Chart";
+
+        private const string ValidationMAETestSetQuality = "Validation MAE (test)";
+        private const string ValidationMAETrainingSetQuality = "Validation MAE (training)";
+
+        private const string ValidationMSETestSetQuality = "Validation MSE (test)";
+        private const string ValidationMSETrainingSetQuality = "Validation MSE (training)";
+
+        private const string ValidationRMSETestSetQuality = "Validation RMSE (test)";
+        private const string ValidationRMSETrainingSetQuality = "Validation RMSE (training)";
+
+        private const string ValidationPearsonR2TestSetQuality = "Validation PearsonR2 (test)";
+        private const string ValidationPearsonR2TrainingSetQuality = "Validation PearsonR2 (training)";
+
+        private const string TrainingMAETestSetQuality = "Training MAE (test)";
+        private const string TrainingMAETrainingSetQuality = "Training MAE (training)";
+
+        private const string TrainingMSETestSetQuality = "Training MSE (test)";
+        private const string TrainingMSETrainingSetQuality = "Training MSE (training)";
+
+        private const string TrainingRMSETestSetQuality = "Training RMSE (test)";
+        private const string TrainingRMSETrainingSetQuality = "Training RMSE (training)";
+
+        private const string TrainingPearsonR2TestSetQuality = "Training PearsonR2 (test)";
+        private const string TrainingPearsonR2TrainingSetQuality = "Training PearsonR2 (training)";
+
+        private const string PreviousWindowBestValidationSolutionQuality = "Quality on previous window (Best Validation Solution)";
+        private const string NextWindowBestValidationSolutionQuality = "Quality on next window (Best Validation Solution)";
+
+        private bool reevaluateValidationResult = false;
+
+        #region parameter properties
+        public ILookupParameter<S> ValidationBestSolutionParameter {
+            get { return (ILookupParameter<S>)Parameters[ValidationBestSolutionParameterName]; }
+        }
+        public ILookupParameter<DoubleValue> ValidationBestSolutionQualityParameter {
+            get { return (ILookupParameter<DoubleValue>)Parameters[ValidationBestSolutionQualityParameterName]; }
+        }
+        public ILookupParameter<IntValue> ValidationBestSolutionGenerationParameter {
+            get { return (ILookupParameter<IntValue>)Parameters[ValidationBestSolutionGenerationParameterName]; }
+        }
+        public IFixedValueParameter<BoolValue> UpdateAlwaysParameter {
+            get { return (IFixedValueParameter<BoolValue>)Parameters[UpdateAlwaysParameterName]; }
+        }
+        public ILookupParameter<IntValue> IterationsParameter {
+            get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; }
+        }
+        public IValueLookupParameter<IntValue> MaximumIterationsParameter {
+            get { return (IValueLookupParameter<IntValue>)Parameters[MaximumIterationsParameterName]; }
+        }
+        public IScopeTreeLookupParameter<ResultCollection> LayerResultsParameterParameter {
+            get { return (IScopeTreeLookupParameter<ResultCollection>)Parameters[LayerResultsParameterName]; }
+        }
+        public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
+            get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+        }
+        public ILookupParameter<IntValue> OpenLayersParameter {
+            get { return (ILookupParameter<IntValue>)Parameters[OpenLayersParameterName]; }
+        }
+        #endregion
+
+        #region properties
+        public S ValidationBestSolution {
+            get { return ValidationBestSolutionParameter.ActualValue; }
+            set { ValidationBestSolutionParameter.ActualValue = value; }
+        }
+        public DoubleValue ValidationBestSolutionQuality {
+            get { return ValidationBestSolutionQualityParameter.ActualValue; }
+            set { ValidationBestSolutionQualityParameter.ActualValue = value; }
+        }
+        public BoolValue UpdateAlways {
+            get { return UpdateAlwaysParameter.Value; }
+        }
+        #endregion
+
+        [StorableConstructor]
+        protected SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer(StorableConstructorFlag _) : base(_) { }
+        protected SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer<S, T, U> original, Cloner cloner) : base(original, cloner) { }
+        public SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer()
+          : base()
+        {
+            Parameters.Add(new LookupParameter<S>(ValidationBestSolutionParameterName, "The validation best symbolic data analyis solution."));
+            Parameters.Add(new LookupParameter<DoubleValue>(ValidationBestSolutionQualityParameterName, "The quality of the validation best symbolic data analysis solution."));
+            Parameters.Add(new LookupParameter<IntValue>(ValidationBestSolutionGenerationParameterName, "The generation in which the best validation solution was found."));
+            Parameters.Add(new FixedValueParameter<BoolValue>(UpdateAlwaysParameterName, "Determines if the best validation solution should always be updated regardless of its quality.", new BoolValue(true)));
+            Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "The number of performed iterations."));
+            Parameters.Add(new ValueLookupParameter<IntValue>(MaximumIterationsParameterName, "The maximum number of performed iterations.") { Hidden = true });
+
+            Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model."));
+            Parameters.Add(new ScopeTreeLookupParameter<ResultCollection>(LayerResultsParameterName, "Results of all Layers.") { Depth = 1 });
+
+            Parameters.Add(new LookupParameter<IntValue>(OpenLayersParameterName, "Open Layers"));
+
+            UpdateAlwaysParameter.Hidden = true;
+        }
+
+        protected abstract S CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality);
+
+        public override IOperation Apply()
+        {
+            IEnumerable<int> rows = GenerateRowsToEvaluate();
+            if (!rows.Any()) return base.Apply();
+
+            #region find best validation tree
+            // Obtain result collections from layers
+            LayerResultsParameterParameter.Depth = 1;
+            var resultCollections = LayerResultsParameterParameter.ActualValue;
+            var bestLayerValidationSolution
+                = resultCollections
+                .Where(result =>
+                    result.ContainsKey(ValidationBestSolutionParameterName) &&
+                    result.ContainsKey(ValidationBestSolutionQualityParameterName) &&
+                    result.ContainsKey(ValidationBestSolutionGenerationParameterName)
+                )
+                .Select((item, index) =>
+                new LayerSolution()
+                {
+                    Solution = (S)item[ValidationBestSolutionParameterName].Value,
+                    Quality = (DoubleValue)item[ValidationBestSolutionQualityParameterName].Value,
+                    Generation = (IntValue)item[ValidationBestSolutionGenerationParameterName].Value,
+                    Layer = new IntValue(index) // TODO Ask Affenzeller if layers should be zero indexed
+                }).ToArray();
+
+            // TODO
+            // Check if TrainingBestSolutionAnalyzer added to LayerAnalyzer
+            // if false, add it and restart
+            // else this analyzer is at the wrong scope, must be set as Analyzer not Layer analyzer      
+
+            LayerSolution bestValidationSolution;
+            if (Maximization.Value)
+                bestValidationSolution = bestLayerValidationSolution.OrderByDescending(layerSolution => layerSolution.Quality.Value).First();
+            else
+                bestValidationSolution = bestLayerValidationSolution.OrderBy(layerSolution => layerSolution.Quality.Value).First();
+            #endregion
+            
+            #region find best training tree
+            LayerResultsParameterParameter.Depth = 1;
+            var bestLayerTrainingSolution
+                = resultCollections
+                .Where(result =>
+                    result.ContainsKey(TrainingBestSolutionParameterName) &&
+                    result.ContainsKey(TrainingBestSolutionQualityParameterName) &&
+                    result.ContainsKey(TrainingBestSolutionGenerationParameterName)
+                )
+                .Select((item, index) =>
+                new LayerSolution()
+                {
+                    Solution = (S)item[TrainingBestSolutionParameterName].Value,
+                    Quality = (DoubleValue)item[TrainingBestSolutionQualityParameterName].Value,
+                    Generation = (IntValue)item[TrainingBestSolutionGenerationParameterName].Value,
+                    Layer = new IntValue(index) // TODO Ask Affenzeller if layers should be zero indexed
+                }).ToArray();
+
+            // TODO
+            // Check if TrainingBestSolutionAnalyzer added to LayerAnalyzer
+            // if false, add it and restart
+            // else this analyzer is at the wrong scope, must be set as Analyzer not Layer analyzer      
+
+            LayerSolution bestTrainingSolution;
+            if (Maximization.Value)
+                bestTrainingSolution = bestLayerTrainingSolution.OrderByDescending(layerSolution => layerSolution.Quality.Value).First();
+            else 
+                bestTrainingSolution = bestLayerTrainingSolution.OrderBy(layerSolution => layerSolution.Quality.Value).First();
+            #endregion
+
+            var results = ResultCollection;
+            #region Add Parameter
+            if (!results.ContainsKey(ValidationBestSolutionParameterName))
+            {
+                results.Add(new Result(ValidationBestSolutionParameterName, ValidationBestSolutionParameter.Description, typeof(S)));
+                ValidationPartitionParameter.ActualValue.ValueChanged += ValidationPartition_ValueChanged;
+            }
+            if (!results.ContainsKey(ValidationBestSolutionQualityParameterName))
+                results.Add(new Result(ValidationBestSolutionQualityParameterName, ValidationBestSolutionQualityParameter.Description, typeof(DoubleValue)));
+            if (!results.ContainsKey(ValidationBestSolutionGenerationParameterName))
+                results.Add(new Result(ValidationBestSolutionGenerationParameterName, ValidationBestSolutionGenerationParameter.Description, typeof(IntValue)));
+            if (!results.ContainsKey(LayerOfBestValidationSolutionParameterName))
+                results.Add(new Result(LayerOfBestValidationSolutionParameterName, LayerOfBestSolutionDescription, typeof(IntValue)));
+            if (!results.ContainsKey(ValidationBestSolutionTableParameterName))
+                results.Add(new Result(ValidationBestSolutionTableParameterName, new DataTable(ValidationBestSolutionTableParameterName)));
+
+            var validationBestSolutionTable = (DataTable)results[ValidationBestSolutionTableParameterName].Value;
+
+            if (!validationBestSolutionTable.Rows.ContainsKey(ValidationBestSolutionQualityParameterName))
+                validationBestSolutionTable.Rows.Add(new DataRow(ValidationBestSolutionQualityParameterName));
+            if (!validationBestSolutionTable.Rows.ContainsKey(LayerOfBestValidationSolutionParameterName))
+                validationBestSolutionTable.Rows.Add(new DataRow(LayerOfBestValidationSolutionParameterName) { VisualProperties = { SecondYAxis = true } });
+            if (!validationBestSolutionTable.Rows.ContainsKey(OpenLayersParameterName))
+                validationBestSolutionTable.Rows.Add(new DataRow(OpenLayersParameterName) { VisualProperties = { SecondYAxis = true } });
+
+            if (!validationBestSolutionTable.Rows.ContainsKey(TrainingBestSolutionQualityParameterName))
+                validationBestSolutionTable.Rows.Add(new DataRow(TrainingBestSolutionQualityParameterName));
+            if (!validationBestSolutionTable.Rows.ContainsKey(LayerOfBestTrainingSolutionParameterName))
+                validationBestSolutionTable.Rows.Add(new DataRow(LayerOfBestTrainingSolutionParameterName) { VisualProperties = { SecondYAxis = true } });
+
+            if (!validationBestSolutionTable.Rows.ContainsKey(PreviousWindowBestValidationSolutionQuality))
+                validationBestSolutionTable.Rows.Add(new DataRow(PreviousWindowBestValidationSolutionQuality));
+            if (!validationBestSolutionTable.Rows.ContainsKey(NextWindowBestValidationSolutionQuality))
+                validationBestSolutionTable.Rows.Add(new DataRow(NextWindowBestValidationSolutionQuality));
+
+            if (!results.ContainsKey(ErrorMeasureChart))
+                results.Add(new Result(ErrorMeasureChart, new DataTable(ErrorMeasureChart) { VisualProperties = { YAxisLogScale = true } }));
+
+            var MSEBestSolutionErrorTable = (DataTable)results[ErrorMeasureChart].Value;
+
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(ValidationMAETestSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(ValidationMAETestSetQuality));
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(ValidationMAETrainingSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(ValidationMAETrainingSetQuality));
+
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(ValidationMSETestSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(ValidationMSETestSetQuality));
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(ValidationMSETrainingSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(ValidationMSETrainingSetQuality));
+
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(ValidationRMSETestSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(ValidationRMSETestSetQuality));
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(ValidationRMSETrainingSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(ValidationRMSETrainingSetQuality));
+
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(ValidationPearsonR2TestSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(ValidationPearsonR2TestSetQuality) { VisualProperties = { SecondYAxis = true } });
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(ValidationPearsonR2TrainingSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(ValidationPearsonR2TrainingSetQuality) { VisualProperties = { SecondYAxis = true } });
+
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(TrainingMSETestSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(TrainingMSETestSetQuality));
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(TrainingMSETrainingSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(TrainingMSETrainingSetQuality));
+
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(TrainingRMSETestSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(TrainingRMSETestSetQuality));
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(TrainingRMSETrainingSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(TrainingRMSETrainingSetQuality));
+
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(TrainingMAETestSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(TrainingMAETestSetQuality));
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(TrainingMAETrainingSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(TrainingMAETrainingSetQuality));
+
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(TrainingPearsonR2TestSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(TrainingPearsonR2TestSetQuality) { VisualProperties = { SecondYAxis = true } });
+            if (!MSEBestSolutionErrorTable.Rows.ContainsKey(TrainingPearsonR2TrainingSetQuality))
+                MSEBestSolutionErrorTable.Rows.Add(new DataRow(TrainingPearsonR2TrainingSetQuality) { VisualProperties = { SecondYAxis = true } });
+
+            #endregion
+
+            #region Reevaluate current best solution
+            if (reevaluateValidationResult
+                && ValidationBestSolutionQuality != null
+                && ValidationPartitionParameter.ActualValue != null)
+            {
+                var evaluator = EvaluatorParameter.ActualValue;
+                var problemData = ProblemDataParameter.ActualValue;
+
+                IExecutionContext childContext = (IExecutionContext)ExecutionContext.CreateChildOperation(evaluator);
+                var currentValidationBestSolution = (S)results[ValidationBestSolutionParameterName].Value;
+                ValidationBestSolutionQuality.Value =
+                    evaluator.Evaluate(
+                        childContext,
+                        currentValidationBestSolution.Model.SymbolicExpressionTree,
+                        problemData,
+                        Enumerable.Range(
+                            ValidationPartitionParameter.ActualValue.Start,
+                            ValidationPartitionParameter.ActualValue.End - ValidationPartitionParameter.ActualValue.Start
+                        ));
+                results[ValidationBestSolutionQualityParameterName].Value = ValidationBestSolutionQuality;
+                results[ValidationBestSolutionGenerationParameterName].Value = IterationsParameter.ActualValue;
+                reevaluateValidationResult = false;
+            }
+            #endregion
+
+            if (bestValidationSolution.Solution != null && (UpdateAlways.Value || ValidationBestSolutionQuality == null || 
+              IsBetter(bestValidationSolution.Quality.Value, ValidationBestSolutionQuality.Value, Maximization.Value)))
+            {
+                ValidationBestSolution = CreateSolution(bestValidationSolution.Solution.Model.SymbolicExpressionTree, bestValidationSolution.Quality.Value);
+                ValidationBestSolutionQuality = bestValidationSolution.Quality;
+
+                results[ValidationBestSolutionParameter.Name].Value = ValidationBestSolution;
+                results[ValidationBestSolutionQualityParameter.Name].Value = ValidationBestSolutionQuality;
+                // TODO Ask Affenzeller if current iteration should be shown or the iteration when the solution was created
+                results[ValidationBestSolutionGenerationParameter.Name].Value = bestValidationSolution.Generation;
+                results[LayerOfBestValidationSolutionParameterName].Value = bestValidationSolution.Layer;
+            }
+
+            #region create charts
+            validationBestSolutionTable.Rows[OpenLayersParameterName].Values.Add(OpenLayersParameter.ActualValue.Value);
+            validationBestSolutionTable.Rows[ValidationBestSolutionQualityParameterName].Values.Add(ValidationBestSolutionQualityParameter.ActualValue.Value);
+            validationBestSolutionTable.Rows[LayerOfBestValidationSolutionParameterName].Values.Add(((IntValue)results[LayerOfBestValidationSolutionParameterName].Value).Value + 1);
+            validationBestSolutionTable.Rows[TrainingBestSolutionQualityParameterName].Values.Add(bestTrainingSolution.Quality.Value);
+            validationBestSolutionTable.Rows[LayerOfBestTrainingSolutionParameterName].Values.Add(bestTrainingSolution.Layer.Value + 1);
+
+            results[ValidationBestSolutionTableParameterName].Value = validationBestSolutionTable;
+
+            var bestValidationRegressionSolution = ValidationBestSolution as IRegressionSolution;
+            var bestTrainingRegressionSolution = bestTrainingSolution.Solution as IRegressionSolution;
+
+            MSEBestSolutionErrorTable.Rows[ValidationMSETestSetQuality].Values.Add(bestValidationRegressionSolution.TestMeanSquaredError);
+            MSEBestSolutionErrorTable.Rows[ValidationMSETrainingSetQuality].Values.Add(bestValidationRegressionSolution.TrainingMeanSquaredError);
+
+            MSEBestSolutionErrorTable.Rows[ValidationRMSETestSetQuality].Values.Add(bestValidationRegressionSolution.TestRootMeanSquaredError);
+            MSEBestSolutionErrorTable.Rows[ValidationRMSETrainingSetQuality].Values.Add(bestValidationRegressionSolution.TrainingRootMeanSquaredError);
+
+            MSEBestSolutionErrorTable.Rows[ValidationMAETestSetQuality].Values.Add(bestValidationRegressionSolution.TestMeanAbsoluteError);
+            MSEBestSolutionErrorTable.Rows[ValidationMAETrainingSetQuality].Values.Add(bestValidationRegressionSolution.TrainingMeanAbsoluteError);
+
+            MSEBestSolutionErrorTable.Rows[ValidationPearsonR2TestSetQuality].Values.Add(bestValidationRegressionSolution.TestRSquared);
+            MSEBestSolutionErrorTable.Rows[ValidationPearsonR2TrainingSetQuality].Values.Add(bestValidationRegressionSolution.TrainingRSquared);
+
+            MSEBestSolutionErrorTable.Rows[TrainingMSETestSetQuality].Values.Add(bestTrainingRegressionSolution.TestMeanSquaredError);
+            MSEBestSolutionErrorTable.Rows[TrainingMSETrainingSetQuality].Values.Add(bestTrainingRegressionSolution.TrainingMeanSquaredError);
+
+            MSEBestSolutionErrorTable.Rows[TrainingRMSETestSetQuality].Values.Add(bestTrainingRegressionSolution.TestRootMeanSquaredError);
+            MSEBestSolutionErrorTable.Rows[TrainingRMSETrainingSetQuality].Values.Add(bestTrainingRegressionSolution.TrainingRootMeanSquaredError);
+
+            MSEBestSolutionErrorTable.Rows[TrainingMAETestSetQuality].Values.Add(bestTrainingRegressionSolution.TestMeanAbsoluteError);
+            MSEBestSolutionErrorTable.Rows[TrainingMAETrainingSetQuality].Values.Add(bestTrainingRegressionSolution.TrainingMeanAbsoluteError);
+
+            MSEBestSolutionErrorTable.Rows[TrainingPearsonR2TestSetQuality].Values.Add(bestTrainingRegressionSolution.TestRSquared);
+            MSEBestSolutionErrorTable.Rows[TrainingPearsonR2TrainingSetQuality].Values.Add(bestTrainingRegressionSolution.TrainingRSquared);
+
+            results[ErrorMeasureChart].Value = MSEBestSolutionErrorTable;
+            #endregion
+
+            return base.Apply();
+        }
+
+        private void ValidationPartition_ValueChanged(object sender, EventArgs e)
+        {
+            reevaluateValidationResult = true;
+        }
+
+        private bool IsBetter(double lhs, double rhs, bool maximization)
+        {
+            if (maximization) return lhs > rhs;
+            else return lhs < rhs;
+        }
+
+        protected override IEnumerable<int> GenerateRowsToEvaluate()
+        {
+            if (ValidationPartitionParameter.ActualValue == null
+                || TestPartitionParameter.ActualValue == null)
+                return base.GenerateRowsToEvaluate();
+
+            int seed = RandomParameter.ActualValue.Next();
+            int samplesStart = ValidationPartitionParameter.ActualValue.Start;
+            int samplesEnd = ValidationPartitionParameter.ActualValue.End;
+            int testPartitionStart = TestPartitionParameter.ActualValue.Start;
+            int testPartitionEnd = TestPartitionParameter.ActualValue.End;
+
+            if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value.");
+            int count = (int)((samplesEnd - samplesStart) * RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value);
+            if (count == 0) count = 1;
+            return RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count)
+              .Where(i => i < testPartitionStart && i < ProblemDataParameter.ActualValue.Dataset.Rows);
+        }
+
+        [StorableType("CD82C026-CF61-40D7-A898-77EA61992DE9")]
+        class LayerSolution
+        {
+            [Storable]
+            public S Solution { get; set; }
+            [Storable]
+            public DoubleValue Quality { get; set; }
+            [Storable]
+            public IntValue Generation { get; set; }
+            [Storable]
+            public IntValue Layer { get; set; }
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/ADWIN.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/ADWIN.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/ADWIN.cs	(revision 17479)
@@ -0,0 +1,86 @@
+﻿using HEAL.Attic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.DriftDetection
+{
+    [StorableType("714CAAE4-A88F-44A1-A2D0-92F4D8252C04")]
+    public abstract class ADWIN
+    {
+        [Storable]
+        public int MinCutSize { get; set; }
+        [Storable]
+        public int MinKeepSize { get; set; }
+        [Storable]
+        public double Delta { get; set; }
+
+        public ADWIN() { }
+
+        public ADWIN(double delta, int minKeepSize, int minCutSize)
+        {
+            Delta = delta;
+            MinKeepSize = minKeepSize;
+            MinCutSize = minCutSize;
+        }
+
+        public bool CheckHistogramForCut(Histogram histogram, IEnumerator<Bucket> buckets, int numCutPointsToCheck)
+        {
+            double keepTotal = histogram.Total;
+            double keepVariance = histogram.Total;
+            int keepSize = histogram.NumElements;
+
+            double cutTotal = 0;
+            double cutVariance = 0;
+            int cutSize = 0;
+
+            double bucketTotal, bucketVariance, bucketSize, bucketMean;
+            int cutPointsChecked = 0;
+            while (buckets.MoveNext())
+            {
+                cutPointsChecked++;
+                bucketTotal = buckets.Current.Total;
+                bucketVariance = buckets.Current.Variance;
+                bucketSize = buckets.Current.NumElements;
+                bucketMean = buckets.Current.Mean;
+
+                keepTotal -= bucketTotal;
+                keepVariance -= bucketVariance + keepSize * bucketSize * Math.Pow(keepTotal / keepSize - bucketMean, 2) / (keepSize + bucketSize);
+                keepSize -= (int)bucketSize;
+
+                cutTotal += bucketTotal;
+                if (cutSize > 0)
+                    cutVariance += bucketVariance + cutSize * bucketSize * Math.Pow(cutTotal / cutSize - bucketMean, 2) / (cutSize + bucketSize);
+                cutSize += (int)bucketSize;
+
+                if (keepSize >= MinKeepSize && cutSize >= MinCutSize && IsCutPoint(histogram, keepTotal, keepVariance, keepSize, cutTotal, cutVariance, cutSize))
+                {
+                    return true;
+                }
+                else if (keepSize < MinKeepSize)
+                {
+                    return false;
+                }
+                else if (cutPointsChecked == numCutPointsToCheck)
+                {
+                    return false;
+                }
+            }
+            return false;
+        }
+
+        private bool IsCutPoint(Histogram histogram, double keepTotal, double keepVariance, int keepSize, double cutTotal, double cutVariance, int cutSize)
+        {
+            double absMeanDifference = Math.Abs(keepTotal / keepSize - cutTotal / cutSize);
+            double dd = Math.Log(2.0 * Math.Log(histogram.NumElements) / Delta);
+            double m = 1.0 / (keepSize - MinKeepSize + 3) + 1.0 / (cutSize - MinCutSize + 3);
+            double epsilon = Math.Sqrt(2.0 * m * (histogram.Variance / histogram.NumElements) * dd) + 2.0 / 3.0 * dd * m;
+            return absMeanDifference > epsilon;
+        }
+
+        public abstract bool Execute(ref Histogram histogram);
+        public abstract void Terminate();
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/ADWINWrapper.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/ADWINWrapper.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/ADWINWrapper.cs	(revision 17479)
@@ -0,0 +1,62 @@
+﻿using HEAL.Attic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.DriftDetection
+{
+    [StorableType("719CE0E4-A88F-44A1-A2D0-92F4D8052C04")]
+    class ADWINWrapper
+    {
+        [Storable]
+        private ADWIN adwin;
+
+        [Storable]
+        private Histogram histogram;
+
+        [Storable]
+        public int Count { get; set; }
+        [Storable]
+        public int NumElementsProcessed { get; set; }
+        [Storable]
+        public int MaximumBucketsPerContainer { get; set; }
+
+        public ADWINWrapper() { }
+
+        public ADWINWrapper(double delta, int maximumBucketsPerContainer, int minKeepSize = 100, int minCutSize = 100)
+        {
+            histogram = new Histogram(maximumBucketsPerContainer);
+            adwin = new SequentialADWIN(delta, minKeepSize, minCutSize);
+            NumElementsProcessed = 0;
+            Count = 0;
+            MaximumBucketsPerContainer = maximumBucketsPerContainer;
+        }
+
+        public bool AddElement(double element)
+        {
+            NumElementsProcessed++;
+            histogram.AddElement(element);
+            Count++;
+            return adwin.Execute(ref histogram);
+        }
+
+
+        public void Reset()
+        {
+            Count = 0;
+        }
+
+        public int WindowSize {
+            get { return histogram.NumElements; }
+        }
+
+        public int RemoveOldestInstances()
+        {
+            int startElementsCount = WindowSize;
+            histogram.RemoveBuckets(1);
+            return startElementsCount - WindowSize;
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/Bucket.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/Bucket.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/Bucket.cs	(revision 17479)
@@ -0,0 +1,37 @@
+﻿using HEAL.Attic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.DriftDetection
+{
+    [StorableType("114CE0E4-A88F-44A1-A2D0-92F4D8252C04")]
+    public class Bucket
+    {
+        public Bucket()
+        {
+        }
+
+        public Bucket(double total, double variance, int numElements)
+        {
+            Total = total;
+            Variance = variance;
+            NumElements = numElements;
+        }
+
+        [Storable]
+        public double Total { get; set; }
+        [Storable]
+        public double Variance { get; set; }
+        [Storable]
+        public int NumElements { get; set; }
+
+        public double Mean {
+            get {
+                return Total / NumElements;
+            }
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/BucketContainer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/BucketContainer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/BucketContainer.cs	(revision 17479)
@@ -0,0 +1,121 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.DriftDetection
+{
+    [StorableType("714CE0E4-188F-44A1-A2D0-92F4D82D2C04")]
+    public class BucketContainer
+    {
+        [Storable]
+        private Bucket[] buckets;
+        [Storable]
+        internal BucketContainer Prev { get; set; }
+        [Storable]
+        internal BucketContainer Next { get; set; }
+        [Storable]
+        public int MaxBuckets { get; }
+        [Storable]
+        public int FirstBucket { get; set; }
+        [Storable]
+        public int NumElementsPerBucket { get; set; }
+        [Storable]
+        public int NumBuckets { get; set; }
+
+        public BucketContainer () { }
+
+        public BucketContainer(BucketContainer prev, BucketContainer next, int maxBuckets, int elementsPerBucket)
+        {
+            Prev = prev;
+            Next = next;
+            MaxBuckets = maxBuckets;
+            NumElementsPerBucket = elementsPerBucket;
+            buckets = new Bucket[maxBuckets];
+            FirstBucket = 0;
+            NumBuckets = 0;
+        }
+
+        private BucketContainer(BucketContainer originalContainer)
+        {
+            MaxBuckets = originalContainer.MaxBuckets;
+            Array.Copy(originalContainer.buckets, 0, buckets, 0, originalContainer.buckets.Length);
+            FirstBucket = originalContainer.FirstBucket;
+            NumElementsPerBucket = originalContainer.NumElementsPerBucket;
+            NumBuckets = originalContainer.NumBuckets;
+        }
+
+        public void AddBucket(Bucket newBucket)
+        {
+            if (newBucket.NumElements != NumElementsPerBucket)
+                throw new Exception("Number of elements should be number of elements per bucket.");
+
+            buckets[(FirstBucket + NumBuckets) % MaxBuckets] = newBucket;
+            NumBuckets++;
+        }
+
+        public Bucket[] RemoveBuckets(int num)
+        {
+            Bucket[] resultBuckets = new Bucket[num];
+            if (FirstBucket <= ((FirstBucket + num) % MaxBuckets))
+            {
+                Array.Copy(buckets, FirstBucket, resultBuckets, 0, num);
+            }
+            else
+            {
+                Array.Copy(buckets, FirstBucket, resultBuckets, 0, MaxBuckets - FirstBucket);
+                Array.Copy(buckets, 0, resultBuckets, MaxBuckets - FirstBucket, num - MaxBuckets + FirstBucket);
+            }
+            FirstBucket = (FirstBucket + num) % MaxBuckets;
+            NumBuckets -= num;
+            return resultBuckets;
+        }
+
+        public Bucket GetBucket(int position)
+        {
+            return buckets[(FirstBucket + (NumBuckets - position - 1)) % MaxBuckets];
+        }
+
+        public BucketContainer DeepCopy()
+        {
+            if (!typeof(BucketContainer).IsSerializable)
+            {
+                throw new ArgumentException("The type must be serializable.", "source");
+            }
+
+            // Don't serialize a null object, simply return the default for that object
+            if (ReferenceEquals(this, null))
+            {
+                BucketContainer copyThis = new BucketContainer(this);
+                if (Next != null)
+                {
+                    BucketContainer nextCopy = Next.DeepCopy();
+                    copyThis.Next = nextCopy;
+                    nextCopy.Prev = copyThis;
+                }
+                return copyThis;
+            }
+
+            IFormatter formatter = new BinaryFormatter();
+            using (Stream stream = new MemoryStream())
+            {
+                formatter.Serialize(stream, this);
+                stream.Seek(0, SeekOrigin.Begin);
+                BucketContainer copyThis = (BucketContainer)formatter.Deserialize(stream);
+                if (Next != null)
+                {
+                    BucketContainer nextCopy = Next.DeepCopy();
+                    copyThis.Next = nextCopy;
+                    nextCopy.Prev = copyThis;
+                }
+                return copyThis;
+            }
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/Histogram.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/Histogram.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/Histogram.cs	(revision 17479)
@@ -0,0 +1,257 @@
+﻿using HEAL.Attic;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.DriftDetection
+{
+    [StorableType("714AE0E4-A88F-44A1-A2D0-92F418252C04")]
+    public class Histogram : IEnumerable<Bucket>
+    {
+        [Storable]
+        public int MaxBucketsPerBucketContainer { get; }
+        [Storable]
+        public int NumBucketContainers { get; set; }
+        [Storable]
+        public int NumBuckets { get; set; }
+        [Storable]
+        public int NumElements { get; set; }
+        [Storable]
+        public double Total { get; set; }
+        [Storable]
+        public double Variance { get; set; }
+        [Storable]
+        internal BucketContainer Tail { get; set; }
+        [Storable]
+        internal BucketContainer Head { get; set; }
+
+        public Histogram() { }
+
+        /**
+         * Creates a new empty Histogram
+         * @param maxBucketsPerBucketContainer max number of Buckets in one bucket container. default is 5
+         */
+        public Histogram(int maxBucketsPerBucketContainer)
+        {
+            if (maxBucketsPerBucketContainer < 2)
+            {
+                throw new Exception("maxBucketsPerBucketContainer must be at least 2.");
+            }
+
+            Head = new BucketContainer(null, null, maxBucketsPerBucketContainer, 1);
+            Tail = Head;
+            NumBucketContainers = 1;
+            MaxBucketsPerBucketContainer = maxBucketsPerBucketContainer;
+        }
+
+        // TODO Evaluate
+        private Histogram(Histogram original)
+        {
+            MaxBucketsPerBucketContainer = original.MaxBucketsPerBucketContainer;
+
+            NumBucketContainers = original.NumBucketContainers;
+            NumBuckets = original.NumBuckets;
+            NumElements = original.NumElements;
+
+            Total = original.Total;
+            Variance = original.Variance;
+
+            Head = original.Head.DeepCopy();
+            BucketContainer currentBucketContainer = Head;
+            while (currentBucketContainer.Next != null)
+            {
+                currentBucketContainer = currentBucketContainer.Next;
+            }
+            Tail = currentBucketContainer;
+        }
+
+        public void AddElement(double element)
+        {
+            Bucket newBucket = new Bucket(element, 0, 1);
+            Head.AddBucket(newBucket);
+            NumBuckets++;
+            NumElements++;
+            if (NumElements > 1)
+            {
+                Variance += (NumElements - 1) * Math.Pow(element - Total / (NumElements - 1), 2) / NumElements;
+            }
+            Total += element;
+            Compress();
+        }
+
+        private void AddEmptyTailBucketContainer()
+        {
+            BucketContainer newTail = new BucketContainer(Tail, null, MaxBucketsPerBucketContainer, Tail.NumElementsPerBucket * 2);
+            Tail.Next = newTail;
+            Tail = newTail;
+            NumBucketContainers++;
+        }
+
+        private void Compress()
+        {
+            BucketContainer pointer = Head;
+            while (pointer != null)
+            {
+                if (pointer.NumBuckets == pointer.MaxBuckets)
+                {
+                    if (pointer.Next == null)
+                    {
+                        AddEmptyTailBucketContainer();
+                    }
+                    Bucket[] removedBuckets = pointer.RemoveBuckets(2);
+                    Bucket newBucket = CompressBuckets(removedBuckets[0], removedBuckets[1]);
+                    pointer.Next.AddBucket(newBucket);
+                    NumBuckets -= 1;
+                }
+                pointer = pointer.Next;
+            }
+        }
+
+        private Bucket CompressBuckets(Bucket firstBucket, Bucket secondBucket)
+        {
+            if (firstBucket.NumElements != secondBucket.NumElements)
+                throw new Exception("Number of buckets unequal.");
+
+            int elementsPerBucket = firstBucket.NumElements;
+            double newTotal = firstBucket.Total + secondBucket.Total;
+            double varianceIncrease = Math.Pow(firstBucket.Total - secondBucket.Total, 2) / (2 * elementsPerBucket);
+            double newVariance = firstBucket.Variance + secondBucket.Variance + varianceIncrease;
+            return new Bucket(newTotal, newVariance, 2 * elementsPerBucket);
+        }
+
+        public void RemoveBuckets(int num)
+        {
+            while (num > 0)
+            {
+                Bucket[] removedBuckets;
+                if (num >= Tail.NumBuckets)
+                {
+                    num -= Tail.NumBuckets;
+                    removedBuckets = Tail.RemoveBuckets(Tail.NumBuckets);
+                    Tail = Tail.Prev;
+                    Tail.Next = null;
+                    NumBucketContainers--;
+                }
+                else
+                {
+                    removedBuckets = Tail.RemoveBuckets(num);
+                    num = 0;
+                }
+                foreach (Bucket bucket in removedBuckets)
+                {
+                    NumElements -= bucket.NumElements;
+                    NumBuckets--;
+                    Total -= bucket.Total;
+                    Variance -= bucket.Variance + bucket.NumElements * NumElements * Math.Pow(bucket.Mean - Total / NumElements, 2) / (bucket.NumElements + NumElements);
+                }
+            }
+        }
+
+        public Histogram copy()
+        {
+            return new Histogram(this);
+        }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return GetEnumerator();
+        }
+
+        public IEnumerator<Bucket> GetEnumerator()
+        {
+            return new HistogramReverseEnumerator<Bucket>(this);
+        }
+
+        private class HistogramReverseEnumerator<T> : IEnumerator<Bucket>
+        {
+            private BucketContainer currentBucketContainer;
+            private int currentBucketIndex;
+
+            public HistogramReverseEnumerator(Histogram histogram)
+            {
+                currentBucketContainer = histogram.Tail;
+                currentBucketIndex = histogram.Tail.NumBuckets;
+            }
+
+            public Bucket Current => currentBucketContainer.GetBucket(currentBucketIndex);
+
+            object IEnumerator.Current => Current;
+
+            public void Dispose()
+            {
+            }
+
+            private bool HasNext()
+            {
+                return (currentBucketIndex > 0) || (currentBucketContainer.Prev != null);
+            }
+
+            public bool MoveNext()
+            {
+                if (!HasNext())
+                    return false;
+
+                currentBucketIndex--;
+                if (currentBucketIndex < 0)
+                {
+                    currentBucketContainer = currentBucketContainer.Prev;
+                    currentBucketIndex = currentBucketContainer.NumBuckets - 1;
+                }
+                return true;
+            }
+
+            public void Reset()
+            {
+            }
+        }
+
+        private class HistogramEnumerator<T> : IEnumerator<Bucket>
+        {
+            private Histogram histogram;
+            private BucketContainer currentBucketContainer;
+            private int currentBucketIndex;
+
+            public HistogramEnumerator(Histogram histogram)
+            {
+                this.histogram = histogram;
+                currentBucketContainer = histogram.Head;
+                currentBucketIndex = -1;
+            }
+
+            public Bucket Current => currentBucketContainer.GetBucket(currentBucketIndex);
+
+            object IEnumerator.Current => Current;
+
+            public void Dispose()
+            {
+            }
+
+            private bool HasNext()
+            {
+                return (currentBucketIndex < currentBucketContainer.NumBuckets - 1) || (currentBucketContainer.Next != null);
+            }
+
+            public bool MoveNext()
+            {
+                if (!HasNext())
+                    return false;
+
+                currentBucketIndex++;
+                if (currentBucketIndex > currentBucketContainer.NumBuckets - 1)
+                {
+                    currentBucketContainer = currentBucketContainer.Next;
+                    currentBucketIndex = 0;
+                }
+
+                return true;
+            }
+
+            public void Reset()
+            {
+            }
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/SequentialADWIN.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/SequentialADWIN.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/SequentialADWIN.cs	(revision 17479)
@@ -0,0 +1,41 @@
+﻿using HEAL.Attic;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.DriftDetection
+{
+    [StorableType("714CA0E4-A88F-44D1-A2D0-92F4D8251C04")]
+    public class SequentialADWIN : ADWIN
+    {
+        public SequentialADWIN() { }
+
+        public SequentialADWIN(double delta, int minKeepSize = 100, int minCutSize = 100)
+            : base(delta, minKeepSize, minCutSize)
+        {
+        }
+
+        public override bool Execute(ref Histogram histogram)
+        {
+            bool tryToFindCut = true;
+            bool cutFound = false;
+            while (tryToFindCut)
+            {
+                tryToFindCut = false;           
+                if (CheckHistogramForCut(histogram, histogram.GetEnumerator(), histogram.NumBuckets - 1))
+                {
+                    histogram.RemoveBuckets(1);
+                    tryToFindCut = true;
+                    cutFound = true;
+                }
+            }
+            return cutFound;
+        }
+
+        public override void Terminate()
+        {
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/EldersSelector.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/EldersSelector.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/EldersSelector.cs	(revision 17479)
@@ -0,0 +1,88 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+using HeuristicLab.Selection;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+
+  [Item("EldersSelector", "Select all individuals which are too old for their current layer.")]
+  [StorableType("A809F782-F598-44F6-A586-3515A9BCEB00")]
+    public sealed class EldersSelector : Selector {
+    public IScopeTreeLookupParameter<DoubleValue> AgeParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Age"]; }
+    }
+    public ILookupParameter<IntArray> AgeLimitsParameter {
+      get { return (ILookupParameter<IntArray>)Parameters["AgeLimits"]; }
+    }
+    public ILookupParameter<IntValue> NumberOfLayersParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["NumberOfLayers"]; }
+    }
+    public ILookupParameter<IntValue> LayerParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["Layer"]; }
+    }
+
+    [StorableConstructor]
+    private EldersSelector(StorableConstructorFlag _) : base(_) { }
+    private EldersSelector(EldersSelector original, Cloner cloner)
+      : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new EldersSelector(this, cloner);
+    }
+    public EldersSelector()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The age of individuals."));
+      Parameters.Add(new LookupParameter<IntArray>("AgeLimits", "The maximum age an individual is allowed to reach in a certain layer."));
+      Parameters.Add(new LookupParameter<IntValue>("NumberOfLayers", "The number of layers."));
+      Parameters.Add(new LookupParameter<IntValue>("Layer", "The number of the current layer."));
+    }
+
+    protected override IScope[] Select(List<IScope> scopes) {
+      var ages = AgeParameter.ActualValue;
+      var ageLimits = AgeLimitsParameter.ActualValue;
+      int numberOfLayers = NumberOfLayersParameter.ActualValue.Value;
+      int layer = LayerParameter.ActualValue.Value;
+
+      if (layer >= numberOfLayers - 1) // is max layer?
+        return new IScope[0];
+
+      int limit = ageLimits[layer];
+      var elders = ages
+        .Select((x, index) => new { index, age = x.Value })
+        .Where(x => x.age > limit)
+        .ToList();
+
+      IScope[] selected = new IScope[elders.Count];
+      for (int i = 0; i < elders.Count; i++) {
+        selected[i] = scopes[elders[i].index];
+        scopes[elders[i].index] = null;
+      }
+      scopes.RemoveAll(x => x == null);
+      return selected;
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Evaluators/SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Evaluators/SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Evaluators/SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator.cs	(revision 17479)
@@ -0,0 +1,100 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HEAL.Attic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Evaluators
+{
+    [Item("Mean squared error Evaluator", "Calculates the mean squared error of a symbolic regression solution.")]
+    [StorableType("8D4B5243-1615-46A6-AAF9-18C9BCB725DD")]
+    public class SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator : SymbolicRegressionSingleObjectiveEvaluator
+    {
+        public override bool Maximization { get { return false; } }
+        [StorableConstructor]
+        protected SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator(StorableConstructorFlag _) : base(_) { }
+        protected SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator(SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator original, Cloner cloner)
+          : base(original, cloner)
+        {
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator(this, cloner);
+        }
+        public SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator() : base() { }
+
+        public override IOperation InstrumentedApply()
+        {
+            var solution = SymbolicExpressionTreeParameter.ActualValue;
+            IEnumerable<int> rows = GenerateRowsToEvaluate();
+
+            double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value);
+            QualityParameter.ActualValue = new DoubleValue(quality);
+
+            return base.InstrumentedApply();
+        }
+
+        public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows, bool applyLinearScaling)
+        {
+            IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
+            IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
+            OnlineCalculatorError errorState;
+
+            double mse;
+            if (applyLinearScaling)
+            {
+                var mseCalculator = new OnlineMeanSquaredErrorCalculator();
+                CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, mseCalculator, problemData.Dataset.Rows);
+                errorState = mseCalculator.ErrorState;
+                mse = mseCalculator.MeanSquaredError;
+            }
+            else
+            {
+                IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
+                mse = OnlineMeanSquaredErrorCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);
+            }
+            if (errorState != OnlineCalculatorError.None) return double.NaN;
+            return mse;
+        }
+
+        public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IRegressionProblemData problemData, IEnumerable<int> rows)
+        {
+            SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
+            EstimationLimitsParameter.ExecutionContext = context;
+            ApplyLinearScalingParameter.ExecutionContext = context;
+
+            double mse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows, ApplyLinearScalingParameter.ActualValue.Value);
+
+            SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
+            EstimationLimitsParameter.ExecutionContext = null;
+            ApplyLinearScalingParameter.ExecutionContext = null;
+
+            return mse;
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Evaluators/SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Evaluators/SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Evaluators/SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator.cs	(revision 17479)
@@ -0,0 +1,81 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using HeuristicLab.Random;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Evaluators
+{
+    [Item("Sliding Window Pearson R² Evaluator", "Calculates the square of the pearson correlation coefficient (also known as coefficient of determination) of a symbolic regression solution.")]
+    [StorableType("6FAEC6C2-C711-452A-A60D-29AE37898A90")]
+    public class SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator : SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator
+    {
+        private const string TestPartitionParameterName = "TestPartition";
+        private const string TrainingPartitionParameterName = "TrainingPartition";
+
+        public ILookupParameter<IntRange> TrainingPartitionParameter {
+            get { return (ILookupParameter<IntRange>)Parameters[TrainingPartitionParameterName]; }
+        }
+        public ILookupParameter<IntRange> TestPartitionParameter {
+            get { return (ILookupParameter<IntRange>)Parameters[TestPartitionParameterName]; }
+        }
+
+        [StorableConstructor]
+        protected SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator(StorableConstructorFlag _) : base(_) { }
+        protected SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator(SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator original, Cloner cloner)
+          : base(original, cloner)
+        {
+        }
+        public override IDeepCloneable Clone(Cloner cloner)
+        {
+            return new SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator(this, cloner);
+        }
+
+        public SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator() : base()
+        {
+            Parameters.Add(new ValueLookupParameter<IntRange>(TrainingPartitionParameterName, "The current training sliding window position or range."));
+            Parameters.Add(new ValueLookupParameter<IntRange>(TestPartitionParameterName, "The current test sliding window position or range."));
+        }
+
+        //protected override IEnumerable<int> GenerateRowsToEvaluate(double percentageOfRows)
+        //{
+        //    if (TrainingPartitionParameter.ActualValue == null
+        //        || TestPartitionParameter.ActualValue == null)
+        //       return base.GenerateRowsToEvaluate(percentageOfRows);
+
+        //    IEnumerable<int> rows;
+        //    int samplesStart = TrainingPartitionParameter.ActualValue.Start;
+        //    int samplesEnd = TrainingPartitionParameter.ActualValue.End;
+        //    int testPartitionStart = TestPartitionParameter.ActualValue.Start;
+        //    int testPartitionEnd = TestPartitionParameter.ActualValue.End;
+        //    if (samplesEnd < samplesStart) throw new ArgumentException("Start value is larger than end value.");
+
+        //    if (percentageOfRows.IsAlmost(1.0))
+        //        rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart);
+        //    else
+        //    {
+        //        int seed = RandomParameter.ActualValue.Next();
+        //        int count = (int)((samplesEnd - samplesStart) * percentageOfRows);
+        //        if (count == 0) count = 1;
+        //        rows = RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count);
+        //    }
+
+        //    rows = rows.Where(i => i < testPartitionStart || testPartitionEnd <= i);
+        //    if (ValidRowIndicatorParameter.ActualValue != null)
+        //    {
+        //        string indicatorVar = ValidRowIndicatorParameter.ActualValue.Value;
+        //        var problemData = ProblemDataParameter.ActualValue;
+        //        var indicatorRow = problemData.Dataset.GetReadOnlyDoubleValues(indicatorVar);
+        //        rows = rows.Where(r => !indicatorRow[r].IsAlmost(0.0));
+        //    }
+        //    return rows;
+        //}
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/GeneticAlgorithm.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/GeneticAlgorithm.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/GeneticAlgorithm.cs	(revision 17479)
@@ -0,0 +1,531 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Algorithms.SWGA
+{
+  /// <summary>
+  /// A genetic algorithm.
+  /// </summary>
+  [Item("Sliding window Genetic Algorithm (SWGA)", "A genetic algorithm with sliding window.")]
+  [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 100)]
+  [StorableType("708F2368-F29C-47B8-8A80-E4CA5FDFEBFF")]
+
+    public sealed class GeneticAlgorithm : HeuristicOptimizationEngineAlgorithm, IStorableContent {
+    public string Filename { get; set; }
+
+    private const string TerminateSlidingWindowParameterName = "TerminateSlidingWindow";
+        
+
+
+
+    #region Problem Properties
+    public override Type ProblemType {
+      get { return typeof(ISingleObjectiveHeuristicOptimizationProblem); }
+    }
+    public new ISingleObjectiveHeuristicOptimizationProblem Problem {
+      get { return (ISingleObjectiveHeuristicOptimizationProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+    #endregion
+
+    #region Parameter Properties
+    private ValueParameter<IntValue> SeedParameter {
+      get { return (ValueParameter<IntValue>)Parameters["Seed"]; }
+    }
+    private ValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
+    }
+    private ValueParameter<IntValue> PopulationSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    public IConstrainedValueParameter<ISelector> SelectorParameter {
+      get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
+    }
+    public IConstrainedValueParameter<ICrossover> CrossoverParameter {
+      get { return (IConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
+    }
+    private ValueParameter<PercentValue> MutationProbabilityParameter {
+      get { return (ValueParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    public IConstrainedValueParameter<IManipulator> MutatorParameter {
+      get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
+    }
+    private ValueParameter<IntValue> ElitesParameter {
+      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
+    }
+    private IFixedValueParameter<BoolValue> ReevaluateElitesParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; }
+    }
+    private ValueParameter<MultiAnalyzer> AnalyzerParameter {
+      get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
+    }
+    private ValueParameter<IntValue> MaximumGenerationsParameter {
+      get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; }
+    }
+
+    private IValueParameter<MultiTerminator> TerminatorParameter {
+      get { return (IValueParameter<MultiTerminator>)Parameters["Terminator"]; }
+    }
+
+    public IFixedValueParameter<MultiAnalyzer> SlidingWindowParameter {
+      get { return (IFixedValueParameter<MultiAnalyzer>)Parameters["SlidingWindow"]; }
+    }
+    #endregion
+
+    #region Properties
+    public IntValue Seed {
+      get { return SeedParameter.Value; }
+      set { SeedParameter.Value = value; }
+    }
+    public BoolValue SetSeedRandomly {
+      get { return SetSeedRandomlyParameter.Value; }
+      set { SetSeedRandomlyParameter.Value = value; }
+    }
+    public IntValue PopulationSize {
+      get { return PopulationSizeParameter.Value; }
+      set { PopulationSizeParameter.Value = value; }
+    }
+    public ISelector Selector {
+      get { return SelectorParameter.Value; }
+      set { SelectorParameter.Value = value; }
+    }
+    public ICrossover Crossover {
+      get { return CrossoverParameter.Value; }
+      set { CrossoverParameter.Value = value; }
+    }
+    public PercentValue MutationProbability {
+      get { return MutationProbabilityParameter.Value; }
+      set { MutationProbabilityParameter.Value = value; }
+    }
+    public IManipulator Mutator {
+      get { return MutatorParameter.Value; }
+      set { MutatorParameter.Value = value; }
+    }
+    public IntValue Elites {
+      get { return ElitesParameter.Value; }
+      set { ElitesParameter.Value = value; }
+    }
+    public bool ReevaluteElites {
+      get { return ReevaluateElitesParameter.Value.Value; }
+      set { ReevaluateElitesParameter.Value.Value = value; }
+    }
+    public MultiAnalyzer Analyzer {
+      get { return AnalyzerParameter.Value; }
+      set { AnalyzerParameter.Value = value; }
+    }
+    public IntValue MaximumGenerations {
+      get { return MaximumGenerationsParameter.Value; }
+      set { MaximumGenerationsParameter.Value = value; }
+    }
+    private RandomCreator RandomCreator {
+      get { return (RandomCreator)OperatorGraph.InitialOperator; }
+    }
+    private SolutionsCreator SolutionsCreator {
+      get { return (SolutionsCreator)RandomCreator.Successor; }
+    }
+    private GeneticAlgorithmMainLoop GeneticAlgorithmMainLoop {
+      get { return FindMainLoop(SolutionsCreator.Successor); }
+    }
+    public MultiTerminator Terminators {
+      get { return TerminatorParameter.Value; }
+    }
+    public MultiAnalyzer SlidingWindow {
+        get { return SlidingWindowParameter.Value; }
+    }
+
+    [Storable]
+    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
+    #endregion
+
+    [Storable]
+    private SymbolicRegressionGenerationalSlidingWindowAnalyzer generationalSlidingWindowAnalyzer;
+    [Storable]
+    private SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer offspringSelectionSlidingWindowAnalyze;
+    [Storable]
+    private SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer overfittingSelectionSlidingWindowAnalyzer;
+    [Storable]
+    private SymbolicRegressionAdaptiveSlidingWindowAnalyzer generationalAdaptiveSlidingWindowAnalyzer;
+
+    #region Preconfigured Terminators
+    [Storable]
+    private ComparisonTerminator<IntValue> generationsTerminator;
+    [Storable]
+    private ComparisonTerminator<IntValue> evaluationsTerminator;
+    [Storable]
+    private SingleObjectiveQualityTerminator qualityTerminator;
+    [Storable]
+    private ExecutionTimeTerminator executionTimeTerminator;
+    [Storable]
+    private ComparisonTerminator<BoolValue> slidingWindowTerminator;
+    #endregion
+
+    public GeneticAlgorithm()
+      : base() {
+      Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
+      Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions.", new IntValue(100)));
+      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.05)));
+      Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
+      Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true });
+      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
+      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000)));
+
+      Parameters.Add(new ValueParameter<MultiTerminator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop.", new MultiTerminator()));
+      Parameters.Add(new FixedValueParameter<MultiAnalyzer>("SlidingWindow", "Operator which moves a sliding window over the training data.", new MultiAnalyzer()));   
+      Parameters.Add(new ValueParameter<BoolValue>(TerminateSlidingWindowParameterName, "Indicates if the sliding window has reached the end of the training data set", new BoolValue(false)) { Hidden = true });
+
+      RandomCreator randomCreator = new RandomCreator();
+      SolutionsCreator solutionsCreator = new SolutionsCreator();
+      SubScopesCounter subScopesCounter = new SubScopesCounter();
+      ResultsCollector resultsCollector = new ResultsCollector();
+      GeneticAlgorithmMainLoop mainLoop = new GeneticAlgorithmMainLoop();
+      OperatorGraph.InitialOperator = randomCreator;
+
+      randomCreator.RandomParameter.ActualName = "Random";
+      randomCreator.SeedParameter.ActualName = SeedParameter.Name;
+      randomCreator.SeedParameter.Value = null;
+      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
+      randomCreator.SetSeedRandomlyParameter.Value = null;
+      randomCreator.Successor = solutionsCreator;
+
+      solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
+      solutionsCreator.Successor = subScopesCounter;
+
+      subScopesCounter.Name = "Initialize EvaluatedSolutions";
+      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
+      subScopesCounter.Successor = resultsCollector;
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
+      resultsCollector.ResultsParameter.ActualName = "Results";
+      resultsCollector.Successor = mainLoop;
+
+      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
+      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
+      mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
+      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
+      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
+      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
+      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
+      mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
+      mainLoop.ResultsParameter.ActualName = "Results";
+      mainLoop.TerminatorParameter.ActualName = TerminatorParameter.Name;
+      mainLoop.SlidingWindowParameter.ActualName = SlidingWindowParameter.Name;
+
+      foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name))
+        SelectorParameter.ValidValues.Add(selector);
+      ISelector proportionalSelector = SelectorParameter.ValidValues.FirstOrDefault(x => x.GetType().Name.Equals("ProportionalSelector"));
+      if (proportionalSelector != null) SelectorParameter.Value = proportionalSelector;
+      ParameterizeSelectors();
+
+      generationalSlidingWindowAnalyzer = new SymbolicRegressionGenerationalSlidingWindowAnalyzer();
+      offspringSelectionSlidingWindowAnalyze = new SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer();
+      overfittingSelectionSlidingWindowAnalyzer = new SymbolicRegressionOverfittingSelectionSlidingWindowAnalyzer();
+      generationalAdaptiveSlidingWindowAnalyzer = new SymbolicRegressionAdaptiveSlidingWindowAnalyzer();
+
+      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+
+      #region Create terminators
+      generationsTerminator = new ComparisonTerminator<IntValue>("Generations", ComparisonType.Less, new IntValue(1000)) { Name = "Generations" };
+      evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, new IntValue(int.MaxValue)) { Name = "Evaluations" };
+      qualityTerminator = new SingleObjectiveQualityTerminator() { Name = "Quality" };
+      executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5)));
+      slidingWindowTerminator = new ComparisonTerminator<BoolValue>(TerminateSlidingWindowParameterName, ComparisonType.NotEqual, new BoolValue(true)) { Name = "Terminate sliding window" };
+      #endregion
+
+      ParameterizeAnalyzers();
+      UpdateAnalyzers();
+
+      UpdateTerminators();
+
+      Initialize();
+    }
+    [StorableConstructor]
+    private GeneticAlgorithm(StorableConstructorFlag _) : base(_) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      if (!Parameters.ContainsKey("ReevaluateElites")) {
+        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", (BoolValue)new BoolValue(false).AsReadOnly()) { Hidden = true });
+      }
+      var optionalMutatorParameter = MutatorParameter as OptionalConstrainedValueParameter<IManipulator>;
+      if (optionalMutatorParameter != null) {
+        Parameters.Remove(optionalMutatorParameter);
+        Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
+        foreach (var m in optionalMutatorParameter.ValidValues)
+          MutatorParameter.ValidValues.Add(m);
+        if (optionalMutatorParameter.Value == null) MutationProbability.Value = 0; // to guarantee that the old configuration results in the same behavior
+        else Mutator = optionalMutatorParameter.Value;
+        optionalMutatorParameter.ValidValues.Clear(); // to avoid dangling references to the old parameter its valid values are cleared
+      }
+      #endregion
+
+      Initialize();
+    }
+
+
+
+    private GeneticAlgorithm(GeneticAlgorithm original, Cloner cloner)
+      : base(original, cloner) {
+      qualityAnalyzer = cloner.Clone(original.qualityAnalyzer);
+      generationalSlidingWindowAnalyzer = cloner.Clone(original.generationalSlidingWindowAnalyzer);
+      offspringSelectionSlidingWindowAnalyze = cloner.Clone(original.offspringSelectionSlidingWindowAnalyze);
+      overfittingSelectionSlidingWindowAnalyzer = cloner.Clone(original.overfittingSelectionSlidingWindowAnalyzer);
+      generationalAdaptiveSlidingWindowAnalyzer = cloner.Clone(original.generationalAdaptiveSlidingWindowAnalyzer);
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GeneticAlgorithm(this, cloner);
+    }
+
+    public override void Prepare() {
+      if (Problem != null) base.Prepare();
+    }
+
+    #region Events
+    protected override void OnProblemChanged() {
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      ParameterizeStochasticOperator(Problem.Evaluator);
+      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
+      ParameterizeSolutionsCreator();
+      ParameterizeGeneticAlgorithmMainLoop();
+      ParameterizeSelectors();
+      ParameterizeAnalyzers();
+      ParameterizeIterationBasedOperators();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateAnalyzers();
+      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      base.OnProblemChanged();
+    }
+
+    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      ParameterizeSolutionsCreator();
+      base.Problem_SolutionCreatorChanged(sender, e);
+    }
+    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperator(Problem.Evaluator);
+      ParameterizeSolutionsCreator();
+      ParameterizeGeneticAlgorithmMainLoop();
+      ParameterizeSelectors();
+      ParameterizeAnalyzers();
+      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      base.Problem_EvaluatorChanged(sender, e);
+    }
+    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
+      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
+      ParameterizeIterationBasedOperators();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateAnalyzers();
+      base.Problem_OperatorsChanged(sender, e);
+    }
+    private void ElitesParameter_ValueChanged(object sender, EventArgs e) {
+      Elites.ValueChanged += new EventHandler(Elites_ValueChanged);
+      ParameterizeSelectors();
+    }
+    private void Elites_ValueChanged(object sender, EventArgs e) {
+      ParameterizeSelectors();
+    }
+
+    private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) {
+      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
+      ParameterizeSelectors();
+    }
+    private void PopulationSize_ValueChanged(object sender, EventArgs e) {
+      ParameterizeSelectors();
+    }
+    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeGeneticAlgorithmMainLoop();
+      ParameterizeSelectors();
+      ParameterizeAnalyzers();
+    }
+    #endregion
+
+    #region Helpers
+    private void Initialize() {
+      PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged);
+      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
+      ElitesParameter.ValueChanged += new EventHandler(ElitesParameter_ValueChanged);
+      Elites.ValueChanged += new EventHandler(Elites_ValueChanged);
+      if (Problem != null) {
+        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      }
+    }
+
+    private void ParameterizeSolutionsCreator() {
+      SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+    }
+    private void ParameterizeGeneticAlgorithmMainLoop() {
+      GeneticAlgorithmMainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      GeneticAlgorithmMainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+      GeneticAlgorithmMainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+    }
+    private void ParameterizeStochasticOperator(IOperator op) {
+      IStochasticOperator stochasticOp = op as IStochasticOperator;
+      if (stochasticOp != null) {
+        stochasticOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+        stochasticOp.RandomParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeSelectors() {
+      foreach (ISelector selector in SelectorParameter.ValidValues) {
+        selector.CopySelected = new BoolValue(true);
+        selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * (PopulationSizeParameter.Value.Value - ElitesParameter.Value.Value));
+        selector.NumberOfSelectedSubScopesParameter.Hidden = true;
+        ParameterizeStochasticOperator(selector);
+      }
+      if (Problem != null) {
+        foreach (ISingleObjectiveSelector selector in SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>()) {
+          selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+          selector.MaximizationParameter.Hidden = true;
+          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+          selector.QualityParameter.Hidden = true;
+        }
+      }
+    }
+    private void ParameterizeAnalyzers() {
+      qualityAnalyzer.ResultsParameter.ActualName = "Results";
+      qualityAnalyzer.ResultsParameter.Hidden = true;
+      if (Problem != null) {
+        qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+        qualityAnalyzer.MaximizationParameter.Hidden = true;
+        qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+        qualityAnalyzer.QualityParameter.Depth = 1;
+        qualityAnalyzer.QualityParameter.Hidden = true;
+        qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+        qualityAnalyzer.BestKnownQualityParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeIterationBasedOperators() {
+      if (Problem != null) {
+        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
+          op.IterationsParameter.ActualName = "Generations";
+          op.IterationsParameter.Hidden = true;
+          op.MaximumIterationsParameter.ActualName = "MaximumGenerations";
+          op.MaximumIterationsParameter.Hidden = true;
+        }
+      }
+    }
+    private void UpdateCrossovers() {
+      ICrossover oldCrossover = CrossoverParameter.Value;
+      CrossoverParameter.ValidValues.Clear();
+      ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault();
+
+      foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name))
+        CrossoverParameter.ValidValues.Add(crossover);
+
+      if (oldCrossover != null) {
+        ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType());
+        if (crossover != null) CrossoverParameter.Value = crossover;
+        else oldCrossover = null;
+      }
+      if (oldCrossover == null && defaultCrossover != null)
+        CrossoverParameter.Value = defaultCrossover;
+    }
+    private void UpdateMutators() {
+      IManipulator oldMutator = MutatorParameter.Value;
+      MutatorParameter.ValidValues.Clear();
+      IManipulator defaultMutator = Problem.Operators.OfType<IManipulator>().FirstOrDefault();
+
+      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name))
+        MutatorParameter.ValidValues.Add(mutator);
+
+      if (oldMutator != null) {
+        IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType());
+        if (mutator != null) MutatorParameter.Value = mutator;
+        else oldMutator = null;
+      }
+
+      if (oldMutator == null && defaultMutator != null)
+        MutatorParameter.Value = defaultMutator;
+    }
+    private void UpdateAnalyzers() {
+      Analyzer.Operators.Clear();
+
+      SlidingWindow.Operators.Clear();
+
+      SlidingWindow.Operators.Add(generationalSlidingWindowAnalyzer);
+      SlidingWindow.Operators.Add(offspringSelectionSlidingWindowAnalyze, false);
+      SlidingWindow.Operators.Add(overfittingSelectionSlidingWindowAnalyzer, false);
+      SlidingWindow.Operators.Add(generationalAdaptiveSlidingWindowAnalyzer, false);
+      if (Problem != null) {
+        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) {
+          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
+            param.Depth = 1;
+          Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault);
+        }
+      }
+      Analyzer.Operators.Add(qualityAnalyzer, qualityAnalyzer.EnabledByDefault);
+    }
+    private GeneticAlgorithmMainLoop FindMainLoop(IOperator start) {
+      IOperator mainLoop = start;
+      while (mainLoop != null && !(mainLoop is GeneticAlgorithmMainLoop))
+        mainLoop = ((SingleSuccessorOperator)mainLoop).Successor;
+      if (mainLoop == null) return null;
+      else return (GeneticAlgorithmMainLoop)mainLoop;
+    }
+    #endregion
+
+    private void UpdateTerminators() {
+      var newTerminators = new Dictionary<ITerminator, bool> {
+        {generationsTerminator, Terminators.Operators.Contains(generationsTerminator) && Terminators.Operators.ItemChecked(generationsTerminator)},
+        {evaluationsTerminator, Terminators.Operators.Contains(evaluationsTerminator) && Terminators.Operators.ItemChecked(evaluationsTerminator)},
+        {qualityTerminator, Terminators.Operators.Contains(qualityTerminator) && Terminators.Operators.ItemChecked(qualityTerminator) },
+        {executionTimeTerminator, Terminators.Operators.Contains(executionTimeTerminator) && Terminators.Operators.ItemChecked(executionTimeTerminator)},
+        {slidingWindowTerminator, !Terminators.Operators.Contains(slidingWindowTerminator) || Terminators.Operators.ItemChecked(slidingWindowTerminator)}
+      };
+      if (Problem != null) {
+        foreach (var terminator in Problem.Operators.OfType<ITerminator>())
+          newTerminators.Add(terminator, !Terminators.Operators.Contains(terminator) || Terminators.Operators.ItemChecked(terminator));
+      }
+
+      Terminators.Operators.Clear();
+
+      foreach (var newTerminator in newTerminators)
+        Terminators.Operators.Add(newTerminator.Key, newTerminator.Value);
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/GeneticAlgorithmMainLoop.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/GeneticAlgorithmMainLoop.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/GeneticAlgorithmMainLoop.cs	(revision 17479)
@@ -0,0 +1,274 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 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 HEAL.Attic;
+using HeuristicLab.Selection;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Algorithms.SWGA {
+  /// <summary>
+  /// An operator which represents the main loop of a genetic algorithm.
+  /// </summary>
+  [Item("GeneticAlgorithmMainLoop", "An operator which represents the main loop of a genetic algorithm.")]
+  [StorableType("78FFFD80-9708-4FE7-9092-16DA0B51D33B")]
+    public sealed class GeneticAlgorithmMainLoop : AlgorithmOperator {
+    #region Parameter properties
+    public ValueLookupParameter<IRandom> RandomParameter {
+      get { return (ValueLookupParameter<IRandom>)Parameters["GlobalRandom"]; }
+    }
+    public ValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (ValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public ValueLookupParameter<IOperator> SelectorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Selector"]; }
+    }
+    public ValueLookupParameter<IOperator> CrossoverParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Crossover"]; }
+    }
+    public ValueLookupParameter<PercentValue> MutationProbabilityParameter {
+      get { return (ValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    public ValueLookupParameter<IOperator> MutatorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Mutator"]; }
+    }
+    public ValueLookupParameter<IOperator> EvaluatorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
+    }
+    public ValueLookupParameter<IntValue> ElitesParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
+    }
+    public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
+    }
+    public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
+    }
+    public ValueLookupParameter<VariableCollection> ResultsParameter {
+      get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
+    }
+    public ValueLookupParameter<IOperator> AnalyzerParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
+    }
+    public ValueLookupParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
+    }
+    public ValueLookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    private ScopeParameter CurrentScopeParameter {
+      get { return (ScopeParameter)Parameters["CurrentScope"]; }
+    }
+
+    public IScope CurrentScope {
+      get { return CurrentScopeParameter.ActualValue; }
+    }
+
+    public IValueLookupParameter<IOperator> TerminatorParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["Terminator"]; }
+    }
+
+    public IValueLookupParameter<IOperator> SlidingWindowParameter {
+      get { return (IValueLookupParameter<IOperator>)Parameters["SlidingWindow"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private GeneticAlgorithmMainLoop(StorableConstructorFlag _) : base(_) { }
+    private GeneticAlgorithmMainLoop(GeneticAlgorithmMainLoop original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GeneticAlgorithmMainLoop(this, cloner);
+    }
+    public GeneticAlgorithmMainLoop()
+      : base() {
+      Initialize();
+    }
+
+    private void Initialize() {
+      #region Create parameters
+      Parameters.Add(new ValueLookupParameter<IRandom>("GlobalRandom", "A pseudo random number generator."));
+      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."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
+      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population."));
+      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the genetic algorithm should be applied."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop"));
+      Parameters.Add(new ValueLookupParameter<IOperator>("SlidingWindow", "Operator which moves a sliding window over the training data."));
+      #endregion
+
+      #region Create operators
+      VariableCreator variableCreator = new VariableCreator();
+      ResultsCollector resultsCollector1 = new ResultsCollector();
+      Placeholder analyzer1 = new Placeholder();
+      Placeholder slidingWindow = new Placeholder() { Name = "Sliding Window (Placeholder)" };
+      Placeholder selector = new Placeholder();
+      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
+      ChildrenCreator childrenCreator = new ChildrenCreator();
+      UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
+      Placeholder crossover = new Placeholder();
+      StochasticBranch stochasticBranch = new StochasticBranch();
+      Placeholder mutator = new Placeholder();
+      SubScopesRemover subScopesRemover = new SubScopesRemover();
+      UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
+      Placeholder evaluator = new Placeholder();
+      SubScopesCounter subScopesCounter = new SubScopesCounter();
+      SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
+      BestSelector bestSelector = new BestSelector();
+      RightReducer rightReducer = new RightReducer();
+      MergingReducer mergingReducer = new MergingReducer();
+      IntCounter intCounter = new IntCounter();
+      Comparator comparator = new Comparator();
+      Placeholder analyzer2 = new Placeholder();
+      TerminationOperator termination = new TerminationOperator();
+      ConditionalBranch reevaluateElitesBranch = new ConditionalBranch();
+
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class GeneticAlgorithm expects this to be called Generations
+
+      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      resultsCollector1.ResultsParameter.ActualName = "Results";
+
+      analyzer1.Name = "Analyzer";
+      analyzer1.OperatorParameter.ActualName = "Analyzer";
+
+      selector.Name = "Selector";
+      selector.OperatorParameter.ActualName = "Selector";
+
+      childrenCreator.ParentsPerChild = new IntValue(2);
+
+      crossover.Name = "Crossover";
+      crossover.OperatorParameter.ActualName = "Crossover";
+
+      stochasticBranch.ProbabilityParameter.ActualName = "MutationProbability";
+      stochasticBranch.RandomParameter.ActualName = "Random";
+
+      mutator.Name = "Mutator";
+      mutator.OperatorParameter.ActualName = "Mutator";
+
+      subScopesRemover.RemoveAllSubScopes = true;
+
+      uniformSubScopesProcessor2.Parallel.Value = true;
+
+      evaluator.Name = "Evaluator";
+      evaluator.OperatorParameter.ActualName = "Evaluator";
+
+      subScopesCounter.Name = "Increment EvaluatedSolutions";
+      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+
+      bestSelector.CopySelected = new BoolValue(false);
+      bestSelector.MaximizationParameter.ActualName = "Maximization";
+      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "Elites";
+      bestSelector.QualityParameter.ActualName = "Quality";
+
+      intCounter.Increment = new IntValue(1);
+      intCounter.ValueParameter.ActualName = "Generations";
+
+      comparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      comparator.LeftSideParameter.ActualName = "Generations";
+      comparator.ResultParameter.ActualName = "Terminate";
+      comparator.RightSideParameter.ActualName = "MaximumGenerations";
+
+      analyzer2.Name = "Analyzer";
+      analyzer2.OperatorParameter.ActualName = "Analyzer";
+
+      termination.TerminatorParameter.ActualName = TerminatorParameter.Name;
+      slidingWindow.OperatorParameter.ActualName = SlidingWindowParameter.Name;
+      
+
+      reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites";
+      reevaluateElitesBranch.Name = "Reevaluate elites ?";
+      #endregion
+
+      #region Create operator graph
+      OperatorGraph.InitialOperator = variableCreator;
+      variableCreator.Successor = resultsCollector1;
+      resultsCollector1.Successor = analyzer1;
+      analyzer1.Successor = slidingWindow;
+      slidingWindow.Successor = selector;
+      selector.Successor = subScopesProcessor1;
+      subScopesProcessor1.Operators.Add(new EmptyOperator());
+      subScopesProcessor1.Operators.Add(childrenCreator);
+      subScopesProcessor1.Successor = subScopesProcessor2;
+      childrenCreator.Successor = uniformSubScopesProcessor1;
+      uniformSubScopesProcessor1.Operator = crossover;
+      uniformSubScopesProcessor1.Successor = uniformSubScopesProcessor2;
+      crossover.Successor = stochasticBranch;
+      stochasticBranch.FirstBranch = mutator;
+      stochasticBranch.SecondBranch = null;
+      stochasticBranch.Successor = subScopesRemover;
+      mutator.Successor = null;
+      subScopesRemover.Successor = null;
+      uniformSubScopesProcessor2.Operator = evaluator;
+      uniformSubScopesProcessor2.Successor = subScopesCounter;
+      evaluator.Successor = null;
+      subScopesCounter.Successor = null;
+      subScopesProcessor2.Operators.Add(bestSelector);
+      subScopesProcessor2.Operators.Add(new EmptyOperator());
+      subScopesProcessor2.Successor = mergingReducer;
+      bestSelector.Successor = rightReducer;
+      rightReducer.Successor = reevaluateElitesBranch;
+      reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor2;
+      reevaluateElitesBranch.FalseBranch = null;
+      reevaluateElitesBranch.Successor = null;
+      mergingReducer.Successor = intCounter;
+      intCounter.Successor = comparator;
+      comparator.Successor = analyzer2;
+      analyzer2.Successor = termination;
+      termination.ContinueBranch = slidingWindow;
+      #endregion
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code, remove with 3.4
+      if (!Parameters.ContainsKey("ReevaluateElites")) {
+        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
+      }
+      #endregion
+    }
+
+    public override IOperation Apply() {
+      if (CrossoverParameter.ActualValue == null)
+        return null;
+      return base.Apply();
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/HeuristicLab.Algorithms.OESRALPS.csproj
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/HeuristicLab.Algorithms.OESRALPS.csproj	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/HeuristicLab.Algorithms.OESRALPS.csproj	(revision 17479)
@@ -0,0 +1,219 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{7309A53A-8D55-4CDA-B58F-4C08852D954A}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Algorithms.OESRALPS</RootNamespace>
+    <AssemblyName>HeuristicLab.Algorithms.OESRALPS-3.3</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ALGLIB-3.15.0, Version=3.15.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\ALGLIB-3.15.0.dll</HintPath>
+    </Reference>
+    <Reference Include="EPPlus-4.0.3, Version=4.0.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\EPPlus-4.0.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HEAL.Attic">
+      <HintPath>..\..\..\trunk\bin\HEAL.Attic.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Analysis.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Analysis.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Optimization.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Parameters.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec" />
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Selection-3.3">
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Selection-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Windows.Forms.DataVisualization" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Xml.Linq" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AgingScheme.cs" />
+    <Compile Include="AlpsGeneticAlgorithm.cs" />
+    <Compile Include="AlpsGeneticAlgorithmMainLoop.cs" />
+    <Compile Include="AlpsGeneticAlgorithmMainOperator.cs" />
+    <Compile Include="AlpsOffspringSelectionGeneticAlgorithm.cs" />
+    <Compile Include="AlpsOffspringSelectionGeneticAlgorithmMainLoop.cs" />
+    <Compile Include="AlpsOffspringSelectionGeneticAlgorithmMainOperator.cs" />
+    <Compile Include="AlpsOffspringSelector.cs" />
+    <Compile Include="Analyzers\LayerQualityAnalyzer.cs" />
+    <Compile Include="Analyzers\AgeDistributionAnalyzer.cs" />
+    <Compile Include="Analyzers\GenerationalSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\ISlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\OverfittingSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\Regression\SymbolicRegressionAdaptiveSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\Regression\SymbolicRegressionGenerationalSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\Regression\SymbolicRegressionOverfittingSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\Regression\SymbolicRegressionOffspringSelectionSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\Regression\SymbolicRegressionSingleObjectiveLayerOverfittingSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\Regression\SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\OffspringSelectionSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\Regression\SymbolicRegressionSingleObjectiveValidationBestSolutionSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\SlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\Regression\SymbolicRregressionSingleObjectiveLayerQualityAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveOverfittingSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveLayerValidationAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer.cs" />
+    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveValidationLayerBestSolutionAnalyzer.cs" />
+    <Compile Include="Analyzers\Regression\SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer.cs" />
+    <Compile Include="DriftDetection\ADWIN.cs" />
+    <Compile Include="DriftDetection\ADWINWrapper.cs" />
+    <Compile Include="DriftDetection\Bucket.cs" />
+    <Compile Include="DriftDetection\BucketContainer.cs" />
+    <Compile Include="DriftDetection\Histogram.cs" />
+    <Compile Include="DriftDetection\SequentialADWIN.cs" />
+    <Compile Include="Evaluators\SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator.cs" />
+    <Compile Include="Evaluators\SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator.cs" />
+    <Compile Include="Analyzers\OldestAverageYoungestAgeAnalyzer.cs" />
+    <Compile Include="Analyzers\OldestAverageYoungestAgeCalculator.cs" />
+    <Compile Include="GeneticAlgorithm.cs" />
+    <Compile Include="GeneticAlgorithmMainLoop.cs" />
+    <Compile Include="Operators\IGenerationalSlidingWindowOperator.cs" />
+    <Compile Include="Operators\ISlidingWindowOperator.cs" />
+    <Compile Include="EldersSelector.cs" />
+    <Compile Include="LastLayerCloner.cs" />
+    <Compile Include="MatingPoolCreator.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Problems\SymbolicRegressionSingleObjectiveSlidingWindowProblem.cs" />
+    <Compile Include="Problems\SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ReseedingController.cs" />
+    <Compile Include="ResultsHistoryWiper.cs" />
+    <Compile Include="WeightingReducer.cs" />
+  </ItemGroup>
+  <ItemGroup />
+  <ItemGroup>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/LastLayerCloner.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/LastLayerCloner.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/LastLayerCloner.cs	(revision 17479)
@@ -0,0 +1,77 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Operators;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("LastLayerCloner", "An operator that creates a new layer by cloning the current last one.")]
+  [StorableType("FD47E368-0F23-4E0F-AE0C-A15FFC48D8F2")]
+    public sealed class LastLayerCloner : SingleSuccessorOperator {
+    public OperatorParameter NewLayerOperatorParameter {
+      get { return (OperatorParameter)Parameters["NewLayerOperator"]; }
+    }
+
+    public IOperator NewLayerOperator {
+      get { return NewLayerOperatorParameter.Value; }
+      set { NewLayerOperatorParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    private LastLayerCloner(StorableConstructorFlag _) : base(_) { }
+
+    private LastLayerCloner(LastLayerCloner original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new LastLayerCloner(this, cloner);
+    }
+
+    public LastLayerCloner()
+      : base() {
+      Parameters.Add(new OperatorParameter("NewLayerOperator", "An operator that is performed on the new layer."));
+    }
+
+    public override IOperation Apply() {
+      var scopes = ExecutionContext.Scope.SubScopes;
+      if (scopes.Count < 1)
+        throw new ArgumentException("At least one layer must exist.");
+
+      var newScope = (IScope)scopes.Last().Clone();
+
+      int scopeNumber;
+      if (int.TryParse(newScope.Name, out scopeNumber))
+        newScope.Name = (scopeNumber + 1).ToString();
+
+      scopes.Add(newScope);
+
+      var next = new OperationCollection(base.Apply());
+      if (NewLayerOperator != null)
+        next.Insert(0, ExecutionContext.CreateOperation(NewLayerOperator, newScope));
+      return next;
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/MatingPoolCreator.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/MatingPoolCreator.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/MatingPoolCreator.cs	(revision 17479)
@@ -0,0 +1,79 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Parameters;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("MatingPoolCreator", "An operator which creates mating pools based on a set of sub-populations. For each sub-population, the individuals from the previous sub-population are copied into the current sub-population.")]
+  [StorableType("93DFEA4A-AE4E-42CA-8799-A79A437BEF86")]
+    public sealed class MatingPoolCreator : SingleSuccessorOperator {
+    public IValueLookupParameter<IntValue> MatingPoolRangeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["MatingPoolRange"]; }
+    }
+
+    [StorableConstructor]
+    private MatingPoolCreator(StorableConstructorFlag _) : base(_) { }
+    private MatingPoolCreator(MatingPoolCreator original, Cloner cloner)
+      : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new MatingPoolCreator(this, cloner);
+    }
+    public MatingPoolCreator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IntValue>("MatingPoolRange", "The range of sub-populations used for creating a mating pool. (1 = current + previous sub-population)", new IntValue(1)));
+    }
+
+    /// <summary>
+    /// Copies the subscopes of the n previous scopes into the current scope. (default n = 1)
+    /// <pre>
+    ///          __ scope __              __ scope __
+    ///         /     |     \            /     |     \
+    ///       Pop1   Pop2   Pop3  =>   Pop1   Pop2   Pop3
+    ///       /|\    /|\    /|\         /|\   /|\    /|\
+    ///       ABC    DEF    GHI         ABC   DEF    GHI
+    ///                                       ABC    DEF
+    /// </pre>
+    /// </summary>
+    /// <returns>The next operation.</returns>
+    public override IOperation Apply() {
+      var subScopes = ExecutionContext.Scope.SubScopes;
+      int range = MatingPoolRangeParameter.ActualValue.Value;
+
+      for (int targetIndex = subScopes.Count - 1; targetIndex > 0; targetIndex--) {
+        var targetScope = subScopes[targetIndex];
+        for (int n = 1; (n <= range) && (targetIndex - n >= 0); n++) {
+          var prevScope = subScopes[targetIndex - n];
+          var individuals = prevScope.SubScopes;
+          foreach (var individual in individuals) {
+            targetScope.SubScopes.Add((IScope)individual.Clone());
+          }
+        }
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Operators/IGenerationalSlidingWindowOperator.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Operators/IGenerationalSlidingWindowOperator.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Operators/IGenerationalSlidingWindowOperator.cs	(revision 17479)
@@ -0,0 +1,19 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.SlidingWindow.Operator
+{
+    [StorableType("136DA41B-0AC1-49A8-B4D9-DCE73BDB7A14")]
+    interface IGenerationalSlidingWindowOperator : ISlidingWindowOperator, IIterationBasedOperator
+    {
+        IFixedValueParameter<IntValue> GenerationsIntervalParameter { get; }
+        IFixedValueParameter<IntValue> GenerationsIntervalStartParameter { get; }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Operators/ISlidingWindowOperator.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Operators/ISlidingWindowOperator.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Operators/ISlidingWindowOperator.cs	(revision 17479)
@@ -0,0 +1,22 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Problems.DataAnalysis;
+using System;
+
+namespace HeuristicLab.Algorithms.OESRALPS.SlidingWindow.Operator
+{
+    [StorableType("3E8AA082-3B86-4609-BD38-E3FA78DAD29F")]
+    public interface ISlidingWindowOperator : IOperator
+    {
+        IFixedValueParameter<IntValue> SlidingWindowStepWidthParameter { get; }
+        IFixedValueParameter<IntValue> StartSlidingWindowParameter { get; }
+        IFixedValueParameter<IntValue> SlidingWindowSizeParameter { get; }
+        ILookupParameter<IntRange> FitnessCalculationPartitionParameter { get; }
+        IValueLookupParameter<IntRange> TrainingPartitionParameter { get; }
+        IValueLookupParameter<IntRange> ValidationPartitionParameter { get; }
+
+        event EventHandler MoveWindow;
+        IOperation OnMoveWindow();
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Plugin.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Plugin.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Plugin.cs	(revision 17479)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  /// <summary>
+  /// Plugin class for HeuristicLab.Algorithms.OESRALPS plugin.
+  /// </summary>
+  [Plugin("HeuristicLab.Algorithms.OESRALPS", "3.3.16.17184")]
+  [PluginFile("HeuristicLab.Algorithms.OESRALPS-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Attic", "1.0")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  [PluginDependency("HeuristicLab.Selection", "3.3")]
+  public class HeuristicLabAlgorithmsOESRALPSPlugin : PluginBase {
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Problems/SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Problems/SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Problems/SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem.cs	(revision 17479)
@@ -0,0 +1,169 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression;
+using HeuristicLab.Algorithms.OESRALPS.Evaluators;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Problems
+{
+    [Item("Symbolic Regression Sliding Window MSE Problem (single-objective)", "Represents a single objective symbolic regression problem.")]
+    [StorableType("7DDCF683-92FC-4A70-BF4F-FE3A0B0DE110")]
+    [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 101)]
+    class SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem
+    {
+        private const double PunishmentFactor = 10;
+        private const int InitialMaximumTreeDepth = 12;
+        private const int InitialMaximumTreeLength = 50;
+        private const string EstimationLimitsParameterName = "EstimationLimits";
+        private const string EstimationLimitsParameterDescription = "The limits for the estimated value that can be returned by the symbolic regression model.";
+
+        #region parameter properties
+        public IFixedValueParameter<DoubleLimit> EstimationLimitsParameter {
+            get { return (IFixedValueParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+        }
+        #endregion
+        #region properties
+        public DoubleLimit EstimationLimits {
+            get { return EstimationLimitsParameter.Value; }
+        }
+        #endregion
+        [StorableConstructor]
+        protected SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem(StorableConstructorFlag _) : base(_) { }
+        protected SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem(SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem original, Cloner cloner)
+          : base(original, cloner)
+        {
+            RegisterEventHandlers();
+        }
+        public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem(this, cloner); }
+
+        public SymbolicRegressionSingleObjectiveSlidingWindowMSEProblem()
+          : base(new RegressionProblemData(), new SymbolicRegressionSingleObjectiveMeanSquaredErrorSlidingWindowEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator())
+        {
+            Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription));
+
+            EstimationLimitsParameter.Hidden = true;
+
+
+            ApplyLinearScalingParameter.Value.Value = true;
+            Maximization.Value = false;
+            MaximumSymbolicExpressionTreeDepth.Value = InitialMaximumTreeDepth;
+            MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
+
+            RegisterEventHandlers();
+            ConfigureGrammarSymbols();
+            InitializeOperators();
+            UpdateEstimationLimits();
+        }
+
+        [StorableHook(HookType.AfterDeserialization)]
+        private void AfterDeserialization()
+        {
+            RegisterEventHandlers();
+            // compatibility
+            bool changed = false;
+            if (!Operators.OfType<SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer>().Any())
+            {
+                Operators.Add(new SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer());
+                changed = true;
+            }
+            if (!Operators.OfType<SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer>().Any())
+            {
+                Operators.Add(new SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer());
+                changed = true;
+            }
+            if (!Operators.OfType<SymbolicRegressionSolutionsAnalyzer>().Any())
+            {
+                Operators.Add(new SymbolicRegressionSolutionsAnalyzer());
+                changed = true;
+            }
+            if (changed)
+            {
+                ParameterizeOperators();
+            }
+        }
+
+        private void RegisterEventHandlers()
+        {
+            SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
+        }
+
+        private void ConfigureGrammarSymbols()
+        {
+            var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
+            if (grammar != null) grammar.ConfigureAsDefaultRegressionGrammar();
+        }
+
+        private void InitializeOperators()
+        {
+            Operators.Add(new SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveTrainingBestSolutionAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveOverfittingAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer());
+            Operators.Add(new SymbolicRegressionSolutionsAnalyzer());
+            Operators.Add(new SymbolicExpressionTreePhenotypicSimilarityCalculator());
+            Operators.Add(new SymbolicRegressionPhenotypicDiversityAnalyzer(Operators.OfType<SymbolicExpressionTreePhenotypicSimilarityCalculator>()) { DiversityResultName = "Phenotypic Diversity" });
+            ParameterizeOperators();
+        }
+
+        private void UpdateEstimationLimits()
+        {
+            if (ProblemData.TrainingIndices.Any())
+            {
+                var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).ToList();
+                var mean = targetValues.Average();
+                var range = targetValues.Max() - targetValues.Min();
+                EstimationLimits.Upper = mean + PunishmentFactor * range;
+                EstimationLimits.Lower = mean - PunishmentFactor * range;
+            }
+            else
+            {
+                EstimationLimits.Upper = double.MaxValue;
+                EstimationLimits.Lower = double.MinValue;
+            }
+        }
+
+        protected override void OnProblemDataChanged()
+        {
+            base.OnProblemDataChanged();
+            UpdateEstimationLimits();
+        }
+
+        protected override void ParameterizeOperators()
+        {
+            base.ParameterizeOperators();
+            if (Parameters.ContainsKey(EstimationLimitsParameterName))
+            {
+                var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators);
+                foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>())
+                {
+                    op.EstimationLimitsParameter.ActualName = EstimationLimitsParameter.Name;
+                }
+            }
+
+            foreach (var op in Operators.OfType<ISolutionSimilarityCalculator>())
+            {
+                op.SolutionVariableName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+                op.QualityVariableName = Evaluator.QualityParameter.ActualName;
+
+                if (op is SymbolicExpressionTreePhenotypicSimilarityCalculator)
+                {
+                    var phenotypicSimilarityCalculator = (SymbolicExpressionTreePhenotypicSimilarityCalculator)op;
+                    phenotypicSimilarityCalculator.ProblemData = ProblemData;
+                    phenotypicSimilarityCalculator.Interpreter = SymbolicExpressionTreeInterpreter;
+                }
+            }
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Problems/SymbolicRegressionSingleObjectiveSlidingWindowProblem.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Problems/SymbolicRegressionSingleObjectiveSlidingWindowProblem.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Problems/SymbolicRegressionSingleObjectiveSlidingWindowProblem.cs	(revision 17479)
@@ -0,0 +1,169 @@
+﻿using HEAL.Attic;
+using HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression;
+using HeuristicLab.Algorithms.OESRALPS.Evaluators;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HeuristicLab.Algorithms.OESRALPS.Problems
+{
+    [Item("Symbolic Regression Sliding Window Problem (single-objective)", "Represents a single objective symbolic regression problem.")]
+    [StorableType("7DDCF683-96FC-4F70-BF4F-FE3A0B0DE110")]
+    [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 101)]
+    class SymbolicRegressionSingleObjectiveSlidingWindowProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem
+    {
+        private const double PunishmentFactor = 10;
+        private const int InitialMaximumTreeDepth = 12;
+        private const int InitialMaximumTreeLength = 50;
+        private const string EstimationLimitsParameterName = "EstimationLimits";
+        private const string EstimationLimitsParameterDescription = "The limits for the estimated value that can be returned by the symbolic regression model.";
+
+        #region parameter properties
+        public IFixedValueParameter<DoubleLimit> EstimationLimitsParameter {
+            get { return (IFixedValueParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+        }
+        #endregion
+        #region properties
+        public DoubleLimit EstimationLimits {
+            get { return EstimationLimitsParameter.Value; }
+        }
+        #endregion
+        [StorableConstructor]
+        protected SymbolicRegressionSingleObjectiveSlidingWindowProblem(StorableConstructorFlag _) : base(_) { }
+        protected SymbolicRegressionSingleObjectiveSlidingWindowProblem(SymbolicRegressionSingleObjectiveSlidingWindowProblem original, Cloner cloner)
+          : base(original, cloner)
+        {
+            RegisterEventHandlers();
+        }
+        public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionSingleObjectiveSlidingWindowProblem(this, cloner); }
+
+        public SymbolicRegressionSingleObjectiveSlidingWindowProblem()
+          : base(new RegressionProblemData(), new SymbolicRegressionSingleObjectivePearsonRSquaredSlidingWindowEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator())
+        {
+            Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription));
+
+            EstimationLimitsParameter.Hidden = true;
+
+
+            ApplyLinearScalingParameter.Value.Value = true;
+            Maximization.Value = true;
+            MaximumSymbolicExpressionTreeDepth.Value = InitialMaximumTreeDepth;
+            MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength;
+
+            RegisterEventHandlers();
+            ConfigureGrammarSymbols();
+            InitializeOperators();
+            UpdateEstimationLimits();
+        }
+
+        [StorableHook(HookType.AfterDeserialization)]
+        private void AfterDeserialization()
+        {
+            RegisterEventHandlers();
+            // compatibility
+            bool changed = false;
+            if (!Operators.OfType<SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer>().Any())
+            {
+                Operators.Add(new SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer());
+                changed = true;
+            }
+            if (!Operators.OfType<SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer>().Any())
+            {
+                Operators.Add(new SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer());
+                changed = true;
+            }
+            if (!Operators.OfType<SymbolicRegressionSolutionsAnalyzer>().Any())
+            {
+                Operators.Add(new SymbolicRegressionSolutionsAnalyzer());
+                changed = true;
+            }
+            if (changed)
+            {
+                ParameterizeOperators();
+            }
+        }
+
+        private void RegisterEventHandlers()
+        {
+            SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
+        }
+
+        private void ConfigureGrammarSymbols()
+        {
+            var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
+            if (grammar != null) grammar.ConfigureAsDefaultRegressionGrammar();
+        }
+
+        private void InitializeOperators()
+        {
+            Operators.Add(new SymbolicRegressionSingleObjectiveValidationLayerBestSolutionSlidingWindowAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveTrainingBestSolutionAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveOverfittingAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer());
+            Operators.Add(new SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer());
+            Operators.Add(new SymbolicRegressionSolutionsAnalyzer());
+            Operators.Add(new SymbolicExpressionTreePhenotypicSimilarityCalculator());
+            Operators.Add(new SymbolicRegressionPhenotypicDiversityAnalyzer(Operators.OfType<SymbolicExpressionTreePhenotypicSimilarityCalculator>()) { DiversityResultName = "Phenotypic Diversity" });
+            ParameterizeOperators();
+        }
+
+        private void UpdateEstimationLimits()
+        {
+            if (ProblemData.TrainingIndices.Any())
+            {
+                var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).ToList();
+                var mean = targetValues.Average();
+                var range = targetValues.Max() - targetValues.Min();
+                EstimationLimits.Upper = mean + PunishmentFactor * range;
+                EstimationLimits.Lower = mean - PunishmentFactor * range;
+            }
+            else
+            {
+                EstimationLimits.Upper = double.MaxValue;
+                EstimationLimits.Lower = double.MinValue;
+            }
+        }
+
+        protected override void OnProblemDataChanged()
+        {
+            base.OnProblemDataChanged();
+            UpdateEstimationLimits();
+        }
+
+        protected override void ParameterizeOperators()
+        {
+            base.ParameterizeOperators();
+            if (Parameters.ContainsKey(EstimationLimitsParameterName))
+            {
+                var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators);
+                foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>())
+                {
+                    op.EstimationLimitsParameter.ActualName = EstimationLimitsParameter.Name;
+                }
+            }
+
+            foreach (var op in Operators.OfType<ISolutionSimilarityCalculator>())
+            {
+                op.SolutionVariableName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+                op.QualityVariableName = Evaluator.QualityParameter.ActualName;
+
+                if (op is SymbolicExpressionTreePhenotypicSimilarityCalculator)
+                {
+                    var phenotypicSimilarityCalculator = (SymbolicExpressionTreePhenotypicSimilarityCalculator)op;
+                    phenotypicSimilarityCalculator.ProblemData = ProblemData;
+                    phenotypicSimilarityCalculator.Interpreter = SymbolicExpressionTreeInterpreter;
+                }
+            }
+        }
+    }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Properties/AssemblyInfo.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Properties/AssemblyInfo.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Properties/AssemblyInfo.cs	(revision 17479)
@@ -0,0 +1,35 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Algorithms.OESRALPS")]
+[assembly: AssemblyDescription("HeuristicLab OESRALPS")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7309a53a-8d55-4cda-b58f-4c08852d954a")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.16.17184")]
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/ReseedingController.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/ReseedingController.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/ReseedingController.cs	(revision 17479)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Parameters;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("ReseedingController", "An operator that controls if reseeding is needed.")]
+  [StorableType("CC91942C-EB1C-462D-BA4B-9C00ED747E06")]
+    public sealed class ReseedingController : SingleSuccessorOperator {
+    public ILookupParameter<IntValue> GenerationsParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["Generations"]; }
+    }
+    public ILookupParameter<IntValue> AgeGapParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["AgeGap"]; }
+    }
+    public OperatorParameter FirstLayerOperatorParameter {
+      get { return (OperatorParameter)Parameters["FirstLayerOperator"]; }
+    }
+
+    public IOperator FirstLayerOperator {
+      get { return FirstLayerOperatorParameter.Value; }
+      set { FirstLayerOperatorParameter.Value = value; }
+    }
+
+    [StorableConstructor]
+    private ReseedingController(StorableConstructorFlag _) : base(_) { }
+
+    private ReseedingController(ReseedingController original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ReseedingController(this, cloner);
+    }
+
+    public ReseedingController()
+      : base() {
+      Parameters.Add(new LookupParameter<IntValue>("Generations", "The current number of generations."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers."));
+      Parameters.Add(new OperatorParameter("FirstLayerOperator", "The operator that is performed on the first layer if reseeding is required."));
+    }
+
+    public override IOperation Apply() {
+      int generations = GenerationsParameter.ActualValue.Value;
+      int ageGap = AgeGapParameter.ActualValue.Value;
+
+      var next = new OperationCollection(base.Apply());
+      if (generations % ageGap == 0) {
+        var layerZeroScope = ExecutionContext.Scope.SubScopes[0];
+        if (FirstLayerOperator != null)
+          next.Insert(0, ExecutionContext.CreateChildOperation(FirstLayerOperator, layerZeroScope));
+      }
+      return next;
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/ResultsHistoryWiper.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/ResultsHistoryWiper.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/ResultsHistoryWiper.cs	(revision 17479)
@@ -0,0 +1,77 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("ResultsHistoryWiper", "An operator that removes the history of a ResultsCollection by setting all values in all DataTables to NaN.")]
+  [StorableType("BE9D6302-02DD-48C4-A711-9A7772AF58E4")]
+    public sealed class ResultsHistoryWiper : SingleSuccessorOperator {
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; }
+    }
+
+    [StorableConstructor]
+    private ResultsHistoryWiper(StorableConstructorFlag _) : base(_) {
+    }
+
+    private ResultsHistoryWiper(ResultsHistoryWiper original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ResultsHistoryWiper(this, cloner);
+    }
+
+    public ResultsHistoryWiper()
+      : base() {
+      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The ResultCollection the history is wiped from."));
+    }
+
+    public override IOperation Apply() {
+      var results = ResultsParameter.ActualValue;
+      ClearHistoryRecursively(results);
+      return base.Apply();
+    }
+
+    private void ClearHistoryRecursively(ResultCollection results) {
+      var values = results.Select(r => r.Value);
+
+      // Reset all values within results in results
+      foreach (var resultsCollection in values.OfType<ResultCollection>())
+        ClearHistoryRecursively(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;
+      }
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/WeightingReducer.cs
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/WeightingReducer.cs	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/WeightingReducer.cs	(revision 17479)
@@ -0,0 +1,79 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 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.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.OESRALPS {
+  [Item("WeightingReducer", "An operator that combines two values based on the weight of the lower (0.0) and higher (1.0) value.")]
+  [StorableType("93542030-F607-4A90-A2D6-85226D3861A3")]
+  public sealed class WeightingReducer : SingleSuccessorOperator {
+    public IScopeTreeLookupParameter<DoubleValue> ParameterToReduce {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["ParameterToReduce"]; }
+    }
+    public ILookupParameter<DoubleValue> TargetParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["TargetParameter"]; }
+    }
+    public IValueLookupParameter<DoubleValue> WeightParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["Weight"]; }
+    }
+
+    [StorableConstructor]
+    private WeightingReducer(StorableConstructorFlag _) : base(_) { }
+    private WeightingReducer(WeightingReducer original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new WeightingReducer(this, cloner);
+    }
+    public WeightingReducer()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("ParameterToReduce", "The parameter on which the weighting should be applied."));
+      Parameters.Add(new LookupParameter<DoubleValue>("TargetParameter", "The target variable in which the weighted value should be stored."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("Weight", "Weight of the two values (0.0 for the smaller, 1.0 for the larger)."));
+    }
+
+    public override IOperation Apply() {
+      var values = ParameterToReduce.ActualValue;
+      if (values.Length != 2)
+        throw new InvalidOperationException("Weighting between values can only done for two values.");
+
+      double weight = WeightParameter.ActualValue.Value;
+
+      double max = values.Max(v => v.Value);
+      double min = values.Min(v => v.Value);
+
+      double result = max * weight + min * (1 - weight);
+
+      if (TargetParameter.ActualValue == null)
+        TargetParameter.ActualValue = new DoubleValue(result);
+      else TargetParameter.ActualValue.Value = result;
+
+      return base.Apply();
+    }
+  }
+}
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/PreBuildEvent.cmd
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/PreBuildEvent.cmd	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/PreBuildEvent.cmd	(revision 17479)
@@ -0,0 +1,11 @@
+IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+GOTO Done
+
+:Error_Handling
+ECHO There was an error while running subwcrev. Please verify that the *.cs.frame files have been correctly converted to *.cs files, otherwise HeuristicLab won't build. 
+exit 0
+
+:Done
Index: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/README.md
===================================================================
--- branches/3057_DynamicALPS/TestProblems/oesr-alps-master/README.md	(revision 17479)
+++ branches/3057_DynamicALPS/TestProblems/oesr-alps-master/README.md	(revision 17479)
@@ -0,0 +1,2 @@
+# OESRALPS
+
Index: branches/3057_DynamicALPS/backup/13022020/Build.cmd
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/Build.cmd	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/Build.cmd	(revision 17479)
@@ -0,0 +1,2 @@
+@ECHO OFF
+powershell.exe .\Build.ps1
Index: branches/3057_DynamicALPS/backup/13022020/Build.ps1
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/Build.ps1	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/Build.ps1	(revision 17479)
@@ -0,0 +1,130 @@
+﻿# find ms build
+$programFilesX86Dir = ($Env:ProgramFiles, ${Env:ProgramFiles(x86)})[[bool]${Env:ProgramFiles(x86)}]
+$locations = @(
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Enterprise", "MSBuild", "15.0", "Bin", "amd64")
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Enterprise", "MSBuild", "15.0", "Bin")
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Community", "MSBuild", "15.0", "Bin", "amd64")
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Community", "MSBuild", "15.0", "Bin")
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "BuildTools", "MSBuild", "15.0", "Bin", "amd64"),
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "BuildTools", "MSBuild", "15.0", "Bin")
+)
+
+$msBuildPath = $undefined
+Foreach ($loc in $locations) {
+  $loc = [System.IO.Path]::Combine($loc, "MSBuild.exe")
+  If ([System.IO.File]::Exists($loc)) {
+    $msBuildPath = $loc
+    Break;
+  }
+}
+
+Try {
+  If ($msBuildPath -eq $undefined) {
+    "Could not locate MSBuild, ABORTING ..."
+    Return
+  }
+
+  $curPath = $MyInvocation.MyCommand.Path
+  $curDir = Split-Path $curPath
+
+  $slnFiles = Get-ChildItem $curDir -Filter *.sln
+
+  If ($slnFiles.Count -le 0) {
+    "No solutions found, ABORTING ..."
+    Return
+  }
+
+  $slnIndices = @()
+
+  If ($slnFiles.Count -eq 1) {
+    "Selecting the only solution found: `"{0}`"" -f $slnFiles[0].Name
+    $slnIndices += 0
+  } Else {
+    "Found the following solutions:"
+
+    ""
+
+    $slnFiles | % { $i = 0 } { ("  {0}. `"{1}`"" -f ($i + 1), $_.Name); $i++ }
+
+    ""
+
+    $success = $false
+
+    # query solution to build
+    $slnIndex = -1
+    Do {
+        $input = Read-Host "Which solution(s) to build? (e.g.: 1 2 3) { 1..$($slnFiles.Count) }"
+        $inputParts = $input -Split " "
+
+        Foreach ($part in $inputParts) {
+          If ($part -eq "") { Continue }
+
+          $success = [int]::TryParse($part, [ref]$slnIndex) -and ($slnIndex -gt 0) -and ($slnIndex -le $slnFiles.Count)
+
+          If ($success) {
+            $slnIndices += $slnIndex - 1
+          } Else {
+            $slnIndices = @()
+            Break
+          }
+        }
+    } While (-Not $success)
+
+    $slnIndices = $slnIndices | Select-Object -Unique
+  }
+
+
+  # query configuration to build
+  $config = "Release"
+  $input = Read-Host "Which configuration to build? [$($config)]"
+  $config = ($config, $input)[[bool]$input]
+
+  # query platform to build
+  $platform = "Any CPU"
+  $input = Read-Host "Which platform to build? [$($platform)]"
+  $platform = ($platform, $input)[[bool]$input]
+
+  # query clean desire
+  $clean = $false
+  Do {
+      $input = Read-Host "Would you like to clean before building? [y/N]"
+      $input = ([string]("n", $input)[[bool]$input]).ToLowerInvariant()
+      $success = $input -eq "n" -or ($clean = $input -eq "y")
+  } While (-Not $success)
+
+  ""
+
+  If ($clean) {
+    Foreach ($slnIndex in $slnIndices) {
+      $solution = $slnFiles[$slnIndex]
+      "Cleaning `"$($solution.Name)`" ..."
+      $args = @(
+        $solution.FullName,
+        "/t:Clean",
+        "/p:Configuration=`"$config`",Platform=`"$platform`"",
+        "/m", "/nologo", "/verbosity:q", "/clp:ErrorsOnly"
+      )
+      & $msBuildPath $args
+      "===== CLEAN FINISHED ====="
+    }
+  }
+
+  Foreach ($slnIndex in $slnIndices) {
+    $solution = $slnFiles[$slnIndex]
+    "Building `"$($solution.Name)`" ($config|$platform) ..."
+    $args = @(
+      $solution.FullName,
+      "/t:Build",
+      "/p:Configuration=`"$config`",Platform=`"$platform`"",
+      "/m", "/nologo", "/verbosity:q", "/clp:ErrorsOnly"
+    )
+    & $msBuildPath $args
+    "===== BUILD FINISHED ====="
+  }
+} Finally {
+  ""
+
+  Write-Host -NoNewline "Press any key to continue ... "
+
+  [void][System.Console]::ReadKey($true)
+}
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS-3.4.sln
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS-3.4.sln	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS-3.4.sln	(revision 17479)
@@ -0,0 +1,37 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29519.181
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.DynamicALPS-3.4", "HeuristicLab.Algorithms.DynamicALPS\3.4\HeuristicLab.Algorithms.DynamicALPS-3.4.csproj", "{15452B9F-A436-4139-8EE7-DA72FB8D3664}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|x64.ActiveCfg = Debug|x64
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|x64.Build.0 = Debug|x64
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|x86.ActiveCfg = Debug|x86
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|x86.Build.0 = Debug|x86
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|Any CPU.Build.0 = Release|Any CPU
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|x64.ActiveCfg = Release|x64
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|x64.Build.0 = Release|x64
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|x86.ActiveCfg = Release|x86
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {869173B1-B417-4ED0-9A2F-8F42578EA993}
+	EndGlobalSection
+EndGlobal
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSASolution.cs
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSASolution.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSASolution.cs	(revision 17479)
@@ -0,0 +1,152 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Algorithms.DynamicALPS
+{
+  [StorableType("F405DFE4-CCC9-4CAF-9EFC-1AF45DC81FE6")]
+
+  public interface IDynamicALPSSolution : IItem {
+    IItem Individual { get; set; }
+    double[] Qualities { get; set; }
+    double[] Constraints { get; set; }
+    // KF, SMS-EMOA
+    double[] HypervolumeContribution { get; set; }
+    int[] NondominanceRanking { get; set; }
+
+    // KF, DynamicALPS, could also be used for any self-adpative EA
+    double IndividualPc { get; set; }   // individual crossover rate
+    double IndividualPm { get; set; }   // individual mutation rate
+    int Age { get; set; }               // age info for ALPS
+
+    int Dimensions { get; }
+  }
+
+
+
+  [Item("DynamicALPSSolution", "Represents a solution inside the DynamicALPS population")]
+  [StorableType("457A8E67-2B70-4767-896B-47056BD89732")]
+  public class DynamicALPSSolution : Item, IDynamicALPSSolution
+  {
+    [Storable]
+    public IItem Individual { get; set; }
+
+    [Storable]
+    public double[] Qualities { get; set; }
+
+    [Storable]
+    public double[] Constraints { get; set; }
+
+    //kf, sms-emoa
+    [Storable]
+    public double[] HypervolumeContribution { get; set; }
+
+    [Storable]
+    public int[] NondominanceRanking { get; set; }
+
+    [Storable]
+    public double IndividualPc { get; set; }
+
+    [Storable]
+    public double IndividualPm { get; set; }
+
+    [Storable]
+    public int Age { get; set; }
+
+    public DynamicALPSSolution(int nObjectives, int nConstraints)
+    {
+      Qualities = new double[nObjectives];
+      Constraints = new double[nConstraints];
+      HypervolumeContribution = new double[1];
+      NondominanceRanking = new int[1];
+      IndividualPc = 0;
+      IndividualPm = 0;
+      Age = 0;
+    }
+
+    public DynamicALPSSolution(IItem individual, int nObjectives, int nConstraints) : this(nObjectives, nConstraints)
+    {
+      Individual = individual;
+    }
+
+    public DynamicALPSSolution(IItem individual, double[] qualities, double[] constraints, double[] hypervolumecontribution, int[] nondominanceranking)
+    {
+      Individual = individual;
+      Qualities = qualities;
+      Constraints = constraints;
+      HypervolumeContribution = hypervolumecontribution;
+      NondominanceRanking = nondominanceranking;
+    }
+
+    public DynamicALPSSolution(double[] qualities)
+    {
+      Qualities = (double[])qualities.Clone();
+    }
+
+    public int Dimensions => Qualities == null ? 0 : Qualities.Length;
+
+    public override IDeepCloneable Clone(Cloner cloner)
+    {
+      return new DynamicALPSSolution(this, cloner);
+    }
+
+    protected DynamicALPSSolution(DynamicALPSSolution original, Cloner cloner) : base(original, cloner)
+    {
+      Qualities = (double[])original.Qualities.Clone();
+      Constraints = (double[])original.Qualities.Clone();
+      HypervolumeContribution = (double[])original.HypervolumeContribution.Clone();       // kf, sms-emoa
+      NondominanceRanking = (int[])original.NondominanceRanking.Clone();                  // kf, sms-emoa
+      Individual = (IItem)original.Individual.Clone(cloner);
+    }
+
+    [StorableConstructor]
+    protected DynamicALPSSolution(StorableConstructorFlag deserializing) : base(deserializing) { }
+  }
+
+  [Item("DynamicALPSSolution", "Represents a solution inside the DynamicALPS population")]
+
+
+
+  [StorableType("1EFC2459-C52E-4F95-9E14-23E69DCB23E0")]
+  public class DynamicALPSSolution<T> : DynamicALPSSolution where T : class, IItem
+  {
+    public new T Individual
+    {
+      get { return (T)base.Individual; }
+      set { base.Individual = value; }
+    }
+
+    public DynamicALPSSolution(T individual, int nObjectives, int nConstraints) : base(individual, nObjectives, nConstraints) { }
+
+    protected DynamicALPSSolution(DynamicALPSSolution<T> original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner)
+    {
+      return new DynamicALPSSolution<T>(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected DynamicALPSSolution(StorableConstructorFlag deserializing) : base(deserializing) { }
+  }
+}
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithm.cs
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithm.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithm.cs	(revision 17479)
@@ -0,0 +1,189 @@
+﻿#region License Information
+/* HeuristicLab
+ * Author: Kaifeng Yang
+ * 
+ * Copyright (C) 2002-2019 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/>.
+ */
+
+// SMS-EMOA
+/*
+Implemenetation of a real-coded SMS_EMOA algorithm.
+This implementation follows the description of: 'M. Emmerich, N. Beume, and B. Naujoks. 
+An EMO Algorithm Using the Hypervolume Measure as Selection Criterion.EMO 2005.'
+*/
+#endregion
+
+using HEAL.Attic;                       
+using HeuristicLab.Common;             
+using HeuristicLab.Core;               
+using HeuristicLab.Data;               
+using HeuristicLab.Random;             
+using System.Linq;                     
+using System;
+using CancellationToken = System.Threading.CancellationToken;
+
+
+/*  This algorithm is SMS-EMOA implementation on HL. The main structure and interfaces with HL are copied from MOEA/D on HL, which was written by Dr. Bogdan Burlacu. The S-metric selection operator was adapted from Kaifeng's MATLAB toolbox in SMS-EMOA. The computational complexity of HVC is AT LEAST $O (n^2 \log n)$ in 2-D and 3-D cases. HVC should definitely be reduced to $\Theta (n \times \log n)$. 
+ *  
+ *  This algorithm assumes: 
+ *    1. minimization problems. For maximization problems, it is better to add "-" symbol.
+ *  
+ *  This algorithm works on:
+ *    1. continuous, discrete, mixed-integer MOO problems. For different types of problems, the operators should be adjusted accordingly. 
+ *    2. both multi-objective and many-objective problems. For many-objective problems, the bottleneck is the computational complexity of HV. 
+ * 
+ * This algorithm is the basic implementation of SMS-EMOA, proposed by Michael Emmerich et. al. Some potential improvements can be: 
+ *    1. Dynamic reference point strategy
+ *    2. Normalized fitness value strategy ---- desirability function. See, Yali, Longmei, Kaifeng, Michael Emmerich CEC paper. 
+ *    3. HVC calculation should definitely be improved, at least in the 2D and 3D cases.
+ *    4. multiple point strategy when $\lambda>1$ 
+ *    5. multiple reference points strategy, in ICNC 2016, Zhiwei Yang et. al. 
+ *    6. HVC approximation by R2 for MANY OBJECTIVE cases, by Ishibushi 2019, IEEE TEC  
+ *    7. Maybe: See maps 
+ * 
+ * Global parameters:
+ *    1. population  
+ *    
+ * Many thanks for Bogdan Burlacu and Johannes Karder, especially Bogdan for his explanation, help, and supports. 
+ */
+
+namespace HeuristicLab.Algorithms.DynamicALPS {
+  // Format: 
+  // The indexed name of the algorithm/item, Description of the algorithm/item in HL  
+  [Item("DynamicALPS-MainLoop", "DynamicALPS-MainLoop implementation adapted from SMS-EMOA in HL.")]
+
+  // Call "HeuristicLab.Core"
+  // Define the category of this class. 
+  [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 125)]
+
+  // Call "HEAL.Attic"
+  // Define GUID for this Class
+  [StorableType("A7F33D16-3495-43E8-943C-8A919123F541")]
+
+  public class DynamicALPSAlgorithm : DynamicALPSAlgorithmBase {
+    public DynamicALPSAlgorithm() { }
+
+    protected DynamicALPSAlgorithm(DynamicALPSAlgorithm original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DynamicALPSAlgorithm(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected DynamicALPSAlgorithm(StorableConstructorFlag deserializing) : base(deserializing) { }
+
+    protected override void Run(CancellationToken cancellationToken) {
+      if (previousExecutionState != ExecutionState.Paused) { // Call "base" class, DynamicALPSAlgorithmBase
+        InitializeAlgorithm(cancellationToken);
+      }
+
+ 
+      var populationSize = PopulationSize.Value;
+      bool[] maximization = ((BoolArray)Problem.MaximizationParameter.ActualValue).CloneAsArray();
+      
+      var crossover = Crossover;
+      var crossoverProbability = CrossoverProbability.Value;
+      var mutator = Mutator;
+      var mutationProbability = MutationProbability.Value;
+      var evaluator = Problem.Evaluator;
+      var analyzer = Analyzer;
+      var rand = RandomParameter.Value;
+      
+
+      var maximumEvaluatedSolutions = MaximumEvaluatedSolutions.Value;  
+
+
+      int lambda = 1;            // the size of offspring 
+
+
+      int nLayerALPS = 10000000;
+      int counterLayerALPS = 0;
+      //int indexOffspring = 0;    // the index of offspring to be generated
+      bool[] activeLayer = new bool[ALPSLayers.Value];
+      int[][] ageMatrix = new int[ALPSLayers.Value][];      // layer * population size
+
+
+
+      // cancellation token for the inner operations which should not be immediately cancelled
+      var innerToken = new CancellationToken();
+
+
+      // initilize the offspring population. 
+      // offspringPopulation = new IDynamicALPSSolution[lambda];
+
+
+
+
+      
+      //jointPopulation = new IDynamicALPSSolution[lambda + populationSize];
+
+      // 12022020
+      layerPopulation = new IDynamicALPSSolution[nLayerALPS][];
+      layerOffspringPopulation = new IDynamicALPSSolution[nLayerALPS][];
+      layerJointPopulation = new IDynamicALPSSolution[nLayerALPS][];
+
+
+
+      var test = new IDynamicALPSSolution[100, 100];
+      IDynamicALPSSolution[][] test2 = new IDynamicALPSSolution[10000][];
+
+
+
+
+      layerPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize];
+      // BUG: The size of offspring should vary in different layers!!!!
+      layerOffspringPopulation[counterLayerALPS] = new IDynamicALPSSolution[lambda];
+      population.CopyTo(layerPopulation[counterLayerALPS], 0);
+      // Mainloop 
+      while (evaluatedSolutions < maximumEvaluatedSolutions && !cancellationToken.IsCancellationRequested) {
+
+
+        evaluatedSolutions = SMSEMOA( populationSize,  lambda,  counterLayerALPS);
+
+        if (evaluatedSolutions >= maximumEvaluatedSolutions) {
+          break;
+        }
+
+        layerPopulation[counterLayerALPS].CopyTo(population, 0);  // DEBUG ,DETELE THIS 
+
+        // run analyzer
+        var analyze = executionContext.CreateChildOperation(analyzer, globalScope);
+        ExecuteOperation(executionContext, innerToken, analyze);
+        // update Pareto-front approximation sets
+        UpdateParetoFronts();
+        // Show some results in the GUI.
+        Results.AddOrUpdateResult("IdealPoint", new DoubleArray(IdealPoint));
+        Results.AddOrUpdateResult("NadirPoint", new DoubleArray(NadirPoint));
+        Results.AddOrUpdateResult("Evaluated Solutions", new IntValue(evaluatedSolutions));
+
+        // Update globalScope
+        globalScope.SubScopes.Replace(population.Select(x => (IScope)x.Individual));
+
+
+        // intilize the population for the next layer
+        counterLayerALPS += 1;
+        layerPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize];
+        layerPopulation[counterLayerALPS-1].CopyTo(layerPopulation[counterLayerALPS], 0); // DETELTE DUBGU 
+        // BUG lambda should be different~~~~!!!!
+        layerOffspringPopulation[counterLayerALPS] = new IDynamicALPSSolution[lambda];
+      }
+    }
+
+    
+  }
+}
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithmBase.cs
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithmBase.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithmBase.cs	(revision 17479)
@@ -0,0 +1,861 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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
+
+// 03/02/2020
+// TODO LIST:                                                                     
+// 1. Dynamic reference point strategy                                               
+// 2. Normalized fitness value strategy, desibility function.                         
+// 3. HVC calculation should be definitely improved, at least in the 2D case.
+// 4. multiple point strategy when $\lambda>1$ 
+
+using HEAL.Attic;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.ExpressionGenerator;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.TestFunctions.MultiObjective;
+using HeuristicLab.Random;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using CancellationToken = System.Threading.CancellationToken;
+
+namespace HeuristicLab.Algorithms.DynamicALPS {
+  [Item("DynamicALPSAlgorithmBase", "Base class for all DynamicALPS algorithm variants.")]
+  [StorableType("C0141748-DF5A-4CA0-A3DD-1DFB98236F7E")]
+  public abstract class DynamicALPSAlgorithmBase : BasicAlgorithm {
+    #region data members
+ 
+    [StorableType("75C9EA99-D699-4A1F-8AB2-AB86B7A2FD68")]
+    protected enum NeighborType { NEIGHBOR, POPULATION }
+
+
+    [StorableType("2A71E397-05CE-460F-B982-EE2F4B37C354")]
+    // TCHE = Chebyshev (Tchebyshev)
+    // PBI  = Penalty-based boundary intersection
+    // AGG  = Weighted sum
+    public enum FunctionType { TCHE, PBI, AGG }
+
+    [Storable]
+    protected double[] IdealPoint { get; set; }
+    [Storable]
+    protected double[] NadirPoint { get; set; } // potentially useful for objective normalization
+
+    [Storable]
+    protected double[][] lambda_moead;
+
+    [Storable]
+    protected int[][] neighbourhood;
+
+    [Storable]
+    protected IDynamicALPSSolution[] solutions;
+
+    [Storable]
+    protected FunctionType functionType;
+
+    [Storable]
+    protected IDynamicALPSSolution[] population;
+
+    [Storable]
+    protected IDynamicALPSSolution[][] layerPopulation;
+
+    [Storable]
+    protected IDynamicALPSSolution[][] layerOffspringPopulation;
+
+    [Storable]
+    protected IDynamicALPSSolution[][] layerJointPopulation;
+
+    [Storable]
+    protected IDynamicALPSSolution[] offspringPopulation;
+
+    //[Storable]
+    //protected IDynamicALPSSolution[] jointPopulation;
+
+    [Storable]
+    protected int evaluatedSolutions;
+
+    [Storable]
+    protected ExecutionContext executionContext;
+
+    [Storable]
+    protected IScope globalScope;
+
+    [Storable]
+    protected ExecutionState previousExecutionState;
+
+    [Storable]
+    protected ExecutionState executionState;
+
+    private DoubleArray ReferencePoint {
+      get {
+        var problem = (MultiObjectiveTestFunctionProblem)Problem;
+        return problem.ReferencePoint;
+      }
+    }
+    #endregion
+
+    #region parameters
+    private const string SeedParameterName = "Seed";
+    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    private const string PopulationSizeParameterName = "PopulationSize";
+    private const string ResultPopulationSizeParameterName = "ResultPopulationSize";
+    private const string CrossoverProbabilityParameterName = "CrossoverProbability";
+    private const string CrossoverParameterName = "Crossover";
+    private const string MutationProbabilityParameterName = "MutationProbability";
+    private const string MutatorParameterName = "Mutator";
+    private const string MaximumEvaluatedSolutionsParameterName = "MaximumEvaluatedSolutions";
+    private const string RandomParameterName = "Random";
+    private const string AnalyzerParameterName = "Analyzer";
+    // MOEA-D parameters
+    //private const string NeighbourSizeParameterName = "NeighbourSize";
+    //private const string NeighbourhoodSelectionProbabilityParameterName = "NeighbourhoodSelectionProbability";
+    //private const string MaximumNumberOfReplacedSolutionsParameterName = "MaximumNumberOfReplacedSolutions";
+    //private const string FunctionTypeParameterName = "FunctionType";
+    // private const string NormalizeObjectivesParameterName = "NormalizeObjectives";
+
+    // SMS-EMOA parameters: 
+    private const string LambdaParameterName = "Lambda";   // The number of offspring size 
+    private const string ALPSLayersParameterName = "ALPSLayers";   // The number of offspring size 
+    private const string ALPSAgeGapParameterName = "ALPSAgeGap";   // The number of offspring size 
+
+
+
+    // "Parameters" are defined in "HeuristicLab.Parameters"
+    // Contains: generic parameters of every class/algorithm/instance, 
+    // It seems that "I***ValueParameter" is declared in "Heuristic.core", where "***ValueParameter" are defined in "HeuristicLab.Parameter"
+    // The function of "I***ValueParameter" is to bridge current scripts to "HeuristicLab.Parameter". 
+    public IValueParameter<MultiAnalyzer> AnalyzerParameter {
+      get { return (ValueParameter<MultiAnalyzer>)Parameters[AnalyzerParameterName]; }
+    }
+
+    //public IConstrainedValueParameter<StringValue> FunctionTypeParameter
+    //{
+    //  get { return (IConstrainedValueParameter<StringValue>)Parameters[FunctionTypeParameterName]; }
+    //}
+    //public IFixedValueParameter<IntValue> NeighbourSizeParameter
+    //{
+    //  get { return (IFixedValueParameter<IntValue>)Parameters[NeighbourSizeParameterName]; }
+    //}
+    //public IFixedValueParameter<BoolValue> NormalizeObjectivesParameter
+    //{
+    //  get { return (IFixedValueParameter<BoolValue>)Parameters[NormalizeObjectivesParameterName]; }
+    //}
+    //public IFixedValueParameter<IntValue> MaximumNumberOfReplacedSolutionsParameter
+    //{
+    //  get { return (IFixedValueParameter<IntValue>)Parameters[MaximumNumberOfReplacedSolutionsParameterName]; }
+    //}
+    //public IFixedValueParameter<DoubleValue> NeighbourhoodSelectionProbabilityParameter
+    //{
+    //  get { return (IFixedValueParameter<DoubleValue>)Parameters[NeighbourhoodSelectionProbabilityParameterName]; }
+    //}
+    public IFixedValueParameter<IntValue> SeedParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[SeedParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; }
+    }
+    private IValueParameter<IntValue> PopulationSizeParameter {
+      get { return (IValueParameter<IntValue>)Parameters[PopulationSizeParameterName]; }
+    }
+    // KF, SMS-EMOA
+    private IValueParameter<IntValue> LambdaParameter {
+      get { return (IValueParameter<IntValue>)Parameters[LambdaParameterName]; }
+    }
+    //// KF, DynamicALPS
+    private IValueParameter<IntValue> ALPSLayersParameter{
+      get { return (IValueParameter<IntValue>)Parameters[ALPSLayersParameterName]; }
+    }
+    private IValueParameter<IntValue> ALPSAgeGapParameter {
+      get { return (IValueParameter<IntValue>)Parameters[ALPSAgeGapParameterName]; }
+    }
+
+    private IValueParameter<IntValue> ResultPopulationSizeParameter {
+      get { return (IValueParameter<IntValue>)Parameters[ResultPopulationSizeParameterName]; }
+    }
+
+    public IValueParameter<PercentValue> CrossoverProbabilityParameter {
+      get { return (IValueParameter<PercentValue>)Parameters[CrossoverProbabilityParameterName]; }
+    }
+    public IConstrainedValueParameter<ICrossover> CrossoverParameter {
+      get { return (IConstrainedValueParameter<ICrossover>)Parameters[CrossoverParameterName]; }
+    }
+    public IValueParameter<PercentValue> MutationProbabilityParameter {
+      get { return (IValueParameter<PercentValue>)Parameters[MutationProbabilityParameterName]; }
+    }
+    public IConstrainedValueParameter<IManipulator> MutatorParameter {
+      get { return (IConstrainedValueParameter<IManipulator>)Parameters[MutatorParameterName]; }
+    }
+    public IValueParameter<IntValue> MaximumEvaluatedSolutionsParameter {
+      get { return (IValueParameter<IntValue>)Parameters[MaximumEvaluatedSolutionsParameterName]; }
+    }
+    public IValueParameter<IRandom> RandomParameter {
+      get { return (IValueParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    #endregion
+
+    #region parameter properties
+    public new IMultiObjectiveHeuristicOptimizationProblem Problem {
+      get { return (IMultiObjectiveHeuristicOptimizationProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+    public int Seed {
+      get { return SeedParameter.Value.Value; }
+      set { SeedParameter.Value.Value = value; }
+    }
+    public bool SetSeedRandomly {
+      get { return SetSeedRandomlyParameter.Value.Value; }
+      set { SetSeedRandomlyParameter.Value.Value = value; }
+    }
+    public IntValue PopulationSize {
+      get { return PopulationSizeParameter.Value; }
+      set { PopulationSizeParameter.Value = value; }
+    }
+    public IntValue Lambda {
+      get { return LambdaParameter.Value; }
+      set { LambdaParameter.Value = value; }
+    }
+
+    public IntValue ResultPopulationSize {
+      get { return ResultPopulationSizeParameter.Value; }
+      set { ResultPopulationSizeParameter.Value = value; }
+    }
+
+    public IntValue ALPSLayers {
+      get { return ALPSLayersParameter.Value; }
+      set { ALPSLayersParameter.Value = value; }
+    }
+
+    public IntValue ALPSAgeGap {
+      get { return ALPSAgeGapParameter.Value; }
+      set { ALPSAgeGapParameter.Value = value; }
+    }
+
+    public PercentValue CrossoverProbability {
+      get { return CrossoverProbabilityParameter.Value; }
+      set { CrossoverProbabilityParameter.Value = value; }
+    }
+    public ICrossover Crossover {
+      get { return CrossoverParameter.Value; }
+      set { CrossoverParameter.Value = value; }
+    }
+    public PercentValue MutationProbability {
+      get { return MutationProbabilityParameter.Value; }
+      set { MutationProbabilityParameter.Value = value; }
+    }
+    public IManipulator Mutator {
+      get { return MutatorParameter.Value; }
+      set { MutatorParameter.Value = value; }
+    }
+    public MultiAnalyzer Analyzer {
+      get { return AnalyzerParameter.Value; }
+      set { AnalyzerParameter.Value = value; }
+    }
+    public IntValue MaximumEvaluatedSolutions {
+      get { return MaximumEvaluatedSolutionsParameter.Value; }
+      set { MaximumEvaluatedSolutionsParameter.Value = value; }
+    }
+    #endregion
+
+    #region constructors
+    public DynamicALPSAlgorithmBase() {
+      // Add or define or specify the parameters that may be use in SMS-EMOA.   
+      // ***("Name", "Description", "Value")
+      //  Name                            Type                Description
+      //  FixedValueParameter:            ANY                 Not changed???
+      //  ValueParameter:                                     Changable??? What is the difference between "ValueParameter" and "FixedVlaueParameter"?????
+
+
+      // types: 
+      //      IntValue
+      //      BoolValue
+      //      DoubleValue
+      //      PercentValue
+      //      ICrossover:       
+      //      IManipulator:     
+      //      IRandom:         
+      //      MultiAnalyzer:    
+      //      ---------
+      Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+      Parameters.Add(new ValueParameter<IntValue>(PopulationSizeParameterName, "The size of the population of solutions.", new IntValue(100)));
+      Parameters.Add(new ValueParameter<IntValue>(ResultPopulationSizeParameterName, "The size of the population of solutions.", new IntValue(100)));
+      Parameters.Add(new ValueParameter<PercentValue>(CrossoverProbabilityParameterName, "The probability that the crossover operator is applied.", new PercentValue(0.9)));
+      Parameters.Add(new ConstrainedValueParameter<ICrossover>(CrossoverParameterName, "The operator used to cross solutions."));
+      Parameters.Add(new ValueParameter<PercentValue>(MutationProbabilityParameterName, "The probability that the mutation operator is applied on a solution.", new PercentValue(0.25)));
+      Parameters.Add(new ConstrainedValueParameter<IManipulator>(MutatorParameterName, "The operator used to mutate solutions."));
+      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
+      Parameters.Add(new ValueParameter<IntValue>(MaximumEvaluatedSolutionsParameterName, "The maximum number of evaluated solutions (approximately).", new IntValue(100_000)));
+      Parameters.Add(new ValueParameter<IRandom>(RandomParameterName, new FastRandom()));
+
+      // SMS-EMOA, kf
+      Parameters.Add(new ValueParameter<IntValue>(LambdaParameterName, "The size of the offsprings. Now, it only works when lambda = 1", new IntValue(1)));
+      // DynamicALPS, KF
+      Parameters.Add(new ValueParameter<IntValue>(ALPSLayersParameterName, "Test, maximum = 1000, defualt is 1", new IntValue(10)));
+      Parameters.Add(new ValueParameter<IntValue>(ALPSAgeGapParameterName, "Test, maximum = 1000, defualt is 20", new IntValue(20)));
+      
+
+    }
+
+    protected DynamicALPSAlgorithmBase(DynamicALPSAlgorithmBase original, Cloner cloner) : base(original, cloner) {
+      functionType = original.functionType;
+      evaluatedSolutions = original.evaluatedSolutions;
+      previousExecutionState = original.previousExecutionState;
+
+      if (original.IdealPoint != null) {
+        IdealPoint = (double[])original.IdealPoint.Clone();
+      }
+
+      if (original.NadirPoint != null) {
+        NadirPoint = (double[])original.NadirPoint.Clone();
+      }
+
+      if (original.lambda_moead != null) {
+        lambda_moead = (double[][])original.lambda_moead.Clone();
+      }
+
+      if (original.neighbourhood != null) {
+        neighbourhood = (int[][])original.neighbourhood.Clone();
+      }
+
+      if (original.solutions != null) {
+        solutions = original.solutions.Select(cloner.Clone).ToArray();
+      }
+
+      if (original.population != null) {
+        population = original.population.Select(cloner.Clone).ToArray();
+      }
+
+      if (original.offspringPopulation != null) {
+        offspringPopulation = original.offspringPopulation.Select(cloner.Clone).ToArray();
+      }
+
+      //if (original.jointPopulation != null) {
+      //  jointPopulation = original.jointPopulation.Select(x => cloner.Clone(x)).ToArray();
+      //}
+
+      if (original.executionContext != null) {
+        executionContext = cloner.Clone(original.executionContext);
+      }
+
+      if (original.globalScope != null) {
+        globalScope = cloner.Clone(original.globalScope);
+      }
+    }
+
+
+
+    [StorableConstructor]
+    protected DynamicALPSAlgorithmBase(StorableConstructorFlag deserializing) : base(deserializing) { }
+    #endregion
+
+    private void InitializePopulation(ExecutionContext executionContext, CancellationToken cancellationToken, IRandom random, bool[] maximization) {
+      // creator: how to create the initilized population. "UniformRandom" is used here. 
+      // TODO: LHS, latin hypercube sampling? Exisit??? 
+      var creator = Problem.SolutionCreator;
+      var evaluator = Problem.Evaluator;
+
+      // dimensions: objective space
+      var dimensions = maximization.Length;
+      var populationSize = PopulationSize.Value;
+      population = new IDynamicALPSSolution[populationSize];
+
+      var parentScope = executionContext.Scope;
+      // first, create all individuals
+      for (int i = 0; i < populationSize; ++i) {
+        var childScope = new Scope(i.ToString()) { Parent = parentScope };
+        ExecuteOperation(executionContext, cancellationToken, executionContext.CreateChildOperation(creator, childScope));
+        parentScope.SubScopes.Add(childScope);
+      }
+
+      for (int i = 0; i < populationSize; ++i) {
+        var childScope = parentScope.SubScopes[i];
+        ExecuteOperation(executionContext, cancellationToken, executionContext.CreateChildOperation(evaluator, childScope));
+
+        var qualities = (DoubleArray)childScope.Variables["Qualities"].Value;
+
+        // solution: a method, contains a decision vector and objecitve values     
+        //    solution.Qualities:     objective values, fitness values 
+        //    solution.Individual:    decision vector
+        var solution = new DynamicALPSSolution(childScope, dimensions, 0);
+        for (int j = 0; j < dimensions; ++j) {
+          // TODO: convert maximization problems into minimization problems. 
+          solution.Qualities[j] = maximization[j] ? 1 - qualities[j] : qualities[j];
+        }
+
+        // population is a collection of solution.  
+        population[i] = solution;
+
+        // KF, DyanmicALPS
+        population[i].HypervolumeContribution[0] = -0;
+        population[i].NondominanceRanking[0] = -0;
+        population[i].Age = 1;
+        population[i].IndividualPc = CrossoverProbability.Value;
+        population[i].IndividualPc = MutationProbability.Value;
+      }
+    }
+
+    protected void InitializeAlgorithm(CancellationToken cancellationToken) { // Type of random operator, "FastRandom" in this script. 
+      // RandomParameter <-- Parameters in "HeuristicLab.Core.ParameterizedNameItem", 
+      var rand = RandomParameter.Value;
+
+      // Initialize random seed
+      // If random seed exist, get it; otherwise, 
+      if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
+
+      // Call 
+      rand.Reset(Seed);
+
+      bool[] maximization = ((BoolArray)Problem.MaximizationParameter.ActualValue).CloneAsArray();
+
+      // dimensions: the dimension in an objective space 
+      var dimensions = maximization.Length;
+
+
+      var populationSize = PopulationSize.Value;
+
+      InitializePopulation(executionContext, cancellationToken, rand, maximization);
+
+      IdealPoint = new double[dimensions];
+      IdealPoint.UpdateIdeal(population);
+
+      NadirPoint = Enumerable.Repeat(double.MinValue, dimensions).ToArray();
+      //NadirPoint = new double[dimensions];
+      NadirPoint.UpdateNadir(population);
+
+
+      evaluatedSolutions = populationSize;
+    }
+
+    protected override void Initialize(CancellationToken cancellationToken) {
+      globalScope = new Scope("Global Scope");
+      executionContext = new ExecutionContext(null, this, globalScope);
+
+      // set the execution context for parameters to allow lookup
+      foreach (var parameter in Problem.Parameters.OfType<IValueParameter>()) {
+        // we need all of these in order for the wiring of the operators to work
+        globalScope.Variables.Add(new Variable(parameter.Name, parameter.Value));
+      }
+      globalScope.Variables.Add(new Variable("Results", Results)); // make results available as a parameter for analyzers etc.
+
+      base.Initialize(cancellationToken);
+    }
+
+    public override bool SupportsPause => true;
+
+
+
+
+    // Mate Selection. 
+    // Randomly select a specific number of individuals for later operators. 
+    // Inputs: 
+    //    1. random:                      Random number generate method
+    //    2. numberOfSolutionToSelect:    The number of selection    
+    // Outputs: 
+    //    1. listOfSolutions:             The selection individuals
+    protected List<int> MatingSelection(IRandom random, int numberOfSolutionsToSelect) {
+      int populationSize = PopulationSize.Value;
+
+      var listOfSolutions = new List<int>(numberOfSolutionsToSelect);
+
+      while (listOfSolutions.Count < numberOfSolutionsToSelect) {
+        var selectedSolution = random.Next(populationSize);
+
+        bool flag = true;
+        foreach (int individualId in listOfSolutions) {
+          if (individualId == selectedSolution) {
+            flag = false;
+            break;
+          }
+        }
+
+        if (flag) {
+          listOfSolutions.Add(selectedSolution);
+        }
+      }
+      return listOfSolutions;
+    }
+
+    protected void ApplyCrossover(int lambda) {
+    }
+
+    protected void ApplyMutation(int lambda) {
+    }
+
+
+    protected void ApplyEvaluation(int lambda) {
+    }
+
+    protected void ApplyMateSelection(int rho) {
+    }
+
+
+    // Select/Discard the individual(s) according to HVC 
+    protected void SmetricSelection(int lambda, int nLayerALPS) {
+      var wholePopulation = layerJointPopulation[nLayerALPS];
+      var qualities = wholePopulation.Select(x => x.Qualities).ToArray();
+
+      var maximization = Enumerable.Repeat(false, IdealPoint.Length).ToArray(); // Minimization or maximization ????
+      var pf2 = DominationCalculator<IDynamicALPSSolution>.CalculateAllParetoFronts(wholePopulation, qualities, maximization, out int[] ranking);
+
+      int numberOfLayer;             // number of layers in PF
+      int numberOfLastLayer;          // number of discarded points in PF (the number of points in the last layer)
+
+      pf2.RemoveAt(pf2.Count() - 1);
+      numberOfLayer = pf2.Count();
+      numberOfLastLayer = pf2[numberOfLayer - 1].Count();
+      double[] hvc = new double[numberOfLastLayer];
+      int discardIndex;
+      if (numberOfLastLayer > lambda) {
+        double tempHV;
+        double smetric;
+        var lastLayer = pf2.Last();
+
+        // TODO: This can be use for dynamic reference point strategy later. Kaifeng , 02/2020
+        // smetric = Hypervolume.Calculate(lastLayer.Select(x => x.Item2), Enumerable.Repeat(11d, NadirPoint.Length).ToArray(), maximization);
+        var reference = ReferencePoint.ToArray();
+        var nondominated = NonDominatedSelect.GetDominatingVectors(lastLayer.Select(x => x.Item2), reference, maximization, false);
+        smetric = nondominated.Any() ? Hypervolume.Calculate(nondominated, reference, maximization) : int.MinValue;
+
+        for (int ii = 0; ii < lastLayer.Count; ++ii) {
+          try { // TODO: This can be use for dynamic reference point strategy later. Kaifeng , 02/2020
+            // tempHV = Hypervolume.Calculate(indices.Where(idx => idx != ii).Select(idx => lastLayer[idx].Item2), Enumerable.Repeat(11d, NadirPoint.Length).ToArray(), maximization);
+            tempHV = Hypervolume.Calculate(Enumerable.Range(0, lastLayer.Count).Where(idx => idx != ii).Select(idx => lastLayer[idx].Item2), reference, maximization);
+          }
+          catch {
+            tempHV = int.MinValue;
+          }
+          hvc[ii] = smetric - tempHV;
+          tempHV = 0;
+        }
+        discardIndex = Array.IndexOf(hvc, hvc.Min());
+        pf2[numberOfLayer - 1].RemoveAt(discardIndex);
+      }
+      else {
+        // TODO: This should be updated when $lambda > 1$
+        pf2.RemoveAt(pf2.Count() - 1);
+        numberOfLayer = numberOfLayer - 1;
+      }
+      layerPopulation[nLayerALPS] = pf2.SelectMany(x => x.Select(y => y.Item1)).ToArray();
+    }
+
+    protected int SMSEMOA(int populationSize, int lambda, int counterLayerALPS) {
+      var innerToken = new CancellationToken();
+      bool[] maximization = ((BoolArray)Problem.MaximizationParameter.ActualValue).CloneAsArray();
+      var maximumEvaluatedSolutions = MaximumEvaluatedSolutions.Value;
+      var crossover = Crossover;
+      var crossoverProbability = CrossoverProbability.Value;
+      var mutator = Mutator;
+      var mutationProbability = MutationProbability.Value;
+      var evaluator = Problem.Evaluator;
+      var analyzer = Analyzer;
+      var rand = RandomParameter.Value;
+
+
+      int indexOffspring = 0;
+      var mates = MatingSelection(rand, 2); // select parents
+                                            //var s1 = (IScope)population[mates[0]].Individual.Clone();
+                                            //var s2 = (IScope)population[mates[1]].Individual.Clone();
+                                            //var ages = population.Select(x => x.Age).ToArray();
+
+      var s1 = (IScope)layerPopulation[counterLayerALPS][mates[0]].Individual.Clone();
+      var s2 = (IScope)layerPopulation[counterLayerALPS][mates[1]].Individual.Clone();
+      var ages = layerPopulation[counterLayerALPS].Select(x => x.Age).ToArray();
+
+      var s1_age = ages[mates[0]];
+      var s2_age = ages[mates[1]];
+      int offSpringAge = 0;
+      s1.Parent = s2.Parent = globalScope;
+      IScope childScope = null;
+
+      // crossover
+      if (rand.NextDouble() < crossoverProbability) {
+        childScope = new Scope($"{mates[0]}+{mates[1]}") { Parent = executionContext.Scope };
+        childScope.SubScopes.Add(s1);
+        childScope.SubScopes.Add(s2);
+        var opCrossover = executionContext.CreateChildOperation(crossover, childScope);
+        ExecuteOperation(executionContext, innerToken, opCrossover);
+        offSpringAge = Math.Max(s1_age, s2_age) + 1;
+        childScope.SubScopes.Clear(); // <<-- VERY IMPORTANT!
+      }
+      else { // MUTATION   POLISHI
+        if (childScope == null) {
+          offSpringAge = ages[mates[0]] + 1;
+        }
+        else {
+        }
+        childScope = childScope ?? s1;
+        var opMutation = executionContext.CreateChildOperation(mutator, childScope);
+        ExecuteOperation(executionContext, innerToken, opMutation);
+      }
+      if (childScope != null) { // Evaluate the childScope
+        var opEvaluation = executionContext.CreateChildOperation(evaluator, childScope);
+        ExecuteOperation(executionContext, innerToken, opEvaluation);
+        // childScope 
+        var qualities = (DoubleArray)childScope.Variables["Qualities"].Value;
+        var childSolution = new DynamicALPSSolution(childScope, maximization.Length, 0);
+        // set child qualities
+        for (int j = 0; j < maximization.Length; ++j) {
+          childSolution.Qualities[j] = maximization[j] ? 1 - qualities[j] : qualities[j];
+        }
+        IdealPoint.UpdateIdeal(childSolution.Qualities);
+        NadirPoint.UpdateNadir(childSolution.Qualities);
+        // TODO, KF -- For later usage when $lambda > 1$
+        childSolution.HypervolumeContribution = null;
+        childSolution.NondominanceRanking = null;
+        childSolution.Age = offSpringAge;
+        layerOffspringPopulation[counterLayerALPS][indexOffspring] = childSolution;
+        ++evaluatedSolutions;
+        indexOffspring += 1;
+      }
+      else {
+        // no crossover or mutation were applied, a child was not produced, do nothing
+      }
+
+
+      layerJointPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize + lambda];
+      layerPopulation[counterLayerALPS].CopyTo(layerJointPopulation[counterLayerALPS], 0);
+      layerOffspringPopulation[counterLayerALPS].CopyTo(layerJointPopulation[counterLayerALPS], populationSize);
+
+      SmetricSelection(lambda, counterLayerALPS);   // SMS-EMOA 
+      return evaluatedSolutions;
+    }
+
+
+
+
+
+
+
+    // Update the Pareto-front approximation set and scatter the solutions in PF approximation set. 
+    protected void UpdateParetoFronts() {
+      //var qualities = population.Select(x => Enumerable.Range(0, NadirPoint.Length).Select(i => x.Qualities[i] / NadirPoint[i]).ToArray()).ToArray();
+      var qualities = population.Select(x => x.Qualities).ToArray();
+      var maximization = Enumerable.Repeat(false, IdealPoint.Length).ToArray();                             // DynamicALPS minimizes everything internally
+      var pf = DominationCalculator<IDynamicALPSSolution>.CalculateBestParetoFront(population, qualities, maximization);
+
+      var pf2 = DominationCalculator<IDynamicALPSSolution>.CalculateAllParetoFronts(population, qualities, maximization, out int[] ranking);
+      var n = (int)EnumerableExtensions.BinomialCoefficient(IdealPoint.Length, 2);
+
+
+      // Struture hypervolume 
+      // [0,0]:  Value of HV
+      // [0,1]:  PF size, $|PF|$
+      var hypervolumes = new DoubleMatrix(n == 1 ? 1 : n + 1, 2) { ColumnNames = new[] { "PF hypervolume", "PF size" } };
+
+
+      // HV calculation 
+      // pf.Select(x => x.Item2): the "Item2" in var "pd"
+      // Enumerable.Repeat(1d, NadirPoint.Length).ToArray():     reference point 
+      // maximization:   type of optimization problem:
+      //               True:  maximization problem 
+      //               False: minimization problem
+      var reference = ReferencePoint.ToArray();
+      var nondominated = NonDominatedSelect.GetDominatingVectors(pf.Select(x => x.Item2), reference, maximization, false);
+      hypervolumes[0, 0] = nondominated.Any() ? Hypervolume.Calculate(nondominated, reference, maximization) : int.MinValue;
+
+      //hypervolumes[0, 0] = Hypervolume.Calculate(pf.Select(x => x.Item2), reference, maximization);
+      hypervolumes[0, 1] = pf.Count;
+      Console.WriteLine("Current HV is", hypervolumes[0, 0]);
+
+      var elementNames = new List<string>() { "Pareto Front" };
+
+      ResultCollection results;
+      if (Results.ContainsKey("Hypervolume Analysis")) {
+        results = (ResultCollection)Results["Hypervolume Analysis"].Value;
+      }
+      else {
+        results = new ResultCollection();
+        Results.AddOrUpdateResult("Hypervolume Analysis", results);
+      }
+
+      ScatterPlot sp;
+      if (IdealPoint.Length == 2) {
+        var points = pf.Select(x => new Point2D<double>(x.Item2[0], x.Item2[1]));
+        var r = OnlinePearsonsRCalculator.Calculate(points.Select(x => x.X), points.Select(x => x.Y), out OnlineCalculatorError error);
+        if (error != OnlineCalculatorError.None) { r = double.NaN; }
+        var resultName = "Pareto Front Analysis ";
+        if (!results.ContainsKey(resultName)) {
+          sp = new ScatterPlot() {
+            VisualProperties = {
+              XAxisMinimumAuto = false, XAxisMinimumFixedValue = 0d, XAxisMaximumAuto = false, XAxisMaximumFixedValue = 1d,
+              YAxisMinimumAuto = false, YAxisMinimumFixedValue = 0d, YAxisMaximumAuto = false, YAxisMaximumFixedValue = 1d
+            }
+          };
+          sp.Rows.Add(new ScatterPlotDataRow(resultName, "", points) { VisualProperties = { PointSize = 8 } });
+          results.AddOrUpdateResult(resultName, sp);
+        }
+        else {
+          sp = (ScatterPlot)results[resultName].Value;
+          sp.Rows[resultName].Points.Replace(points);
+        }
+        sp.Name = $"Dimensions [0, 1], correlation: {r.ToString("N2")}";
+      }
+      else if (IdealPoint.Length > 2) {
+        var indices = Enumerable.Range(0, IdealPoint.Length).ToArray();
+        var visualProperties = new ScatterPlotDataRowVisualProperties { PointSize = 8, Color = Color.LightGray };
+        var combinations = indices.Combinations(2).ToArray();
+        var maximization2d = new[] { false, false };
+        var solutions2d = pf.Select(x => x.Item1).ToArray();
+        for (int i = 0; i < combinations.Length; ++i) {
+          var c = combinations[i].ToArray();
+
+          // calculate the hypervolume in the 2d coordinate space
+          var reference2d = new[] { 1d, 1d };
+          var qualities2d = pf.Select(x => new[] { x.Item2[c[0]], x.Item2[c[1]] }).ToArray();
+          var pf2d = DominationCalculator<IDynamicALPSSolution>.CalculateBestParetoFront(solutions2d, qualities2d, maximization2d);
+
+          hypervolumes[i + 1, 0] = pf2d.Count > 0 ? Hypervolume.Calculate(pf2d.Select(x => x.Item2), reference2d, maximization2d) : 0d;
+          hypervolumes[i + 1, 1] = pf2d.Count;
+
+          var resultName = $"Pareto Front Analysis [{c[0]}, {c[1]}]";
+          elementNames.Add(resultName);
+
+          var points = pf.Select(x => new Point2D<double>(x.Item2[c[0]], x.Item2[c[1]]));
+          var pf2dPoints = pf2d.Select(x => new Point2D<double>(x.Item2[0], x.Item2[1]));
+
+          if (!results.ContainsKey(resultName)) {
+            sp = new ScatterPlot() {
+              VisualProperties = {
+                XAxisMinimumAuto = false, XAxisMinimumFixedValue = 0d, XAxisMaximumAuto = false, XAxisMaximumFixedValue = 1d,
+                YAxisMinimumAuto = false, YAxisMinimumFixedValue = 0d, YAxisMaximumAuto = false, YAxisMaximumFixedValue = 1d
+              }
+            };
+            sp.Rows.Add(new ScatterPlotDataRow("Pareto Front", "", points) { VisualProperties = visualProperties });
+            sp.Rows.Add(new ScatterPlotDataRow($"Pareto Front [{c[0]}, {c[1]}]", "", pf2dPoints) { VisualProperties = { PointSize = 10, Color = Color.OrangeRed } });
+            results.AddOrUpdateResult(resultName, sp);
+          }
+          else {
+            sp = (ScatterPlot)results[resultName].Value;
+            sp.Rows["Pareto Front"].Points.Replace(points);
+            sp.Rows[$"Pareto Front [{c[0]}, {c[1]}]"].Points.Replace(pf2dPoints);
+          }
+          var r = OnlinePearsonsRCalculator.Calculate(points.Select(x => x.X), points.Select(x => x.Y), out OnlineCalculatorError error);
+          var r2 = r * r;
+          sp.Name = $"Pareto Front [{c[0]}, {c[1]}], correlation: {r2.ToString("N2")}";
+        }
+      }
+      hypervolumes.RowNames = elementNames;
+      results.AddOrUpdateResult("Hypervolumes", hypervolumes);
+    }
+
+    #region operator wiring and events
+    protected void ExecuteOperation(ExecutionContext executionContext, CancellationToken cancellationToken, IOperation operation) {
+      Stack<IOperation> executionStack = new Stack<IOperation>();
+      executionStack.Push(operation);
+      while (executionStack.Count > 0) {
+        cancellationToken.ThrowIfCancellationRequested();
+        IOperation next = executionStack.Pop();
+        if (next is OperationCollection) {
+          OperationCollection coll = (OperationCollection)next;
+          for (int i = coll.Count - 1; i >= 0; i--)
+            if (coll[i] != null) executionStack.Push(coll[i]);
+        }
+        else if (next is IAtomicOperation) {
+          IAtomicOperation op = (IAtomicOperation)next;
+          next = op.Operator.Execute((IExecutionContext)op, cancellationToken);
+          if (next != null) executionStack.Push(next);
+        }
+      }
+    }
+
+    private void UpdateAnalyzers() {
+      Analyzer.Operators.Clear();
+      if (Problem != null) {
+        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) {
+          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
+            param.Depth = 1;
+          Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault);
+        }
+      }
+    }
+
+    private void UpdateCrossovers() {
+      ICrossover oldCrossover = CrossoverParameter.Value;
+      CrossoverParameter.ValidValues.Clear();
+      ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault();
+
+      foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name))
+        CrossoverParameter.ValidValues.Add(crossover);
+
+      if (oldCrossover != null) {
+        ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType());
+        if (crossover != null) CrossoverParameter.Value = crossover;
+        else oldCrossover = null;
+      }
+      if (oldCrossover == null && defaultCrossover != null)
+        CrossoverParameter.Value = defaultCrossover;
+    }
+
+    private void UpdateMutators() {
+      IManipulator oldMutator = MutatorParameter.Value;
+      MutatorParameter.ValidValues.Clear();
+      IManipulator defaultMutator = Problem.Operators.OfType<IManipulator>().FirstOrDefault();
+
+      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name))
+        MutatorParameter.ValidValues.Add(mutator);
+
+      if (oldMutator != null) {
+        IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType());
+        if (mutator != null) MutatorParameter.Value = mutator;
+        else oldMutator = null;
+      }
+
+      if (oldMutator == null && defaultMutator != null)
+        MutatorParameter.Value = defaultMutator;
+    }
+
+    protected override void OnProblemChanged() {
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateAnalyzers();
+      base.OnProblemChanged();
+    }
+
+    protected override void OnExecutionStateChanged() {
+      previousExecutionState = executionState;
+      executionState = ExecutionState;
+      base.OnExecutionStateChanged();
+    }
+
+    public void ClearState() {
+      solutions = null;
+      population = null;
+      offspringPopulation = null;
+      //jointPopulation = null;
+      lambda_moead = null;
+      neighbourhood = null;
+      if (executionContext != null && executionContext.Scope != null) {
+        executionContext.Scope.SubScopes.Clear();
+      }
+    }
+
+    protected override void OnStopped() {
+      ClearState();
+      base.OnStopped();
+    }
+    #endregion
+  }
+}
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSUtil.cs
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSUtil.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSUtil.cs	(revision 17479)
@@ -0,0 +1,279 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace HeuristicLab.Algorithms.DynamicALPS
+{
+  public static class DynamicALPSUtil
+  {
+    public static void QuickSort(double[] array, int[] idx, int from, int to)
+    {
+      if (from < to)
+      {
+        double temp = array[to];
+        int tempIdx = idx[to];
+        int i = from - 1;
+        for (int j = from; j < to; j++)
+        {
+          if (array[j] <= temp)
+          {
+            i++;
+            double tempValue = array[j];
+            array[j] = array[i];
+            array[i] = tempValue;
+            int tempIndex = idx[j];
+            idx[j] = idx[i];
+            idx[i] = tempIndex;
+          }
+        }
+        array[to] = array[i + 1];
+        array[i + 1] = temp;
+        idx[to] = idx[i + 1];
+        idx[i + 1] = tempIdx;
+        QuickSort(array, idx, from, i);
+        QuickSort(array, idx, i + 1, to);
+      }
+    }
+
+    public static void MinFastSort(double[] x, int[] idx, int n, int m)
+    {
+      for (int i = 0; i < m; i++)
+      {
+        for (int j = i + 1; j < n; j++)
+        {
+          if (x[i] > x[j])
+          {
+            double temp = x[i];
+            x[i] = x[j];
+            x[j] = temp;
+            int id = idx[i];
+            idx[i] = idx[j];
+            idx[j] = id;
+          }
+        }
+      }
+    }
+
+    public static IList<IDynamicALPSSolution> GetSubsetOfEvenlyDistributedSolutions(IRandom random, IList<IDynamicALPSSolution> solutionList, int newSolutionListSize)
+    {
+      if (solutionList == null || solutionList.Count == 0)
+      {
+        throw new ArgumentException("Solution list is null or empty.");
+      }
+
+      return solutionList[0].Dimensions == 2
+        ? TwoObjectivesCase(solutionList, newSolutionListSize)
+        : MoreThanTwoObjectivesCase(random, solutionList, newSolutionListSize);
+    }
+
+    private static IList<IDynamicALPSSolution> TwoObjectivesCase(IList<IDynamicALPSSolution> solutionList, int newSolutionListSize)
+    {
+      var resultSolutionList = new IDynamicALPSSolution[newSolutionListSize];
+
+      // compute weight vectors
+      double[][] lambda_moead = new double[newSolutionListSize][];
+      var values = SequenceGenerator.GenerateSteps(0m, 1m, 1m / newSolutionListSize).ToArray();
+      for (int i = 0; i < newSolutionListSize; ++i)
+      {
+        var weights = new double[newSolutionListSize];
+        weights[0] = (double)values[i];
+        weights[1] = 1 - weights[0];
+
+        lambda_moead[i] = weights;
+      }
+
+      var idealPoint = new double[2];
+      foreach (var solution in solutionList)
+      {
+        // update ideal point
+        idealPoint.UpdateIdeal(solution.Qualities);
+      }
+
+      // Select the best solution for each weight vector
+      for (int i = 0; i < newSolutionListSize; i++)
+      {
+        var currentBest = solutionList[0];
+        double value = ScalarizingFitnessFunction(currentBest, lambda_moead[i], idealPoint);
+        for (int j = 1; j < solutionList.Count; j++)
+        {
+          double aux = ScalarizingFitnessFunction(solutionList[j], lambda_moead[i], idealPoint); // we are looking for the best for the weight i
+          if (aux < value)
+          { // solution in position j is better!
+            value = aux;
+            currentBest = solutionList[j];
+          }
+        }
+        resultSolutionList[i] = (DynamicALPSSolution)currentBest.Clone();
+      }
+
+      return resultSolutionList;
+    }
+
+    private static IList<IDynamicALPSSolution> MoreThanTwoObjectivesCase(IRandom random, IList<IDynamicALPSSolution> solutionList, int newSolutionListSize)
+    {
+      var resultSolutionList = new List<IDynamicALPSSolution>();
+
+      int randomIndex = random.Next(0, solutionList.Count);
+
+      var candidate = new List<IDynamicALPSSolution>();
+      resultSolutionList.Add(solutionList[randomIndex]);
+
+      for (int i = 0; i < solutionList.Count; ++i)
+      {
+        if (i != randomIndex)
+        {
+          candidate.Add(solutionList[i]);
+        }
+      }
+
+      while (resultSolutionList.Count < newSolutionListSize)
+      {
+        int index = 0;
+        var selected = candidate[0]; // it should be a next! (n <= population size!)
+        double aux = CalculateBestDistance(selected, solutionList);
+        int i = 1;
+        while (i < candidate.Count)
+        {
+          var nextCandidate = candidate[i];
+          double distanceValue = CalculateBestDistance(nextCandidate, solutionList);
+          if (aux < distanceValue)
+          {
+            index = i;
+            aux = distanceValue;
+          }
+          i++;
+        }
+
+        // add the selected to res and remove from candidate list
+        var removedSolution = candidate[index];
+        candidate.RemoveAt(index);
+        resultSolutionList.Add((DynamicALPSSolution)removedSolution.Clone());
+      }
+
+      return resultSolutionList;
+    }
+
+    private static double ScalarizingFitnessFunction(IDynamicALPSSolution currentBest, double[] lambda_moead, double[] idealPoint)
+    {
+      double maxFun = -1.0e+30;
+
+      for (int n = 0; n < idealPoint.Length; n++)
+      {
+        double diff = Math.Abs(currentBest.Qualities[n] - idealPoint[n]);
+
+        double functionValue;
+        if (lambda_moead[n] == 0)
+        {
+          functionValue = 0.0001 * diff;
+        }
+        else
+        {
+          functionValue = diff * lambda_moead[n];
+        }
+        if (functionValue > maxFun)
+        {
+          maxFun = functionValue;
+        }
+      }
+
+      return maxFun;
+    }
+
+    public static void UpdateIdeal(this double[] idealPoint, double[] point)
+    {
+      for (int i = 0; i < point.Length; ++i)
+      {
+        if (double.IsInfinity(point[i]) || double.IsNaN(point[i]))
+        {
+          continue;
+        }
+
+        if (idealPoint[i] > point[i])
+        {
+          idealPoint[i] = point[i];
+        }
+      }
+    }
+
+    public static void UpdateNadir(this double[] nadirPoint, double[] point)
+    {
+      for (int i = 0; i < point.Length; ++i)
+      {
+        if (double.IsInfinity(point[i]) || double.IsNaN(point[i]))
+        {
+          continue;
+        }
+
+        if (nadirPoint[i] < point[i])
+        {
+          nadirPoint[i] = point[i];
+        }
+      }
+    }
+
+    public static void UpdateIdeal(this double[] idealPoint, IList<IDynamicALPSSolution> solutions)
+    {
+      foreach (var s in solutions)
+      {
+        idealPoint.UpdateIdeal(s.Qualities);
+      }
+    }
+
+    public static void UpdateNadir(this double[] nadirPoint, IList<IDynamicALPSSolution> solutions)
+    {
+      foreach (var s in solutions)
+      {
+        nadirPoint.UpdateNadir(s.Qualities);
+      }
+    }
+
+    private static double CalculateBestDistance(IDynamicALPSSolution solution, IList<IDynamicALPSSolution> solutionList)
+    {
+      var best = solutionList.Min(x => EuclideanDistance(solution.Qualities, x.Qualities));
+      if (double.IsNaN(best) || double.IsInfinity(best))
+      {
+        best = double.MaxValue;
+      }
+      return best;
+    }
+
+    public static double EuclideanDistance(double[] a, double[] b)
+    {
+      if (a.Length != b.Length)
+      {
+        throw new ArgumentException("Euclidean distance: the arrays have different lengths.");
+      }
+
+      var distance = 0d;
+      for (int i = 0; i < a.Length; ++i)
+      {
+        var d = a[i] - b[i];
+        distance += d * d;
+      }
+      return Math.Sqrt(distance);
+    }
+  }
+}
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/HeuristicLab.Algorithms.DynamicALPS-3.4.csproj
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/HeuristicLab.Algorithms.DynamicALPS-3.4.csproj	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/HeuristicLab.Algorithms.DynamicALPS-3.4.csproj	(revision 17479)
@@ -0,0 +1,271 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{15452B9F-A436-4139-8EE7-DA72FB8D3664}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Algorithms.DynamicALPS</RootNamespace>
+    <AssemblyName>HeuristicLab.Algorithms.DynamicALPS-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HEAL.Attic.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Algorithms.NSGA2-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Algorithms.NSGA2-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimizer-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Optimizer-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence.GUI-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Persistence.GUI-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.GeneticProgramming-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.GeneticProgramming-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances.DataAnalysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.Instances.DataAnalysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.TestFunctions-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.TestFunctions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.TestFunctions.MultiObjective-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.TestFunctions.MultiObjective-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.SequentialEngine-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.SequentialEngine-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DynamicALPSAlgorithm.cs" />
+    <Compile Include="DynamicALPSAlgorithmBase.cs" />
+    <Compile Include="DynamicALPSASolution.cs" />
+    <Compile Include="DynamicALPSUtil.cs" />
+    <None Include="app.config" />
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+  <PropertyGroup>
+    <PostBuildEvent>
+    </PostBuildEvent>
+  </PropertyGroup>
+</Project>
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs	(revision 17479)
@@ -0,0 +1,44 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.DynamicALPS
+{
+  [Plugin("HeuristicLab.Algorithms.DynamicALPS", "Provides the multi-objective evolutonary algorithm based on decomposition (DynamicALPS) as described by Zhang and Li: DynamicALPS: A Multiobjective Evolutionary Algorithm Based on Decomposition, IEEE Transactions on Evolutionary Computation, Volume 11, Issue 6, Dec. 2007, pp. 712-731", "3.4.25.16714")]
+  [PluginFile("HeuristicLab.Algorithms.DynamicALPS-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Attic", "1.0")]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.TestFunctions.MultiObjective", "3.3")]
+  public class HeuristicLabAlgorithmsDynamicALPSPlugin : PluginBase
+  {
+  }
+}
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs.frame
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs.frame	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs.frame	(revision 17479)
@@ -0,0 +1,44 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.SMSEMOA
+{
+  [Plugin("HeuristicLab.Algorithms.SMSEMOA", "Provides the multi-objective evolutonary algorithm based on decomposition (SMSEMOA) as described by Zhang and Li: SMSEMOA: A Multiobjective Evolutionary Algorithm Based on Decomposition, IEEE Transactions on Evolutionary Computation, Volume 11, Issue 6, Dec. 2007, pp. 712-731", "3.4.25.16714")]
+  [PluginFile("HeuristicLab.Algorithms.SMSEMOA-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Attic", "1.0")]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.TestFunctions.MultiObjective", "3.3")]
+  public class HeuristicLabAlgorithmsSMSEMOAPlugin : PluginBase
+  {
+  }
+}
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs	(revision 17479)
@@ -0,0 +1,57 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Algorithms.SMSEMOA")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HEAL")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7d0fdb00-8511-45a2-ae51-c830b0c9b548")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.15.17425")]
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs.frame	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs.frame	(revision 17479)
@@ -0,0 +1,57 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Algorithms.SMSEMOA")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HEAL")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7d0fdb00-8511-45a2-ae51-c830b0c9b548")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.15.$WCREV$")]
Index: branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/app.config
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/app.config	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/HeuristicLab.Algorithms.DynamicALPS/3.4/app.config	(revision 17479)
@@ -0,0 +1,11 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-3.7.0.0" newVersion="3.7.0.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
Index: branches/3057_DynamicALPS/backup/13022020/PreBuildEvent.cmd
===================================================================
--- branches/3057_DynamicALPS/backup/13022020/PreBuildEvent.cmd	(revision 17479)
+++ branches/3057_DynamicALPS/backup/13022020/PreBuildEvent.cmd	(revision 17479)
@@ -0,0 +1,11 @@
+IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+GOTO Done
+
+:Error_Handling
+ECHO There was an error while running subwcrev. Please verify that the *.cs.frame files have been correctly converted to *.cs files, otherwise HeuristicLab won't build. 
+exit 0
+
+:Done
Index: branches/3057_DynamicALPS/backup/17032020/Build.cmd
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/Build.cmd	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/Build.cmd	(revision 17479)
@@ -0,0 +1,2 @@
+@ECHO OFF
+powershell.exe .\Build.ps1
Index: branches/3057_DynamicALPS/backup/17032020/Build.ps1
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/Build.ps1	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/Build.ps1	(revision 17479)
@@ -0,0 +1,130 @@
+﻿# find ms build
+$programFilesX86Dir = ($Env:ProgramFiles, ${Env:ProgramFiles(x86)})[[bool]${Env:ProgramFiles(x86)}]
+$locations = @(
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Enterprise", "MSBuild", "15.0", "Bin", "amd64")
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Enterprise", "MSBuild", "15.0", "Bin")
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Community", "MSBuild", "15.0", "Bin", "amd64")
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "Community", "MSBuild", "15.0", "Bin")
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "BuildTools", "MSBuild", "15.0", "Bin", "amd64"),
+  [System.IO.Path]::Combine($programFilesX86Dir, "Microsoft Visual Studio", "2017", "BuildTools", "MSBuild", "15.0", "Bin")
+)
+
+$msBuildPath = $undefined
+Foreach ($loc in $locations) {
+  $loc = [System.IO.Path]::Combine($loc, "MSBuild.exe")
+  If ([System.IO.File]::Exists($loc)) {
+    $msBuildPath = $loc
+    Break;
+  }
+}
+
+Try {
+  If ($msBuildPath -eq $undefined) {
+    "Could not locate MSBuild, ABORTING ..."
+    Return
+  }
+
+  $curPath = $MyInvocation.MyCommand.Path
+  $curDir = Split-Path $curPath
+
+  $slnFiles = Get-ChildItem $curDir -Filter *.sln
+
+  If ($slnFiles.Count -le 0) {
+    "No solutions found, ABORTING ..."
+    Return
+  }
+
+  $slnIndices = @()
+
+  If ($slnFiles.Count -eq 1) {
+    "Selecting the only solution found: `"{0}`"" -f $slnFiles[0].Name
+    $slnIndices += 0
+  } Else {
+    "Found the following solutions:"
+
+    ""
+
+    $slnFiles | % { $i = 0 } { ("  {0}. `"{1}`"" -f ($i + 1), $_.Name); $i++ }
+
+    ""
+
+    $success = $false
+
+    # query solution to build
+    $slnIndex = -1
+    Do {
+        $input = Read-Host "Which solution(s) to build? (e.g.: 1 2 3) { 1..$($slnFiles.Count) }"
+        $inputParts = $input -Split " "
+
+        Foreach ($part in $inputParts) {
+          If ($part -eq "") { Continue }
+
+          $success = [int]::TryParse($part, [ref]$slnIndex) -and ($slnIndex -gt 0) -and ($slnIndex -le $slnFiles.Count)
+
+          If ($success) {
+            $slnIndices += $slnIndex - 1
+          } Else {
+            $slnIndices = @()
+            Break
+          }
+        }
+    } While (-Not $success)
+
+    $slnIndices = $slnIndices | Select-Object -Unique
+  }
+
+
+  # query configuration to build
+  $config = "Release"
+  $input = Read-Host "Which configuration to build? [$($config)]"
+  $config = ($config, $input)[[bool]$input]
+
+  # query platform to build
+  $platform = "Any CPU"
+  $input = Read-Host "Which platform to build? [$($platform)]"
+  $platform = ($platform, $input)[[bool]$input]
+
+  # query clean desire
+  $clean = $false
+  Do {
+      $input = Read-Host "Would you like to clean before building? [y/N]"
+      $input = ([string]("n", $input)[[bool]$input]).ToLowerInvariant()
+      $success = $input -eq "n" -or ($clean = $input -eq "y")
+  } While (-Not $success)
+
+  ""
+
+  If ($clean) {
+    Foreach ($slnIndex in $slnIndices) {
+      $solution = $slnFiles[$slnIndex]
+      "Cleaning `"$($solution.Name)`" ..."
+      $args = @(
+        $solution.FullName,
+        "/t:Clean",
+        "/p:Configuration=`"$config`",Platform=`"$platform`"",
+        "/m", "/nologo", "/verbosity:q", "/clp:ErrorsOnly"
+      )
+      & $msBuildPath $args
+      "===== CLEAN FINISHED ====="
+    }
+  }
+
+  Foreach ($slnIndex in $slnIndices) {
+    $solution = $slnFiles[$slnIndex]
+    "Building `"$($solution.Name)`" ($config|$platform) ..."
+    $args = @(
+      $solution.FullName,
+      "/t:Build",
+      "/p:Configuration=`"$config`",Platform=`"$platform`"",
+      "/m", "/nologo", "/verbosity:q", "/clp:ErrorsOnly"
+    )
+    & $msBuildPath $args
+    "===== BUILD FINISHED ====="
+  }
+} Finally {
+  ""
+
+  Write-Host -NoNewline "Press any key to continue ... "
+
+  [void][System.Console]::ReadKey($true)
+}
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS-3.4.sln
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS-3.4.sln	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS-3.4.sln	(revision 17479)
@@ -0,0 +1,37 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29519.181
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.DynamicALPS-3.4", "HeuristicLab.Algorithms.DynamicALPS\3.4\HeuristicLab.Algorithms.DynamicALPS-3.4.csproj", "{15452B9F-A436-4139-8EE7-DA72FB8D3664}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|x64.ActiveCfg = Debug|x64
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|x64.Build.0 = Debug|x64
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|x86.ActiveCfg = Debug|x86
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Debug|x86.Build.0 = Debug|x86
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|Any CPU.Build.0 = Release|Any CPU
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|x64.ActiveCfg = Release|x64
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|x64.Build.0 = Release|x64
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|x86.ActiveCfg = Release|x86
+		{15452B9F-A436-4139-8EE7-DA72FB8D3664}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {869173B1-B417-4ED0-9A2F-8F42578EA993}
+	EndGlobalSection
+EndGlobal
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSASolution.cs
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSASolution.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSASolution.cs	(revision 17479)
@@ -0,0 +1,152 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Algorithms.DynamicALPS
+{
+  [StorableType("F405DFE4-CCC9-4CAF-9EFC-1AF45DC81FE6")]
+
+  public interface IDynamicALPSSolution : IItem {
+    IItem Individual { get; set; }
+    double[] Qualities { get; set; }
+    double[] Constraints { get; set; }
+    // KF, SMS-EMOA
+    double[] HypervolumeContribution { get; set; }
+    int[] NondominanceRanking { get; set; }
+
+    // KF, DynamicALPS, could also be used for any self-adpative EA
+    double IndividualPc { get; set; }   // individual crossover rate
+    double IndividualPm { get; set; }   // individual mutation rate
+    int Age { get; set; }               // age info for ALPS
+
+    int Dimensions { get; }
+  }
+
+
+
+  [Item("DynamicALPSSolution", "Represents a solution inside the DynamicALPS population")]
+  [StorableType("457A8E67-2B70-4767-896B-47056BD89732")]
+  public class DynamicALPSSolution : Item, IDynamicALPSSolution
+  {
+    [Storable]
+    public IItem Individual { get; set; }
+
+    [Storable]
+    public double[] Qualities { get; set; }
+
+    [Storable]
+    public double[] Constraints { get; set; }
+
+    //kf, sms-emoa
+    [Storable]
+    public double[] HypervolumeContribution { get; set; }
+
+    [Storable]
+    public int[] NondominanceRanking { get; set; }
+
+    [Storable]
+    public double IndividualPc { get; set; }
+
+    [Storable]
+    public double IndividualPm { get; set; }
+
+    [Storable]
+    public int Age { get; set; }
+
+    public DynamicALPSSolution(int nObjectives, int nConstraints)
+    {
+      Qualities = new double[nObjectives];
+      Constraints = new double[nConstraints];
+      HypervolumeContribution = new double[1];
+      NondominanceRanking = new int[1];
+      IndividualPc = 0;
+      IndividualPm = 0;
+      Age = 0;
+    }
+
+    public DynamicALPSSolution(IItem individual, int nObjectives, int nConstraints) : this(nObjectives, nConstraints)
+    {
+      Individual = individual;
+    }
+
+    public DynamicALPSSolution(IItem individual, double[] qualities, double[] constraints, double[] hypervolumecontribution, int[] nondominanceranking)
+    {
+      Individual = individual;
+      Qualities = qualities;
+      Constraints = constraints;
+      HypervolumeContribution = hypervolumecontribution;
+      NondominanceRanking = nondominanceranking;
+    }
+
+    public DynamicALPSSolution(double[] qualities)
+    {
+      Qualities = (double[])qualities.Clone();
+    }
+
+    public int Dimensions => Qualities == null ? 0 : Qualities.Length;
+
+    public override IDeepCloneable Clone(Cloner cloner)
+    {
+      return new DynamicALPSSolution(this, cloner);
+    }
+
+    protected DynamicALPSSolution(DynamicALPSSolution original, Cloner cloner) : base(original, cloner)
+    {
+      Qualities = (double[])original.Qualities.Clone();
+      Constraints = (double[])original.Qualities.Clone();
+      HypervolumeContribution = (double[])original.HypervolumeContribution.Clone();       // kf, sms-emoa
+      NondominanceRanking = (int[])original.NondominanceRanking.Clone();                  // kf, sms-emoa
+      Individual = (IItem)original.Individual.Clone(cloner);
+    }
+
+    [StorableConstructor]
+    protected DynamicALPSSolution(StorableConstructorFlag deserializing) : base(deserializing) { }
+  }
+
+  [Item("DynamicALPSSolution", "Represents a solution inside the DynamicALPS population")]
+
+
+
+  [StorableType("1EFC2459-C52E-4F95-9E14-23E69DCB23E0")]
+  public class DynamicALPSSolution<T> : DynamicALPSSolution where T : class, IItem
+  {
+    public new T Individual
+    {
+      get { return (T)base.Individual; }
+      set { base.Individual = value; }
+    }
+
+    public DynamicALPSSolution(T individual, int nObjectives, int nConstraints) : base(individual, nObjectives, nConstraints) { }
+
+    protected DynamicALPSSolution(DynamicALPSSolution<T> original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner)
+    {
+      return new DynamicALPSSolution<T>(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected DynamicALPSSolution(StorableConstructorFlag deserializing) : base(deserializing) { }
+  }
+}
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithm.cs
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithm.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithm.cs	(revision 17479)
@@ -0,0 +1,249 @@
+﻿#region License Information
+/* HeuristicLab
+ * Author: Kaifeng Yang
+ * 
+ * Copyright (C) 2002-2019 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/>.
+ */
+
+// SMS-EMOA
+/*
+Implemenetation of a real-coded SMS_EMOA algorithm.
+This implementation follows the description of: 'M. Emmerich, N. Beume, and B. Naujoks. 
+An EMO Algorithm Using the Hypervolume Measure as Selection Criterion.EMO 2005.'
+*/
+#endregion
+
+using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Random;
+using System.Linq;
+using System;
+using CancellationToken = System.Threading.CancellationToken;
+using HeuristicLab.Analysis;
+using HeuristicLab.Problems.TestFunctions.MultiObjective;
+using HeuristicLab.Optimization;
+using System.Collections.Generic;
+
+
+/*  This algorithm is SMS-EMOA implementation on HL. The main structure and interfaces with HL are copied from MOEA/D on HL, which was written by Dr. Bogdan Burlacu. The S-metric selection operator was adapted from Kaifeng's MATLAB toolbox in SMS-EMOA. The computational complexity of HVC is AT LEAST $O (n^2 \log n)$ in 2-D and 3-D cases. HVC should definitely be reduced to $\Theta (n \times \log n)$. 
+ *  
+ *  This algorithm assumes: 
+ *    1. minimization problems. For maximization problems, it is better to add "-" symbol.
+ *  
+ *  This algorithm works on:
+ *    1. continuous, discrete, mixed-integer MOO problems. For different types of problems, the operators should be adjusted accordingly. 
+ *    2. both multi-objective and many-objective problems. For many-objective problems, the bottleneck is the computational complexity of HV. 
+ * 
+ * This algorithm is the basic implementation of SMS-EMOA, proposed by Michael Emmerich et. al. Some potential improvements can be: 
+ *    1. Dynamic reference point strategy
+ *    2. Normalized fitness value strategy ---- desirability function. See, Yali, Longmei, Kaifeng, Michael Emmerich CEC paper. 
+ *    3. HVC calculation should definitely be improved, at least in the 2D and 3D cases.
+ *    4. multiple point strategy when $\lambda>1$ 
+ *    5. multiple reference points strategy, in ICNC 2016, Zhiwei Yang et. al. 
+ *    6. HVC approximation by R2 for MANY OBJECTIVE cases, by Ishibushi 2019, IEEE TEC  
+ *    7. Maybe: See maps 
+ * 
+ * Global parameters:
+ *    1. population  
+ *    
+ * Many thanks for Bogdan Burlacu and Johannes Karder, especially Bogdan for his explanation, help, and supports. 
+ */
+
+namespace HeuristicLab.Algorithms.DynamicALPS {
+  // Format: 
+  // The indexed name of the algorithm/item, Description of the algorithm/item in HL  
+  [Item("DynamicALPS-MainLoop", "DynamicALPS-MainLoop implementation adapted from SMS-EMOA in HL.")]
+
+  // Call "HeuristicLab.Core"
+  // Define the category of this class. 
+  [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 125)]
+
+  // Call "HEAL.Attic"
+  // Define GUID for this Class
+  [StorableType("A7F33D16-3495-43E8-943C-8A919123F541")]
+
+  public class DynamicALPSAlgorithm : DynamicALPSAlgorithmBase {
+    public DynamicALPSAlgorithm() { }
+
+    protected DynamicALPSAlgorithm(DynamicALPSAlgorithm original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DynamicALPSAlgorithm(this, cloner);
+    }
+
+    [StorableConstructor]
+    protected DynamicALPSAlgorithm(StorableConstructorFlag deserializing) : base(deserializing) { }
+
+    protected override void Run(CancellationToken cancellationToken) {
+      if (previousExecutionState != ExecutionState.Paused) { // Call "base" class, DynamicALPSAlgorithmBase
+        InitializeAlgorithm(cancellationToken);
+      }
+
+
+      var populationSize = PopulationSize.Value;
+      bool[] maximization = ((BoolArray)Problem.MaximizationParameter.ActualValue).CloneAsArray();
+
+      var crossover = Crossover;
+      var crossoverProbability = CrossoverProbability.Value;
+      var mutator = Mutator;
+      var mutationProbability = MutationProbability.Value;
+      var evaluator = Problem.Evaluator;
+      var analyzer = Analyzer;
+      var rand = RandomParameter.Value;
+
+
+      var maximumEvaluatedSolutions = MaximumEvaluatedSolutions.Value;
+
+
+      int lambda = 1;            // the size of offspring 
+
+
+      int nLayerALPS = ALPSLayers.Value;
+      int counterLayerALPS = 0;
+
+      // IMPROVE: ........
+      int[] ageGapArray = new int[] { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
+      int[] numberDiscard = new int[10];
+
+
+
+      activeLayer = new bool[nLayerALPS];
+      int[][] ageMatrix = new int[nLayerALPS][];      // layer * population size
+
+
+
+      // cancellation token for the inner operations which should not be immediately cancelled
+      var innerToken = new CancellationToken();
+
+
+      // run some analyzer on each layer (for now calculate scatter plots )
+      List<Tuple<int, ScatterPlotAnalyzer>> layerAnalyzers;
+
+
+      // 12022020
+      layerPopulation = new IDynamicALPSSolution[nLayerALPS][];
+      layerOffspringPopulation = new IDynamicALPSSolution[nLayerALPS][];
+      layerJointPopulation = new IDynamicALPSSolution[nLayerALPS][];
+      layerDiscardPopulation = new IDynamicALPSSolution[nLayerALPS][];
+
+
+      layerPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize];
+      // BUG: The size of offspring should vary in different layers!!!!
+      layerOffspringPopulation[counterLayerALPS] = new IDynamicALPSSolution[lambda];
+      layerDiscardPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize];
+      population.CopyTo(layerPopulation[counterLayerALPS], 0);
+
+      activeLayer[counterLayerALPS] = true;
+      for (int i = 0; i < nLayerALPS; i++) {
+        if (i == 0) {
+          activeLayer[i] = true;
+        }
+        else { activeLayer[i] = false; }
+        numberDiscard[i] = 0;
+      }
+
+      // Mainloop 
+      while (evaluatedSolutions < maximumEvaluatedSolutions && !cancellationToken.IsCancellationRequested) {
+        for (int i = 0; i < nLayerALPS; i++) {            // loop for every layer
+          int discardedIndividualIndex = 0;
+          if (activeLayer[i] == true) {                   // check the layer is active or not. 
+            evaluatedSolutions = SMSEMOA(populationSize, lambda, i);
+            if (evaluatedSolutions >= maximumEvaluatedSolutions) { break; }           // check evaluation budget
+            ageMatrix[i] = layerJointPopulation[i].Select(x => x.Age).ToArray();      // get age info of the current layer joint population 
+            if (ageMatrix[i].Max() > ageGapArray[i]) {    // mature: moving 
+              discardedIndividualIndex = ageMatrix[i].ToList().IndexOf(ageMatrix[i].Max());   // BUG when two individual has the same maximal age???? NOT POSSBILE IN SMS-EMOA 
+              layerDiscardPopulation[i][numberDiscard[i]] = layerJointPopulation[i][discardedIndividualIndex];                    // move the individual to the next layer 
+              layerJointPopulation[i].Where((x, idx) => idx != discardedIndividualIndex).ToArray().CopyTo(layerPopulation[i], 0); // discard the indivudal in the current layer  
+              numberDiscard[i] += 1;
+              if (activeLayer[i + 1] == false) {   // next layer is not active  // bug, if i == number of layer,  out of range .
+                if (numberDiscard[i] == populationSize) {
+                  InitializeLayer(i + 1, populationSize, lambda);  // initilizae the layerPopulation for the next layer && ACTIVE FLAGE
+                  layerDiscardPopulation[i].CopyTo(layerPopulation[i + 1], 0);
+                  numberDiscard[i] = 0;
+                }
+                else {
+                  // number of matured individuals < population size in the next layer
+                }
+              }
+              else {  // next layer is active
+                layerPopulation[i+1].CopyTo(layerJointPopulation[i + 1], 0);
+                layerJointPopulation[i].Where((x, idx) => idx == discardedIndividualIndex).ToArray().CopyTo(layerJointPopulation[i + 1], populationSize);
+                SmetricSelection(lambda, i + 1); // AGE and HVC 
+                numberDiscard[i] = 0;
+              }
+            }
+            layerPopulation[i].CopyTo(population, 0);  // BUG: should copy all the active layers to population.
+          }
+          else {
+            // Some thing wrong? lol nothing wrong here ^_^
+          }
+        }
+
+
+
+        // run analyzer
+        var analyze = executionContext.CreateChildOperation(analyzer, globalScope);
+        ExecuteOperation(executionContext, innerToken, analyze);
+        // update Pareto-front approximation sets
+        UpdateParetoFronts();
+        // Show some results in the GUI.
+        Results.AddOrUpdateResult("IdealPoint", new DoubleArray(IdealPoint));
+        Results.AddOrUpdateResult("NadirPoint", new DoubleArray(NadirPoint));
+        Results.AddOrUpdateResult("Evaluated Solutions", new IntValue(evaluatedSolutions));
+
+        var allLayerResults = new ResultCollection();
+        Results.AddOrUpdateResult("LayerResults", allLayerResults);
+        
+        // run layer analyzers
+        for (int i = 0; i < activeLayer.Length; ++i) {
+          if (!activeLayer[i]) continue;
+          var scope = new Scope($"Layer {i}");
+          var layer = layerPopulation[i];
+          var layerResults = new ResultCollection();
+          allLayerResults.Add(new Result(scope.Name, layerResults));
+
+          var problem = (MultiObjectiveTestFunctionProblem)Problem;
+          //scope.Variables.Add(new Variable("Individuals", new ItemArray<IScope>(layer.Select(x => (IScope)x.Individual))));
+          //scope.Variables.Add(new Variable("Qualities", new ItemArray<DoubleArray>(layer.Select(x => new DoubleArray(x.Qualities)))));
+          scope.SubScopes.AddRange(layer.Select(x => (IScope)x.Individual));
+          scope.Variables.Add(new Variable("Results", layerResults));
+          scope.Variables.Add(new Variable("TestFunction", problem.TestFunction));
+          var scatterPlotAnalyzer = new ScatterPlotAnalyzer();
+          scatterPlotAnalyzer.IndividualsParameter.ActualName = "RealVector";
+          var scattetPlotAnalyzerContext = executionContext.CreateChildOperation(scatterPlotAnalyzer, scope);
+          ExecuteOperation(executionContext, CancellationToken.None, scattetPlotAnalyzerContext);
+          scope.SubScopes.Clear();
+          scope.Variables.Clear();
+        }
+
+        // Update globalScope
+        globalScope.SubScopes.Replace(population.Select(x => (IScope)x.Individual));
+
+
+        //// intilize the population for the next layer
+        //counterLayerALPS += 1;
+        //layerPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize];
+        //layerPopulation[counterLayerALPS-1].CopyTo(layerPopulation[counterLayerALPS], 0); // DETELTE DUBGU 
+        //// BUG lambda should be different~~~~!!!!
+        //layerOffspringPopulation[counterLayerALPS] = new IDynamicALPSSolution[lambda];
+      }
+    }
+  }
+}
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithmBase.cs
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithmBase.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSAlgorithmBase.cs	(revision 17479)
@@ -0,0 +1,875 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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
+
+// 03/02/2020
+// TODO LIST:                                                                     
+// 1. Dynamic reference point strategy                                               
+// 2. Normalized fitness value strategy, desibility function.                         
+// 3. HVC calculation should be definitely improved, at least in the 2D case.
+// 4. multiple point strategy when $\lambda>1$ 
+
+using HEAL.Attic;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.ExpressionGenerator;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.TestFunctions.MultiObjective;
+using HeuristicLab.Random;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using CancellationToken = System.Threading.CancellationToken;
+
+namespace HeuristicLab.Algorithms.DynamicALPS {
+  [Item("DynamicALPSAlgorithmBase", "Base class for all DynamicALPS algorithm variants.")]
+  [StorableType("C0141748-DF5A-4CA0-A3DD-1DFB98236F7E")]
+  public abstract class DynamicALPSAlgorithmBase : BasicAlgorithm {
+    #region data members
+ 
+    [StorableType("75C9EA99-D699-4A1F-8AB2-AB86B7A2FD68")]
+    protected enum NeighborType { NEIGHBOR, POPULATION }
+
+
+    [StorableType("2A71E397-05CE-460F-B982-EE2F4B37C354")]
+    // TCHE = Chebyshev (Tchebyshev)
+    // PBI  = Penalty-based boundary intersection
+    // AGG  = Weighted sum
+    public enum FunctionType { TCHE, PBI, AGG }
+
+    [Storable]
+    protected double[] IdealPoint { get; set; }
+    [Storable]
+    protected double[] NadirPoint { get; set; } // potentially useful for objective normalization
+
+    [Storable]
+    protected double[][] lambda_moead;
+
+    [Storable]
+    protected int[][] neighbourhood;
+
+    [Storable]
+    protected IDynamicALPSSolution[] solutions;
+
+    [Storable]
+    protected FunctionType functionType;
+
+    [Storable]
+    protected IDynamicALPSSolution[] population;
+
+    [Storable]
+    protected IDynamicALPSSolution[][] layerPopulation;
+
+    [Storable]
+    protected bool[] activeLayer;
+
+    [Storable]
+    protected IDynamicALPSSolution[][] layerDiscardPopulation;
+
+    [Storable]
+    protected IDynamicALPSSolution[][] layerOffspringPopulation;
+
+    [Storable]
+    protected IDynamicALPSSolution[][] layerJointPopulation;
+
+    [Storable]
+    protected IDynamicALPSSolution[] offspringPopulation;
+
+    //[Storable]
+    //protected IDynamicALPSSolution[] jointPopulation;
+
+    [Storable]
+    protected int evaluatedSolutions;
+
+    [Storable]
+    protected ExecutionContext executionContext;
+
+    [Storable]
+    protected IScope globalScope;
+
+    [Storable]
+    protected ExecutionState previousExecutionState;
+
+    [Storable]
+    protected ExecutionState executionState;
+
+    private DoubleArray ReferencePoint {
+      get {
+        var problem = (MultiObjectiveTestFunctionProblem)Problem;
+        return problem.ReferencePoint;
+      }
+    }
+    #endregion
+
+    #region parameters
+    private const string SeedParameterName = "Seed";
+    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    private const string PopulationSizeParameterName = "PopulationSize";
+    private const string ResultPopulationSizeParameterName = "ResultPopulationSize";
+    private const string CrossoverProbabilityParameterName = "CrossoverProbability";
+    private const string CrossoverParameterName = "Crossover";
+    private const string MutationProbabilityParameterName = "MutationProbability";
+    private const string MutatorParameterName = "Mutator";
+    private const string MaximumEvaluatedSolutionsParameterName = "MaximumEvaluatedSolutions";
+    private const string RandomParameterName = "Random";
+    private const string AnalyzerParameterName = "Analyzer";
+    // MOEA-D parameters
+    //private const string NeighbourSizeParameterName = "NeighbourSize";
+    //private const string NeighbourhoodSelectionProbabilityParameterName = "NeighbourhoodSelectionProbability";
+    //private const string MaximumNumberOfReplacedSolutionsParameterName = "MaximumNumberOfReplacedSolutions";
+    //private const string FunctionTypeParameterName = "FunctionType";
+    // private const string NormalizeObjectivesParameterName = "NormalizeObjectives";
+
+    // SMS-EMOA parameters: 
+    private const string LambdaParameterName = "Lambda";   // The number of offspring size 
+    private const string ALPSLayersParameterName = "ALPSLayers";   // The number of offspring size 
+    private const string ALPSAgeGapParameterName = "ALPSAgeGap";   // The number of offspring size 
+
+
+
+    // "Parameters" are defined in "HeuristicLab.Parameters"
+    // Contains: generic parameters of every class/algorithm/instance, 
+    // It seems that "I***ValueParameter" is declared in "Heuristic.core", where "***ValueParameter" are defined in "HeuristicLab.Parameter"
+    // The function of "I***ValueParameter" is to bridge current scripts to "HeuristicLab.Parameter". 
+    public IValueParameter<MultiAnalyzer> AnalyzerParameter {
+      get { return (ValueParameter<MultiAnalyzer>)Parameters[AnalyzerParameterName]; }
+    }
+
+    //public IConstrainedValueParameter<StringValue> FunctionTypeParameter
+    //{
+    //  get { return (IConstrainedValueParameter<StringValue>)Parameters[FunctionTypeParameterName]; }
+    //}
+    //public IFixedValueParameter<IntValue> NeighbourSizeParameter
+    //{
+    //  get { return (IFixedValueParameter<IntValue>)Parameters[NeighbourSizeParameterName]; }
+    //}
+    //public IFixedValueParameter<BoolValue> NormalizeObjectivesParameter
+    //{
+    //  get { return (IFixedValueParameter<BoolValue>)Parameters[NormalizeObjectivesParameterName]; }
+    //}
+    //public IFixedValueParameter<IntValue> MaximumNumberOfReplacedSolutionsParameter
+    //{
+    //  get { return (IFixedValueParameter<IntValue>)Parameters[MaximumNumberOfReplacedSolutionsParameterName]; }
+    //}
+    //public IFixedValueParameter<DoubleValue> NeighbourhoodSelectionProbabilityParameter
+    //{
+    //  get { return (IFixedValueParameter<DoubleValue>)Parameters[NeighbourhoodSelectionProbabilityParameterName]; }
+    //}
+    public IFixedValueParameter<IntValue> SeedParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[SeedParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; }
+    }
+    private IValueParameter<IntValue> PopulationSizeParameter {
+      get { return (IValueParameter<IntValue>)Parameters[PopulationSizeParameterName]; }
+    }
+    // KF, SMS-EMOA
+    private IValueParameter<IntValue> LambdaParameter {
+      get { return (IValueParameter<IntValue>)Parameters[LambdaParameterName]; }
+    }
+    //// KF, DynamicALPS
+    private IValueParameter<IntValue> ALPSLayersParameter{
+      get { return (IValueParameter<IntValue>)Parameters[ALPSLayersParameterName]; }
+    }
+    private IValueParameter<IntValue> ALPSAgeGapParameter {
+      get { return (IValueParameter<IntValue>)Parameters[ALPSAgeGapParameterName]; }
+    }
+
+    private IValueParameter<IntValue> ResultPopulationSizeParameter {
+      get { return (IValueParameter<IntValue>)Parameters[ResultPopulationSizeParameterName]; }
+    }
+
+    public IValueParameter<PercentValue> CrossoverProbabilityParameter {
+      get { return (IValueParameter<PercentValue>)Parameters[CrossoverProbabilityParameterName]; }
+    }
+    public IConstrainedValueParameter<ICrossover> CrossoverParameter {
+      get { return (IConstrainedValueParameter<ICrossover>)Parameters[CrossoverParameterName]; }
+    }
+    public IValueParameter<PercentValue> MutationProbabilityParameter {
+      get { return (IValueParameter<PercentValue>)Parameters[MutationProbabilityParameterName]; }
+    }
+    public IConstrainedValueParameter<IManipulator> MutatorParameter {
+      get { return (IConstrainedValueParameter<IManipulator>)Parameters[MutatorParameterName]; }
+    }
+    public IValueParameter<IntValue> MaximumEvaluatedSolutionsParameter {
+      get { return (IValueParameter<IntValue>)Parameters[MaximumEvaluatedSolutionsParameterName]; }
+    }
+    public IValueParameter<IRandom> RandomParameter {
+      get { return (IValueParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
+    #endregion
+
+    #region parameter properties
+    public new IMultiObjectiveHeuristicOptimizationProblem Problem {
+      get { return (IMultiObjectiveHeuristicOptimizationProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+    public int Seed {
+      get { return SeedParameter.Value.Value; }
+      set { SeedParameter.Value.Value = value; }
+    }
+    public bool SetSeedRandomly {
+      get { return SetSeedRandomlyParameter.Value.Value; }
+      set { SetSeedRandomlyParameter.Value.Value = value; }
+    }
+    public IntValue PopulationSize {
+      get { return PopulationSizeParameter.Value; }
+      set { PopulationSizeParameter.Value = value; }
+    }
+    public IntValue Lambda {
+      get { return LambdaParameter.Value; }
+      set { LambdaParameter.Value = value; }
+    }
+
+    public IntValue ResultPopulationSize {
+      get { return ResultPopulationSizeParameter.Value; }
+      set { ResultPopulationSizeParameter.Value = value; }
+    }
+
+    public IntValue ALPSLayers {
+      get { return ALPSLayersParameter.Value; }
+      set { ALPSLayersParameter.Value = value; }
+    }
+
+    public IntValue ALPSAgeGap {
+      get { return ALPSAgeGapParameter.Value; }
+      set { ALPSAgeGapParameter.Value = value; }
+    }
+
+    public PercentValue CrossoverProbability {
+      get { return CrossoverProbabilityParameter.Value; }
+      set { CrossoverProbabilityParameter.Value = value; }
+    }
+    public ICrossover Crossover {
+      get { return CrossoverParameter.Value; }
+      set { CrossoverParameter.Value = value; }
+    }
+    public PercentValue MutationProbability {
+      get { return MutationProbabilityParameter.Value; }
+      set { MutationProbabilityParameter.Value = value; }
+    }
+    public IManipulator Mutator {
+      get { return MutatorParameter.Value; }
+      set { MutatorParameter.Value = value; }
+    }
+    public MultiAnalyzer Analyzer {
+      get { return AnalyzerParameter.Value; }
+      set { AnalyzerParameter.Value = value; }
+    }
+    public IntValue MaximumEvaluatedSolutions {
+      get { return MaximumEvaluatedSolutionsParameter.Value; }
+      set { MaximumEvaluatedSolutionsParameter.Value = value; }
+    }
+    #endregion
+
+    #region constructors
+    public DynamicALPSAlgorithmBase() {
+      // Add or define or specify the parameters that may be use in SMS-EMOA.   
+      // ***("Name", "Description", "Value")
+      //  Name                            Type                Description
+      //  FixedValueParameter:            ANY                 Not changed???
+      //  ValueParameter:                                     Changable??? What is the difference between "ValueParameter" and "FixedVlaueParameter"?????
+
+
+      // types: 
+      //      IntValue
+      //      BoolValue
+      //      DoubleValue
+      //      PercentValue
+      //      ICrossover:       
+      //      IManipulator:     
+      //      IRandom:         
+      //      MultiAnalyzer:    
+      //      ---------
+      Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+      Parameters.Add(new ValueParameter<IntValue>(PopulationSizeParameterName, "The size of the population of solutions.", new IntValue(100)));
+      Parameters.Add(new ValueParameter<IntValue>(ResultPopulationSizeParameterName, "The size of the population of solutions.", new IntValue(100)));
+      Parameters.Add(new ValueParameter<PercentValue>(CrossoverProbabilityParameterName, "The probability that the crossover operator is applied.", new PercentValue(0.9)));
+      Parameters.Add(new ConstrainedValueParameter<ICrossover>(CrossoverParameterName, "The operator used to cross solutions."));
+      Parameters.Add(new ValueParameter<PercentValue>(MutationProbabilityParameterName, "The probability that the mutation operator is applied on a solution.", new PercentValue(0.25)));
+      Parameters.Add(new ConstrainedValueParameter<IManipulator>(MutatorParameterName, "The operator used to mutate solutions."));
+      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
+      Parameters.Add(new ValueParameter<IntValue>(MaximumEvaluatedSolutionsParameterName, "The maximum number of evaluated solutions (approximately).", new IntValue(100_000)));
+      Parameters.Add(new ValueParameter<IRandom>(RandomParameterName, new FastRandom()));
+
+      // SMS-EMOA, kf
+      Parameters.Add(new ValueParameter<IntValue>(LambdaParameterName, "The size of the offsprings. Now, it only works when lambda = 1", new IntValue(1)));
+      // DynamicALPS, KF
+      Parameters.Add(new ValueParameter<IntValue>(ALPSLayersParameterName, "Test, maximum = 1000, defualt is 1", new IntValue(10)));
+      Parameters.Add(new ValueParameter<IntValue>(ALPSAgeGapParameterName, "Test, maximum = 1000, defualt is 20", new IntValue(20)));
+      
+
+    }
+
+    protected DynamicALPSAlgorithmBase(DynamicALPSAlgorithmBase original, Cloner cloner) : base(original, cloner) {
+      functionType = original.functionType;
+      evaluatedSolutions = original.evaluatedSolutions;
+      previousExecutionState = original.previousExecutionState;
+
+      if (original.IdealPoint != null) {
+        IdealPoint = (double[])original.IdealPoint.Clone();
+      }
+
+      if (original.NadirPoint != null) {
+        NadirPoint = (double[])original.NadirPoint.Clone();
+      }
+
+      if (original.lambda_moead != null) {
+        lambda_moead = (double[][])original.lambda_moead.Clone();
+      }
+
+      if (original.neighbourhood != null) {
+        neighbourhood = (int[][])original.neighbourhood.Clone();
+      }
+
+      if (original.solutions != null) {
+        solutions = original.solutions.Select(cloner.Clone).ToArray();
+      }
+
+      if (original.population != null) {
+        population = original.population.Select(cloner.Clone).ToArray();
+      }
+
+      if (original.offspringPopulation != null) {
+        offspringPopulation = original.offspringPopulation.Select(cloner.Clone).ToArray();
+      }
+
+      //if (original.jointPopulation != null) {
+      //  jointPopulation = original.jointPopulation.Select(x => cloner.Clone(x)).ToArray();
+      //}
+
+      if (original.executionContext != null) {
+        executionContext = cloner.Clone(original.executionContext);
+      }
+
+      if (original.globalScope != null) {
+        globalScope = cloner.Clone(original.globalScope);
+      }
+    }
+
+
+
+    [StorableConstructor]
+    protected DynamicALPSAlgorithmBase(StorableConstructorFlag deserializing) : base(deserializing) { }
+    #endregion
+
+    private void InitializePopulation(ExecutionContext executionContext, CancellationToken cancellationToken, IRandom random, bool[] maximization) {
+      // creator: how to create the initilized population. "UniformRandom" is used here. 
+      // TODO: LHS, latin hypercube sampling? Exisit??? 
+      var creator = Problem.SolutionCreator;
+      var evaluator = Problem.Evaluator;
+
+      // dimensions: objective space
+      var dimensions = maximization.Length;
+      var populationSize = PopulationSize.Value;
+      population = new IDynamicALPSSolution[populationSize];
+
+      var parentScope = executionContext.Scope;
+      // first, create all individuals
+      for (int i = 0; i < populationSize; ++i) {
+        var childScope = new Scope(i.ToString()) { Parent = parentScope };
+        ExecuteOperation(executionContext, cancellationToken, executionContext.CreateChildOperation(creator, childScope));
+        parentScope.SubScopes.Add(childScope);
+      }
+
+      for (int i = 0; i < populationSize; ++i) {
+        var childScope = parentScope.SubScopes[i];
+        ExecuteOperation(executionContext, cancellationToken, executionContext.CreateChildOperation(evaluator, childScope));
+
+        var qualities = (DoubleArray)childScope.Variables["Qualities"].Value;
+
+        // solution: a method, contains a decision vector and objecitve values     
+        //    solution.Qualities:     objective values, fitness values 
+        //    solution.Individual:    decision vector
+        var solution = new DynamicALPSSolution(childScope, dimensions, 0);
+        for (int j = 0; j < dimensions; ++j) {
+          // TODO: convert maximization problems into minimization problems. 
+          solution.Qualities[j] = maximization[j] ? 1 - qualities[j] : qualities[j];
+        }
+
+        // population is a collection of solution.  
+        population[i] = solution;
+
+        // KF, DyanmicALPS
+        population[i].HypervolumeContribution[0] = -0;
+        population[i].NondominanceRanking[0] = -0;
+        population[i].Age = 1;
+        population[i].IndividualPc = CrossoverProbability.Value;
+        population[i].IndividualPc = MutationProbability.Value;
+      }
+    }
+
+    protected void InitializeAlgorithm(CancellationToken cancellationToken) { // Type of random operator, "FastRandom" in this script. 
+      // RandomParameter <-- Parameters in "HeuristicLab.Core.ParameterizedNameItem", 
+      var rand = RandomParameter.Value;
+
+      // Initialize random seed
+      // If random seed exist, get it; otherwise, 
+      if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
+
+      // Call 
+      rand.Reset(Seed);
+
+      bool[] maximization = ((BoolArray)Problem.MaximizationParameter.ActualValue).CloneAsArray();
+
+      // dimensions: the dimension in an objective space 
+      var dimensions = maximization.Length;
+
+
+      var populationSize = PopulationSize.Value;
+
+      InitializePopulation(executionContext, cancellationToken, rand, maximization);
+
+      IdealPoint = new double[dimensions];
+      IdealPoint.UpdateIdeal(population);
+
+      NadirPoint = Enumerable.Repeat(double.MinValue, dimensions).ToArray();
+      //NadirPoint = new double[dimensions];
+      NadirPoint.UpdateNadir(population);
+
+
+      evaluatedSolutions = populationSize;
+    }
+
+    protected override void Initialize(CancellationToken cancellationToken) {
+      globalScope = new Scope("Global Scope");
+      executionContext = new ExecutionContext(null, this, globalScope);
+
+      // set the execution context for parameters to allow lookup
+      foreach (var parameter in Problem.Parameters.OfType<IValueParameter>()) {
+        // we need all of these in order for the wiring of the operators to work
+        globalScope.Variables.Add(new Variable(parameter.Name, parameter.Value));
+      }
+      globalScope.Variables.Add(new Variable("Results", Results)); // make results available as a parameter for analyzers etc.
+
+      base.Initialize(cancellationToken);
+    }
+
+    public override bool SupportsPause => true;
+
+
+
+
+    // Mate Selection. 
+    // Randomly select a specific number of individuals for later operators. 
+    // Inputs: 
+    //    1. random:                      Random number generate method
+    //    2. numberOfSolutionToSelect:    The number of selection    
+    // Outputs: 
+    //    1. listOfSolutions:             The selection individuals
+    protected List<int> MatingSelection(IRandom random, int numberOfSolutionsToSelect) {
+      int populationSize = PopulationSize.Value;
+
+      var listOfSolutions = new List<int>(numberOfSolutionsToSelect);
+
+      while (listOfSolutions.Count < numberOfSolutionsToSelect) {
+        var selectedSolution = random.Next(populationSize);
+
+        bool flag = true;
+        foreach (int individualId in listOfSolutions) {
+          if (individualId == selectedSolution) {
+            flag = false;
+            break;
+          }
+        }
+
+        if (flag) {
+          listOfSolutions.Add(selectedSolution);
+        }
+      }
+      return listOfSolutions;
+    }
+
+    protected void ApplyCrossover(int lambda) {
+    }
+
+    protected void ApplyMutation(int lambda) {
+    }
+
+
+    protected void ApplyEvaluation(int lambda) {
+    }
+
+    protected void ApplyMateSelection(int rho) {
+    }
+
+    protected void InitializeLayer(int indexLayer, int populationSize, int lambda) {
+      layerPopulation[indexLayer] = new IDynamicALPSSolution[populationSize];
+      layerJointPopulation[indexLayer] = new IDynamicALPSSolution[populationSize + lambda];
+      layerOffspringPopulation[indexLayer] = new IDynamicALPSSolution[lambda];
+      layerDiscardPopulation[indexLayer] = new IDynamicALPSSolution[populationSize];
+      activeLayer[indexLayer] = true;
+    }
+
+
+    // Select/Discard the individual(s) according to HVC 
+    protected void SmetricSelection(int lambda, int nLayerALPS) {
+      var wholePopulation = layerJointPopulation[nLayerALPS];
+      var qualities = wholePopulation.Select(x => x.Qualities).ToArray();
+
+      var maximization = Enumerable.Repeat(false, IdealPoint.Length).ToArray(); // Minimization or maximization ????
+      var pf2 = DominationCalculator<IDynamicALPSSolution>.CalculateAllParetoFronts(wholePopulation, qualities, maximization, out int[] ranking);
+
+      int numberOfLayer;             // number of layers in PF
+      int numberOfLastLayer;          // number of discarded points in PF (the number of points in the last layer)
+
+      pf2.RemoveAt(pf2.Count() - 1);
+      numberOfLayer = pf2.Count();
+      numberOfLastLayer = pf2[numberOfLayer - 1].Count();
+      double[] hvc = new double[numberOfLastLayer];
+      int discardIndex;
+      if (numberOfLastLayer > lambda) {
+        double tempHV;
+        double smetric;
+        var lastLayer = pf2.Last();
+
+        // TODO: This can be use for dynamic reference point strategy later. Kaifeng , 02/2020
+        // smetric = Hypervolume.Calculate(lastLayer.Select(x => x.Item2), Enumerable.Repeat(11d, NadirPoint.Length).ToArray(), maximization);
+        var reference = ReferencePoint.ToArray();
+        var nondominated = NonDominatedSelect.GetDominatingVectors(lastLayer.Select(x => x.Item2), reference, maximization, false);
+        smetric = nondominated.Any() ? Hypervolume.Calculate(nondominated, reference, maximization) : int.MinValue;
+
+        for (int ii = 0; ii < lastLayer.Count; ++ii) {
+          try { // TODO: This can be use for dynamic reference point strategy later. Kaifeng , 02/2020
+            // tempHV = Hypervolume.Calculate(indices.Where(idx => idx != ii).Select(idx => lastLayer[idx].Item2), Enumerable.Repeat(11d, NadirPoint.Length).ToArray(), maximization);
+            tempHV = Hypervolume.Calculate(Enumerable.Range(0, lastLayer.Count).Where(idx => idx != ii).Select(idx => lastLayer[idx].Item2), reference, maximization);
+          }
+          catch {
+            tempHV = int.MinValue;
+          }
+          hvc[ii] = smetric - tempHV;
+          tempHV = 0;
+        }
+        discardIndex = Array.IndexOf(hvc, hvc.Min());
+        pf2[numberOfLayer - 1].RemoveAt(discardIndex);
+      }
+      else {
+        // TODO: This should be updated when $lambda > 1$
+        pf2.RemoveAt(pf2.Count() - 1);
+        numberOfLayer = numberOfLayer - 1;
+      }
+      layerPopulation[nLayerALPS] = pf2.SelectMany(x => x.Select(y => y.Item1)).ToArray();
+    }
+
+    protected int SMSEMOA(int populationSize, int lambda, int counterLayerALPS) {
+      var innerToken = new CancellationToken();
+      bool[] maximization = ((BoolArray)Problem.MaximizationParameter.ActualValue).CloneAsArray();
+      var maximumEvaluatedSolutions = MaximumEvaluatedSolutions.Value;
+      var crossover = Crossover;
+      var crossoverProbability = CrossoverProbability.Value;
+      var mutator = Mutator;
+      var mutationProbability = MutationProbability.Value;
+      var evaluator = Problem.Evaluator;
+      var analyzer = Analyzer;
+      var rand = RandomParameter.Value;
+
+
+      int indexOffspring = 0;
+      var mates = MatingSelection(rand, 2); // select parents
+                                            //var s1 = (IScope)population[mates[0]].Individual.Clone();
+                                            //var s2 = (IScope)population[mates[1]].Individual.Clone();
+                                            //var ages = population.Select(x => x.Age).ToArray();
+
+      var s1 = (IScope)layerPopulation[counterLayerALPS][mates[0]].Individual.Clone();
+      var s2 = (IScope)layerPopulation[counterLayerALPS][mates[1]].Individual.Clone();
+      var ages = layerPopulation[counterLayerALPS].Select(x => x.Age).ToArray();
+
+      var s1_age = ages[mates[0]];
+      var s2_age = ages[mates[1]];
+      int offSpringAge = 0;
+      s1.Parent = s2.Parent = globalScope;
+      IScope childScope = null;
+
+      // crossover
+      if (rand.NextDouble() < crossoverProbability) {
+        childScope = new Scope($"{mates[0]}+{mates[1]}") { Parent = executionContext.Scope };
+        childScope.SubScopes.Add(s1);
+        childScope.SubScopes.Add(s2);
+        var opCrossover = executionContext.CreateChildOperation(crossover, childScope);
+        ExecuteOperation(executionContext, innerToken, opCrossover);
+        offSpringAge = Math.Max(s1_age, s2_age) + 1;
+        childScope.SubScopes.Clear(); // <<-- VERY IMPORTANT!
+      }
+      else { // MUTATION   POLISHI
+        if (childScope == null) {
+          offSpringAge = ages[mates[0]] + 1;
+        }
+        else {
+        }
+        childScope = childScope ?? s1;
+        var opMutation = executionContext.CreateChildOperation(mutator, childScope);
+        ExecuteOperation(executionContext, innerToken, opMutation);
+      }
+      if (childScope != null) { // Evaluate the childScope
+        var opEvaluation = executionContext.CreateChildOperation(evaluator, childScope);
+        ExecuteOperation(executionContext, innerToken, opEvaluation);
+        // childScope 
+        var qualities = (DoubleArray)childScope.Variables["Qualities"].Value;
+        var childSolution = new DynamicALPSSolution(childScope, maximization.Length, 0);
+        // set child qualities
+        for (int j = 0; j < maximization.Length; ++j) {
+          childSolution.Qualities[j] = maximization[j] ? 1 - qualities[j] : qualities[j];
+        }
+        IdealPoint.UpdateIdeal(childSolution.Qualities);
+        NadirPoint.UpdateNadir(childSolution.Qualities);
+        // TODO, KF -- For later usage when $lambda > 1$
+        childSolution.HypervolumeContribution = null;
+        childSolution.NondominanceRanking = null;
+        childSolution.Age = offSpringAge;
+        layerOffspringPopulation[counterLayerALPS][indexOffspring] = childSolution;
+        ++evaluatedSolutions;
+        indexOffspring += 1;
+      }
+      else {
+        // no crossover or mutation were applied, a child was not produced, do nothing
+      }
+
+
+      layerJointPopulation[counterLayerALPS] = new IDynamicALPSSolution[populationSize + lambda];
+      layerPopulation[counterLayerALPS].CopyTo(layerJointPopulation[counterLayerALPS], 0);
+      layerOffspringPopulation[counterLayerALPS].CopyTo(layerJointPopulation[counterLayerALPS], populationSize);
+
+      SmetricSelection(lambda, counterLayerALPS);   // SMS-EMOA 
+      return evaluatedSolutions;
+    }
+
+
+
+
+
+
+
+    // Update the Pareto-front approximation set and scatter the solutions in PF approximation set. 
+    protected void UpdateParetoFronts() {
+      //var qualities = population.Select(x => Enumerable.Range(0, NadirPoint.Length).Select(i => x.Qualities[i] / NadirPoint[i]).ToArray()).ToArray();
+      var qualities = population.Select(x => x.Qualities).ToArray();
+      var maximization = Enumerable.Repeat(false, IdealPoint.Length).ToArray();                             // DynamicALPS minimizes everything internally
+      var pf = DominationCalculator<IDynamicALPSSolution>.CalculateBestParetoFront(population, qualities, maximization);
+
+      var pf2 = DominationCalculator<IDynamicALPSSolution>.CalculateAllParetoFronts(population, qualities, maximization, out int[] ranking);
+      var n = (int)EnumerableExtensions.BinomialCoefficient(IdealPoint.Length, 2);
+
+
+      // Struture hypervolume 
+      // [0,0]:  Value of HV
+      // [0,1]:  PF size, $|PF|$
+      var hypervolumes = new DoubleMatrix(n == 1 ? 1 : n + 1, 2) { ColumnNames = new[] { "PF hypervolume", "PF size" } };
+
+
+      // HV calculation 
+      // pf.Select(x => x.Item2): the "Item2" in var "pd"
+      // Enumerable.Repeat(1d, NadirPoint.Length).ToArray():     reference point 
+      // maximization:   type of optimization problem:
+      //               True:  maximization problem 
+      //               False: minimization problem
+      var reference = ReferencePoint.ToArray();
+      var nondominated = NonDominatedSelect.GetDominatingVectors(pf.Select(x => x.Item2), reference, maximization, false);
+      hypervolumes[0, 0] = nondominated.Any() ? Hypervolume.Calculate(nondominated, reference, maximization) : int.MinValue;
+
+      //hypervolumes[0, 0] = Hypervolume.Calculate(pf.Select(x => x.Item2), reference, maximization);
+      hypervolumes[0, 1] = pf.Count;
+      Console.WriteLine("Current HV is", hypervolumes[0, 0]);
+
+      var elementNames = new List<string>() { "Pareto Front" };
+
+      ResultCollection results;
+      if (Results.ContainsKey("Hypervolume Analysis")) {
+        results = (ResultCollection)Results["Hypervolume Analysis"].Value;
+      }
+      else {
+        results = new ResultCollection();
+        Results.AddOrUpdateResult("Hypervolume Analysis", results);
+      }
+
+      ScatterPlot sp;
+      if (IdealPoint.Length == 2) {
+        var points = pf.Select(x => new Point2D<double>(x.Item2[0], x.Item2[1]));
+        var r = OnlinePearsonsRCalculator.Calculate(points.Select(x => x.X), points.Select(x => x.Y), out OnlineCalculatorError error);
+        if (error != OnlineCalculatorError.None) { r = double.NaN; }
+        var resultName = "Pareto Front Analysis ";
+        if (!results.ContainsKey(resultName)) {
+          sp = new ScatterPlot() {
+            VisualProperties = {
+              XAxisMinimumAuto = false, XAxisMinimumFixedValue = 0d, XAxisMaximumAuto = false, XAxisMaximumFixedValue = 1d,
+              YAxisMinimumAuto = false, YAxisMinimumFixedValue = 0d, YAxisMaximumAuto = false, YAxisMaximumFixedValue = 1d
+            }
+          };
+          sp.Rows.Add(new ScatterPlotDataRow(resultName, "", points) { VisualProperties = { PointSize = 8 } });
+          results.AddOrUpdateResult(resultName, sp);
+        }
+        else {
+          sp = (ScatterPlot)results[resultName].Value;
+          sp.Rows[resultName].Points.Replace(points);
+        }
+        sp.Name = $"Dimensions [0, 1], correlation: {r.ToString("N2")}";
+      }
+      else if (IdealPoint.Length > 2) {
+        var indices = Enumerable.Range(0, IdealPoint.Length).ToArray();
+        var visualProperties = new ScatterPlotDataRowVisualProperties { PointSize = 8, Color = Color.LightGray };
+        var combinations = indices.Combinations(2).ToArray();
+        var maximization2d = new[] { false, false };
+        var solutions2d = pf.Select(x => x.Item1).ToArray();
+        for (int i = 0; i < combinations.Length; ++i) {
+          var c = combinations[i].ToArray();
+
+          // calculate the hypervolume in the 2d coordinate space
+          var reference2d = new[] { 1d, 1d };
+          var qualities2d = pf.Select(x => new[] { x.Item2[c[0]], x.Item2[c[1]] }).ToArray();
+          var pf2d = DominationCalculator<IDynamicALPSSolution>.CalculateBestParetoFront(solutions2d, qualities2d, maximization2d);
+
+          hypervolumes[i + 1, 0] = pf2d.Count > 0 ? Hypervolume.Calculate(pf2d.Select(x => x.Item2), reference2d, maximization2d) : 0d;
+          hypervolumes[i + 1, 1] = pf2d.Count;
+
+          var resultName = $"Pareto Front Analysis [{c[0]}, {c[1]}]";
+          elementNames.Add(resultName);
+
+          var points = pf.Select(x => new Point2D<double>(x.Item2[c[0]], x.Item2[c[1]]));
+          var pf2dPoints = pf2d.Select(x => new Point2D<double>(x.Item2[0], x.Item2[1]));
+
+          if (!results.ContainsKey(resultName)) {
+            sp = new ScatterPlot() {
+              VisualProperties = {
+                XAxisMinimumAuto = false, XAxisMinimumFixedValue = 0d, XAxisMaximumAuto = false, XAxisMaximumFixedValue = 1d,
+                YAxisMinimumAuto = false, YAxisMinimumFixedValue = 0d, YAxisMaximumAuto = false, YAxisMaximumFixedValue = 1d
+              }
+            };
+            sp.Rows.Add(new ScatterPlotDataRow("Pareto Front", "", points) { VisualProperties = visualProperties });
+            sp.Rows.Add(new ScatterPlotDataRow($"Pareto Front [{c[0]}, {c[1]}]", "", pf2dPoints) { VisualProperties = { PointSize = 10, Color = Color.OrangeRed } });
+            results.AddOrUpdateResult(resultName, sp);
+          }
+          else {
+            sp = (ScatterPlot)results[resultName].Value;
+            sp.Rows["Pareto Front"].Points.Replace(points);
+            sp.Rows[$"Pareto Front [{c[0]}, {c[1]}]"].Points.Replace(pf2dPoints);
+          }
+          var r = OnlinePearsonsRCalculator.Calculate(points.Select(x => x.X), points.Select(x => x.Y), out OnlineCalculatorError error);
+          var r2 = r * r;
+          sp.Name = $"Pareto Front [{c[0]}, {c[1]}], correlation: {r2.ToString("N2")}";
+        }
+      }
+      hypervolumes.RowNames = elementNames;
+      results.AddOrUpdateResult("Hypervolumes", hypervolumes);
+    }
+
+    #region operator wiring and events
+    protected void ExecuteOperation(ExecutionContext executionContext, CancellationToken cancellationToken, IOperation operation) {
+      Stack<IOperation> executionStack = new Stack<IOperation>();
+      executionStack.Push(operation);
+      while (executionStack.Count > 0) {
+        cancellationToken.ThrowIfCancellationRequested();
+        IOperation next = executionStack.Pop();
+        if (next is OperationCollection) {
+          OperationCollection coll = (OperationCollection)next;
+          for (int i = coll.Count - 1; i >= 0; i--)
+            if (coll[i] != null) executionStack.Push(coll[i]);
+        }
+        else if (next is IAtomicOperation) {
+          IAtomicOperation op = (IAtomicOperation)next;
+          next = op.Operator.Execute((IExecutionContext)op, cancellationToken);
+          if (next != null) executionStack.Push(next);
+        }
+      }
+    }
+
+    protected virtual void UpdateAnalyzers() {
+      Analyzer.Operators.Clear();
+      if (Problem != null) {
+        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) {
+          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
+            param.Depth = 1;
+          Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault);
+        }
+      }
+    }
+
+    private void UpdateCrossovers() {
+      ICrossover oldCrossover = CrossoverParameter.Value;
+      CrossoverParameter.ValidValues.Clear();
+      ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault();
+
+      foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name))
+        CrossoverParameter.ValidValues.Add(crossover);
+
+      if (oldCrossover != null) {
+        ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType());
+        if (crossover != null) CrossoverParameter.Value = crossover;
+        else oldCrossover = null;
+      }
+      if (oldCrossover == null && defaultCrossover != null)
+        CrossoverParameter.Value = defaultCrossover;
+    }
+
+    private void UpdateMutators() {
+      IManipulator oldMutator = MutatorParameter.Value;
+      MutatorParameter.ValidValues.Clear();
+      IManipulator defaultMutator = Problem.Operators.OfType<IManipulator>().FirstOrDefault();
+
+      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name))
+        MutatorParameter.ValidValues.Add(mutator);
+
+      if (oldMutator != null) {
+        IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType());
+        if (mutator != null) MutatorParameter.Value = mutator;
+        else oldMutator = null;
+      }
+
+      if (oldMutator == null && defaultMutator != null)
+        MutatorParameter.Value = defaultMutator;
+    }
+
+    protected override void OnProblemChanged() {
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateAnalyzers();
+      base.OnProblemChanged();
+    }
+
+    protected override void OnExecutionStateChanged() {
+      previousExecutionState = executionState;
+      executionState = ExecutionState;
+      base.OnExecutionStateChanged();
+    }
+
+    public void ClearState() {
+      solutions = null;
+      population = null;
+      offspringPopulation = null;
+      //jointPopulation = null;
+      lambda_moead = null;
+      neighbourhood = null;
+      if (executionContext != null && executionContext.Scope != null) {
+        executionContext.Scope.SubScopes.Clear();
+      }
+    }
+
+    protected override void OnStopped() {
+      ClearState();
+      base.OnStopped();
+    }
+    #endregion
+  }
+}
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSUtil.cs
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSUtil.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/DynamicALPSUtil.cs	(revision 17479)
@@ -0,0 +1,279 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace HeuristicLab.Algorithms.DynamicALPS
+{
+  public static class DynamicALPSUtil
+  {
+    public static void QuickSort(double[] array, int[] idx, int from, int to)
+    {
+      if (from < to)
+      {
+        double temp = array[to];
+        int tempIdx = idx[to];
+        int i = from - 1;
+        for (int j = from; j < to; j++)
+        {
+          if (array[j] <= temp)
+          {
+            i++;
+            double tempValue = array[j];
+            array[j] = array[i];
+            array[i] = tempValue;
+            int tempIndex = idx[j];
+            idx[j] = idx[i];
+            idx[i] = tempIndex;
+          }
+        }
+        array[to] = array[i + 1];
+        array[i + 1] = temp;
+        idx[to] = idx[i + 1];
+        idx[i + 1] = tempIdx;
+        QuickSort(array, idx, from, i);
+        QuickSort(array, idx, i + 1, to);
+      }
+    }
+
+    public static void MinFastSort(double[] x, int[] idx, int n, int m)
+    {
+      for (int i = 0; i < m; i++)
+      {
+        for (int j = i + 1; j < n; j++)
+        {
+          if (x[i] > x[j])
+          {
+            double temp = x[i];
+            x[i] = x[j];
+            x[j] = temp;
+            int id = idx[i];
+            idx[i] = idx[j];
+            idx[j] = id;
+          }
+        }
+      }
+    }
+
+    public static IList<IDynamicALPSSolution> GetSubsetOfEvenlyDistributedSolutions(IRandom random, IList<IDynamicALPSSolution> solutionList, int newSolutionListSize)
+    {
+      if (solutionList == null || solutionList.Count == 0)
+      {
+        throw new ArgumentException("Solution list is null or empty.");
+      }
+
+      return solutionList[0].Dimensions == 2
+        ? TwoObjectivesCase(solutionList, newSolutionListSize)
+        : MoreThanTwoObjectivesCase(random, solutionList, newSolutionListSize);
+    }
+
+    private static IList<IDynamicALPSSolution> TwoObjectivesCase(IList<IDynamicALPSSolution> solutionList, int newSolutionListSize)
+    {
+      var resultSolutionList = new IDynamicALPSSolution[newSolutionListSize];
+
+      // compute weight vectors
+      double[][] lambda_moead = new double[newSolutionListSize][];
+      var values = SequenceGenerator.GenerateSteps(0m, 1m, 1m / newSolutionListSize).ToArray();
+      for (int i = 0; i < newSolutionListSize; ++i)
+      {
+        var weights = new double[newSolutionListSize];
+        weights[0] = (double)values[i];
+        weights[1] = 1 - weights[0];
+
+        lambda_moead[i] = weights;
+      }
+
+      var idealPoint = new double[2];
+      foreach (var solution in solutionList)
+      {
+        // update ideal point
+        idealPoint.UpdateIdeal(solution.Qualities);
+      }
+
+      // Select the best solution for each weight vector
+      for (int i = 0; i < newSolutionListSize; i++)
+      {
+        var currentBest = solutionList[0];
+        double value = ScalarizingFitnessFunction(currentBest, lambda_moead[i], idealPoint);
+        for (int j = 1; j < solutionList.Count; j++)
+        {
+          double aux = ScalarizingFitnessFunction(solutionList[j], lambda_moead[i], idealPoint); // we are looking for the best for the weight i
+          if (aux < value)
+          { // solution in position j is better!
+            value = aux;
+            currentBest = solutionList[j];
+          }
+        }
+        resultSolutionList[i] = (DynamicALPSSolution)currentBest.Clone();
+      }
+
+      return resultSolutionList;
+    }
+
+    private static IList<IDynamicALPSSolution> MoreThanTwoObjectivesCase(IRandom random, IList<IDynamicALPSSolution> solutionList, int newSolutionListSize)
+    {
+      var resultSolutionList = new List<IDynamicALPSSolution>();
+
+      int randomIndex = random.Next(0, solutionList.Count);
+
+      var candidate = new List<IDynamicALPSSolution>();
+      resultSolutionList.Add(solutionList[randomIndex]);
+
+      for (int i = 0; i < solutionList.Count; ++i)
+      {
+        if (i != randomIndex)
+        {
+          candidate.Add(solutionList[i]);
+        }
+      }
+
+      while (resultSolutionList.Count < newSolutionListSize)
+      {
+        int index = 0;
+        var selected = candidate[0]; // it should be a next! (n <= population size!)
+        double aux = CalculateBestDistance(selected, solutionList);
+        int i = 1;
+        while (i < candidate.Count)
+        {
+          var nextCandidate = candidate[i];
+          double distanceValue = CalculateBestDistance(nextCandidate, solutionList);
+          if (aux < distanceValue)
+          {
+            index = i;
+            aux = distanceValue;
+          }
+          i++;
+        }
+
+        // add the selected to res and remove from candidate list
+        var removedSolution = candidate[index];
+        candidate.RemoveAt(index);
+        resultSolutionList.Add((DynamicALPSSolution)removedSolution.Clone());
+      }
+
+      return resultSolutionList;
+    }
+
+    private static double ScalarizingFitnessFunction(IDynamicALPSSolution currentBest, double[] lambda_moead, double[] idealPoint)
+    {
+      double maxFun = -1.0e+30;
+
+      for (int n = 0; n < idealPoint.Length; n++)
+      {
+        double diff = Math.Abs(currentBest.Qualities[n] - idealPoint[n]);
+
+        double functionValue;
+        if (lambda_moead[n] == 0)
+        {
+          functionValue = 0.0001 * diff;
+        }
+        else
+        {
+          functionValue = diff * lambda_moead[n];
+        }
+        if (functionValue > maxFun)
+        {
+          maxFun = functionValue;
+        }
+      }
+
+      return maxFun;
+    }
+
+    public static void UpdateIdeal(this double[] idealPoint, double[] point)
+    {
+      for (int i = 0; i < point.Length; ++i)
+      {
+        if (double.IsInfinity(point[i]) || double.IsNaN(point[i]))
+        {
+          continue;
+        }
+
+        if (idealPoint[i] > point[i])
+        {
+          idealPoint[i] = point[i];
+        }
+      }
+    }
+
+    public static void UpdateNadir(this double[] nadirPoint, double[] point)
+    {
+      for (int i = 0; i < point.Length; ++i)
+      {
+        if (double.IsInfinity(point[i]) || double.IsNaN(point[i]))
+        {
+          continue;
+        }
+
+        if (nadirPoint[i] < point[i])
+        {
+          nadirPoint[i] = point[i];
+        }
+      }
+    }
+
+    public static void UpdateIdeal(this double[] idealPoint, IList<IDynamicALPSSolution> solutions)
+    {
+      foreach (var s in solutions)
+      {
+        idealPoint.UpdateIdeal(s.Qualities);
+      }
+    }
+
+    public static void UpdateNadir(this double[] nadirPoint, IList<IDynamicALPSSolution> solutions)
+    {
+      foreach (var s in solutions)
+      {
+        nadirPoint.UpdateNadir(s.Qualities);
+      }
+    }
+
+    private static double CalculateBestDistance(IDynamicALPSSolution solution, IList<IDynamicALPSSolution> solutionList)
+    {
+      var best = solutionList.Min(x => EuclideanDistance(solution.Qualities, x.Qualities));
+      if (double.IsNaN(best) || double.IsInfinity(best))
+      {
+        best = double.MaxValue;
+      }
+      return best;
+    }
+
+    public static double EuclideanDistance(double[] a, double[] b)
+    {
+      if (a.Length != b.Length)
+      {
+        throw new ArgumentException("Euclidean distance: the arrays have different lengths.");
+      }
+
+      var distance = 0d;
+      for (int i = 0; i < a.Length; ++i)
+      {
+        var d = a[i] - b[i];
+        distance += d * d;
+      }
+      return Math.Sqrt(distance);
+    }
+  }
+}
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/HeuristicLab.Algorithms.DynamicALPS-3.4.csproj
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/HeuristicLab.Algorithms.DynamicALPS-3.4.csproj	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/HeuristicLab.Algorithms.DynamicALPS-3.4.csproj	(revision 17479)
@@ -0,0 +1,275 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{15452B9F-A436-4139-8EE7-DA72FB8D3664}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Algorithms.DynamicALPS</RootNamespace>
+    <AssemblyName>HeuristicLab.Algorithms.DynamicALPS-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HEAL.Attic.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Algorithms.NSGA2-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Algorithms.NSGA2-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimizer-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Optimizer-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence.GUI-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Persistence.GUI-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.GeneticProgramming-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.GeneticProgramming-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances.DataAnalysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.Instances.DataAnalysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.TestFunctions-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.TestFunctions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.TestFunctions.MultiObjective-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Problems.TestFunctions.MultiObjective-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.SequentialEngine-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\trunk\bin\HeuristicLab.SequentialEngine-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DynamicALPSAlgorithm.cs" />
+    <Compile Include="DynamicALPSAlgorithmBase.cs" />
+    <Compile Include="DynamicALPSASolution.cs" />
+    <Compile Include="DynamicALPSUtil.cs" />
+    <None Include="app.config" />
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+  <PropertyGroup>
+    <PostBuildEvent>
+    </PostBuildEvent>
+  </PropertyGroup>
+</Project>
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs	(revision 17479)
@@ -0,0 +1,44 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.DynamicALPS
+{
+  [Plugin("HeuristicLab.Algorithms.DynamicALPS", "Provides the multi-objective evolutonary algorithm based on decomposition (DynamicALPS) as described by Zhang and Li: DynamicALPS: A Multiobjective Evolutionary Algorithm Based on Decomposition, IEEE Transactions on Evolutionary Computation, Volume 11, Issue 6, Dec. 2007, pp. 712-731", "3.4.25.16714")]
+  [PluginFile("HeuristicLab.Algorithms.DynamicALPS-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Attic", "1.0")]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.TestFunctions.MultiObjective", "3.3")]
+  public class HeuristicLabAlgorithmsDynamicALPSPlugin : PluginBase
+  {
+  }
+}
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs.frame
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs.frame	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Plugin.cs.frame	(revision 17479)
@@ -0,0 +1,44 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.SMSEMOA
+{
+  [Plugin("HeuristicLab.Algorithms.SMSEMOA", "Provides the multi-objective evolutonary algorithm based on decomposition (SMSEMOA) as described by Zhang and Li: SMSEMOA: A Multiobjective Evolutionary Algorithm Based on Decomposition, IEEE Transactions on Evolutionary Computation, Volume 11, Issue 6, Dec. 2007, pp. 712-731", "3.4.25.16714")]
+  [PluginFile("HeuristicLab.Algorithms.SMSEMOA-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Attic", "1.0")]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Operators", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Parameters", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.TestFunctions.MultiObjective", "3.3")]
+  public class HeuristicLabAlgorithmsSMSEMOAPlugin : PluginBase
+  {
+  }
+}
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs	(revision 17479)
@@ -0,0 +1,57 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Algorithms.SMSEMOA")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HEAL")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7d0fdb00-8511-45a2-ae51-c830b0c9b548")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.15.17425")]
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs.frame	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/Properties/AssemblyInfo.cs.frame	(revision 17479)
@@ -0,0 +1,57 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Algorithms.SMSEMOA")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HEAL")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7d0fdb00-8511-45a2-ae51-c830b0c9b548")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.15.$WCREV$")]
Index: branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/app.config
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/app.config	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/HeuristicLab.Algorithms.DynamicALPS/3.4/app.config	(revision 17479)
@@ -0,0 +1,11 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-3.7.0.0" newVersion="3.7.0.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
Index: branches/3057_DynamicALPS/backup/17032020/PreBuildEvent.cmd
===================================================================
--- branches/3057_DynamicALPS/backup/17032020/PreBuildEvent.cmd	(revision 17479)
+++ branches/3057_DynamicALPS/backup/17032020/PreBuildEvent.cmd	(revision 17479)
@@ -0,0 +1,11 @@
+IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+GOTO Done
+
+:Error_Handling
+ECHO There was an error while running subwcrev. Please verify that the *.cs.frame files have been correctly converted to *.cs files, otherwise HeuristicLab won't build. 
+exit 0
+
+:Done
Index: branches/3057_DynamicALPS/backup/readme.txt.txt
===================================================================
--- branches/3057_DynamicALPS/backup/readme.txt.txt	(revision 17479)
+++ branches/3057_DynamicALPS/backup/readme.txt.txt	(revision 17479)
@@ -0,0 +1,6 @@
+13022020:
+1. Have all the recipes for the DynamicALPS
+2. The algorithm is still the SMS-EMOA. Age info is not used in layers.
+
+17032020:
+1. Not the updated version, but the version on SVN.... 
