Index: trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj	(revision 3403)
+++ trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj	(revision 3404)
@@ -98,4 +98,5 @@
     <Compile Include="StochasticBranch.cs" />
     <Compile Include="SubScopesCreator.cs" />
+    <Compile Include="SubScopesMixer.cs" />
     <Compile Include="SubScopesProcessor.cs" />
     <Compile Include="SubScopesRemover.cs" />
Index: trunk/sources/HeuristicLab.Operators/3.3/SubScopesMixer.cs
===================================================================
--- trunk/sources/HeuristicLab.Operators/3.3/SubScopesMixer.cs	(revision 3403)
+++ trunk/sources/HeuristicLab.Operators/3.3/SubScopesMixer.cs	(revision 3404)
@@ -1,5 +1,5 @@
 #region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -21,8 +21,8 @@
 
 using System;
-using System.Collections.Generic;
-using System.Text;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
 namespace HeuristicLab.Operators {
@@ -30,9 +30,16 @@
   /// Mixes the sub scopes of a specified scope according to a specified number of partitions.
   /// </summary>
-  public class SubScopesMixer : OperatorBase {
-    /// <inheritdoc select="summary"/>
-    public override string Description {
-      get { return @"TODO\r\nOperator description still missing ..."; }
+  [Item("SubScopesMixer", "Changes the order of the sub-scopes by repartitioning the sub-scopes such that each new partition contains one scope from each old partition.")]
+  [StorableClass]
+  public class SubScopesMixer : SingleSuccessorOperator {
+    public ValueParameter<IntValue> PartitionsParameter {
+      get { return (ValueParameter<IntValue>)Parameters["Partitions"]; }
     }
+
+    public IntValue Partitions {
+      get { return PartitionsParameter.Value; }
+      set { PartitionsParameter.Value = value; }
+    }
+
     /// <summary>
     /// Initializes a new instance of <see cref="SubScopesMixer"/> with one variable infos 
@@ -41,19 +48,16 @@
     public SubScopesMixer()
       : base() {
-      AddVariableInfo(new VariableInfo("Partitions", "Number of partitions to mix", typeof(IntData), VariableKind.In));
-      GetVariableInfo("Partitions").Local = true;
-      AddVariable(new Variable("Partitions", new IntData(2)));
+      Parameters.Add(new ValueParameter<IntValue>("Partitions", "The number of equal-sized partitions.", new IntValue(2)));
     }
 
     /// <summary>
-    /// Mixes the subscopes of the given <paramref name="scope"/>.
+    /// Mixes the sub-scopes of the scope this operator is applied on.
     /// </summary>
-    /// <remarks>Calls <see cref="IScope.ReorderSubScopes"/>.<br/>
-    /// Mixing of sub scopes is based on the number of partitions.
-    /// <example>12 sub scopes and 3 partitions:<br/>
-    /// Partition 1 contains sub scopes 1-4, partition 2 sub scopes 5-8 and partition 3 sub scopes 9-12. <br/>
-    /// Mixing is realized by selecting at the beginning the first sub scope from partition one, then the 
-    /// first sub scope from partition 2, afterwards first sub scope from partition 3, 
-    /// then the second sub scope from the first partition and so on. <br/>
+    /// <remarks>Mixing of sub-scopes is based on the number of partitions.
+    /// <example>12 sub-scopes and 3 partitions:<br/>
+    /// Partition 1 contains scopes 1-4, partition 2 scopes 5-8 and partition 3 scopes 9-12. <br/>
+    /// Mixing is realized by selecting at the beginning the first scope from partition one, then the 
+    /// first scope from partition 2, afterwards first scope from partition 3, 
+    /// then the second scope from the first partition and so on. <br/>
     /// In the end the new sorting of the sub scopes is 1-5-9-2-6-10-3-7-11-4-8-12. 
     /// </example>
@@ -63,19 +67,24 @@
     /// <param name="scope">The scope whose sub scopes should be mixed.</param>
     /// <returns><c>null</c>.</returns>
-    public override IOperation Apply(IScope scope) {
-      int partitions = GetVariableValue<IntData>("Partitions", scope, true).Data;
-      int[] sequence = new int[scope.SubScopes.Count];
-      if ((sequence.Length % partitions) != 0)
-        throw new ArgumentException("The number of subScopes is not divisible by the number of partitions without remainder.");
-      int partitionSize = sequence.Length / partitions;
+    public override IOperation Apply() {
+      int partitions = Partitions.Value;
+      IScope scope = ExecutionContext.Scope;
+      int count = scope.SubScopes.Count;
+      if ((count % partitions) != 0)
+        throw new ArgumentException(Name + ": The number of sub-scopes is not divisible by the number of partitions without remainder.");
+      int partitionSize = count / partitions;
+
+      IScope[] reorderedSubScopes = new IScope[count];
 
       // mix sub-scopes -> alternately take one sub-scope from each partition
       for (int i = 0; i < partitionSize; i++) {
-        for (int j = 0; j < partitions; j++)
-          sequence[i * partitions + j] = j * partitionSize + i;
+        for (int j = 0; j < partitions; j++) {
+          reorderedSubScopes[i * partitions + j] = scope.SubScopes[j * partitionSize + i];
+        }
       }
-      scope.ReorderSubScopes(sequence);
+      scope.SubScopes.Clear();
+      scope.SubScopes.AddRange(reorderedSubScopes);
 
-      return null;
+      return base.Apply();
     }
   }
Index: trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj	(revision 3403)
+++ trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj	(revision 3404)
@@ -139,7 +139,4 @@
     <None Include="app.config" />
     <EmbeddedResource Include="Documents\FirstSteps.rtf" />
-    <EmbeddedResource Include="Documents\LS_OneMax.hl" />
-    <EmbeddedResource Include="Documents\SA_Rastrigin.hl" />
-    <EmbeddedResource Include="Documents\TS_TSP.hl" />
     <None Include="HeuristicLab.snk" />
     <None Include="Properties\AssemblyInfo.frame" />
Index: trunk/sources/HeuristicLab.Selection/3.3/GenderSpecificSelector.cs
===================================================================
--- trunk/sources/HeuristicLab.Selection/3.3/GenderSpecificSelector.cs	(revision 3404)
+++ trunk/sources/HeuristicLab.Selection/3.3/GenderSpecificSelector.cs	(revision 3404)
@@ -0,0 +1,193 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.PluginInfrastructure;
+using System;
+
+namespace HeuristicLab.Selection {
+  [Item("GenderSpecificSelection", "Brings two parents together by sampling each with a different selection scheme (Wagner, S. and Affenzeller, M. 2005. SexualGA: Gender-Specific Selection for Genetic Algorithms. Proceedings of the 9th World Multi-Conference on Systemics, Cybernetics and Informatics (WMSCI), pp. 76-81).")]
+  [StorableClass]
+  public class GenderSpecificSelector : AlgorithmOperator, ISingleObjectiveSelector, IStochasticOperator {
+    private List<ISelector> femaleSelectors;
+    private List<ISelector> maleSelectors;
+
+    #region Parameters
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
+      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
+    }
+    public IValueLookupParameter<IntValue> NumberOfSelectedSubScopesParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfSelectedSubScopes"]; }
+    }
+    public IValueLookupParameter<BoolValue> CopySelectedParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["CopySelected"]; }
+    }
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    public ConstrainedValueParameter<ISelector> FemaleSelectorParameter {
+      get { return (ConstrainedValueParameter<ISelector>)Parameters["FemaleSelector"]; }
+    }
+    public ConstrainedValueParameter<ISelector> MaleSelectorParameter {
+      get { return (ConstrainedValueParameter<ISelector>)Parameters["MaleSelector"]; }
+    }
+    #endregion
+
+    #region Properties
+    public BoolValue Maximization {
+      get { return MaximizationParameter.Value; }
+      set { MaximizationParameter.Value = value; }
+    }
+    public IntValue NumberOfSelectedSubScopes {
+      get { return NumberOfSelectedSubScopesParameter.Value; }
+      set { NumberOfSelectedSubScopesParameter.Value = value; }
+    }
+    public BoolValue CopySelected {
+      get { return CopySelectedParameter.Value; }
+      set { CopySelectedParameter.Value = value; }
+    }
+    public ISelector FemaleSelector {
+      get { return FemaleSelectorParameter.Value; }
+      set { FemaleSelectorParameter.Value = value; }
+    }
+    public ISelector MaleSelector {
+      get { return MaleSelectorParameter.Value; }
+      set { MaleSelectorParameter.Value = value; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private GenderSpecificSelector(bool deserializing) : base() { }
+    public GenderSpecificSelector()
+      : base() {
+      #region Create parameters
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
+      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The quality of the solutions."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfSelectedSubScopes", "The number of scopes that should be selected."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("CopySelected", "True if the scopes should be copied, false if they should be moved.", new BoolValue(true)));
+      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
+      Parameters.Add(new ConstrainedValueParameter<ISelector>("FemaleSelector", "The selection operator to select the first parent."));
+      Parameters.Add(new ConstrainedValueParameter<ISelector>("MaleSelector", "The selection operator to select the second parent."));
+      #endregion
+
+      #region Create operators
+      Placeholder femaleSelector = new Placeholder();
+      SubScopesProcessor maleSelection = new SubScopesProcessor();
+      Placeholder maleSelector = new Placeholder();
+      EmptyOperator empty = new EmptyOperator();
+      RightChildReducer rightChildReducer = new RightChildReducer();
+      SubScopesMixer subScopesMixer = new SubScopesMixer();
+
+      femaleSelector.OperatorParameter.ActualName = "FemaleSelector";
+      
+      maleSelector.OperatorParameter.ActualName = "MaleSelector";
+
+      subScopesMixer.Partitions = new IntValue(2);
+      #endregion
+
+      #region Create operator graph
+      OperatorGraph.InitialOperator = femaleSelector;
+      femaleSelector.Successor = maleSelection;
+      maleSelection.Operators.Add(maleSelector);
+      maleSelection.Operators.Add(empty);
+      maleSelection.Successor = rightChildReducer;
+      rightChildReducer.Successor = subScopesMixer;
+      #endregion
+
+      Initialize();
+    }
+
+    /// <summary>
+    /// Sets how many sub-scopes male and female selectors should select.
+    /// </summary>
+    /// <exception cref="InvalidOperationException">Thrown when <see cref="NumberOfSelectedSubScopesParameter"/> returns an odd number.</exception>
+    /// <returns>Returns Apply of <see cref="AlgorithmOperator"/>.</returns>
+    public override IOperation Apply() {
+      int count = NumberOfSelectedSubScopesParameter.ActualValue.Value;
+      if (count % 2 > 0) throw new InvalidOperationException(Name + ": There must be an equal number of sub-scopes to be selected.");
+      FemaleSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(count / 2);
+      MaleSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(count / 2);
+      return base.Apply();
+    }
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void Initialize() {
+      InitializeSelectors();
+      UpdateSelectors();
+    }
+
+    private void InitializeSelectors() {
+      femaleSelectors = new List<ISelector>();
+      maleSelectors = new List<ISelector>();
+      IEnumerable<Type> types = ApplicationManager.Manager.GetTypes(typeof(ISelector)).OrderBy(x => x.FullName);
+      foreach (Type type in types) {
+        if (type != typeof(IMultiObjectiveSelector) && type != typeof(GenderSpecificSelector)) {
+          femaleSelectors.Add((ISelector)Activator.CreateInstance(type));
+          maleSelectors.Add((ISelector)Activator.CreateInstance(type));
+        }
+      }
+      ParameterizeSelectors(femaleSelectors);
+      ParameterizeSelectors(maleSelectors);
+    }
+    private void ParameterizeSelectors(List<ISelector> selectors) {
+      foreach (ISelector selector in selectors) {
+        selector.CopySelected = new BoolValue(true);
+      }
+      foreach (IStochasticOperator op in selectors.OfType<IStochasticOperator>()) {
+        op.RandomParameter.ActualName = RandomParameter.Name;
+      }
+      foreach (ISingleObjectiveSelector selector in selectors.OfType<ISingleObjectiveSelector>()) {
+        selector.MaximizationParameter.ActualName = MaximizationParameter.Name;
+        selector.QualityParameter.ActualName = QualityParameter.Name;
+      }
+    }
+    private void UpdateSelectors() {
+      ISelector oldFemaleSelector = FemaleSelector;
+      FemaleSelectorParameter.ValidValues.Clear();
+      foreach (ISelector selector in femaleSelectors)
+        FemaleSelectorParameter.ValidValues.Add(selector);
+      if (oldFemaleSelector == null) oldFemaleSelector = new ProportionalSelector();
+      ISelector femaleSelector = FemaleSelectorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldFemaleSelector.GetType());
+      if (femaleSelector != null) FemaleSelectorParameter.Value = femaleSelector;
+
+      ISelector oldMaleSelector = MaleSelector;
+      MaleSelectorParameter.ValidValues.Clear();
+      foreach (ISelector selector in maleSelectors)
+        MaleSelectorParameter.ValidValues.Add(selector);
+      if (oldMaleSelector == null) oldMaleSelector = new RandomSelector();
+      ISelector maleSelector = MaleSelectorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMaleSelector.GetType());
+      if (maleSelector != null) MaleSelectorParameter.Value = maleSelector;
+    }
+    #endregion
+  }
+}
Index: trunk/sources/HeuristicLab.Selection/3.3/HeuristicLab.Selection-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Selection/3.3/HeuristicLab.Selection-3.3.csproj	(revision 3403)
+++ trunk/sources/HeuristicLab.Selection/3.3/HeuristicLab.Selection-3.3.csproj	(revision 3404)
@@ -83,4 +83,6 @@
     <None Include="HeuristicLabSelectionPlugin.cs.frame" />
     <Compile Include="BestSelector.cs" />
