Index: /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/Calculator.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/Calculator.cs	(revision 8622)
+++ /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/Calculator.cs	(revision 8622)
@@ -0,0 +1,107 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.RAPGA {
+  /// <summary>
+  /// An operator that evaluates an expression.
+  /// </summary>
+  [Item("Calculator", "An operator that evaluates an expression.")]
+  [StorableClass]
+  public class Calculator : ValuesCollector {
+    [Storable]
+    public Optimization.Calculator Calc { get; set; }
+
+    #region Parameter Properties
+    public IValueLookupParameter<StringValue> ExpressionParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters["Expression"]; }
+    }
+    public IValueLookupParameter<IItem> ExpressionResultParameter {
+      get { return (IValueLookupParameter<IItem>)Parameters["ExpressionResult"]; }
+    }
+    #endregion
+
+    #region Properties
+    private string Formula {
+      get { return ExpressionParameter.Value.Value; }
+    }
+    private IItem ExpressionResult {
+      set { ExpressionResultParameter.ActualValue = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected Calculator(bool deserializing) : base(deserializing) { }
+    protected Calculator(Calculator original, Cloner cloner)
+      : base(original, cloner) {
+      this.Calc = cloner.Clone(original.Calc);
+    }
+    public Calculator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<IItem>("ExpressionResult", "The result of the evaluated expression."));
+      Parameters.Add(new ValueLookupParameter<StringValue>("Expression",
+@"RPN formula for new value in postfix notation.
+
+This can contain the following elements:
+
+literals:
+  numbers, true, false, null and strings in single quotes
+variables (run parameters or results):
+  unquoted or in double quotes if they contain special characters or whitespace
+mathematical functions:
+  +, -, /, ^ (power), log
+predicates:
+  ==, <, >, isnull, not
+stack manipulation:
+  drop swap dup
+string matching:
+  <string> <pattern> ismatch
+string replacing:
+  <string> <pattern> <replacement> rename
+conditionals:
+  <then> <else> <condition> if
+
+If the final value is null, the result variable is removed if it exists."));
+
+      Calc = new Optimization.Calculator();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Calculator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      Calc.Formula = Formula;
+      var variables = new Dictionary<string, IItem>();
+      foreach (var collectedValue in CollectedValues)
+        variables[collectedValue.Name] = collectedValue.ActualValue;
+      ExpressionResult = Calc.GetValue(variables);
+      return base.Apply();
+    }
+  }
+}
Index: anches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/ExpressionEvaluator.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/ExpressionEvaluator.cs	(revision 8621)
+++ 	(revision )
@@ -1,108 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Operators;
-using HeuristicLab.Optimization;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.RAPGA {
-  /// <summary>
-  /// An operator that evaluates an expression.
-  /// </summary>
-  [Item("ExpressionEvaluator", "An operator that evaluates an expression.")]
-  [StorableClass]
-  public class ExpressionEvaluator : ValuesCollector {
-    [Storable]
-    public Calculator Calculator { get; set; }
-
-    #region Parameter Properties
-    public IValueLookupParameter<StringValue> ExpressionParameter {
-      get { return (IValueLookupParameter<StringValue>)Parameters["Expression"]; }
-    }
-    public IValueLookupParameter<IItem> ExpressionResultParameter {
-      get { return (IValueLookupParameter<IItem>)Parameters["ExpressionResult"]; }
-    }
-    #endregion
-
-    #region Properties
-    private string Formula {
-      get { return ExpressionParameter.Value.Value; }
-    }
-    private IItem ExpressionResult {
-      set { ExpressionResultParameter.ActualValue = value; }
-    }
-    #endregion
-
-    [StorableConstructor]
-    protected ExpressionEvaluator(bool deserializing) : base(deserializing) { }
-    protected ExpressionEvaluator(ExpressionEvaluator original, Cloner cloner)
-      : base(original, cloner) {
-      this.Calculator = cloner.Clone(original.Calculator);
-    }
-    public ExpressionEvaluator()
-      : base() {
-      Parameters.Add(new ValueLookupParameter<IItem>("ExpressionResult", "The result of the evaluated expression."));
-      Parameters.Add(new ValueLookupParameter<StringValue>("Expression",
-@"RPN formula for new value in postfix notation.
-
-This can contain the following elements:
-
-literals:
-  numbers, true, false, null and strings in single quotes
-variables (run parameters or results):
-  unquoted or in double quotes if they contain special characters or whitespace
-mathematical functions:
-  +, -, /, ^ (power), log
-predicates:
-  ==, <, >, isnull, not
-stack manipulation:
-  drop swap dup
-string matching:
-  <string> <pattern> ismatch
-string replacing:
-  <string> <pattern> <replacement> rename
-conditionals:
-  <then> <else> <condition> if
-
-If the final value is null, the result variable is removed if it exists."));
-
-      Calculator = new Calculator();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new ExpressionEvaluator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      Calculator.Formula = Formula;
-      var variables = new Dictionary<string, IItem>();
-      foreach (var collectedValue in CollectedValues)
-        variables[collectedValue.Name] = collectedValue.ActualValue;
-      ExpressionResult = Calculator.GetValue(variables);
-      return base.Apply();
-    }
-  }
-}
Index: /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/HeuristicLab.Algorithms.RAPGA-3.3.csproj
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/HeuristicLab.Algorithms.RAPGA-3.3.csproj	(revision 8621)
+++ /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/HeuristicLab.Algorithms.RAPGA-3.3.csproj	(revision 8622)
@@ -100,9 +100,9 @@
     <Compile Include="Analyzers\OffspringSuccessAnalyzer.cs" />
     <Compile Include="Analyzers\PopulationSizeAnalyzer.cs" />
+    <Compile Include="Calculator.cs" />
     <Compile Include="DuplicatesSelector.cs" />
-    <Compile Include="ExpressionEvaluator.cs" />
-    <Compile Include="OffspringRestorer.cs" />
     <Compile Include="ProgressiveOffspringPreserver.cs" />
-    <Compile Include="SimilarityCalculator\BlindSimilarityCalculator.cs" />
+    <Compile Include="ScopeRestorer.cs" />
+    <Compile Include="SimilarityCalculator\NoSimilarityCalculator.cs" />
     <Compile Include="SimilarityCalculator\QualitySimilarityCalculator.cs" />
     <Compile Include="RAPGA.cs" />
Index: anches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/OffspringRestorer.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/OffspringRestorer.cs	(revision 8621)
+++ 	(revision )
@@ -1,74 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Operators;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.RAPGA {
-  /// <summary>
-  /// An operator that restores created offspring from a scope list.
-  /// </summary>
-  /// <remarks>
-  /// It adds all scopes in the list as sub-scopes to the current scope.
-  /// </remarks>
-  [Item("OffspringRestorer", "An operator that restores created offspring from a scope list. It adds all scopes in the list as sub-scopes to the current scope.")]
-  [StorableClass]
-  public class OffspringRestorer : SingleSuccessorOperator {
-    #region Parameter Properties
-    public ScopeParameter CurrentScopeParameter {
-      get { return (ScopeParameter)Parameters["CurrentScope"]; }
-    }
-    public ILookupParameter<ScopeList> OffspringListParameter {
-      get { return (ILookupParameter<ScopeList>)Parameters["OffspringList"]; }
-    }
-    #endregion
-
-    #region Properties
-    private IScope CurrentScope {
-      get { return CurrentScopeParameter.ActualValue; }
-    }
-    private ScopeList OffspringList {
-      get { return OffspringListParameter.ActualValue; }
-    }
-    #endregion
-
-    [StorableConstructor]
-    protected OffspringRestorer(bool deserializing) : base(deserializing) { }
-    protected OffspringRestorer(OffspringRestorer original, Cloner cloner) : base(original, cloner) { }
-    public OffspringRestorer()
-      : base() {
-      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope that contains the offspring."));
-      Parameters.Add(new LookupParameter<ScopeList>("OffspringList", "The list that contains the offspring."));
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new OffspringRestorer(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      CurrentScope.SubScopes.AddRange(OffspringList);
-      return base.Apply();
-    }
-  }
-}
Index: /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/ProgressiveOffspringPreserver.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/ProgressiveOffspringPreserver.cs	(revision 8621)
+++ /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/ProgressiveOffspringPreserver.cs	(revision 8622)
@@ -93,13 +93,27 @@
 
     public override IOperation Apply() {
-      if (CurrentScope.SubScopes.Any()) {
-        if (OffspringList.Any()) {
-          var currentOffspring = new Scope();
-          currentOffspring.SubScopes.AddRange(OffspringList);
-          var similarityMatrix = SimilarityCalculator.CalculateSolutionCrowdSimilarity(CurrentScope, currentOffspring);
-          for (int i = CurrentScope.SubScopes.Count - 1; i >= 0 && OffspringList.Count < MaximumPopulationSize.Value - Elites.Value; i--)
-            if (similarityMatrix[i].Any(x => x == 1.0)) CurrentScope.SubScopes.RemoveAt(i);
-            else OffspringList.Add(CurrentScope.SubScopes[i]);
-        } else OffspringList.AddRange(CurrentScope.SubScopes);
+      if (CurrentScope.SubScopes.Any()) { // offspring created
+        if (!OffspringList.Any()) OffspringList.AddRange(CurrentScope.SubScopes);
+        else { // stored offspring exists
+          var storedOffspringScope = new Scope();
+          storedOffspringScope.SubScopes.AddRange(OffspringList);
+          var similarityMatrix = SimilarityCalculator.CalculateSolutionCrowdSimilarity(CurrentScope, storedOffspringScope);
+
+          var createdOffspring = CurrentScope.SubScopes.ToArray();
+
+          int i = 0;
+          // as long as offspring is available and not enough offspring has been preserved
+          while (i < createdOffspring.Length && OffspringList.Count < MaximumPopulationSize.Value - Elites.Value) {
+            if (similarityMatrix[i].Any(x => x == 1.0)) createdOffspring[i] = null; // discard duplicates
+            else OffspringList.Add(createdOffspring[i]);
+            i++;
+          }
+
+          // discard remaining offspring
+          while (i < createdOffspring.Length) createdOffspring[i++] = null;
+
+          // clean current scope
+          CurrentScope.SubScopes.Replace(createdOffspring.Where(x => x != null));
+        }
       }
       return base.Apply();
Index: /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs	(revision 8621)
+++ /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs	(revision 8622)
@@ -483,5 +483,5 @@
 
       SimilarityCalculatorParameter.ValidValues.Add(new QualitySimilarityCalculator { QualityVariableName = Problem.Evaluator.QualityParameter.ActualName });
-      SimilarityCalculatorParameter.ValidValues.Add(new BlindSimilarityCalculator());
+      SimilarityCalculatorParameter.ValidValues.Add(new NoSimilarityCalculator());
 
       foreach (ISingleObjectiveSolutionSimilarityCalculator similarityCalculator in Problem.Operators.OfType<ISingleObjectiveSolutionSimilarityCalculator>())
Index: /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGAMainLoop.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGAMainLoop.cs	(revision 8621)
+++ /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGAMainLoop.cs	(revision 8622)
@@ -166,7 +166,7 @@
       ProgressiveOffspringPreserver progressiveOffspringSelector = new ProgressiveOffspringPreserver();
       SubScopesCounter subScopesCounter2 = new SubScopesCounter();
+      Calculator calculator1 = new Calculator();
+      ConditionalBranch conditionalBranch1 = new ConditionalBranch();
       Comparator comparator1 = new Comparator();
-      ConditionalBranch conditionalBranch1 = new ConditionalBranch();
-      Comparator comparator2 = new Comparator();
       ConditionalBranch conditionalBranch2 = new ConditionalBranch();
       LeftReducer leftReducer2 = new LeftReducer();
@@ -175,15 +175,16 @@
       RightReducer rightReducer2 = new RightReducer();
       ScopeCleaner scopeCleaner = new ScopeCleaner();
-      OffspringRestorer offspringRestorer = new OffspringRestorer();
+      ScopeRestorer scopeRestorer = new ScopeRestorer();
       MergingReducer mergingReducer = new MergingReducer();
-      Assigner assigner2 = new Assigner();
       IntCounter intCounter3 = new IntCounter();
       SubScopesCounter subScopesCounter3 = new SubScopesCounter();
-      ExpressionEvaluator expressionEvaluator = new ExpressionEvaluator();
+      Calculator calculator2 = new Calculator();
+      Comparator comparator2 = new Comparator();
+      ConditionalBranch conditionalBranch3 = new ConditionalBranch();
       Placeholder analyzer2 = new Placeholder();
       Comparator comparator3 = new Comparator();
-      ConditionalBranch conditionalBranch3 = new ConditionalBranch();
+      ConditionalBranch conditionalBranch4 = new ConditionalBranch();
       Comparator comparator4 = new Comparator();
-      ConditionalBranch conditionalBranch4 = new ConditionalBranch();
+      ConditionalBranch conditionalBranch5 = new ConditionalBranch();
       Assigner assigner3 = new Assigner();
       Assigner assigner4 = new Assigner();
@@ -192,5 +193,4 @@
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class RAPGA expects this to be called Generations
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("CurrentPopulationSize", new IntValue(0)));
-      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("LastPopulationSize", new IntValue(0)));
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("NumberOfCreatedOffspring", new IntValue(0)));
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("NumberOfSuccessfulOffspring", new IntValue(0)));
@@ -258,18 +258,19 @@
       subScopesCounter2.ValueParameter.ActualName = "NumberOfSuccessfulOffspring";
 
-      comparator1.Name = "NumberOfSuccessfulOffspring >= MaximumPopulationSize";
-      comparator1.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
-      comparator1.LeftSideParameter.ActualName = "NumberOfSuccessfulOffspring";
-      comparator1.RightSideParameter.ActualName = MaximumPopulationSizeParameter.Name;
-      comparator1.ResultParameter.ActualName = "Break";
+      calculator1.Name = "NumberOfSuccessfulOffspring == MaximumPopulationSize - Elites";
+      calculator1.CollectedValues.Add(new ValueLookupParameter<IntValue>("NumberOfSuccessfulOffspring"));
+      calculator1.CollectedValues.Add(new ValueLookupParameter<IntValue>("MaximumPopulationSize"));
+      calculator1.CollectedValues.Add(new ValueLookupParameter<IntValue>("Elites"));
+      calculator1.ExpressionParameter.Value = new StringValue("NumberOfSuccessfulOffspring MaximumPopulationSize Elites - ==");
+      calculator1.ExpressionResultParameter.ActualName = "Break";
 
       conditionalBranch1.Name = "Break?";
       conditionalBranch1.ConditionParameter.ActualName = "Break";
 
-      comparator2.Name = "NumberOfCreatedOffspring >= Effort";
-      comparator2.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
-      comparator2.LeftSideParameter.ActualName = "NumberOfCreatedOffspring";
-      comparator2.RightSideParameter.ActualName = EffortParameter.Name;
-      comparator2.ResultParameter.ActualName = "Break";
+      comparator1.Name = "NumberOfCreatedOffspring >= Effort";
+      comparator1.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      comparator1.LeftSideParameter.ActualName = "NumberOfCreatedOffspring";
+      comparator1.RightSideParameter.ActualName = EffortParameter.Name;
+      comparator1.ResultParameter.ActualName = "Break";
 
       conditionalBranch2.Name = "Break?";
@@ -281,8 +282,4 @@
       bestSelector.QualityParameter.ActualName = QualityParameter.Name;
 
-      assigner2.Name = "Update LastPopulationSize";
-      assigner2.LeftSideParameter.ActualName = "LastPopulationSize";
-      assigner2.RightSideParameter.ActualName = "CurrentPopulationSize";
-
       intCounter3.Name = "Increment Generations";
       intCounter3.Increment = new IntValue(1);
@@ -293,11 +290,19 @@
       subScopesCounter3.AccumulateParameter.Value = new BoolValue(false);
 
-      expressionEvaluator.Name = "Evaluate ActualSelectionPressure";
-      expressionEvaluator.CollectedValues.Add(new ValueLookupParameter<IntValue>("CurrentPopulationSize"));
-      expressionEvaluator.CollectedValues.Add(new ValueLookupParameter<IntValue>("LastPopulationSize"));
-      expressionEvaluator.CollectedValues.Add(new ValueLookupParameter<IntValue>("NumberOfCreatedOffspring"));
-      expressionEvaluator.CollectedValues.Add(new ValueLookupParameter<IntValue>("NumberOfSuccessfulOffspring"));
-      expressionEvaluator.ExpressionParameter.Value = new StringValue("CurrentPopulationSize NumberOfCreatedOffspring NumberOfSuccessfulOffspring - + LastPopulationSize /");
-      expressionEvaluator.ExpressionResultParameter.ActualName = "ActualSelectionPressure";
+      calculator2.Name = "Evaluate ActualSelectionPressure";
+      calculator2.CollectedValues.Add(new ValueLookupParameter<IntValue>("NumberOfCreatedOffspring"));
+      calculator2.CollectedValues.Add(new ValueLookupParameter<IntValue>("Elites"));
+      calculator2.CollectedValues.Add(new ValueLookupParameter<IntValue>("CurrentPopulationSize"));
+      calculator2.ExpressionParameter.Value = new StringValue("NumberOfCreatedOffspring Elites + CurrentPopulationSize /");
+      calculator2.ExpressionResultParameter.ActualName = "ActualSelectionPressure";
+
+      comparator2.Name = "CurrentPopulationSize < 1";
+      comparator2.Comparison = new Comparison(ComparisonType.Less);
+      comparator2.LeftSideParameter.ActualName = "CurrentPopulationSize";
+      comparator2.RightSideParameter.Value = new IntValue(1);
+      comparator2.ResultParameter.ActualName = "Terminate";
+
+      conditionalBranch3.Name = "Terminate?";
+      conditionalBranch3.ConditionParameter.ActualName = "Terminate";
 
       analyzer2.Name = "Analyzer";
@@ -310,6 +315,6 @@
       comparator3.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
 
-      conditionalBranch3.Name = "Terminate?";
-      conditionalBranch3.ConditionParameter.ActualName = "Terminate";
+      conditionalBranch4.Name = "Terminate?";
+      conditionalBranch4.ConditionParameter.ActualName = "Terminate";
 
       comparator4.Name = "CurrentPopulationSize < MinimumPopulationSize";
@@ -319,6 +324,6 @@
       comparator4.ResultParameter.ActualName = "Terminate";
 
-      conditionalBranch4.Name = "Terminate?";
-      conditionalBranch4.ConditionParameter.ActualName = "Terminate";
+      conditionalBranch5.Name = "Terminate?";
+      conditionalBranch5.ConditionParameter.ActualName = "Terminate";
 
       assigner3.Name = "Reset NumberOfCreatedOffspring";
@@ -344,5 +349,5 @@
       subScopesProcessor1.Operators.Add(new EmptyOperator());
       subScopesProcessor1.Operators.Add(childrenCreator);
-      subScopesProcessor1.Successor = comparator1;
+      subScopesProcessor1.Successor = calculator1;
       childrenCreator.Successor = uniformSubScopesProcessor;
       uniformSubScopesProcessor.Operator = crossover;
@@ -362,8 +367,8 @@
       leftReducer1.Successor = progressiveOffspringSelector;
       progressiveOffspringSelector.Successor = subScopesCounter2;
-      comparator1.Successor = conditionalBranch1;
-      conditionalBranch1.FalseBranch = comparator2;
+      calculator1.Successor = conditionalBranch1;
+      conditionalBranch1.FalseBranch = comparator1;
       conditionalBranch1.TrueBranch = subScopesProcessor2;
-      comparator2.Successor = conditionalBranch2;
+      comparator1.Successor = conditionalBranch2;
       conditionalBranch2.FalseBranch = leftReducer2;
       conditionalBranch2.TrueBranch = subScopesProcessor2;
@@ -374,19 +379,21 @@
       bestSelector.Successor = rightReducer2;
       rightReducer2.Successor = null;
-      scopeCleaner.Successor = offspringRestorer;
-      mergingReducer.Successor = assigner2;
-      assigner2.Successor = intCounter3;
+      scopeCleaner.Successor = scopeRestorer;
+      mergingReducer.Successor = intCounter3;
       intCounter3.Successor = subScopesCounter3;
-      subScopesCounter3.Successor = expressionEvaluator;
-      expressionEvaluator.Successor = analyzer2;
+      subScopesCounter3.Successor = calculator2;
+      calculator2.Successor = comparator2;
+      comparator2.Successor = conditionalBranch3;
+      conditionalBranch3.FalseBranch = analyzer2;
+      conditionalBranch3.TrueBranch = null;
       analyzer2.Successor = comparator3;
-      comparator3.Successor = conditionalBranch3;
-      conditionalBranch3.FalseBranch = comparator4;
-      conditionalBranch3.TrueBranch = null;
-      conditionalBranch3.Successor = null;
-      comparator4.Successor = conditionalBranch4;
-      conditionalBranch4.FalseBranch = assigner3;
+      comparator3.Successor = conditionalBranch4;
+      conditionalBranch4.FalseBranch = comparator4;
       conditionalBranch4.TrueBranch = null;
       conditionalBranch4.Successor = null;
+      comparator4.Successor = conditionalBranch5;
+      conditionalBranch5.FalseBranch = assigner3;
+      conditionalBranch5.TrueBranch = null;
+      conditionalBranch5.Successor = null;
       assigner3.Successor = assigner4;
       assigner4.Successor = assigner5;
Index: /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/ScopeRestorer.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/ScopeRestorer.cs	(revision 8622)
+++ /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/ScopeRestorer.cs	(revision 8622)
@@ -0,0 +1,74 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.RAPGA {
+  /// <summary>
+  /// An operator that restores created offspring from a scope list.
+  /// </summary>
+  /// <remarks>
+  /// It adds all scopes in the list as sub-scopes to the current scope.
+  /// </remarks>
+  [Item("ScopeRestorer", "An operator that restores created offspring from a scope list. It adds all scopes in the list as sub-scopes to the current scope.")]
+  [StorableClass]
+  public class ScopeRestorer : SingleSuccessorOperator {
+    #region Parameter Properties
+    public ScopeParameter CurrentScopeParameter {
+      get { return (ScopeParameter)Parameters["CurrentScope"]; }
+    }
+    public ILookupParameter<ScopeList> OffspringListParameter {
+      get { return (ILookupParameter<ScopeList>)Parameters["OffspringList"]; }
+    }
+    #endregion
+
+    #region Properties
+    private IScope CurrentScope {
+      get { return CurrentScopeParameter.ActualValue; }
+    }
+    private ScopeList OffspringList {
+      get { return OffspringListParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected ScopeRestorer(bool deserializing) : base(deserializing) { }
+    protected ScopeRestorer(ScopeRestorer original, Cloner cloner) : base(original, cloner) { }
+    public ScopeRestorer()
+      : base() {
+      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope that contains the offspring."));
+      Parameters.Add(new LookupParameter<ScopeList>("OffspringList", "The list that contains the offspring."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ScopeRestorer(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      CurrentScope.SubScopes.AddRange(OffspringList);
+      return base.Apply();
+    }
+  }
+}
Index: anches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/SimilarityCalculator/BlindSimilarityCalculator.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/SimilarityCalculator/BlindSimilarityCalculator.cs	(revision 8621)
+++ 	(revision )
@@ -1,51 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 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.Optimization.Operators;
-
-namespace HeuristicLab.Algorithms.RAPGA {
-  /// <summary>
-  /// An item that performs similarity calculation between two solutions.
-  /// </summary>
-  /// <remarks>
-  /// The item always considers two solutions to be distinct.
-  /// </remarks>
-  [Item("BlindSimilarityCalculator", "An item that performs similarity calculation between two solutions. The item always considers two solutions to be distinct.")]
-  public sealed class BlindSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
-    private BlindSimilarityCalculator(bool deserializing) : base(deserializing) { }
-    private BlindSimilarityCalculator(BlindSimilarityCalculator original, Cloner cloner) : base(original, cloner) { }
-    public BlindSimilarityCalculator() : base() { }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new BlindSimilarityCalculator(this, cloner);
-    }
-
-    public static double CalculateSimilarity(IScope left, IScope right) {
-      return 0.0;
-    }
-
-    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
-      return CalculateSimilarity(leftSolution, rightSolution);
-    }
-  }
-}
Index: /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/SimilarityCalculator/NoSimilarityCalculator.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/SimilarityCalculator/NoSimilarityCalculator.cs	(revision 8622)
+++ /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/SimilarityCalculator/NoSimilarityCalculator.cs	(revision 8622)
@@ -0,0 +1,51 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Optimization.Operators;
+
+namespace HeuristicLab.Algorithms.RAPGA {
+  /// <summary>
+  /// An item that performs similarity calculation between two solutions.
+  /// </summary>
+  /// <remarks>
+  /// The item always considers two solutions to be distinct.
+  /// </remarks>
+  [Item("NoSimilarityCalculator", "An item that performs similarity calculation between two solutions. The item always considers two solutions to be distinct.")]
+  public sealed class NoSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
+    private NoSimilarityCalculator(bool deserializing) : base(deserializing) { }
+    private NoSimilarityCalculator(NoSimilarityCalculator original, Cloner cloner) : base(original, cloner) { }
+    public NoSimilarityCalculator() : base() { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new NoSimilarityCalculator(this, cloner);
+    }
+
+    public static double CalculateSimilarity(IScope left, IScope right) {
+      return 0.0;
+    }
+
+    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
+      return CalculateSimilarity(leftSolution, rightSolution);
+    }
+  }
+}
Index: /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/SimilarityCalculator/QualitySimilarityCalculator.cs
===================================================================
--- /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/SimilarityCalculator/QualitySimilarityCalculator.cs	(revision 8621)
+++ /branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/SimilarityCalculator/QualitySimilarityCalculator.cs	(revision 8622)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -43,5 +44,8 @@
 
     public static double CalculateSimilarity(IScope left, IScope right, string qualityVariableName) {
-      return ((DoubleValue)left.Variables[qualityVariableName].Value).Value == ((DoubleValue)right.Variables[qualityVariableName].Value).Value ? 1.0 : 0.0;
+      double leftQuality = ((DoubleValue)left.Variables[qualityVariableName].Value).Value;
+      double rightQuality = ((DoubleValue)right.Variables[qualityVariableName].Value).Value;
+      double delta = leftQuality.IsAlmost(rightQuality) ? 0.0 : Math.Abs(leftQuality - rightQuality);
+      return 1.0 - delta / Math.Max(leftQuality, rightQuality);
     }
 
