Index: trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdingDistanceAssignment.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdingDistanceAssignment.cs	(revision 4017)
+++ trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/CrowdingDistanceAssignment.cs	(revision 4017)
@@ -0,0 +1,116 @@
+﻿#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 HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.NSGA2 {
+  [Item("CrowdingDistanceAssignment", "Calculates the crowding distances for each sub-scope as described in Deb et al. 2002. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2), pp. 182-197.")]
+  [StorableClass]
+  public class CrowdingDistanceAssignment : SingleSuccessorOperator {
+
+    public ScopeTreeLookupParameter<DoubleArray> QualitiesParameter {
+      get { return (ScopeTreeLookupParameter<DoubleArray>)Parameters["Qualities"]; }
+    }
+
+    public ScopeTreeLookupParameter<DoubleValue> CrowdingDistanceParameter {
+      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["CrowdingDistance"]; }
+    }
+
+    private void QualitiesParameter_DepthChanged(object sender, EventArgs e) {
+      CrowdingDistanceParameter.Depth = QualitiesParameter.Depth;
+    }
+
+    [StorableConstructor]
+    protected CrowdingDistanceAssignment(bool deserializing) : base(deserializing) { }
+    public CrowdingDistanceAssignment() {
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The vector of quality values."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("CrowdingDistance", "Sets the crowding distance in each sub-scope."));
+      AttachEventHandlers();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AttachEventHandlers() {
+      QualitiesParameter.DepthChanged += new EventHandler(QualitiesParameter_DepthChanged);
+    }
+
+    public static void Apply(DoubleArray[] qualities, DoubleValue[] distances) {
+      int populationSize = qualities.Length;
+      int objectiveCount = qualities[0].Length;
+      for (int m = 0; m < objectiveCount; m++) {
+        Array.Sort<DoubleArray, DoubleValue>(qualities, distances, new QualitiesComparer(m));
+
+        distances[0].Value = double.MaxValue;
+        distances[populationSize - 1].Value = double.MaxValue;
+
+        double minQuality = qualities[0][m];
+        double maxQuality = qualities[populationSize - 1][m];
+        for (int i = 2; i < populationSize - 1; i++) {
+          distances[i].Value += (qualities[i + 1][m] - qualities[i - 1][m]) / (maxQuality - minQuality);
+        }
+      }
+    }
+
+    public override IOperation Apply() {
+      DoubleArray[] qualities = QualitiesParameter.ActualValue.ToArray();
+      int populationSize = qualities.Length;
+      DoubleValue[] distances = new DoubleValue[populationSize];
+      for (int i = 0; i < populationSize; i++)
+        distances[i] = new DoubleValue(0);
+      
+      Apply(qualities, distances);
+
+      CrowdingDistanceParameter.ActualValue = new ItemArray<DoubleValue>(distances);
+      return base.Apply();
+    }
+
+    private void Initialize(ItemArray<DoubleValue> distances) {
+      for (int i = 0; i < distances.Length; i++) {
+        if (distances[i] == null) distances[i] = new DoubleValue(0);
+        else distances[i].Value = 0;
+      }
+    }
+
+    private class QualitiesComparer : IComparer<DoubleArray> {
+      private int index;
+
+      public QualitiesComparer(int index) {
+        this.index = index;
+      }
+
+      #region IComparer<DoubleArray> Members
+
+      public int Compare(DoubleArray x, DoubleArray y) {
+        if (x[index] < y[index]) return -1;
+        else if (x[index] > y[index]) return +1;
+        else return 0;
+      }
+
+      #endregion
+    }
+  }
+}
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 4016)
+++ trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLab.Algorithms.NSGA2-3.3.csproj	(revision 4017)
@@ -70,10 +70,4 @@
       <RequiredTargetFramework>3.5</RequiredTargetFramework>
     </Reference>
-    <Reference Include="System.Xml.Linq">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
-    <Reference Include="System.Data.DataSetExtensions">
-      <RequiredTargetFramework>3.5</RequiredTargetFramework>
-    </Reference>
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
@@ -82,4 +76,5 @@
     <None Include="HeuristicLab.snk" />
     <None Include="HeuristicLabAlgorithmsNSGA2Plugin.cs.frame" />