+    <Compile Include="GenderSpecificSelector.cs" />
+    <Compile Include="RightChildReducer.cs" />
     <Compile Include="SingleObjectiveSelector.cs" />
     <Compile Include="LeftReducer.cs" />
Index: trunk/sources/HeuristicLab.Selection/3.3/RightChildReducer.cs
===================================================================
--- trunk/sources/HeuristicLab.Selection/3.3/RightChildReducer.cs	(revision 3403)
+++ trunk/sources/HeuristicLab.Selection/3.3/RightChildReducer.cs	(revision 3404)
@@ -1,5 +1,5 @@
 #region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -20,47 +20,44 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
-using System.Text;
 using HeuristicLab.Core;
-using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
 namespace HeuristicLab.Selection {
   /// <summary>
-  /// Reduces the sub scopes by one level, so that the right sub scope contains also the right child scopes
-  /// of the left sub scope and the left sub scope represents its left child scope.
+  /// Reduces the sub-scopes, so that the selected sub-scope contains all selected leaves (1) and (2)
+  /// and the remaining sub-scope contains the sub-scopes of the bottom-most remaining scope (3).
   /// <pre>                                                      
-  ///                   scope             scope  
-  ///                   / | \             /   \      
-  ///                  L ... R   =>      A     R                 
-  ///                / | \    \              / /\ \       
-  ///               A ... LR   C             C D E F      
-  ///                     /|\                              
-  ///                    D E F                             
+  ///                  scope            scope  
+  ///                   / \             /   \      
+  ///                  R   S(1)   =>   R     S                 
+  ///                 / \     \       /|\   /|\       
+  ///               R(3) S(2)  C     ABCDEF  CDEF      
+  ///               /|\  /|\                              
+  ///             ABCDEF DEF                             
   /// </pre>
   /// </summary>
-  public class RightChildReducer : ReducerBase {
-    /// <inheritdoc select="summary"/>
-    public override string Description {
-      get { return @"TODO\r\nOperator description still missing ..."; }
-    }
-
+  [Item("RightChildReducer", "Merges all sub-scopes generated by successively selecting sub-scopes of the remaining part.")]
+  [StorableClass]
+  public class RightChildReducer : Reducer, IReducer {
     /// <summary>
-    /// Reduces the right child of the left sub scope and adds its sub scopes to the right sub scope.
-    /// The left sub scope is also narrowed, which means it represents then its left child.
+    ///  Reduces the sub-scopes, so that the selected sub-scope contains all selected leaves
+    /// and the remaining sub-scope contains the sub-scopes of the bottom-most remaining scope.
     /// </summary>
     /// <param name="scope">The current scope to reduce.</param>
     /// <returns>A list of the new reduced sub scopes.</returns>
-    protected override ICollection<IScope> Reduce(IScope scope) {
-      IScope rightChild = scope.SubScopes[scope.SubScopes.Count - 1];
-      IScope leftChild = scope.SubScopes[0];
-      IScope leftRightChild = leftChild.SubScopes[leftChild.SubScopes.Count - 1];
+    protected override List<IScope> Reduce(List<IScope> scopes) {
+      IScope rightChild = scopes[scopes.Count - 1];
+      IScope leftChild = scopes[0];
+      while (leftChild.SubScopes.Count > 1 && leftChild.SubScopes[0].SubScopes.Count > 0) {
+        IScope leftRightChild = leftChild.SubScopes[leftChild.SubScopes.Count - 1];
 
-      // merge right children
-      for (int i = 0; i < leftRightChild.SubScopes.Count; i++)
-        rightChild.AddSubScope(leftRightChild.SubScopes[i]);
+        // merge right children
+        while (leftRightChild.SubScopes.Count > 0)
+          rightChild.SubScopes.Add(leftRightChild.SubScopes[0]);
 
-      leftChild = leftChild.SubScopes[0];
-
+        leftChild = leftChild.SubScopes[0];
+      }
       List<IScope> subScopes = new List<IScope>();
       subScopes.Add(leftChild);
