Index: branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/Comparators/EliteWeightedParentsQualityComparator.cs
===================================================================
--- branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/Comparators/EliteWeightedParentsQualityComparator.cs	(revision 12363)
+++ branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/Comparators/EliteWeightedParentsQualityComparator.cs	(revision 12363)
@@ -0,0 +1,140 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm {
+  [Item("EliteWeightedParentsQualityComparator", "M2")]
+  [StorableClass]
+  public class EliteWeightedParentsQualityComparator : SingleSuccessorOperator, ISubScopesQualityComparatorOperator {
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    public ILookupParameter<DoubleValue> LeftSideParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["LeftSide"]; }
+    }
+    public ILookupParameter<ItemArray<DoubleValue>> RightSideParameter {
+      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["RightSide"]; }
+    }
+    public ILookupParameter<BoolValue> ResultParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters["Result"]; }
+    }
+    public ILookupParameter<BoolValue> ResultImprovementParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters["ResultImprovement"]; }
+    }
+    public ValueLookupParameter<DoubleValue> ComparisonFactorParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
+    }
+
+    [StorableConstructor]
+    protected EliteWeightedParentsQualityComparator(bool deserializing) : base(deserializing) { }
+    protected EliteWeightedParentsQualityComparator(EliteWeightedParentsQualityComparator original, Cloner cloner) : base(original, cloner) { }
+    public EliteWeightedParentsQualityComparator()
+      : base() {
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, false otherwise"));
+      Parameters.Add(new LookupParameter<DoubleValue>("LeftSide", "The quality of the child."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("RightSide", "The qualities of the parents."));
+      Parameters.Add(new LookupParameter<BoolValue>("Result", "The result of the comparison: True means Quality is better, False means it is worse than parents."));
+      Parameters.Add(new LookupParameter<BoolValue>("ResultImprovement", "A solution has improved if it is better than the worse parent."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactor", "Determines if the quality should be compared to the better parent (1.0), to the worse (0.0) or to any linearly interpolated value between them."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new EliteWeightedParentsQualityComparator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      ItemArray<DoubleValue> rightQualities = RightSideParameter.ActualValue;
+      if (rightQualities.Length < 1) throw new InvalidOperationException(Name + ": No subscopes found.");
+      double compFact = ComparisonFactorParameter.ActualValue.Value;
+      bool maximization = MaximizationParameter.ActualValue.Value;
+      double leftQuality = LeftSideParameter.ActualValue.Value;
+
+      double threshold = 0;
+
+      #region Calculate threshold
+      if (rightQualities.Length == 2) { // this case will probably be used most often
+        double minQuality = Math.Min(rightQualities[0].Value, rightQualities[1].Value);
+        double maxQuality = Math.Max(rightQualities[0].Value, rightQualities[1].Value);
+        if (maximization)
+          threshold = minQuality + (maxQuality - minQuality) * compFact;
+        else
+          threshold = maxQuality - (maxQuality - minQuality) * compFact;
+      } else if (rightQualities.Length == 1) { // case for just one parent
+        threshold = rightQualities[0].Value;
+      } else { // general case extended to 3 or more parents
+        List<double> sortedQualities = rightQualities.Select(x => x.Value).ToList();
+        sortedQualities.Sort();
+        double minimumQuality = sortedQualities.First();
+
+        double integral = 0;
+        for (int i = 0; i < sortedQualities.Count - 1; i++) {
+          integral += (sortedQualities[i] + sortedQualities[i + 1]) / 2.0; // sum of the trapezoid
+        }
+        integral -= minimumQuality * sortedQualities.Count;
+        if (integral == 0) threshold = sortedQualities[0]; // all qualities are equal
+        else {
+          double selectedArea = integral * (maximization ? compFact : (1 - compFact));
+          integral = 0;
+          for (int i = 0; i < sortedQualities.Count - 1; i++) {
+            double currentSliceArea = (sortedQualities[i] + sortedQualities[i + 1]) / 2.0;
+            double windowedSliceArea = currentSliceArea - minimumQuality;
+            if (windowedSliceArea == 0) continue;
+            integral += windowedSliceArea;
+            if (integral >= selectedArea) {
+              double factor = 1 - ((integral - selectedArea) / (windowedSliceArea));
+              threshold = sortedQualities[i] + (sortedQualities[i + 1] - sortedQualities[i]) * factor;
+              break;
+            }
+          }
+        }
+      }
+      #endregion
+
+      bool result = maximization && leftQuality > threshold || !maximization && leftQuality < threshold;
+      BoolValue resultValue = ResultParameter.ActualValue;
+      if (resultValue == null) {
+        ResultParameter.ActualValue = new BoolValue(result);
+      } else {
+        resultValue.Value = result;
+      }
+
+      bool resultImprovement = maximization && leftQuality > rightQualities.Min(x => x.Value) ||
+                              !maximization && leftQuality < rightQualities.Max(x => x.Value);
+      BoolValue resultImprovementValue = ResultImprovementParameter.ActualValue;
+      if (resultImprovementValue == null) {
+        ResultImprovementParameter.ActualValue = new BoolValue(resultImprovement);
+      } else {
+        resultImprovementValue.Value = resultImprovement;
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm-3.3.csproj
===================================================================
--- branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm-3.3.csproj	(revision 12352)
+++ branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm-3.3.csproj	(revision 12363)
@@ -176,8 +176,10 @@
     <Compile Include="Comparators\UnwantedMutationsComparator.cs" />
     <Compile Include="Comparators\WeightedParentsDiversityComparator.cs" />
+    <Compile Include="Comparators\EliteWeightedParentsQualityComparator.cs" />
     <Compile Include="Comparators\WeightedParentsQualityComparator.cs" />
     <Compile Include="ISubScopesQualityComparatorOperator.cs" />
     <Compile Include="OffspringCollector.cs" />
     <Compile Include="OffspringSelectors\IOffspringSelector.cs" />
+    <Compile Include="OffspringSelectors\EliteOffspringSelector.cs" />
     <Compile Include="OffspringSelectors\PopDivOffspringSelector.cs" />
     <Compile Include="OffspringSelectors\StandardOffspringSelector.cs" />
Index: branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/OffspringSelectors/EliteOffspringSelector.cs
===================================================================
--- branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/OffspringSelectors/EliteOffspringSelector.cs	(revision 12363)
+++ branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/OffspringSelectors/EliteOffspringSelector.cs	(revision 12363)
@@ -0,0 +1,289 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using HeuristicLab.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.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm {
+  [Item("EliteOffspringSelector", "M2")]
+  [StorableClass]
+  public class EliteOffspringSelector : InstrumentedOperator, IOffspringSelector {
+
+    private const string SuccessRatioChart = "SuccessRatioChart";
+    private const string SuccessRatioDataRow = "SuccessRatio";
+
+
+    public ValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
+    }
+    public ValueLookupParameter<DoubleValue> SuccessRatioParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
+    }
+    public LookupParameter<DoubleValue> SelectionPressureParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["SelectionPressure"]; }
+    }
+    public LookupParameter<DoubleValue> CurrentSuccessRatioParameter {
+      get { return (LookupParameter<DoubleValue>)Parameters["CurrentSuccessRatio"]; }
+    }
+    public LookupParameter<ItemList<IScope>> OffspringPopulationParameter {
+      get { return (LookupParameter<ItemList<IScope>>)Parameters["OffspringPopulation"]; }
+    }
+    public LookupParameter<IntValue> OffspringPopulationWinnersParameter {
+      get { return (LookupParameter<IntValue>)Parameters["OffspringPopulationWinners"]; }
+    }
+    public ScopeTreeLookupParameter<BoolValue> SuccessfulOffspringParameter {
+      get { return (ScopeTreeLookupParameter<BoolValue>)Parameters["SuccessfulOffspring"]; }
+    }
+    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
+    }
+    public ILookupParameter<BoolValue> EnoughChildrenGeneratedParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters["EnoughChildrenGenerated"]; }
+    }
+    public IValueLookupParameter<ISolutionSimilarityCalculator> SimilarityCalculatorParameter {
+      get { return (IValueLookupParameter<ISolutionSimilarityCalculator>)Parameters["SimilarityCalculator"]; }
+    }
+    public ValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
+    }
+
+    public ValueLookupParameter<DoubleValue> DiversityComparisonFactorParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["DiversityComparisonFactor"]; }
+    }
+    private ValueLookupParameter<DoubleValue> ComparisonFactorLowerBoundParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["DiversityComparisonFactorLowerBound"]; }
+    }
+    private ValueLookupParameter<DoubleValue> ComparisonFactorUpperBoundParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["DiversityComparisonFactorUpperBound"]; }
+    }
+
+    public IConstrainedValueParameter<IDiscreteDoubleValueModifier> ComparisonFactorModifierParameter {
+      get { return (IConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters["ComparisonFactorModifier"]; }
+    }
+
+    [StorableConstructor]
+    protected EliteOffspringSelector(bool deserializing) : base(deserializing) { }
+    protected EliteOffspringSelector(EliteOffspringSelector original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new EliteOffspringSelector(this, cloner);
+    }
+    public EliteOffspringSelector()
+      : 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 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 LookupParameter<BoolValue>("EnoughChildrenGenerated", "True if enough children have been generated, otherwise false."));
+      Parameters.Add(new ValueLookupParameter<ISolutionSimilarityCalculator>("SimilarityCalculator", "The similarity calculator that should be used to calculate solution similarity."));
+      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the population diversity analysis results should be stored."));
+
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("DiversityComparisonFactor", "Determines if the quality should be compared to the better parent (1.0), to the worse (0.0) or to any linearly interpolated value between them.", new DoubleValue(0.0)));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("DiversityComparisonFactorLowerBound", "The lower bound of the comparison factor (start).", new DoubleValue(0.5)));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("DiversityComparisonFactorUpperBound", "The upper bound of the comparison factor (end).", new DoubleValue(1.0)));
+      Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("ComparisonFactorModifier", "The operator used to modify the comparison factor.", new ItemSet<IDiscreteDoubleValueModifier>(new IDiscreteDoubleValueModifier[] { new LinearDiscreteDoubleValueModifier() }), new LinearDiscreteDoubleValueModifier()));
+
+
+      foreach (IDiscreteDoubleValueModifier modifier in ApplicationManager.Manager.GetInstances<IDiscreteDoubleValueModifier>().OrderBy(x => x.Name))
+        ComparisonFactorModifierParameter.ValidValues.Add(modifier);
+      IDiscreteDoubleValueModifier linearModifier = ComparisonFactorModifierParameter.ValidValues.FirstOrDefault(x => x.GetType().Name.Equals("LinearDiscreteDoubleValueModifier"));
+      if (linearModifier != null) ComparisonFactorModifierParameter.Value = linearModifier;
+      ParameterizeComparisonFactorModifiers();
+
+      this.AfterExecutionOperators.Clear();
+      this.AfterExecutionOperators.Add(ComparisonFactorModifierParameter.Value);
+      ComparisonFactorModifierParameter.ValueChanged += ComparisonFactorModifierParameter_ValueChanged;
+    }
+
+    void ComparisonFactorModifierParameter_ValueChanged(object sender, EventArgs e) {
+      this.AfterExecutionOperators.Clear();
+      this.AfterExecutionOperators.Add(ComparisonFactorModifierParameter.Value);
+    }
+
+    private void ParameterizeComparisonFactorModifiers() {
+      //TODO: does not work if Generations parameter names are changed
+      foreach (IDiscreteDoubleValueModifier modifier in ComparisonFactorModifierParameter.ValidValues) {
+        modifier.IndexParameter.ActualName = "Generations";
+        modifier.EndIndexParameter.ActualName = "MaximumGenerations";
+        modifier.EndValueParameter.ActualName = ComparisonFactorUpperBoundParameter.Name;
+        modifier.StartIndexParameter.Value = new IntValue(0);
+        modifier.StartValueParameter.ActualName = ComparisonFactorLowerBoundParameter.Name;
+        modifier.ValueParameter.ActualName = "DiversityComparisonFactor";
+      }
+    }
+
+    public override IOperation InstrumentedApply() {
+      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 = parents.SubScopes.Count;
+
+      // 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;
+      }
+
+      DataTable successRatioDataTable;
+      if (ResultsParameter.ActualValue.ContainsKey(SuccessRatioChart)) {
+        successRatioDataTable = (DataTable)ResultsParameter.ActualValue[SuccessRatioChart].Value;
+      } else {
+        successRatioDataTable = new DataTable(SuccessRatioChart);
+        successRatioDataTable.Rows.Add(new DataRow(SuccessRatioDataRow));
+        ResultsParameter.ActualValue.Add(new Result(SuccessRatioChart, successRatioDataTable));
+      }
+
+      // 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;
+      double avgPopDiv = DiversityComparisonFactorParameter.Value.Value;
+
+      // 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.");
+
+        if (!offspring.SubScopes[i].Variables.TryGetValue("ResultImprovement", out tmpVar)) throw new InvalidOperationException(Name + ": Could not find ResultImprovment.");
+        BoolValue betterThanWorseParent = (tmpVar.Value as BoolValue);
+        if (betterThanWorseParent == null) throw new InvalidOperationException(Name + ": Could not find ResultImprovment.");
+
+        //this is an "elite" solution candidate
+        double tmpCurSuccRatio = (successfulOffspring.Value + successfulOffspringAdded) / (double)populationSize;
+        if (tmp.Value && tmpCurSuccRatio <= successRatio) {
+          //this overrides the diversity mechanism; always fill up elites if there is space
+          IScope currentOffspring = offspring.SubScopes[i];
+          offspring.SubScopes.Remove(currentOffspring);
+          i--;
+          population.Add(currentOffspring);
+          successfulOffspringAdded++;
+        } else if (!tmp.Value && betterThanWorseParent.Value) {
+          //quality is ok, check for diversity
+          IScope currentOffspring = offspring.SubScopes[i];
+
+          if (!population.Any()) {
+            offspring.SubScopes.Remove(currentOffspring);
+            i--;
+            worseOffspringNeeded--;
+            population.Add(currentOffspring);
+          } else {
+            Scope tmpScope = new Scope();
+            tmpScope.SubScopes.AddRange(population);
+            Scope tmpCurrentScope = new Scope();
+            tmpCurrentScope.SubScopes.Add(currentOffspring);
+            double curDiv = SimilarityCalculatorParameter.ActualValue.CalculateSolutionCrowdSimilarity(tmpCurrentScope, tmpScope)[0].Average();
+            if (curDiv < avgPopDiv) {
+              if (worseOffspringNeeded > 0 || tmpSelPress >= maxSelPress) {
+                if (!fillPopulationWithParents || worseOffspringNeeded > 0) {
+                  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);
+      successRatioDataTable.Rows[SuccessRatioDataRow].Values.Add(currentSuccessRatio.Value);
+
+      if (EnoughChildrenGeneratedParameter.ActualValue == null) {
+        EnoughChildrenGeneratedParameter.ActualValue = new BoolValue();
+      }
+      // check if enough children have been generated
+      if (((selectionPressure.Value < maxSelPress) &&
+        (currentSuccessRatio.Value < successRatio) &&
+        (population.Count < populationSize)) ||
+          (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);
+        }
+        EnoughChildrenGeneratedParameter.ActualValue.Value = false;
+      } else {
+        // enough children generated
+        offspring.SubScopes.Clear();
+        offspring.SubScopes.AddRange(population);
+
+        scope.Variables.Remove(OffspringPopulationParameter.TranslatedName);
+        scope.Variables.Remove(OffspringPopulationWinnersParameter.TranslatedName);
+        EnoughChildrenGeneratedParameter.ActualValue.Value = true;
+      }
+
+      return base.InstrumentedApply();
+    }
+  }
+}
Index: branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/OffspringSelectors/PopDivOffspringSelector.cs
===================================================================
--- branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/OffspringSelectors/PopDivOffspringSelector.cs	(revision 12352)
+++ branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/OffspringSelectors/PopDivOffspringSelector.cs	(revision 12363)
@@ -34,5 +34,5 @@
 
 namespace HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm {
-  [Item("PopDivOffspringSelector", "")]
+  [Item("PopDivOffspringSelector", "M1")]
   [StorableClass]
   public class PopDivOffspringSelector : InstrumentedOperator, IOffspringSelector {
