Index: trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdedTournamentSelector.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdedTournamentSelector.cs	(revision 4041)
+++ trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdedTournamentSelector.cs	(revision 4041)
@@ -0,0 +1,109 @@
+﻿#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 System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Selection;
+using HeuristicLab.Optimization;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using HeuristicLab.Parameters;
+using HeuristicLab.Collections;
+
+namespace HeuristicLab.Algorithms.NSGA2 {
+  public class CrowdedTournamentSelector : Selector, IMultiObjectiveSelector, IStochasticOperator {
+
+    public ILookupParameter<ItemArray<DoubleArray>> QualitiesParameter {
+      get { return (ILookupParameter<ItemArray<DoubleArray>>)Parameters["Qualities"]; }
+    }
+    public IScopeTreeLookupParameter<IntValue> RankParameter {
+      get { return (IScopeTreeLookupParameter<IntValue>)Parameters["Rank"]; }
+    }
+    public IScopeTreeLookupParameter<DoubleValue> CrowdingDistanceParameter {
+      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["CrowdingDistance"]; }
+    }
+    public IValueParameter<BoolValue> CopySelectedParameter {
+      get { return (IValueParameter<BoolValue>)Parameters["CopySelected"]; }
+    }
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    public IValueLookupParameter<IntValue> GroupSizeParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["GroupSize"]; }
+    }
+
+    public BoolValue CopySelected {
+      get { return CopySelectedParameter.Value; }
+      set { CopySelectedParameter.Value = value; }
+    }
+
+    public IValueLookupParameter<IntValue> NumberOfSelectedSubScopesParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["NumberOfSelectedSubScopes"]; }
+    }
+
+    public CrowdedTournamentSelector()
+      : base() {
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The solutions' qualities vector."));
+      Parameters.Add(new ScopeTreeLookupParameter<IntValue>("Rank", "The solutions' domination rank."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("CrowdingDistance", "The solutions' crowding distance values."));
+      Parameters.Add(new ValueParameter<BoolValue>("CopySelected", "True if the selected scopes are to be copied (cloned) otherwise they're moved."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfSelectedSubScopes", "The number of sub-scopes that should be selected."));
+      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("GroupSize", "The size of the group from which the best will be chosen.", new IntValue(2)));
+    }
+
+    protected override IScope[] Select(List<IScope> scopes) {
+      IRandom random = RandomParameter.ActualValue;
+      List<int> ranks = RankParameter.ActualValue.Select(x => x.Value).ToList();
+      List<double> crowdingDistance = CrowdingDistanceParameter.ActualValue.Select(x => x.Value).ToList();
+      int count = NumberOfSelectedSubScopesParameter.ActualValue.Value;
+      int groupSize = GroupSizeParameter.ActualValue.Value;
+      bool copy = CopySelected.Value;
+      IScope[] selected = new IScope[count];
+
+      for (int i = 0; i < count; i++) {
+        int best = random.Next(scopes.Count);
+        int index;
+        for (int j = 1; j < groupSize; j++) {
+          index = random.Next(scopes.Count);
+          if (ranks[best] > ranks[index]
+            || ranks[best] == ranks[index]
+              && crowdingDistance[best] < crowdingDistance[index]) {
+            best = index;
+          }
+        }
+
+        if (copy)
+          selected[i] = (IScope)scopes[best].Clone();
+        else {
+          selected[i] = scopes[best];
+          scopes.RemoveAt(best);
+          ranks.RemoveAt(best);
+          crowdingDistance.RemoveAt(best);
+        }
+      }
+
+      return selected;
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLab.Algorithms.NSGA2-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLab.Algorithms.NSGA2-3.3.csproj	(revision 4040)
+++ trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLab.Algorithms.NSGA2-3.3.csproj	(revision 4041)
@@ -77,4 +77,5 @@
     <None Include="HeuristicLabAlgorithmsNSGA2Plugin.cs.frame" />
     <Compile Include="CrowdedComparisonSorter.cs" />
+    <Compile Include="CrowdedTournamentSelector.cs" />
     <Compile Include="CrowdingDistanceAssignment.cs" />
     <Compile Include="FastNonDominatedSort.cs" />
