Index: branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs
===================================================================
--- branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs	(revision 8313)
+++ branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs	(revision 8330)
@@ -64,4 +64,16 @@
       get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; }
     }
+    private IValueParameter<IntValue> MinimumPopulationSizeParameter {
+      get { return (IValueParameter<IntValue>)Parameters["MinimumPopulationSize"]; }
+    } 
+    private IValueParameter<IntValue> MaximumPopulationSizeParameter {
+      get { return (IValueParameter<IntValue>) Parameters["MaximumPopulationSize"]; }
+    }
+    private IValueParameter<DoubleValue> ComparisonFactorParameter {
+      get { return (IValueParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
+    }
+    private IValueParameter<IntValue> EffortParameter {
+      get { return (IValueParameter<IntValue>)Parameters["Effort"]; }
+    }
     public IConstrainedValueParameter<ISelector> SelectorParameter {
       get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
@@ -99,4 +111,20 @@
       get { return PopulationSizeParameter.Value; }
       set { PopulationSizeParameter.Value = value; }
+    }
+    public IntValue MinimumPopulationSize {
+      get { return MinimumPopulationSizeParameter.Value; }
+      set { MinimumPopulationSizeParameter.Value = value; }
+    }
+    public IntValue MaximumPopulationSize {
+      get { return MaximumPopulationSizeParameter.Value; }
+      set { MaximumPopulationSizeParameter.Value = value; }
+    }
+    public DoubleValue ComparisonFactor {
+      get { return ComparisonFactorParameter.Value; }
+      set { ComparisonFactorParameter.Value = value; }
+    }
+    public IntValue Effort {
+      get { return EffortParameter.Value; }
+      set { EffortParameter.Value = value; }
     }
     public ISelector Selector {
@@ -154,5 +182,9 @@
       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 ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions.", new IntValue(300)));
+      Parameters.Add(new ValueParameter<IntValue>("MinimumPopulationSize", "The minimum size of the population of solutions.", new IntValue(2)));
+      Parameters.Add(new ValueParameter<IntValue>("MaximumPopulationSize", "The maximum size of the population of solutions.", new IntValue(499)));
+      Parameters.Add(new ValueParameter<DoubleValue>("ComparisonFactor", "The comparison factor.", new DoubleValue(0.0)));
+      Parameters.Add(new ValueParameter<IntValue>("Effort", "The maximum number of offspring created in each generation.", new IntValue(1000)));
       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."));
Index: branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGAMainLoop.cs
===================================================================
--- branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGAMainLoop.cs	(revision 8313)
+++ branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGAMainLoop.cs	(revision 8330)
@@ -79,4 +79,16 @@
       get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
     }
+    public IValueLookupParameter<IntValue> MinimumPopulationSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["MinimumPopulationSize"]; }
+    }
+    public IValueLookupParameter<IntValue> MaximumPopulationSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["MaximumPopulationSize"]; }
+    }
+    public IValueLookupParameter<DoubleValue> ComparisonFactorParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
+    }
+    public IValueLookupParameter<IntValue> EffortParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["Effort"]; }
+    }
     private ScopeParameter CurrentScopeParameter {
       get { return (ScopeParameter)Parameters["CurrentScope"]; }
@@ -115,4 +127,8 @@
       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 ValueLookupParameter<IntValue>("MinimumPopulationSize", "The minimum size of the population of solutions."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumPopulationSize", "The maximum size of the population of solutions."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactor", "The comparison factor."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("Effort", "The maximum number of offspring created in each generation."));
       Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the genetic algorithm should be applied."));
       #endregion
@@ -120,4 +136,5 @@
       #region Create operators
       VariableCreator variableCreator = new VariableCreator();
+      Assigner assigner1 = new Assigner();
       ResultsCollector resultsCollector1 = new ResultsCollector();
       Placeholder analyzer1 = new Placeholder();
@@ -129,20 +146,41 @@
       StochasticBranch stochasticBranch = new StochasticBranch();
       Placeholder mutator = new Placeholder();
-      SubScopesRemover subScopesRemover = new SubScopesRemover();
       UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
       Placeholder evaluator = new Placeholder();
-      SubScopesCounter subScopesCounter = new SubScopesCounter();
+      WeightedParentsQualityComparator comparator1 = new WeightedParentsQualityComparator();
+      ConditionalSelector conditionalSelector = new ConditionalSelector();
+      RightReducer rightReducer1 = new RightReducer();
+      SubScopesCounter subScopesCounter1 = new SubScopesCounter();
+      IntCounter intCounter1 = new IntCounter();
+      UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor();
+      SubScopesRemover subScopesRemover = new SubScopesRemover();
+      Comparator comparator2 = new Comparator();
+      ConditionalBranch conditionalBranch1 = new ConditionalBranch();
+      BestSelector bestSelector1 = new BestSelector();
+      BestSelector bestSelector2 = new BestSelector();
+      RightReducer rightReducer2 = new RightReducer();
       SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
-      BestSelector bestSelector = new BestSelector();
-      RightReducer rightReducer = new RightReducer();
+      BestSelector bestSelector3 = new BestSelector();
+      RightReducer rightReducer3 = new RightReducer();
       MergingReducer mergingReducer = new MergingReducer();
-      IntCounter intCounter = new IntCounter();
-      Comparator comparator = new Comparator();
+      IntCounter intCounter2 = new IntCounter();
+      Comparator comparator3 = new Comparator();
       Placeholder analyzer2 = new Placeholder();
-      ConditionalBranch conditionalBranch = new ConditionalBranch();
+      ConditionalBranch conditionalBranch2 = new ConditionalBranch();
+      Assigner assigner2 = new Assigner();
+      SubScopesCounter subScopesCounter2 = new SubScopesCounter();
+      ResultsCollector resultsCollector2 = new ResultsCollector();
+      Comparator comparator4 = new Comparator();
+      ConditionalBranch conditionalBranch3 = new ConditionalBranch();
 
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class GeneticAlgorithm expects this to be called Generations
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("CurrentPopulationSize", new IntValue(0)));
+
+      assigner1.Name = "Initialize CurrentPopulationSize";
+      assigner1.LeftSideParameter.ActualName = "CurrentPopulationSize";
+      assigner1.RightSideParameter.ActualName = EvaluatedSolutionsParameter.ActualName;
 
       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("CurrentPopulationSize"));
       resultsCollector1.ResultsParameter.ActualName = "Results";
 