+    <Compile Include="CrowdingDistanceAssignment.cs" />
     <Compile Include="HeuristicLabAlgorithmsNSGA2Plugin.cs" />
     <Compile Include="NSGA2.cs" />
@@ -89,4 +84,8 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
+      <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
+      <Name>HeuristicLab.Analysis-3.3</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
@@ -109,4 +108,8 @@
       <Name>HeuristicLab.Operators-3.3</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">
+      <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project>
+      <Name>HeuristicLab.Optimization.Operators-3.3</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
@@ -124,4 +127,12 @@
       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
+      <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
+      <Name>HeuristicLab.Random-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Selection\3.3\HeuristicLab.Selection-3.3.csproj">
+      <Project>{2C36CD4F-E5F5-43A4-801A-201EA895FE17}</Project>
+      <Name>HeuristicLab.Selection-3.3</Name>
     </ProjectReference>
   </ItemGroup>
Index: trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLabAlgorithmsNSGA2Plugin.cs.frame
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLabAlgorithmsNSGA2Plugin.cs.frame	(revision 4016)
+++ trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/HeuristicLabAlgorithmsNSGA2Plugin.cs.frame	(revision 4017)
@@ -25,4 +25,5 @@
   [Plugin("HeuristicLab.Algorithms.NSGA2", "3.3.0.$WCREV$")]
   [PluginFile("HeuristicLab.Algorithms.NSGA2-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
   [PluginDependency("HeuristicLab.Collections", "3.3")]
   [PluginDependency("HeuristicLab.Common", "3.3")]
@@ -31,6 +32,9 @@
   [PluginDependency("HeuristicLab.Operators", "3.3")]
   [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")]
   [PluginDependency("HeuristicLab.Parameters", "3.3")]
   [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  [PluginDependency("HeuristicLab.Selection", "3.3")]
   public class HeuristicLabAlgorithmsNSGA2Plugin : PluginBase {
   }
Index: trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs	(revision 4016)
+++ trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs	(revision 4017)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -27,4 +28,8 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Analysis;
+using HeuristicLab.Random;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Algorithms.NSGA2 {
@@ -32,5 +37,5 @@
   /// The Nondominated Sorting Genetic Algorithm II was introduced in Deb et al. 2002. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2), pp. 182-197.
   /// </summary>
-  [Item("NSGA2", "The Nondominated Sorting Genetic Algorithm II was introduced in Deb et al. 2002. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2), pp. 182-197.")]
+  [Item("NSGA-II", "The Nondominated Sorting Genetic Algorithm II was introduced in Deb et al. 2002. A Fast and Elitist Multiobjective Genetic Algorithm: NSGA-II. IEEE Transactions on Evolutionary Computation, 6(2), pp. 182-197.")]
   [Creatable("Algorithms")]
   [StorableClass]
@@ -47,10 +52,86 @@
 
     #region Parameter Properties
-    private ValueLookupParameter<IntValue> PopulationSizeParameter {
-      get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    private ValueParameter<IntValue> SeedParameter {
+      get { return (ValueParameter<IntValue>)Parameters["Seed"]; }
+    }
+    private ValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
+    }
+    private ValueParameter<IntValue> PopulationSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    private ConstrainedValueParameter<ISelector> SelectorParameter {
+      get { return (ConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
+    }
+    private ValueParameter<PercentValue> CrossoverProbabilityParameter {
+      get { return (ValueParameter<PercentValue>)Parameters["CrossoverProbability"]; }
+    }
+    private ConstrainedValueParameter<ICrossover> CrossoverParameter {
+      get { return (ConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
+    }
+    private ValueParameter<PercentValue> MutationProbabilityParameter {
+      get { return (ValueParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    private OptionalConstrainedValueParameter<IManipulator> MutatorParameter {
+      get { return (OptionalConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
+    }
+    private ValueParameter<MultiAnalyzer> AnalyzerParameter {
+      get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
+    }
+    private ValueParameter<IntValue> MaximumGenerationsParameter {
+      get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; }
     }
     #endregion
 
     #region Properties
+    public IntValue Seed {
+      get { return SeedParameter.Value; }
+      set { SeedParameter.Value = value; }
+    }
+    public BoolValue SetSeedRandomly {
+      get { return SetSeedRandomlyParameter.Value; }
+      set { SetSeedRandomlyParameter.Value = value; }
+    }
+    public IntValue PopulationSize {
+      get { return PopulationSizeParameter.Value; }
+      set { PopulationSizeParameter.Value = value; }
+    }
+    public ISelector Selector {
+      get { return SelectorParameter.Value; }
+      set { SelectorParameter.Value = value; }
+    }
+    public PercentValue CrossoverProbability {
+      get { return CrossoverProbabilityParameter.Value; }
+      set { CrossoverProbabilityParameter.Value = value; }
+    }
+    public ICrossover Crossover {
+      get { return CrossoverParameter.Value; }
+      set { CrossoverParameter.Value = value; }
+    }
+    public PercentValue MutationProbability {
+      get { return MutationProbabilityParameter.Value; }
+      set { MutationProbabilityParameter.Value = value; }
+    }
+    public IManipulator Mutator {
+      get { return MutatorParameter.Value; }
+      set { MutatorParameter.Value = value; }
+    }
+    public MultiAnalyzer Analyzer {
+      get { return AnalyzerParameter.Value; }
+      set { AnalyzerParameter.Value = value; }
+    }
+    public IntValue MaximumGenerations {
+      get { return MaximumGenerationsParameter.Value; }
+      set { MaximumGenerationsParameter.Value = value; }
+    }
+    private RandomCreator RandomCreator {
+      get { return (RandomCreator)OperatorGraph.InitialOperator; }
+    }
+    private SolutionsCreator SolutionsCreator {
+      get { return (SolutionsCreator)RandomCreator.Successor; }
+    }
+    private NSGA2MainLoop MainLoop {
+      get { return (NSGA2MainLoop)SolutionsCreator.Successor; }
+    }
     #endregion
 
@@ -58,6 +139,48 @@
     public NSGA2(bool deserializing) : base(deserializing) { }
     public NSGA2() {
-      // TODO: Add your parameters here
-      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The population size of the algorithm.", new IntValue(100)));
+      Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
+      Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions.", new IntValue(100)));
+      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ValueParameter<PercentValue>("CrossoverProbability", "The probability that the crossover operator is applied on two parents.", new PercentValue(0.05)));
+      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ValueParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new PercentValue(0.05)));
+      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
+      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000)));
+
+      RandomCreator randomCreator = new RandomCreator();
+      SolutionsCreator solutionsCreator = new SolutionsCreator();
+      NSGA2MainLoop mainLoop = new NSGA2MainLoop();
+      OperatorGraph.InitialOperator = randomCreator;
+
+      randomCreator.RandomParameter.ActualName = "Random";
+      randomCreator.SeedParameter.ActualName = SeedParameter.Name;
+      randomCreator.SeedParameter.Value = null;
+      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
+      randomCreator.SetSeedRandomlyParameter.Value = null;
+      randomCreator.Successor = solutionsCreator;
+
+      solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
+      solutionsCreator.Successor = mainLoop;
+
+      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
+      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      mainLoop.CrossoverProbabilityParameter.ActualName = CrossoverProbabilityParameter.Name;
+      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
+      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
+      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
+      mainLoop.ResultsParameter.ActualName = "Results";
+
+      foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name))
+        SelectorParameter.ValidValues.Add(selector);
+      ISelector proportionalSelector = SelectorParameter.ValidValues.FirstOrDefault(x => x.GetType().Name.Equals("ProportionalSelector"));
+      if (proportionalSelector != null) SelectorParameter.Value = proportionalSelector;
+      
+      // TODO: parameterize selectors
+
+      AttachEventHandlers();
     }
 
@@ -67,4 +190,55 @@
       return clone;
     }
+
+    #region Events
+    protected override void OnProblemChanged() {
+      // parameterize pretty much everything
+      base.OnProblemChanged();
+    }
+    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
+      // parameterize SolutionCreator
+      base.Problem_SolutionCreatorChanged(sender, e);
+    }
+    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
+      // parameterize StochasticOperators
+      // parameterize SolutionsCreator
+      // parameterize MainLoop
+      // parameterize Selectors
+      // parameterize Analyzers
+      Problem.Evaluator.QualitiesParameter.ActualNameChanged += new EventHandler(Evaluator_QualitiesParameter_ActualNameChanged);
+      base.Problem_EvaluatorChanged(sender, e);
+    }
+    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
+      base.Problem_OperatorsChanged(sender, e);
+    }
+    protected override void Problem_Reset(object sender, EventArgs e) {
+      base.Problem_Reset(sender, e);
+    }
+
+    private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) {
+      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
+      // parameterize Selectors
+    }
+    private void PopulationSize_ValueChanged(object sender, EventArgs e) {
+      // parameterize Selectors
+    }
+
+    private void Evaluator_QualitiesParameter_ActualNameChanged(object sender, EventArgs e) {
+      // parameterize Analyzers
+      // parameterize MainLoop
+      // parameterize Selectors
+    }
+    #endregion
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AttachEventHandlers() {
+      PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged);
+      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
+      if (Problem != null) {
+        Problem.Evaluator.QualitiesParameter.ActualNameChanged += new EventHandler(Evaluator_QualitiesParameter_ActualNameChanged);
+      }
+    }
+    #endregion
   }
 }
