Index: /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs
===================================================================
--- /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs	(revision 9064)
+++ /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs	(revision 9064)
@@ -0,0 +1,398 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Algorithms.GeneticAlgorithm {
+  /// <summary>
+  /// A genetic algorithm.
+  /// </summary>
+  [Item("Genetic Algorithm", "A genetic algorithm.")]
+  [Creatable("Algorithms")]
+  [StorableClass]
+  public sealed class GeneticAlgorithm : HeuristicOptimizationEngineAlgorithm, IStorableContent {
+    public string Filename { get; set; }
+
+    #region Problem Properties
+    public override Type ProblemType {
+      get { return typeof(ISingleObjectiveHeuristicOptimizationProblem); }
+    }
+    public new ISingleObjectiveHeuristicOptimizationProblem Problem {
+      get { return (ISingleObjectiveHeuristicOptimizationProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+    #endregion
+
+    #region Parameter Properties
+    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"]; }
+    }
+    public IConstrainedValueParameter<ISelector> SelectorParameter {
+      get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
+    }
+    public IConstrainedValueParameter<ICrossover> CrossoverParameter {
+      get { return (IConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
+    }
+    private ValueParameter<PercentValue> MutationProbabilityParameter {
+      get { return (ValueParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    public IConstrainedValueParameter<IManipulator> MutatorParameter {
+      get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
+    }
+    private ValueParameter<IntValue> ElitesParameter {
+      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
+    }
+    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 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 IntValue Elites {
+      get { return ElitesParameter.Value; }
+      set { ElitesParameter.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 GeneticAlgorithmMainLoop GeneticAlgorithmMainLoop {
+      get { return FindMainLoop(SolutionsCreator.Successor); }
+    }
+    [Storable]
+    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
+    #endregion
+
+    public GeneticAlgorithm()
+      : base() {
+      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 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<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
+      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();
+      SubScopesCounter subScopesCounter = new SubScopesCounter();
+      ResultsCollector resultsCollector = new ResultsCollector();
+      GeneticAlgorithmMainLoop mainLoop = new GeneticAlgorithmMainLoop();
+      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 = subScopesCounter;
+
+      subScopesCounter.Name = "Initialize EvaluatedSolutions";
+      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
+      subScopesCounter.Successor = resultsCollector;
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
+      resultsCollector.ResultsParameter.ActualName = "Results";
+      resultsCollector.Successor = mainLoop;
+
+      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
+      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      mainLoop.ElitesParameter.ActualName = ElitesParameter.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.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
+      mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.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;
+      ParameterizeSelectors();
+
+      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+      ParameterizeAnalyzers();
+      UpdateAnalyzers();
+
+      Initialize();
+    }
+    [StorableConstructor]
+    private GeneticAlgorithm(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      Initialize();
+    }
+
+    private GeneticAlgorithm(GeneticAlgorithm original, Cloner cloner)
+      : base(original, cloner) {
+      qualityAnalyzer = cloner.Clone(original.qualityAnalyzer);
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GeneticAlgorithm(this, cloner);
+    }
+
+    public override void Prepare() {
+      if (Problem != null) base.Prepare();
+    }
+
+    #region Events
+    protected override void OnProblemChanged() {
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      ParameterizeStochasticOperator(Problem.Evaluator);
+      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
+      ParameterizeSolutionsCreator();
+      ParameterizeGeneticAlgorithmMainLoop();
+      ParameterizeSelectors();
+      ParameterizeAnalyzers();
+      ParameterizeIterationBasedOperators();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateAnalyzers();
+      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      base.OnProblemChanged();
+    }
+
+    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      ParameterizeSolutionsCreator();
+      base.Problem_SolutionCreatorChanged(sender, e);
+    }
+    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperator(Problem.Evaluator);
+      ParameterizeSolutionsCreator();
+      ParameterizeGeneticAlgorithmMainLoop();
+      ParameterizeSelectors();
+      ParameterizeAnalyzers();
+      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      base.Problem_EvaluatorChanged(sender, e);
+    }
+    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
+      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
+      ParameterizeIterationBasedOperators();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateAnalyzers();
+      base.Problem_OperatorsChanged(sender, e);
+    }
+    private void ElitesParameter_ValueChanged(object sender, EventArgs e) {
+      Elites.ValueChanged += new EventHandler(Elites_ValueChanged);
+      ParameterizeSelectors();
+    }
+    private void Elites_ValueChanged(object sender, EventArgs e) {
+      ParameterizeSelectors();
+    }
+
+    private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) {
+      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
+      ParameterizeSelectors();
+    }
+    private void PopulationSize_ValueChanged(object sender, EventArgs e) {
+      ParameterizeSelectors();
+    }
+    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeGeneticAlgorithmMainLoop();
+      ParameterizeSelectors();
+      ParameterizeAnalyzers();
+    }
+    #endregion
+
+    #region Helpers
+    private void Initialize() {
+      PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged);
+      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
+      ElitesParameter.ValueChanged += new EventHandler(ElitesParameter_ValueChanged);
+      Elites.ValueChanged += new EventHandler(Elites_ValueChanged);
+      if (Problem != null) {
+        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      }
+    }
+
+    private void ParameterizeSolutionsCreator() {
+      SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+    }
+    private void ParameterizeGeneticAlgorithmMainLoop() {
+      GeneticAlgorithmMainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      GeneticAlgorithmMainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+      GeneticAlgorithmMainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+    }
+    private void ParameterizeStochasticOperator(IOperator op) {
+      IStochasticOperator stochasticOp = op as IStochasticOperator;
+      if (stochasticOp != null) {
+        stochasticOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+        stochasticOp.RandomParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeSelectors() {
+      foreach (ISelector selector in SelectorParameter.ValidValues) {
+        selector.CopySelected = new BoolValue(true);
+        selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * (PopulationSizeParameter.Value.Value - ElitesParameter.Value.Value));
+        selector.NumberOfSelectedSubScopesParameter.Hidden = true;
+        ParameterizeStochasticOperator(selector);
+      }
+      if (Problem != null) {
+        foreach (ISingleObjectiveSelector selector in SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>()) {
+          selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+          selector.MaximizationParameter.Hidden = true;
+          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+          selector.QualityParameter.Hidden = true;
+        }
+      }
+    }
+    private void ParameterizeAnalyzers() {
+      qualityAnalyzer.ResultsParameter.ActualName = "Results";
+      qualityAnalyzer.ResultsParameter.Hidden = true;
+      if (Problem != null) {
+        qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+        qualityAnalyzer.MaximizationParameter.Hidden = true;
+        qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+        qualityAnalyzer.QualityParameter.Depth = 1;
+        qualityAnalyzer.QualityParameter.Hidden = true;
+        qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+        qualityAnalyzer.BestKnownQualityParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeIterationBasedOperators() {
+      if (Problem != null) {
+        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
+          op.IterationsParameter.ActualName = "Generations";
+          op.IterationsParameter.Hidden = true;
+          op.MaximumIterationsParameter.ActualName = "MaximumGenerations";
+          op.MaximumIterationsParameter.Hidden = true;
+        }
+      }
+    }
+    private void UpdateCrossovers() {
+      ICrossover oldCrossover = CrossoverParameter.Value;
+      CrossoverParameter.ValidValues.Clear();
+      ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault();
+
+      foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name))
+        CrossoverParameter.ValidValues.Add(crossover);
+
+      if (oldCrossover != null) {
+        ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType());
+        if (crossover != null) CrossoverParameter.Value = crossover;
+        else oldCrossover = null;
+      }
+      if (oldCrossover == null && defaultCrossover != null)
+        CrossoverParameter.Value = defaultCrossover;
+    }
+    private void UpdateMutators() {
+      IManipulator oldMutator = MutatorParameter.Value;
+      MutatorParameter.ValidValues.Clear();
+      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name))
+        MutatorParameter.ValidValues.Add(mutator);
+      if (oldMutator != null) {
+        IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType());
+        if (mutator != null) MutatorParameter.Value = mutator;
+      }
+    }
+    private void UpdateAnalyzers() {
+      Analyzer.Operators.Clear();
+      if (Problem != null) {
+        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) {
+          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
+            param.Depth = 1;
+          Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault);
+        }
+      }
+      Analyzer.Operators.Add(qualityAnalyzer, qualityAnalyzer.EnabledByDefault);
+    }
+    private GeneticAlgorithmMainLoop FindMainLoop(IOperator start) {
+      IOperator mainLoop = start;
+      while (mainLoop != null && !(mainLoop is GeneticAlgorithmMainLoop))
+        mainLoop = ((SingleSuccessorOperator)mainLoop).Successor;
+      if (mainLoop == null) return null;
+      else return (GeneticAlgorithmMainLoop)mainLoop;
+    }
+    #endregion
+  }
+}
Index: /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs
===================================================================
--- /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs	(revision 9064)
+++ /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs	(revision 9064)
@@ -0,0 +1,240 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Selection;
+
+namespace HeuristicLab.Algorithms.GeneticAlgorithm {
+  /// <summary>
+  /// An operator which represents the main loop of a genetic algorithm.
+  /// </summary>
+  [Item("GeneticAlgorithmMainLoop", "An operator which represents the main loop of a genetic algorithm.")]
+  [StorableClass]
+  public sealed class GeneticAlgorithmMainLoop : 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<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> ElitesParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
+    }
+    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"]; }
+    }
+    public ValueLookupParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
+    }
+    public ValueLookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    private ScopeParameter CurrentScopeParameter {
+      get { return (ScopeParameter)Parameters["CurrentScope"]; }
+    }
+
+    public IScope CurrentScope {
+      get { return CurrentScopeParameter.ActualValue; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private GeneticAlgorithmMainLoop(bool deserializing) : base(deserializing) { }
+    private GeneticAlgorithmMainLoop(GeneticAlgorithmMainLoop original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GeneticAlgorithmMainLoop(this, cloner);
+    }
+    public GeneticAlgorithmMainLoop()
+      : base() {
+      Initialize();
+    }
+
+    private void Initialize() {
+      #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<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. This operator is executed in parallel, if an engine is used which supports parallelization."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
+      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."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population."));
+      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the genetic algorithm should be applied."));
+      #endregion
+
+      #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 uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
+      Placeholder crossover = new Placeholder();
+      StochasticBranch stochasticBranch = new StochasticBranch();
+      Placeholder mutator = new Placeholder();
+      SubScopesRemover subScopesRemover = new SubScopesRemover();
+      UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
+      Placeholder evaluator = new Placeholder();
+      SubScopesCounter subScopesCounter = new SubScopesCounter();
+      SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
+      BestSelector bestSelector = new BestSelector();
+      RightReducer rightReducer = new RightReducer();
+      MergingReducer mergingReducer = new MergingReducer();
+      IntCounter intCounter = new IntCounter();
+      Comparator comparator = new Comparator();
+      Placeholder analyzer2 = new Placeholder();
+      ConditionalBranch conditionalBranch = new ConditionalBranch();
+
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class GeneticAlgorithm expects this to be called Generations
+
+      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";
+
+      subScopesRemover.RemoveAllSubScopes = true;
+
+      uniformSubScopesProcessor2.Parallel.Value = true;
+
+      evaluator.Name = "Evaluator";
+      evaluator.OperatorParameter.ActualName = "Evaluator";
+
+      subScopesCounter.Name = "Increment EvaluatedSolutions";
+      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
+
+      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";
+
+      analyzer2.Name = "Analyzer";
+      analyzer2.OperatorParameter.ActualName = "Analyzer";
+
+      conditionalBranch.ConditionParameter.ActualName = "Terminate";
+      #endregion
+
+      #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 = uniformSubScopesProcessor1;
+      uniformSubScopesProcessor1.Operator = crossover;
+      uniformSubScopesProcessor1.Successor = uniformSubScopesProcessor2;
+      crossover.Successor = stochasticBranch;
+      stochasticBranch.FirstBranch = mutator;
+      stochasticBranch.SecondBranch = null;
+      stochasticBranch.Successor = subScopesRemover;
+      mutator.Successor = null;
+      subScopesRemover.Successor = null;
+      uniformSubScopesProcessor2.Operator = evaluator;
+      uniformSubScopesProcessor2.Successor = subScopesCounter;
+      evaluator.Successor = null;
+      subScopesCounter.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 = 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();
+    }
+  }
+}
Index: /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/HeuristicLab.Algorithms.GeneticAlgorithm-3.3.csproj
===================================================================
--- /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/HeuristicLab.Algorithms.GeneticAlgorithm-3.3.csproj	(revision 9064)
+++ /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/HeuristicLab.Algorithms.GeneticAlgorithm-3.3.csproj	(revision 9064)
@@ -0,0 +1,230 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{A51DA44F-CB35-4F6F-99F5-2A2E904AB93B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Algorithms.GeneticAlgorithm</RootNamespace>
+    <AssemblyName>HeuristicLab.Algorithms.GeneticAlgorithm-3.3</AssemblyName>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <StartupObject>
+    </StartupObject>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>
+    </DocumentationFile>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>$(SolutionDir)\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="GeneticAlgorithm.cs" />
+    <Compile Include="GeneticAlgorithmMainLoop.cs" />
+    <Compile Include="IslandGeneticAlgorithm.cs" />
+    <Compile Include="IslandGeneticAlgorithmMainLoop.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </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>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
+      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
+      <Name>HeuristicLab.Collections-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
+      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
+      <Name>HeuristicLab.Common-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
+      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
+      <Name>HeuristicLab.Core-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
+      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
+      <Name>HeuristicLab.Data-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
+      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
+      <Name>HeuristicLab.Operators-3.3</Name>
+      <Private>False</Private>
+    </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>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
+      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
+      <Name>HeuristicLab.Optimization-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
+      <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
+      <Name>HeuristicLab.Parameters-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
+      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
+      <Name>HeuristicLab.Persistence-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
+      <Private>False</Private>
+    </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>
+      <Private>False</Private>
+    </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>
+      <Private>False</Private>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </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 Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
===================================================================
--- /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs	(revision 9064)
+++ /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs	(revision 9064)
@@ -0,0 +1,563 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Algorithms.GeneticAlgorithm {
+  /// <summary>
+  /// An island genetic algorithm.
+  /// </summary>
+  [Item("Island Genetic Algorithm", "An island genetic algorithm.")]
+  [Creatable("Algorithms")]
+  [StorableClass]
+  public sealed class IslandGeneticAlgorithm : HeuristicOptimizationEngineAlgorithm, IStorableContent {
+    public string Filename { get; set; }
+
+    #region Problem Properties
+    public override Type ProblemType {
+      get { return typeof(ISingleObjectiveHeuristicOptimizationProblem); }
+    }
+    public new ISingleObjectiveHeuristicOptimizationProblem Problem {
+      get { return (ISingleObjectiveHeuristicOptimizationProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+    #endregion
+
+    #region Parameter Properties
+    private ValueParameter<IntValue> SeedParameter {
+      get { return (ValueParameter<IntValue>)Parameters["Seed"]; }
+    }
+    private ValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
+    }
+    private ValueParameter<IntValue> NumberOfIslandsParameter {
+      get { return (ValueParameter<IntValue>)Parameters["NumberOfIslands"]; }
+    }
+    private ValueParameter<IntValue> MigrationIntervalParameter {
+      get { return (ValueParameter<IntValue>)Parameters["MigrationInterval"]; }
+    }
+    private ValueParameter<PercentValue> MigrationRateParameter {
+      get { return (ValueParameter<PercentValue>)Parameters["MigrationRate"]; }
+    }
+    public IConstrainedValueParameter<IMigrator> MigratorParameter {
+      get { return (IConstrainedValueParameter<IMigrator>)Parameters["Migrator"]; }
+    }
+    public IConstrainedValueParameter<ISelector> EmigrantsSelectorParameter {
+      get { return (IConstrainedValueParameter<ISelector>)Parameters["EmigrantsSelector"]; }
+    }
+    public IConstrainedValueParameter<IReplacer> ImmigrationReplacerParameter {
+      get { return (IConstrainedValueParameter<IReplacer>)Parameters["ImmigrationReplacer"]; }
+    }
+    private ValueParameter<IntValue> PopulationSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    private ValueParameter<IntValue> MaximumGenerationsParameter {
+      get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; }
+    }
+    public IConstrainedValueParameter<ISelector> SelectorParameter {
+      get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
+    }
+    public IConstrainedValueParameter<ICrossover> CrossoverParameter {
+      get { return (IConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
+    }
+    private ValueParameter<PercentValue> MutationProbabilityParameter {
+      get { return (ValueParameter<PercentValue>)Parameters["MutationProbability"]; }
+    }
+    public IConstrainedValueParameter<IManipulator> MutatorParameter {
+      get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
+    }
+    private ValueParameter<IntValue> ElitesParameter {
+      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
+    }
+    private ValueParameter<MultiAnalyzer> AnalyzerParameter {
+      get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
+    }
+    private ValueParameter<MultiAnalyzer> IslandAnalyzerParameter {
+      get { return (ValueParameter<MultiAnalyzer>)Parameters["IslandAnalyzer"]; }
+    }
+    #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 NumberOfIslands {
+      get { return NumberOfIslandsParameter.Value; }
+      set { NumberOfIslandsParameter.Value = value; }
+    }
+    public IntValue MigrationInterval {
+      get { return MigrationIntervalParameter.Value; }
+      set { MigrationIntervalParameter.Value = value; }
+    }
+    public PercentValue MigrationRate {
+      get { return MigrationRateParameter.Value; }
+      set { MigrationRateParameter.Value = value; }
+    }
+    public IMigrator Migrator {
+      get { return MigratorParameter.Value; }
+      set { MigratorParameter.Value = value; }
+    }
+    public ISelector EmigrantsSelector {
+      get { return EmigrantsSelectorParameter.Value; }
+      set { EmigrantsSelectorParameter.Value = value; }
+    }
+    public IReplacer ImmigrationReplacer {
+      get { return ImmigrationReplacerParameter.Value; }
+      set { ImmigrationReplacerParameter.Value = value; }
+    }
+    public IntValue PopulationSize {
+      get { return PopulationSizeParameter.Value; }
+      set { PopulationSizeParameter.Value = value; }
+    }
+    public IntValue MaximumGenerations {
+      get { return MaximumGenerationsParameter.Value; }
+      set { MaximumGenerationsParameter.Value = value; }
+    }
+    public ISelector Selector {
+      get { return SelectorParameter.Value; }
+      set { SelectorParameter.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 IntValue Elites {
+      get { return ElitesParameter.Value; }
+      set { ElitesParameter.Value = value; }
+    }
+    public MultiAnalyzer Analyzer {
+      get { return AnalyzerParameter.Value; }
+      set { AnalyzerParameter.Value = value; }
+    }
+    public MultiAnalyzer IslandAnalyzer {
+      get { return IslandAnalyzerParameter.Value; }
+      set { IslandAnalyzerParameter.Value = value; }
+    }
+    private RandomCreator RandomCreator {
+      get { return (RandomCreator)OperatorGraph.InitialOperator; }
+    }
+    private UniformSubScopesProcessor IslandProcessor {
+      get { return OperatorGraph.Iterate().OfType<UniformSubScopesProcessor>().First(x => x.Operator is SolutionsCreator); }
+    }
+    private SolutionsCreator SolutionsCreator {
+      get { return (SolutionsCreator)IslandProcessor.Operator; }
+    }
+    private IslandGeneticAlgorithmMainLoop MainLoop {
+      get { return FindMainLoop(IslandProcessor.Successor); }
+    }
+    [Storable]
+    private BestAverageWorstQualityAnalyzer islandQualityAnalyzer;
+    [Storable]
+    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
+    #endregion
+
+    [StorableConstructor]
+    private IslandGeneticAlgorithm(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      Initialize();
+    }
+    private IslandGeneticAlgorithm(IslandGeneticAlgorithm original, Cloner cloner)
+      : base(original, cloner) {
+      islandQualityAnalyzer = cloner.Clone(original.islandQualityAnalyzer);
+      qualityAnalyzer = cloner.Clone(original.qualityAnalyzer);
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new IslandGeneticAlgorithm(this, cloner);
+    }
+
+    public IslandGeneticAlgorithm()
+      : base() {
+      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>("NumberOfIslands", "The number of islands.", new IntValue(5)));
+      Parameters.Add(new ValueParameter<IntValue>("MigrationInterval", "The number of generations that should pass between migration phases.", new IntValue(20)));
+      Parameters.Add(new ValueParameter<PercentValue>("MigrationRate", "The proportion of individuals that should migrate between the islands.", new PercentValue(0.15)));
+      Parameters.Add(new ConstrainedValueParameter<IMigrator>("Migrator", "The migration strategy."));
+      Parameters.Add(new ConstrainedValueParameter<ISelector>("EmigrantsSelector", "Selects the individuals that will be migrated."));
+      Parameters.Add(new ConstrainedValueParameter<IReplacer>("ImmigrationReplacer", "Selects the population from the unification of the original population and the immigrants."));
+      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions.", new IntValue(100)));
+      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations that should be processed.", new IntValue(1000)));
+      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
+      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<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
+      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the islands.", new MultiAnalyzer()));
+      Parameters.Add(new ValueParameter<MultiAnalyzer>("IslandAnalyzer", "The operator used to analyze each island.", new MultiAnalyzer()));
+
+      RandomCreator randomCreator = new RandomCreator();
+      UniformSubScopesProcessor ussp0 = new UniformSubScopesProcessor();
+      LocalRandomCreator localRandomCreator = new LocalRandomCreator();
+      RandomCreator globalRandomResetter = new RandomCreator();
+      SubScopesCreator populationCreator = new SubScopesCreator();
+      UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor();
+      SolutionsCreator solutionsCreator = new SolutionsCreator();
+      VariableCreator variableCreator = new VariableCreator();
+      UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor();
+      SubScopesCounter subScopesCounter = new SubScopesCounter();
+      ResultsCollector resultsCollector = new ResultsCollector();
+      IslandGeneticAlgorithmMainLoop mainLoop = new IslandGeneticAlgorithmMainLoop();
+      OperatorGraph.InitialOperator = randomCreator;
+
+      randomCreator.RandomParameter.ActualName = "GlobalRandom";
+      randomCreator.SeedParameter.ActualName = SeedParameter.Name;
+      randomCreator.SeedParameter.Value = null;
+      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
+      randomCreator.SetSeedRandomlyParameter.Value = null;
+      randomCreator.Successor = populationCreator;
+
+      populationCreator.NumberOfSubScopesParameter.ActualName = NumberOfIslandsParameter.Name;
+      populationCreator.Successor = ussp0;
+
+      ussp0.Operator = localRandomCreator;
+      ussp0.Successor = globalRandomResetter;
+
+      // BackwardsCompatibility3.3
+      // the global random is resetted to ensure the same algorithm results
+      #region Backwards compatible code, remove with 3.4
+      globalRandomResetter.RandomParameter.ActualName = "GlobalRandom";
+      globalRandomResetter.SeedParameter.ActualName = SeedParameter.Name;
+      globalRandomResetter.SeedParameter.Value = null;
+      globalRandomResetter.SetSeedRandomlyParameter.Value = new BoolValue(false);
+      globalRandomResetter.Successor = ussp1;
+      #endregion
+
+      ussp1.Operator = solutionsCreator;
+      ussp1.Successor = variableCreator;
+
+      solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
+      //don't create solutions in parallel because the hive engine would distribute these tasks
+      solutionsCreator.ParallelParameter.Value = new BoolValue(false);
+      solutionsCreator.Successor = null;
+
+      variableCreator.Name = "Initialize EvaluatedSolutions";
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue()));
+      variableCreator.Successor = ussp2;
+
+      ussp2.Operator = subScopesCounter;
+      ussp2.Successor = resultsCollector;
+
+      subScopesCounter.Name = "Count EvaluatedSolutions";
+      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
+      subScopesCounter.Successor = null;
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
+      resultsCollector.ResultsParameter.ActualName = "Results";
+      resultsCollector.Successor = mainLoop;
+
+      mainLoop.EmigrantsSelectorParameter.ActualName = EmigrantsSelectorParameter.Name;
+      mainLoop.ImmigrationReplacerParameter.ActualName = ImmigrationReplacerParameter.Name;
+      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
+      mainLoop.MigrationIntervalParameter.ActualName = MigrationIntervalParameter.Name;
+      mainLoop.MigrationRateParameter.ActualName = MigrationRateParameter.Name;
+      mainLoop.MigratorParameter.ActualName = MigratorParameter.Name;
+      mainLoop.NumberOfIslandsParameter.ActualName = NumberOfIslandsParameter.Name;
+      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
+      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
+      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
+      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
+      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      mainLoop.RandomParameter.ActualName = randomCreator.RandomParameter.ActualName;
+      mainLoop.ResultsParameter.ActualName = "Results";
+      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
+      mainLoop.IslandAnalyzerParameter.ActualName = IslandAnalyzerParameter.Name;
+      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
+      mainLoop.Successor = null;
+
+      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;
+
+      foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name))
+        EmigrantsSelectorParameter.ValidValues.Add(selector);
+
+      foreach (IReplacer replacer in ApplicationManager.Manager.GetInstances<IReplacer>().OrderBy(x => x.Name))
+        ImmigrationReplacerParameter.ValidValues.Add(replacer);
+
+      ParameterizeSelectors();
+
+      foreach (IMigrator migrator in ApplicationManager.Manager.GetInstances<IMigrator>().OrderBy(x => x.Name))
+        MigratorParameter.ValidValues.Add(migrator);
+
+      qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+      islandQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+      ParameterizeAnalyzers();
+      UpdateAnalyzers();
+
+      Initialize();
+    }
+
+    public override void Prepare() {
+      if (Problem != null) base.Prepare();
+    }
+
+    #region Events
+    protected override void OnProblemChanged() {
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      ParameterizeStochasticOperatorForIsland(Problem.Evaluator);
+      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
+      ParameterizeSolutionsCreator();
+      ParameterizeMainLoop();
+      ParameterizeSelectors();
+      ParameterizeAnalyzers();
+      ParameterizeIterationBasedOperators();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateAnalyzers();
+      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      base.OnProblemChanged();
+    }
+
+    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperator(Problem.SolutionCreator);
+      ParameterizeSolutionsCreator();
+      base.Problem_SolutionCreatorChanged(sender, e);
+    }
+    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperatorForIsland(Problem.Evaluator);
+      ParameterizeSolutionsCreator();
+      ParameterizeMainLoop();
+      ParameterizeSelectors();
+      ParameterizeAnalyzers();
+      Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      base.Problem_EvaluatorChanged(sender, e);
+    }
+    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
+      foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
+      ParameterizeIterationBasedOperators();
+      UpdateCrossovers();
+      UpdateMutators();
+      UpdateAnalyzers();
+      base.Problem_OperatorsChanged(sender, e);
+    }
+    private void ElitesParameter_ValueChanged(object sender, EventArgs e) {
+      Elites.ValueChanged += new EventHandler(Elites_ValueChanged);
+      ParameterizeSelectors();
+    }
+    private void Elites_ValueChanged(object sender, EventArgs e) {
+      ParameterizeSelectors();
+    }
+    private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) {
+      NumberOfIslands.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
+      ParameterizeSelectors();
+    }
+    private void PopulationSize_ValueChanged(object sender, EventArgs e) {
+      ParameterizeSelectors();
+    }
+    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeMainLoop();
+      ParameterizeSelectors();
+      ParameterizeAnalyzers();
+    }
+    private void MigrationRateParameter_ValueChanged(object sender, EventArgs e) {
+      MigrationRate.ValueChanged += new EventHandler(MigrationRate_ValueChanged);
+      ParameterizeSelectors();
+    }
+    private void MigrationRate_ValueChanged(object sender, EventArgs e) {
+      ParameterizeSelectors();
+    }
+    #endregion
+
+    #region Helpers
+    private void Initialize() {
+      PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged);
+      PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged);
+      MigrationRateParameter.ValueChanged += new EventHandler(MigrationRateParameter_ValueChanged);
+      MigrationRate.ValueChanged += new EventHandler(MigrationRate_ValueChanged);
+      ElitesParameter.ValueChanged += new EventHandler(ElitesParameter_ValueChanged);
+      Elites.ValueChanged += new EventHandler(Elites_ValueChanged);
+      if (Problem != null) {
+        Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
+      }
+    }
+    private void ParameterizeSolutionsCreator() {
+      SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+    }
+    private void ParameterizeMainLoop() {
+      MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+      MainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+    }
+    private void ParameterizeStochasticOperator(IOperator op) {
+      IStochasticOperator stochasticOp = op as IStochasticOperator;
+      if (stochasticOp != null) {
+        stochasticOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
+        stochasticOp.RandomParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeStochasticOperatorForIsland(IOperator op) {
+      IStochasticOperator stochasticOp = op as IStochasticOperator;
+      if (stochasticOp != null) {
+        stochasticOp.RandomParameter.ActualName = "LocalRandom";
+        stochasticOp.RandomParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeSelectors() {
+      foreach (ISelector selector in SelectorParameter.ValidValues) {
+        selector.CopySelected = new BoolValue(true);
+        selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * (PopulationSize.Value - Elites.Value));
+        selector.NumberOfSelectedSubScopesParameter.Hidden = true;
+        ParameterizeStochasticOperatorForIsland(selector);
+      }
+      foreach (ISelector selector in EmigrantsSelectorParameter.ValidValues) {
+        selector.CopySelected = new BoolValue(true);
+        selector.NumberOfSelectedSubScopesParameter.Value = new IntValue((int)Math.Ceiling(PopulationSize.Value * MigrationRate.Value));
+        selector.NumberOfSelectedSubScopesParameter.Hidden = true;
+        ParameterizeStochasticOperator(selector);
+      }
+      foreach (IReplacer replacer in ImmigrationReplacerParameter.ValidValues) {
+        ParameterizeStochasticOperator(replacer);
+      }
+      if (Problem != null) {
+        foreach (ISingleObjectiveSelector selector in SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>()) {
+          selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+          selector.MaximizationParameter.Hidden = true;
+          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+          selector.QualityParameter.Hidden = true;
+        }
+        foreach (ISingleObjectiveSelector selector in EmigrantsSelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>()) {
+          selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+          selector.MaximizationParameter.Hidden = true;
+          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+          selector.QualityParameter.Hidden = true;
+        }
+        foreach (ISingleObjectiveReplacer selector in ImmigrationReplacerParameter.ValidValues.OfType<ISingleObjectiveReplacer>()) {
+          selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+          selector.MaximizationParameter.Hidden = true;
+          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+          selector.QualityParameter.Hidden = true;
+        }
+      }
+    }
+    private void ParameterizeAnalyzers() {
+      islandQualityAnalyzer.ResultsParameter.ActualName = "Results";
+      islandQualityAnalyzer.ResultsParameter.Hidden = true;
+      islandQualityAnalyzer.QualityParameter.Depth = 1;
+      qualityAnalyzer.ResultsParameter.ActualName = "Results";
+      qualityAnalyzer.ResultsParameter.Hidden = true;
+      qualityAnalyzer.QualityParameter.Depth = 2;
+
+      if (Problem != null) {
+        islandQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+        islandQualityAnalyzer.MaximizationParameter.Hidden = true;
+        islandQualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+        islandQualityAnalyzer.QualityParameter.Hidden = true;
+        islandQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+        islandQualityAnalyzer.BestKnownQualityParameter.Hidden = true;
+        qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
+        qualityAnalyzer.MaximizationParameter.Hidden = true;
+        qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
+        qualityAnalyzer.QualityParameter.Hidden = true;
+        qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+        qualityAnalyzer.BestKnownQualityParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeIterationBasedOperators() {
+      if (Problem != null) {
+        foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
+          op.IterationsParameter.ActualName = "Generations";
+          op.IterationsParameter.Hidden = true;
+          op.MaximumIterationsParameter.ActualName = "MaximumGenerations";
+          op.MaximumIterationsParameter.Hidden = true;
+        }
+      }
+    }
+    private void UpdateCrossovers() {
+      ICrossover oldCrossover = CrossoverParameter.Value;
+      ICrossover defaultCrossover = Problem.Operators.OfType<ICrossover>().FirstOrDefault();
+      CrossoverParameter.ValidValues.Clear();
+      foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) {
+        ParameterizeStochasticOperatorForIsland(crossover);
+        CrossoverParameter.ValidValues.Add(crossover);
+      }
+      if (oldCrossover != null) {
+        ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType());
+        if (crossover != null) CrossoverParameter.Value = crossover;
+        else oldCrossover = null;
+      }
+      if (oldCrossover == null && defaultCrossover != null)
+        CrossoverParameter.Value = defaultCrossover;
+    }
+    private void UpdateMutators() {
+      IManipulator oldMutator = MutatorParameter.Value;
+      MutatorParameter.ValidValues.Clear();
+      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) {
+        ParameterizeStochasticOperatorForIsland(mutator);
+        MutatorParameter.ValidValues.Add(mutator);
+      }
+      if (oldMutator != null) {
+        IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType());
+        if (mutator != null) MutatorParameter.Value = mutator;
+      }
+    }
+    private void UpdateAnalyzers() {
+      IslandAnalyzer.Operators.Clear();
+      Analyzer.Operators.Clear();
+      IslandAnalyzer.Operators.Add(islandQualityAnalyzer, islandQualityAnalyzer.EnabledByDefault);
+      if (Problem != null) {
+        foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) {
+          foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
+            param.Depth = 2;
+          Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault);
+        }
+      }
+      Analyzer.Operators.Add(qualityAnalyzer, qualityAnalyzer.EnabledByDefault);
+    }
+    private IslandGeneticAlgorithmMainLoop FindMainLoop(IOperator start) {
+      IOperator mainLoop = start;
+      while (mainLoop != null && !(mainLoop is IslandGeneticAlgorithmMainLoop))
+        mainLoop = ((SingleSuccessorOperator)mainLoop).Successor;
+      if (mainLoop == null) return null;
+      else return (IslandGeneticAlgorithmMainLoop)mainLoop;
+    }
+    #endregion
+  }
+}
Index: /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs
===================================================================
--- /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs	(revision 9064)
+++ /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs	(revision 9064)
@@ -0,0 +1,377 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Selection;
+
+namespace HeuristicLab.Algorithms.GeneticAlgorithm {
+  /// <summary>
+  /// An island genetic algorithm main loop operator.
+  /// </summary>
+  [Item("IslandGeneticAlgorithmMainLoop", "An island genetic algorithm main loop operator.")]
+  [StorableClass]
+  public sealed class IslandGeneticAlgorithmMainLoop : 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<DoubleValue> BestKnownQualityParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
+    public ValueLookupParameter<IntValue> NumberOfIslandsParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["NumberOfIslands"]; }
+    }
+    public ValueLookupParameter<IntValue> MigrationIntervalParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["MigrationInterval"]; }
+    }
+    public ValueLookupParameter<PercentValue> MigrationRateParameter {
+      get { return (ValueLookupParameter<PercentValue>)Parameters["MigrationRate"]; }
+    }
+    public ValueLookupParameter<IOperator> MigratorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Migrator"]; }
+    }
+    public ValueLookupParameter<IOperator> EmigrantsSelectorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["EmigrantsSelector"]; }
+    }
+    public ValueLookupParameter<IOperator> ImmigrationReplacerParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["ImmigrationReplacer"]; }
+    }
+    public ValueLookupParameter<IntValue> PopulationSizeParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
+    }
+    public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
+    }
+    public ValueLookupParameter<IOperator> SelectorParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Selector"]; }
+    }
+    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> ElitesParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
+    }
+    public ValueLookupParameter<ResultCollection> ResultsParameter {
+      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
+    }
+    public ValueLookupParameter<IOperator> AnalyzerParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
+    }
+    public ValueLookupParameter<IOperator> IslandAnalyzerParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["IslandAnalyzer"]; }
+    }
+    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
+    }
+    public LookupParameter<IntValue> IslandGenerations {
+      get { return (LookupParameter<IntValue>)Parameters["IslandGenerations"]; }
+    }
+    public LookupParameter<IntValue> IslandEvaluatedSolutions {
+      get { return (LookupParameter<IntValue>)Parameters["IslandEvaluatedSolutions"]; }
+    }
+    public ValueLookupParameter<BoolValue> Migrate {
+      get { return (ValueLookupParameter<BoolValue>)Parameters["Migrate"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    private IslandGeneticAlgorithmMainLoop(bool deserializing) : base(deserializing) { }
+    private IslandGeneticAlgorithmMainLoop(IslandGeneticAlgorithmMainLoop original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new IslandGeneticAlgorithmMainLoop(this, cloner);
+    }
+    public IslandGeneticAlgorithmMainLoop()
+      : base() {
+      #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<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfIslands", "The number of islands."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("MigrationInterval", "The number of generations that should pass between migration phases."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>("MigrationRate", "The proportion of individuals that should migrate between the islands."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Migrator", "The migration strategy."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("EmigrantsSelector", "Selects the individuals that will be migrated."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("ImmigrationReplacer", "Replaces some of the original population with the immigrants."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions."));
+      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations that the algorithm should process."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
+      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>("Elites", "The numer of elite solutions which are kept in each generation."));
+      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to the analyze the islands."));
+      Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island."));
+      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times a solution has been evaluated."));
+      Parameters.Add(new LookupParameter<IntValue>("IslandGenerations", "The number of generations calculated on one island."));
+      Parameters.Add(new LookupParameter<IntValue>("IslandEvaluatedSolutions", "The number of times a solution has been evaluated on one island."));
+      Parameters.Add(new ValueLookupParameter<BoolValue>("Migrate", "Migrate the island?"));
+      #endregion
+
+      #region Create operators
+      VariableCreator variableCreator = new VariableCreator();
+      UniformSubScopesProcessor uniformSubScopesProcessor0 = new UniformSubScopesProcessor();
+      VariableCreator islandVariableCreator = new VariableCreator();
+      Placeholder islandAnalyzer1 = new Placeholder();
+      LocalRandomCreator localRandomCreator = new LocalRandomCreator();
+      Placeholder analyzer1 = new Placeholder();
+      ResultsCollector resultsCollector1 = new ResultsCollector();
+      UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
+      Assigner generationsAssigner = new Assigner();
+      Assigner evaluatedSolutionsAssigner = new Assigner();
+      Placeholder selector = new Placeholder();
+      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
+      ChildrenCreator childrenCreator = new ChildrenCreator();
+      UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
+      Placeholder crossover = new Placeholder();
+      StochasticBranch stochasticBranch = new StochasticBranch();
+      Placeholder mutator = new Placeholder();
+      SubScopesRemover subScopesRemover = new SubScopesRemover();
+      UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor();
+      Placeholder evaluator = new Placeholder();
+      SubScopesCounter subScopesCounter = new SubScopesCounter();
+      SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
+      BestSelector bestSelector = new BestSelector();
+      RightReducer rightReducer = new RightReducer();
+      MergingReducer mergingReducer = new MergingReducer();
+      IntCounter islandGenerationsCounter = new IntCounter();
+      Comparator checkIslandGenerationsReachedMaximum = new Comparator();
+      ConditionalBranch checkContinueEvolution = new ConditionalBranch();
+      DataReducer generationsReducer = new DataReducer();
+      DataReducer evaluatedSolutionsReducer = new DataReducer();
+      Placeholder islandAnalyzer2 = new Placeholder();
+      UniformSubScopesProcessor uniformSubScopesProcessor5 = new UniformSubScopesProcessor();
+      Placeholder emigrantsSelector = new Placeholder();
+      IntCounter migrationsCounter = new IntCounter();
+      Placeholder migrator = new Placeholder();
+      UniformSubScopesProcessor uniformSubScopesProcessor6 = new UniformSubScopesProcessor();
+      Placeholder immigrationReplacer = new Placeholder();
+      Comparator generationsComparator = new Comparator();
+      Placeholder analyzer2 = new Placeholder();
+      ConditionalBranch generationsTerminationCondition = new ConditionalBranch();
+
+
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Migrations", new IntValue(0)));
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastMigration", new IntValue(0)));
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class IslandGeneticAlgorithm expects this to be called Generations
+
+      islandVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection()));
+      islandVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("IslandGenerations", new IntValue(0)));
+      islandVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("IslandEvaluatedSolutions", new IntValue(0)));
+
+      islandAnalyzer1.Name = "Island Analyzer (placeholder)";
+      islandAnalyzer1.OperatorParameter.ActualName = IslandAnalyzerParameter.Name;
+
+      analyzer1.Name = "Analyzer (placeholder)";
+      analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name;
+
+      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Migrations"));
+      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
+      resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results"));
+      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
+
+      uniformSubScopesProcessor1.Parallel.Value = true;
+
+      generationsAssigner.Name = "Initialize Island Generations";
+      generationsAssigner.LeftSideParameter.ActualName = IslandGenerations.Name;
+      generationsAssigner.RightSideParameter.Value = new IntValue(0);
+
+      evaluatedSolutionsAssigner.Name = "Initialize Island evaluated solutions";
+      evaluatedSolutionsAssigner.LeftSideParameter.ActualName = IslandEvaluatedSolutions.Name;
+      evaluatedSolutionsAssigner.RightSideParameter.Value = new IntValue(0);
+
+      selector.Name = "Selector (placeholder)";
+      selector.OperatorParameter.ActualName = SelectorParameter.Name;
+
+      childrenCreator.ParentsPerChild = new IntValue(2);
+
+      crossover.Name = "Crossover (placeholder)";
+      crossover.OperatorParameter.ActualName = CrossoverParameter.Name;
+
+      stochasticBranch.ProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
+      //set it to the random number generator of the island
+      stochasticBranch.RandomParameter.ActualName = "LocalRandom";
+
+      mutator.Name = "Mutator (placeholder)";
+      mutator.OperatorParameter.ActualName = MutatorParameter.Name;
+
+      subScopesRemover.RemoveAllSubScopes = true;
+
+      evaluator.Name = "Evaluator (placeholder)";
+      evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;
+
+      subScopesCounter.Name = "Increment EvaluatedSolutions";
+      subScopesCounter.ValueParameter.ActualName = IslandEvaluatedSolutions.Name;
+
+      bestSelector.CopySelected = new BoolValue(false);
+      bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name;
+      bestSelector.QualityParameter.ActualName = QualityParameter.Name;
+
+      islandGenerationsCounter.Name = "Increment island generatrions";
+      islandGenerationsCounter.ValueParameter.ActualName = IslandGenerations.Name;
+      islandGenerationsCounter.Increment = new IntValue(1);
+
+      checkIslandGenerationsReachedMaximum.LeftSideParameter.ActualName = IslandGenerations.Name;
+      checkIslandGenerationsReachedMaximum.RightSideParameter.ActualName = MigrationIntervalParameter.Name;
+      checkIslandGenerationsReachedMaximum.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      checkIslandGenerationsReachedMaximum.ResultParameter.ActualName = Migrate.Name;
+
+      checkContinueEvolution.Name = "Migrate?";
+      checkContinueEvolution.ConditionParameter.ActualName = Migrate.Name;
+      checkContinueEvolution.FalseBranch = selector;
+
+      islandAnalyzer2.Name = "Island Analyzer (placeholder)";
+      islandAnalyzer2.OperatorParameter.ActualName = IslandAnalyzerParameter.Name;
+
+      generationsReducer.Name = "Increment Generations";
+      generationsReducer.ParameterToReduce.ActualName = islandGenerationsCounter.ValueParameter.ActualName;
+      generationsReducer.TargetParameter.ActualName = "Generations";
+      generationsReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Min);
+      generationsReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Sum);
+
+      evaluatedSolutionsReducer.Name = "Increment Evaluated Solutions";
+      evaluatedSolutionsReducer.ParameterToReduce.ActualName = IslandEvaluatedSolutions.Name;
+      evaluatedSolutionsReducer.TargetParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      evaluatedSolutionsReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum);
+      evaluatedSolutionsReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Sum);
+
+      emigrantsSelector.Name = "Emigrants Selector (placeholder)";
+      emigrantsSelector.OperatorParameter.ActualName = EmigrantsSelectorParameter.Name;
+
+      migrationsCounter.Name = "Increment number of Migrations";
+      migrationsCounter.ValueParameter.ActualName = "Migrations";
+      migrationsCounter.Increment = new IntValue(1);
+
+      migrator.Name = "Migrator (placeholder)";
+      migrator.OperatorParameter.ActualName = MigratorParameter.Name;
+
+      immigrationReplacer.Name = "Immigration Replacer (placeholder)";
+      immigrationReplacer.OperatorParameter.ActualName = ImmigrationReplacerParameter.Name;
+
+      generationsComparator.Name = "Generations >= MaximumGenerations ?";
+      generationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      generationsComparator.LeftSideParameter.ActualName = "Generations";
+      generationsComparator.ResultParameter.ActualName = "TerminateGenerations";
+      generationsComparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
+
+      analyzer2.Name = "Analyzer (placeholder)";
+      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
+
+      generationsTerminationCondition.Name = "Terminate?";
+      generationsTerminationCondition.ConditionParameter.ActualName = "TerminateGenerations";
+      #endregion
+
+      #region Create operator graph
+      OperatorGraph.InitialOperator = variableCreator;
+      variableCreator.Successor = uniformSubScopesProcessor0;
+      uniformSubScopesProcessor0.Operator = islandVariableCreator;
+      uniformSubScopesProcessor0.Successor = analyzer1;
+      islandVariableCreator.Successor = islandAnalyzer1;
+      // BackwardsCompatibility3.3
+      //the local randoms are created by the island GA itself and are only here to ensure same algorithm results
+      #region Backwards compatible code, remove with 3.4
+      islandAnalyzer1.Successor = localRandomCreator;
+      localRandomCreator.Successor = null;
+      #endregion
+      analyzer1.Successor = resultsCollector1;
+      resultsCollector1.Successor = uniformSubScopesProcessor1;
+      uniformSubScopesProcessor1.Operator = generationsAssigner;
+      uniformSubScopesProcessor1.Successor = generationsReducer;
+      generationsReducer.Successor = evaluatedSolutionsReducer;
+      evaluatedSolutionsReducer.Successor = migrationsCounter;
+      migrationsCounter.Successor = uniformSubScopesProcessor5;
+      generationsAssigner.Successor = evaluatedSolutionsAssigner;
+      evaluatedSolutionsAssigner.Successor = selector;
+      selector.Successor = subScopesProcessor1;
+      subScopesProcessor1.Operators.Add(new EmptyOperator());
+      subScopesProcessor1.Operators.Add(childrenCreator);
+      subScopesProcessor1.Successor = subScopesProcessor2;
+      childrenCreator.Successor = uniformSubScopesProcessor2;
+      uniformSubScopesProcessor2.Operator = crossover;
+      uniformSubScopesProcessor2.Successor = uniformSubScopesProcessor3;
+      crossover.Successor = stochasticBranch;
+      stochasticBranch.FirstBranch = mutator;
+      stochasticBranch.SecondBranch = null;
+      stochasticBranch.Successor = subScopesRemover;
+      mutator.Successor = null;
+      subScopesRemover.Successor = null;
+      uniformSubScopesProcessor3.Operator = evaluator;
+      uniformSubScopesProcessor3.Successor = subScopesCounter;
+      evaluator.Successor = null;
+      subScopesCounter.Successor = null;
+      subScopesCounter.Successor = null;
+      subScopesProcessor2.Operators.Add(bestSelector);
+      subScopesProcessor2.Operators.Add(new EmptyOperator());
+      subScopesProcessor2.Successor = mergingReducer;
+      mergingReducer.Successor = islandAnalyzer2;
+      bestSelector.Successor = rightReducer;
+      rightReducer.Successor = null;
+      islandAnalyzer2.Successor = islandGenerationsCounter;
+      islandGenerationsCounter.Successor = checkIslandGenerationsReachedMaximum;
+      checkIslandGenerationsReachedMaximum.Successor = checkContinueEvolution;
+      uniformSubScopesProcessor5.Operator = emigrantsSelector;
+      emigrantsSelector.Successor = null;
+      uniformSubScopesProcessor5.Successor = migrator;
+      migrator.Successor = uniformSubScopesProcessor6;
+      uniformSubScopesProcessor6.Operator = immigrationReplacer;
+      uniformSubScopesProcessor6.Successor = generationsComparator;
+      generationsComparator.Successor = analyzer2;
+      analyzer2.Successor = generationsTerminationCondition;
+      generationsTerminationCondition.TrueBranch = null;
+      generationsTerminationCondition.FalseBranch = uniformSubScopesProcessor1;
+      generationsTerminationCondition.Successor = null;
+      #endregion
+    }
+
+    public override IOperation Apply() {
+      if (CrossoverParameter.ActualValue == null)
+        return null;
+      return base.Apply();
+    }
+  }
+}
Index: /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/Plugin.cs.frame
===================================================================
--- /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/Plugin.cs.frame	(revision 9064)
+++ /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/Plugin.cs.frame	(revision 9064)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.GeneticAlgorithm {
+  /// <summary>
+  /// Plugin class for HeuristicLab.Algorithms.GeneticAlgorithm plugin.
+  /// </summary>
+  [Plugin("HeuristicLab.Algorithms.GeneticAlgorithm", "3.3.7.$WCREV$")]
+  [PluginFile("HeuristicLab.Algorithms.GeneticAlgorithm-3.3.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [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 HeuristicLabAlgorithmsGeneticAlgorithmPlugin : PluginBase {
+  }
+}
Index: /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/Properties/AssemblyInfo.cs.frame	(revision 9064)
+++ /branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/Properties/AssemblyInfo.cs.frame	(revision 9064)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.InteropServices;
+
+// 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.Algorithms.GeneticAlgorithm")]
+[assembly: AssemblyDescription("HeuristicLab genetic algorithm")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2012 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("ec039d68-07a5-43cf-ba26-34f41c2d470a")]
+
+// 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.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
