Index: trunk/sources/HeuristicLab.Selection/3.3/HeuristicLab.Selection-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Selection/3.3/HeuristicLab.Selection-3.3.csproj	(revision 3587)
+++ trunk/sources/HeuristicLab.Selection/3.3/HeuristicLab.Selection-3.3.csproj	(revision 3601)
@@ -84,6 +84,8 @@
     <Compile Include="BestSelector.cs" />
     <Compile Include="ConditionalSelector.cs" />
+    <Compile Include="RandomReplacer.cs" />
     <Compile Include="GenderSpecificSelector.cs" />
     <Compile Include="OffspringSelector.cs" />
+    <Compile Include="Replacer.cs" />
     <Compile Include="RightChildReducer.cs" />
     <Compile Include="SingleObjectiveSelector.cs" />
@@ -101,4 +103,5 @@
     <Compile Include="Selector.cs" />
     <Compile Include="TournamentSelector.cs" />
+    <Compile Include="WorstReplacer.cs" />
     <Compile Include="WorstSelector.cs" />
   </ItemGroup>
Index: trunk/sources/HeuristicLab.Selection/3.3/RandomReplacer.cs
===================================================================
--- trunk/sources/HeuristicLab.Selection/3.3/RandomReplacer.cs	(revision 3601)
+++ trunk/sources/HeuristicLab.Selection/3.3/RandomReplacer.cs	(revision 3601)
@@ -0,0 +1,68 @@
+﻿#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;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Selection {
+  [Item("RandomReplacer", "Replaces some randomly selected sub-scopes of the remaining scope with all those (or the best if there are more) from the selected scope.")]
+  [StorableClass]
+  public sealed class RandomReplacer : Replacer, IStochasticOperator, ISingleObjectiveReplacer {
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
+      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
+    }
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+
+    [StorableConstructor]
+    private RandomReplacer(bool deserializing) : base(deserializing) { }
+    public RandomReplacer()
+      : base() {
+      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The quality of a solution."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
+      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator to use."));
+
+      RandomSelector randomSelector = new RandomSelector();
+      randomSelector.RandomParameter.ActualName = RandomParameter.Name;
+      ReplacedSelectorParameter.Value = randomSelector;
+      BestSelector bestSelector = new BestSelector();
+      bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestSelector.QualityParameter.ActualName = QualityParameter.Name;
+      SelectedSelectorParameter.Value = bestSelector;
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Selection/3.3/Replacer.cs
===================================================================
--- trunk/sources/HeuristicLab.Selection/3.3/Replacer.cs	(revision 3601)
+++ trunk/sources/HeuristicLab.Selection/3.3/Replacer.cs	(revision 3601)
@@ -0,0 +1,92 @@
+﻿#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;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Selection {
+  [Item("Replacer", "Generic replacer that replaces sub-scopes of the remaining scope with those from the selected scope.")]
+  [StorableClass]
+  public class Replacer : AlgorithmOperator, IReplacer {
+    public IValueLookupParameter<ISelector> ReplacedSelectorParameter {
+      get { return (IValueLookupParameter<ISelector>)Parameters["ReplacedSelector"]; }
+    }
+    public IValueLookupParameter<ISelector> SelectedSelectorParameter {
+      get { return (IValueLookupParameter<ISelector>)Parameters["SelectedSelector"]; }
+    }
+
+    [StorableConstructor]
+    protected Replacer(bool deserializing) : base() { }
+    public Replacer() {
+      Parameters.Add(new ValueLookupParameter<ISelector>("ReplacedSelector", "The selection operator to select those scopes that are to be replaced."));
+      Parameters.Add(new ValueLookupParameter<ISelector>("SelectedSelector", "The selection operator to select those scopes that are replacing the others."));
+
+      SubScopesProcessor ssp = new SubScopesProcessor();
+
+      Placeholder replacedSelector = new Placeholder();
+      replacedSelector.OperatorParameter.ActualName = ReplacedSelectorParameter.Name;
+
+      LeftReducer leftReducer = new LeftReducer();
+
+      Placeholder selectedSelector = new Placeholder();
+      selectedSelector.OperatorParameter.ActualName = SelectedSelectorParameter.Name;
+
+      RightReducer rightReducer = new RightReducer();
+
+      MergingReducer merger = new MergingReducer();
+
+      OperatorGraph.InitialOperator = ssp;
+      ssp.Operators.Add(replacedSelector);
+      ssp.Operators.Add(selectedSelector);
+      ssp.Successor = merger;
+      replacedSelector.Successor = leftReducer;
+      leftReducer.Successor = null;
+      selectedSelector.Successor = rightReducer;
+      rightReducer.Successor = null;
+      merger.Successor = null;
+    }
+
+    public override IOperation Apply() {
+      if (ExecutionContext.Scope.SubScopes.Count != 2) throw new InvalidOperationException(Name + ": There must be two sub-scopes which should be replaced/merged.");
+      int remaining = ExecutionContext.Scope.SubScopes[0].SubScopes.Count;
+      int selected = ExecutionContext.Scope.SubScopes[1].SubScopes.Count;
+      
+      ISelector replacedSelector = ReplacedSelectorParameter.ActualValue;
+      ISelector selectedSelector = SelectedSelectorParameter.ActualValue;
+      
+      if (replacedSelector != null) {
+        replacedSelector.CopySelected = new BoolValue(false);
+        replacedSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(Math.Min(remaining, selected));
+      }
+      if (selectedSelector != null) {
+        selectedSelector.CopySelected = new BoolValue(false);
+        selectedSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(Math.Min(remaining, selected));
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Selection/3.3/WorstReplacer.cs
===================================================================
--- trunk/sources/HeuristicLab.Selection/3.3/WorstReplacer.cs	(revision 3601)
+++ trunk/sources/HeuristicLab.Selection/3.3/WorstReplacer.cs	(revision 3601)
@@ -0,0 +1,65 @@
+﻿#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;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Selection {
+  [Item("WorstReplacer", "Replaces the worst sub-scopes of the remaining scope with all those (or the best if there are more) from the selected scope.")]
+  [StorableClass]
+  public sealed class WorstReplacer : Replacer, ISingleObjectiveReplacer {
+    public override bool CanChangeName {
+      get { return false; }
+    }
+    public override bool CanChangeDescription {
+      get { return false; }
+    }
+
+    public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
+      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
+    }
+    public IValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+
+    [StorableConstructor]
+    private WorstReplacer(bool deserializing) : base(deserializing) { }
+    public WorstReplacer()
+      : base() {
+      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The quality of a solution."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
+
+      WorstSelector worstSelector = new WorstSelector();
+      worstSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      worstSelector.QualityParameter.ActualName = QualityParameter.Name;
+      ReplacedSelectorParameter.Value = worstSelector;
+      BestSelector bestSelector = new BestSelector();
+      bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestSelector.QualityParameter.ActualName = QualityParameter.Name;
+      SelectedSelectorParameter.Value = bestSelector;
+    }
+  }
+}