Index: trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2MainLoop.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2MainLoop.cs	(revision 4016)
+++ trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2MainLoop.cs	(revision 4017)
@@ -23,4 +23,8 @@
 using HeuristicLab.Operators;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Parameters;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Selection;
 
 namespace HeuristicLab.Algorithms.NSGA2 {
@@ -31,4 +35,43 @@
   [StorableClass]
   public class NSGA2MainLoop : AlgorithmOperator {
+    #region Parameter properties
+    public ValueLookupParameter<IRandom> RandomParameter {
+      get { return (ValueLookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    public ValueLookupParameter<BoolValue> MaximizationParameter {
+      get { return (ValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
+      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
+    }
+    public ValueLookupParameter<IOperator> SelectorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Selector"]; }
+    }
+    public ValueLookupParameter<PercentValue> CrossoverProbabilityParameter {
+      get { return (ValueLookupParameter<PercentValue>)Parameters["CrossoverProbability"]; }
+    }
+    public ValueLookupParameter<IOperator> CrossoverParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Crossover"]; }
+    }
+    public ValueLookupParameter<PercentValue> MutationProbabilityParameter {
+      get { return (ValueLookupParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    public ValueLookupParameter<IOperator> MutatorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Mutator"]; }
+    }
+    public ValueLookupParameter<IOperator> EvaluatorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
+    }
+    public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
+    }
+    public ValueLookupParameter<VariableCollection> ResultsParameter {
+      get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
+    }
+    public ValueLookupParameter<IOperator> AnalyzerParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
+    }
+    #endregion
+
     [StorableConstructor]
     private NSGA2MainLoop(bool deserializing) : base() { }
@@ -39,12 +82,130 @@
 
     private void Initialize() {
-      #region Create Parameters
+      #region Create parameters
+      Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>("CrossoverProbability", "The probability that the crossover operator is applied on a solution."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
+      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation."));
       #endregion
 
-      #region Create Operators
+      #region Create operators
+      VariableCreator variableCreator = new VariableCreator();
+      ResultsCollector resultsCollector1 = new ResultsCollector();
+      Placeholder analyzer1 = new Placeholder();
+      Placeholder selector = new Placeholder();
+      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
+      ChildrenCreator childrenCreator = new ChildrenCreator();
+      UniformSubScopesProcessor uniformSubScopesProcessor = new UniformSubScopesProcessor();
+      Placeholder crossover = new Placeholder();
+      StochasticBranch stochasticBranch = new StochasticBranch();
+      Placeholder mutator = new Placeholder();
+      Placeholder evaluator = new Placeholder();
+      SubScopesRemover subScopesRemover = new SubScopesRemover();
+      SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
+      BestSelector bestSelector = new BestSelector();
+      RightReducer rightReducer = new RightReducer();
+      MergingReducer mergingReducer = new MergingReducer();
+      IntCounter intCounter = new IntCounter();
+      Comparator comparator = new Comparator();
+      ResultsCollector resultsCollector2 = new ResultsCollector();
+      Placeholder analyzer2 = new Placeholder();
+      ConditionalBranch conditionalBranch = new ConditionalBranch();
+
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
+
+      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      resultsCollector1.ResultsParameter.ActualName = "Results";
+
+      analyzer1.Name = "Analyzer";
+      analyzer1.OperatorParameter.ActualName = "Analyzer";
+
+      selector.Name = "Selector";
+      selector.OperatorParameter.ActualName = "Selector";
+
+      childrenCreator.ParentsPerChild = new IntValue(2);
+
+      crossover.Name = "Crossover";
+      crossover.OperatorParameter.ActualName = "Crossover";
+
+      stochasticBranch.ProbabilityParameter.ActualName = "MutationProbability";
+      stochasticBranch.RandomParameter.ActualName = "Random";
+
+      mutator.Name = "Mutator";
+      mutator.OperatorParameter.ActualName = "Mutator";
+
+      evaluator.Name = "Evaluator";
+      evaluator.OperatorParameter.ActualName = "Evaluator";
+
+      subScopesRemover.RemoveAllSubScopes = true;
+
+      bestSelector.CopySelected = new BoolValue(false);
+      bestSelector.MaximizationParameter.ActualName = "Maximization";
+      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "Elites";
+      bestSelector.QualityParameter.ActualName = "Quality";
+
+      intCounter.Increment = new IntValue(1);
+      intCounter.ValueParameter.ActualName = "Generations";
+
+      comparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      comparator.LeftSideParameter.ActualName = "Generations";
+      comparator.ResultParameter.ActualName = "Terminate";
+      comparator.RightSideParameter.ActualName = "MaximumGenerations";
+
+      resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      resultsCollector2.ResultsParameter.ActualName = "Results";
+
+      analyzer2.Name = "Analyzer";
+      analyzer2.OperatorParameter.ActualName = "Analyzer";
+
+      conditionalBranch.ConditionParameter.ActualName = "Terminate";
       #endregion
 
-      #region Create Operator Graph
+      #region Create operator graph
+      OperatorGraph.InitialOperator = variableCreator;
+      variableCreator.Successor = resultsCollector1;
+      resultsCollector1.Successor = analyzer1;
+      analyzer1.Successor = selector;
+      selector.Successor = subScopesProcessor1;
+      subScopesProcessor1.Operators.Add(new EmptyOperator());
+      subScopesProcessor1.Operators.Add(childrenCreator);
+      subScopesProcessor1.Successor = subScopesProcessor2;
+      childrenCreator.Successor = uniformSubScopesProcessor;
+      uniformSubScopesProcessor.Operator = crossover;
+      uniformSubScopesProcessor.Successor = null;
+      crossover.Successor = stochasticBranch;
+      stochasticBranch.FirstBranch = mutator;
+      stochasticBranch.SecondBranch = null;
+      stochasticBranch.Successor = evaluator;
+      mutator.Successor = null;
+      evaluator.Successor = subScopesRemover;
+      subScopesRemover.Successor = null;
+      subScopesProcessor2.Operators.Add(bestSelector);
+      subScopesProcessor2.Operators.Add(new EmptyOperator());
+      subScopesProcessor2.Successor = mergingReducer;
+      bestSelector.Successor = rightReducer;
+      rightReducer.Successor = null;
+      mergingReducer.Successor = intCounter;
+      intCounter.Successor = comparator;
+      comparator.Successor = resultsCollector2;
+      resultsCollector2.Successor = analyzer2;
+      analyzer2.Successor = conditionalBranch;
+      conditionalBranch.FalseBranch = selector;
+      conditionalBranch.TrueBranch = null;
+      conditionalBranch.Successor = null;
       #endregion
+    }
+
+    public override IOperation Apply() {
+      if (CrossoverParameter.ActualValue == null)
+        return null;
+      return base.Apply();
     }
   }