@@ -164,6 +202,4 @@
       mutator.OperatorParameter.ActualName = "Mutator";
 
-      subScopesRemover.RemoveAllSubScopes = true;
-
       uniformSubScopesProcessor2.Parallel.Value = true;
 
@@ -171,29 +207,82 @@
       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";
+      comparator1.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
+      comparator1.LeftSideParameter.ActualName = QualityParameter.Name;
+      comparator1.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      comparator1.RightSideParameter.ActualName = QualityParameter.Name;
+      comparator1.ResultParameter.ActualName = "SuccessfulOffspring";
+
+      conditionalSelector.ConditionParameter.ActualName = "SuccessfulOffspring";
+      conditionalSelector.ConditionParameter.Depth = 1;
+      conditionalSelector.CopySelected.Value = false;
+
+      subScopesCounter1.Name = "Count Successful Offspring";
+      subScopesCounter1.ValueParameter.ActualName = "NumberOfSuccessfulOffspring";
+
+      intCounter1.IncrementParameter.ActualName = "NumberOfSuccessfulOffspring";
+      intCounter1.IncrementParameter.Value = null;
+      intCounter1.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+
+      uniformSubScopesProcessor3.Parallel.Value = true;
+
+      subScopesRemover.RemoveAllSubScopes = true;
+
+      comparator2.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      comparator2.LeftSideParameter.ActualName = "NumberOfSuccessfulOffspring";
+      comparator2.RightSideParameter.ActualName = MaximumPopulationSizeParameter.Name;
+      comparator2.ResultParameter.ActualName = "SelectMaximum";
+
+      conditionalBranch1.ConditionParameter.ActualName = "SelectMaximum";
+
+      bestSelector1.CopySelected = new BoolValue(true);
+      bestSelector1.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestSelector1.NumberOfSelectedSubScopesParameter.ActualName = MaximumPopulationSizeParameter.Name;
+      bestSelector1.QualityParameter.ActualName = QualityParameter.Name;
+
+      bestSelector2.CopySelected = new BoolValue(true);
+      bestSelector2.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestSelector2.NumberOfSelectedSubScopesParameter.ActualName = "NumberOfSuccessfulOffspring";
+      bestSelector2.QualityParameter.ActualName = QualityParameter.Name;
+
+      bestSelector3.CopySelected = new BoolValue(false);
+      bestSelector3.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestSelector3.NumberOfSelectedSubScopesParameter.ActualName = "Elites";
+      bestSelector3.QualityParameter.ActualName = QualityParameter.Name;
+
+      intCounter2.Increment = new IntValue(1);
+      intCounter2.ValueParameter.ActualName = "Generations";
+
+      comparator3.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      comparator3.LeftSideParameter.ActualName = "Generations";
+      comparator3.ResultParameter.ActualName = "Terminate";
+      comparator3.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
 
       analyzer2.Name = "Analyzer";
       analyzer2.OperatorParameter.ActualName = "Analyzer";
 
