Index: trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/HeuristicLab.Selection.OffspringSelection-3.2.csproj
===================================================================
--- trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/HeuristicLab.Selection.OffspringSelection-3.2.csproj	(revision 1864)
+++ trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/HeuristicLab.Selection.OffspringSelection-3.2.csproj	(revision 1864)
@@ -0,0 +1,119 @@
+﻿<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{205898D3-2717-4686-AF17-52409B7EC0C6}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Selection.OffspringSelection</RootNamespace>
+    <AssemblyName>HeuristicLab.Selection.OffspringSelection-3.2</AssemblyName>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>2.0</OldToolsVersion>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</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>
+    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+    <DocumentationFile>bin\Release\HeuristicLab.Selection.OffspringSelection-3.2.XML</DocumentationFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>bin\Release\HeuristicLab.Selection.OffspringSelection-3.2.XML</DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>bin\Release\HeuristicLab.Selection.OffspringSelection-3.2.XML</DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="HeuristicLabSelectionOffspringSelectionPlugin.cs" />
+    <Compile Include="OffspringAnalyzer.cs" />
+    <Compile Include="OffspringSelector.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="WeightedOffspringFitnessComparer.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
+      <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
+      <Name>HeuristicLab.Core-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Data\3.2\HeuristicLab.Data-3.2.csproj">
+      <Project>{F473D9AF-3F09-4296-9F28-3C65118DAFFA}</Project>
+      <Name>HeuristicLab.Data-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\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>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/HeuristicLabSelectionOffspringSelectionPlugin.cs
===================================================================
--- trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/HeuristicLabSelectionOffspringSelectionPlugin.cs	(revision 1864)
+++ trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/HeuristicLabSelectionOffspringSelectionPlugin.cs	(revision 1864)
@@ -0,0 +1,37 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Selection.OffspringSelection {
+  /// <summary>
+  /// Plugin class for HeuristicLab.Selection.OffspringSelection plugin.
+  /// </summary>
+  [ClassInfo(Name = "HeuristicLab.Selection.OffspringSelection-3.2")]
+  [PluginFile(Filename = "HeuristicLab.Selection.OffspringSelection-3.2.dll", Filetype = PluginFileType.Assembly)]
+  [Dependency(Dependency = "HeuristicLab.Core-3.2")]
+  [Dependency(Dependency = "HeuristicLab.Data-3.2")]
+  public class HeuristicLabSelectionOffspringSelectionPlugin : PluginBase {
+  }
+}
Index: trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/OffspringAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/OffspringAnalyzer.cs	(revision 1864)
+++ trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/OffspringAnalyzer.cs	(revision 1864)
@@ -0,0 +1,136 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Selection.OffspringSelection {
+  /// <summary>
+  /// Analyzes the offspring in a given scope whether it is successful or not.
+  /// </summary>
+  public class OffspringAnalyzer : OperatorBase {
+    /// <inheritdoc select="summary"/>
+    public override string Description {
+      get { return @"TODO\r\nOperator description still missing ..."; }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="OffspringAnalyzer"/> with six variable infos 
+    /// (<c>Maximization</c>, <c>Quality</c>, <c>ParentQualities</c>, <c>SuccessfulChild</c>,
+    /// <c>ComparisonFactor</c> and <c>ParentsCount</c>).
+    /// </summary>
+    public OffspringAnalyzer() {
+      AddVariableInfo(new VariableInfo("Maximization", "Problem is a maximization problem", typeof(BoolData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("Quality", "Quality value", typeof(DoubleData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("ParentQualities", "Temporarily store parent qualities", typeof(DoubleArrayData), VariableKind.New | VariableKind.Out | VariableKind.In | VariableKind.Deleted));
+      AddVariableInfo(new VariableInfo("SuccessfulChild", "True if the child was successful", typeof(BoolData), VariableKind.New));
+
+      VariableInfo compFactorInfo = new VariableInfo("ComparisonFactor", "Factor for comparing the quality of a child with the qualities of its parents (0 = better than worst parent, 1 = better than best parent)", typeof(DoubleData), VariableKind.In);
+      compFactorInfo.Local = true;
+      AddVariableInfo(compFactorInfo);
+      AddVariable(new Variable("ComparisonFactor", new DoubleData(0.5)));
+      VariableInfo parentCount = new VariableInfo("ParentsCount", "How many parents created the offspring", typeof(IntData), VariableKind.In);
+      parentCount.Local = true;
+      AddVariableInfo(parentCount);
+      AddVariable(new Variable("ParentsCount", new IntData(2)));
+    }
+
+    /// <summary>
+    /// Analyzes the offspring in the given scope whether the children are successful or not.
+    /// </summary>
+    /// <exception cref="InvalidOperationException">Thrown when <c>ParentsCount</c> smaller than 1.</exception>
+    /// <exception cref="InvalidOperationException">Thrown when the number of children is not constant or
+    /// smaller than 1.</exception>
+    /// <param name="scope">The scope whose offspring should be analyzed.</param>
+    /// <returns>The next operation or <c>null</c>.</returns>
+    public override IOperation Apply(IScope scope) {
+      bool maximize = GetVariableValue<BoolData>("Maximization", scope, true).Data;
+      double compFact = GetVariableValue<DoubleData>("ComparisonFactor", scope, true).Data;
+      int parentsCount = GetVariableValue<IntData>("ParentsCount", scope, true).Data;
+      if (parentsCount < 1) throw new InvalidOperationException("OffspringAnalyzer: ParentsCount must be >= 1");
+
+      DoubleArrayData qualities = GetVariableValue<DoubleArrayData>("ParentQualities", scope, false, false);
+      if (qualities == null) {
+        // fetch and store parent qualities
+        IVariableInfo qualityInfo = GetVariableInfo("Quality");
+        double[] qualitiesArray = new double[scope.SubScopes.Count];
+        for (int i = 0; i < qualitiesArray.Length; i++)
+          qualitiesArray[i] = scope.SubScopes[i].GetVariableValue<DoubleData>(qualityInfo.FormalName, false).Data;
+        qualities = new DoubleArrayData(qualitiesArray);
+        IVariableInfo parentQualitiesInfo = GetVariableInfo("ParentQualities");
+        if (parentQualitiesInfo.Local)
+          AddVariable(new Variable(parentQualitiesInfo.ActualName, qualities));
+        else
+          scope.AddVariable(new Variable(scope.TranslateName(parentQualitiesInfo.FormalName), qualities));
+
+        CompositeOperation next = new CompositeOperation();
+        next.AddOperation(new AtomicOperation(SubOperators[0], scope));
+        next.AddOperation(new AtomicOperation(this, scope));
+        return next;
+      } else {
+        int crossoverEvents = qualities.Data.Length / parentsCount;
+        int childrenPerCrossoverEvent = scope.SubScopes.Count / crossoverEvents;
+        if (scope.SubScopes.Count % crossoverEvents != 0 ||
+          childrenPerCrossoverEvent < 1) throw new InvalidOperationException("OffspringAnalyzer: The number of children per crossover event has to be constant and >= 1");
+        // analyze offspring of all crossoverEvents
+        for (int i = 0; i < crossoverEvents; i++) {
+          double worstParent = double.MaxValue; // lowest quality parent
+          double bestParent = double.MinValue; // highest quality parent
+          for (int y = 0; y < parentsCount; y++) {
+            if (qualities.Data[i * parentsCount + y] < worstParent) worstParent = qualities.Data[i * parentsCount + y];
+            if (qualities.Data[i * parentsCount + y] > bestParent) bestParent = qualities.Data[i * parentsCount + y];
+          }
+          for (int j = 0; j < childrenPerCrossoverEvent; j++) {
+            IVariableInfo qualityInfo = GetVariableInfo("Quality");
+            double child = scope.SubScopes[i * childrenPerCrossoverEvent + j].GetVariableValue<DoubleData>(qualityInfo.FormalName, false).Data;
+            double threshold;
+
+            if (!maximize)
+              threshold = bestParent + (worstParent - bestParent) * compFact;
+            else
+              threshold = worstParent + (bestParent - worstParent) * compFact;
+
+            IVariableInfo successfulInfo = GetVariableInfo("SuccessfulChild");
+            BoolData successful;
+            if (((!maximize) && (child < threshold)) ||
+                ((maximize) && (child > threshold)))
+              successful = new BoolData(true);
+            else
+              successful = new BoolData(false);
+            scope.SubScopes[i * childrenPerCrossoverEvent + j].AddVariable(new Variable(scope.TranslateName(successfulInfo.FormalName), successful));
+          }
+        }
+
+        // remove parent qualities again
+        IVariableInfo parentQualitiesInfo = GetVariableInfo("ParentQualities");
+        if (parentQualitiesInfo.Local)
+          RemoveVariable(parentQualitiesInfo.ActualName);
+        else
+          scope.RemoveVariable(scope.TranslateName(parentQualitiesInfo.FormalName));
+
+        return null;
+      }
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/OffspringSelector.cs
===================================================================
--- trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/OffspringSelector.cs	(revision 1864)
+++ trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/OffspringSelector.cs	(revision 1864)
@@ -0,0 +1,172 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Selection.OffspringSelection {
+  /// <summary>
+  /// Selects successful and also according to the selection pressure some unsuccessful children.
+  /// </summary>
+  public class OffspringSelector : OperatorBase {
+    /// <inheritdoc select="summary"/>
+    public override string Description {
+      get { return @"TODO\r\nOperator description still missing ..."; }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="OffspringSelector"/> with seven variable infos
+    /// (<c>SuccessfulChild</c>, <c>SelectionPressureLimit</c>, <c>SuccessRatioLimit</c>, 
+    /// <c>SelectionPressure</c>, <c>SuccessRatio</c>, <c>GoodChildren</c> and <c>BadChildren</c>).
+    /// </summary>
+    public OffspringSelector() {
+      AddVariableInfo(new VariableInfo("SuccessfulChild", "True if the child was successful", typeof(BoolData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("SelectionPressureLimit", "Maximum selection pressure", typeof(DoubleData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("SuccessRatioLimit", "Maximum success ratio", typeof(DoubleData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("SelectionPressure", "Current selection pressure", typeof(DoubleData), VariableKind.New | VariableKind.Out));
+      AddVariableInfo(new VariableInfo("SuccessRatio", "Current success ratio", typeof(DoubleData), VariableKind.New | VariableKind.Out));
+      AddVariableInfo(new VariableInfo("GoodChildren", "Temporarily store successful children", typeof(ItemList<IScope>), VariableKind.New | VariableKind.Out | VariableKind.In | VariableKind.Deleted));
+      AddVariableInfo(new VariableInfo("BadChildren", "Temporarily store unsuccessful children", typeof(ItemList<IScope>), VariableKind.New | VariableKind.Out | VariableKind.In | VariableKind.Deleted));
+    }
+
+    /// <summary>
+    /// Selects successful children and also some bad ones depending on the selection
+    /// pressure out of a population.
+    /// </summary>
+    /// <param name="scope">The current scope of the parents and the children.</param>
+    /// <returns>The next operation or <c>null</c>.</returns>
+    public override IOperation Apply(IScope scope) {
+      double selectionPressureLimit = GetVariableValue<DoubleData>("SelectionPressureLimit", scope, true).Data;
+      double successRatioLimit = GetVariableValue<DoubleData>("SuccessRatioLimit", scope, true).Data;
+
+      IScope parents = scope.SubScopes[0];
+      IScope children = scope.SubScopes[1];
+
+      // retrieve actual selection pressure and success ratio
+      DoubleData selectionPressure = GetVariableValue<DoubleData>("SelectionPressure", scope, false, false);
+      if (selectionPressure == null) {
+        IVariableInfo selectionPressureInfo = GetVariableInfo("SelectionPressure");
+        selectionPressure = new DoubleData(0);
+        if (selectionPressureInfo.Local)
+          AddVariable(new Variable(selectionPressureInfo.ActualName, selectionPressure));
+        else
+          scope.AddVariable(new Variable(scope.TranslateName(selectionPressureInfo.FormalName), selectionPressure));
+      }
+      DoubleData successRatio = GetVariableValue<DoubleData>("SuccessRatio", scope, false, false);
+      if (successRatio == null) {
+        IVariableInfo successRatioInfo = GetVariableInfo("SuccessRatio");
+        successRatio = new DoubleData(0);
+        if (successRatioInfo.Local)
+          AddVariable(new Variable(successRatioInfo.ActualName, successRatio));
+        else
+          scope.AddVariable(new Variable(scope.TranslateName(successRatioInfo.FormalName), successRatio));
+      }
+
+      // retrieve good and bad children
+      ItemList<IScope> goodChildren = GetVariableValue<ItemList<IScope>>("GoodChildren", scope, false, false);
+      if (goodChildren == null) {
+        goodChildren = new ItemList<IScope>();
+        IVariableInfo goodChildrenInfo = GetVariableInfo("GoodChildren");
+        if (goodChildrenInfo.Local)
+          AddVariable(new Variable(goodChildrenInfo.ActualName, goodChildren));
+        else
+          scope.AddVariable(new Variable(scope.TranslateName(goodChildrenInfo.FormalName), goodChildren));
+
+        // no good children available -> first iteration of this generation -> initialize selection pressure
+        selectionPressure.Data = 0;
+      }
+      ItemList<IScope> badChildren = GetVariableValue<ItemList<IScope>>("BadChildren", scope, false, false);
+      if (badChildren == null) {
+        badChildren = new ItemList<IScope>();
+        IVariableInfo badChildrenInfo = GetVariableInfo("BadChildren");
+        if (badChildrenInfo.Local)
+          AddVariable(new Variable(badChildrenInfo.ActualName, badChildren));
+        else
+          scope.AddVariable(new Variable(scope.TranslateName(badChildrenInfo.FormalName), badChildren));
+      }
+
+      // separate new children in good and bad children
+      int goodCount = 0;
+      int badCount = 0;
+      IVariableInfo successfulInfo = GetVariableInfo("SuccessfulChild");
+      while (children.SubScopes.Count > 0) {
+        IScope child = children.SubScopes[0];
+        bool successful = child.GetVariableValue<BoolData>(successfulInfo.FormalName, false).Data;
+        if (successful) {
+          goodCount++;
+          goodChildren.Add(child);
+        } else {
+          badCount++;
+          // only keep the child if we have not filled up the pool or if we reached the
+          // selection pressure limit in which case we have to keep more lucky losers than usual
+          if ((1 - successRatioLimit) * parents.SubScopes.Count > badChildren.Count ||
+            selectionPressure.Data >= selectionPressureLimit) {
+            badChildren.Add(child);
+          }
+        }
+        children.RemoveSubScope(child);
+      }
+
+      // calculate actual selection pressure and success ratio
+      selectionPressure.Data += (goodCount + badCount) / ((double)parents.SubScopes.Count);
+      successRatio.Data = goodChildren.Count / ((double)parents.SubScopes.Count);
+
+      // check if enough children have been generated
+      if (((selectionPressure.Data < selectionPressureLimit) && (successRatio.Data < successRatioLimit)) ||
+          ((goodChildren.Count + badChildren.Count) < parents.SubScopes.Count)) {
+        // more children required -> reduce left and start children generation again
+        scope.RemoveSubScope(parents);
+        scope.RemoveSubScope(children);
+        for (int i = 0; i < parents.SubScopes.Count; i++)
+          scope.AddSubScope(parents.SubScopes[i]);
+
+        return new AtomicOperation(SubOperators[0], scope);
+      } else {
+        // enough children generated
+        while (children.SubScopes.Count < parents.SubScopes.Count) {
+          if (goodChildren.Count > 0) {
+            children.AddSubScope((IScope)goodChildren[0]);
+            goodChildren.RemoveAt(0);
+          } else {
+            children.AddSubScope((IScope)badChildren[0]);
+            badChildren.RemoveAt(0);
+          }
+        }
+
+        // remove good and bad children again
+        IVariableInfo goodChildrenInfo = GetVariableInfo("GoodChildren");
+        if (goodChildrenInfo.Local)
+          RemoveVariable(goodChildrenInfo.ActualName);
+        else
+          scope.RemoveVariable(scope.TranslateName(goodChildrenInfo.FormalName));
+        IVariableInfo badChildrenInfo = GetVariableInfo("BadChildren");
+        if (badChildrenInfo.Local)
+          RemoveVariable(badChildrenInfo.ActualName);
+        else
+          scope.RemoveVariable(scope.TranslateName(badChildrenInfo.FormalName));
+        return null;
+      }
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/Properties/AssemblyInfo.frame
===================================================================
--- trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/Properties/AssemblyInfo.frame	(revision 1864)
+++ trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/Properties/AssemblyInfo.frame	(revision 1864)
@@ -0,0 +1,58 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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;
+using HeuristicLab.PluginInfrastructure;
+
+// 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.Selection.OffspringSelection")]
+[assembly: AssemblyDescription("HeuristicLab Offspring Selection operators")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2008 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("b09e28c5-1ac5-4f1c-ba80-60558319828e")]
+
+// 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 Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.2.0.$WCREV$")]
+[assembly: AssemblyFileVersion("3.2.0.$WCREV$")]
+[assembly: AssemblyBuildDate("$WCNOW$")]
Index: trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/WeightedOffspringFitnessComparer.cs
===================================================================
--- trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/WeightedOffspringFitnessComparer.cs	(revision 1864)
+++ trunk/sources/HeuristicLab.Selection.OffspringSelection/3.3/WeightedOffspringFitnessComparer.cs	(revision 1864)
@@ -0,0 +1,89 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2009 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.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Selection.OffspringSelection {
+  /// <summary>
+  /// Analyzes the offspring on whether it is successful or not based on its quality in comparison to its best and worst parents' qualities.
+  /// </summary>
+  public class WeightedOffspringFitnessComparer : OperatorBase  {
+    /// <inheritdoc select="summary"/>
+    public override string Description {
+      get {
+        return @"Compares the quality values of the child with a weighted average of the best and worst parents' qualities.
+Adds a variable SuccessfulChild into the current scope with the result of the comparison.";
+      }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="WeightedOffspringFitnessComparer"/> with four variable infos 
+    /// (<c>Maximization</c>, <c>Quality</c>, <c>SuccessfulChild</c>, and <c>ComparisonFactor</c>).
+    /// </summary>
+    public WeightedOffspringFitnessComparer()
+      : base() {
+      AddVariableInfo(new VariableInfo("Maximization", "True if the problem is a maximization problem", typeof(BoolData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("Quality", "Quality value", typeof(DoubleData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("SuccessfulChild", "True if the child is successful", typeof(BoolData), VariableKind.New));
+      AddVariableInfo(new VariableInfo("ComparisonFactor", "Factor for comparing the quality of a child with the qualities of its parents (0 = better than worst parent, 1 = better than best parent)", typeof(DoubleData), VariableKind.In));
+    }
+
+    /// <summary>
+    /// Weighs the worst and best parent quality with a given factor and decides whether the child is better than this threshold.
+    /// The result of this decision is added as variable "SuccessfulChild" into the scope.
+    /// </summary>
+    /// <param name="scope">The current scope which represents a new child.</param>
+    /// <returns><c>null</c>.</returns>
+    public override IOperation Apply(IScope scope) {
+      bool maximize = GetVariableValue<BoolData>("Maximization", scope, true).Data;
+      double compFactor = GetVariableValue<DoubleData>("ComparisonFactor", scope, true).Data;
+      double child = GetVariableValue<DoubleData>("Quality", scope, false).Data;
+
+      double lowParent = double.MaxValue; // lowest quality parent
+      double highParent = double.MinValue; // highest quality parent
+      for (int i = 0; i < scope.SubScopes.Count; i++) {
+        double parentQuality = scope.SubScopes[i].GetVariableValue<DoubleData>("Quality", false).Data;
+        if (parentQuality < lowParent) lowParent = parentQuality;
+        if (parentQuality > highParent) highParent = parentQuality;
+      }
+
+      double threshold;
+      if (!maximize)
+        threshold = highParent + (lowParent - highParent) * compFactor;
+      else
+        threshold = lowParent + (highParent - lowParent) * compFactor;
+
+      BoolData successful;
+      if (((!maximize) && (child < threshold)) ||
+          ((maximize) && (child > threshold)))
+        successful = new BoolData(true);
+      else
+        successful = new BoolData(false);
+
+      scope.AddVariable(new Variable(scope.TranslateName("SuccessfulChild"), successful));
+      return null;
+    }
+  }
+}