-      conditionalBranch.ConditionParameter.ActualName = "Terminate";
+      conditionalBranch2.ConditionParameter.ActualName = "Terminate";
+
+      assigner2.Name = "Reset CurrentPopulationSize";
+      assigner2.LeftSideParameter.ActualName = "CurrentPopulationSize";
+      assigner2.RightSideParameter.Value = new IntValue(0);
+
+      subScopesCounter2.Name = "Increment EvaluatedSolutions";
+      subScopesCounter2.ValueParameter.ActualName = "CurrentPopulationSize";
+
+      resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("CurrentPopulationSize"));
+      resultsCollector2.ResultsParameter.ActualName = "Results";
+
+      comparator4.Comparison = new Comparison(ComparisonType.Less);
+      comparator4.LeftSideParameter.ActualName = "CurrentPopulationSize";
+      comparator4.RightSideParameter.ActualName = MinimumPopulationSizeParameter.Name;
+      comparator4.ResultParameter.ActualName = "Terminate";
+
+      conditionalBranch3.ConditionParameter.ActualName = "Terminate";
       #endregion
 
       #region Create operator graph
       OperatorGraph.InitialOperator = variableCreator;
-      variableCreator.Successor = resultsCollector1;
+      variableCreator.Successor = assigner1;
+      assigner1.Successor = resultsCollector1;
       resultsCollector1.Successor = analyzer1;
       analyzer1.Successor = selector;
@@ -208,23 +297,40 @@
       stochasticBranch.FirstBranch = mutator;
       stochasticBranch.SecondBranch = null;
-      stochasticBranch.Successor = subScopesRemover;
+      stochasticBranch.Successor = null;
       mutator.Successor = null;
       subScopesRemover.Successor = null;
       uniformSubScopesProcessor2.Operator = evaluator;
-      uniformSubScopesProcessor2.Successor = subScopesCounter;
-      evaluator.Successor = null;
-      subScopesCounter.Successor = null;
-      subScopesProcessor2.Operators.Add(bestSelector);
+      uniformSubScopesProcessor2.Successor = conditionalSelector;
+      evaluator.Successor = comparator1;
+      conditionalSelector.Successor = rightReducer1;
+      rightReducer1.Successor = subScopesCounter1;
+      subScopesCounter1.Successor = intCounter1;
+      intCounter1.Successor = uniformSubScopesProcessor3;
+      uniformSubScopesProcessor3.Operator = subScopesRemover;
+      uniformSubScopesProcessor3.Successor = comparator2;
+      comparator2.Successor = conditionalBranch1;
+      conditionalBranch1.TrueBranch = bestSelector1;
+      conditionalBranch1.FalseBranch = bestSelector2;
+      bestSelector1.Successor = rightReducer2;
+      bestSelector2.Successor = rightReducer2;
+      subScopesProcessor2.Operators.Add(bestSelector3);
       subScopesProcessor2.Operators.Add(new EmptyOperator());
       subScopesProcessor2.Successor = mergingReducer;
-      bestSelector.Successor = rightReducer;
-      rightReducer.Successor = null;
-      mergingReducer.Successor = intCounter;
-      intCounter.Successor = comparator;
-      comparator.Successor = analyzer2;
-      analyzer2.Successor = conditionalBranch;
-      conditionalBranch.FalseBranch = selector;
-      conditionalBranch.TrueBranch = null;
-      conditionalBranch.Successor = null;
+      bestSelector3.Successor = rightReducer3;
+      rightReducer3.Successor = null;
+      mergingReducer.Successor = intCounter2;
+      intCounter2.Successor = comparator3;
+      comparator3.Successor = analyzer2;
+      analyzer2.Successor = conditionalBranch2;
+      conditionalBranch2.FalseBranch = assigner2;
+      conditionalBranch2.TrueBranch = null;
+      conditionalBranch2.Successor = null;
+      assigner2.Successor = subScopesCounter2;
+      subScopesCounter2.Successor = resultsCollector2;
+      resultsCollector2.Successor = comparator4;
+      comparator4.Successor = conditionalBranch3;
+      conditionalBranch3.FalseBranch = selector;
+      conditionalBranch3.TrueBranch = null;
+      conditionalBranch3.Successor = null;
       #endregion
     }
