Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/DifferentialEvolution.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/DifferentialEvolution.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/DifferentialEvolution.cs	(revision 16391)
@@ -0,0 +1,347 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ * Implementation is based on jMetal framework https://github.com/jMetal/jMetal
+ *
+ * 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.TestFunctions;
+using HeuristicLab.Random;
+using System;
+using System.Collections.Generic;
+using System.Threading;
+
+namespace HeuristicLab.Algorithms.DifferentialEvolution {
+
+  [Item("Differential Evolution (DE)", "A differential evolution algorithm.")]
+  [StorableClass]
+  [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 400)]
+  public class DifferentialEvolution : BasicAlgorithm {
+    public Func<IEnumerable<double>, double> Evaluation;
+
+    public override Type ProblemType {
+      get { return typeof(SingleObjectiveTestFunctionProblem); }
+    }
+    public new SingleObjectiveTestFunctionProblem Problem {
+      get { return (SingleObjectiveTestFunctionProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+
+    private readonly IRandom _random = new MersenneTwister();
+    private int evals;
+
+    #region ParameterNames
+    private const string MaximumEvaluationsParameterName = "Maximum Evaluations";
+    private const string SeedParameterName = "Seed";
+    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    private const string CrossoverProbabilityParameterName = "CrossoverProbability";
+    private const string PopulationSizeParameterName = "PopulationSize";
+    private const string ScalingFactorParameterName = "ScalingFactor";
+    private const string ValueToReachParameterName = "ValueToReach";
+    #endregion
+
+    #region ParameterProperties
+    public IFixedValueParameter<IntValue> MaximumEvaluationsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumEvaluationsParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> SeedParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[SeedParameterName]; }
+    }
+    public FixedValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (FixedValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; }
+    }
+    private ValueParameter<IntValue> PopulationSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters[PopulationSizeParameterName]; }
+    }
+    public ValueParameter<DoubleValue> CrossoverProbabilityParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[CrossoverProbabilityParameterName]; }
+    }
+    public ValueParameter<DoubleValue> ScalingFactorParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[ScalingFactorParameterName]; }
+    }
+    public ValueParameter<DoubleValue> ValueToReachParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[ValueToReachParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public int MaximumEvaluations {
+      get { return MaximumEvaluationsParameter.Value.Value; }
+      set { MaximumEvaluationsParameter.Value.Value = value; }
+    }
+
+    public Double CrossoverProbability {
+      get { return CrossoverProbabilityParameter.Value.Value; }
+      set { CrossoverProbabilityParameter.Value.Value = value; }
+    }
+    public Double ScalingFactor {
+      get { return ScalingFactorParameter.Value.Value; }
+      set { ScalingFactorParameter.Value.Value = value; }
+    }
+    public int Seed {
+      get { return SeedParameter.Value.Value; }
+      set { SeedParameter.Value.Value = value; }
+    }
+    public bool SetSeedRandomly {
+      get { return SetSeedRandomlyParameter.Value.Value; }
+      set { SetSeedRandomlyParameter.Value.Value = value; }
+    }
+    public IntValue PopulationSize {
+      get { return PopulationSizeParameter.Value; }
+      set { PopulationSizeParameter.Value = value; }
+    }
+    public Double ValueToReach {
+      get { return ValueToReachParameter.Value.Value; }
+      set { ValueToReachParameter.Value.Value = value; }
+    }
+    #endregion
+
+    #region ResultsProperties
+    private double ResultsBestQuality {
+      get { return ((DoubleValue)Results["Best Quality"].Value).Value; }
+      set { ((DoubleValue)Results["Best Quality"].Value).Value = value; }
+    }
+
+    private double VTRBestQuality {
+      get { return ((DoubleValue)Results["VTR"].Value).Value; }
+      set { ((DoubleValue)Results["VTR"].Value).Value = value; }
+    }
+
+    private RealVector ResultsBestSolution {
+      get { return (RealVector)Results["Best Solution"].Value; }
+      set { Results["Best Solution"].Value = value; }
+    }
+
+    private int ResultsEvaluations {
+      get { return ((IntValue)Results["Evaluations"].Value).Value; }
+      set { ((IntValue)Results["Evaluations"].Value).Value = value; }
+    }
+    private int ResultsIterations {
+      get { return ((IntValue)Results["Iterations"].Value).Value; }
+      set { ((IntValue)Results["Iterations"].Value).Value = value; }
+    }
+
+    private DataTable ResultsQualities {
+      get { return ((DataTable)Results["Qualities"].Value); }
+    }
+    private DataRow ResultsQualitiesBest {
+      get { return ResultsQualities.Rows["Best Quality"]; }
+    }
+
+    #endregion
+
+    [StorableConstructor]
+    protected DifferentialEvolution(bool deserializing) : base(deserializing) { }
+
+    protected DifferentialEvolution(DifferentialEvolution original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DifferentialEvolution(this, cloner);
+    }
+
+    public DifferentialEvolution() {
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumEvaluationsParameterName, "", new IntValue(Int32.MaxValue)));
+      Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+      Parameters.Add(new ValueParameter<IntValue>(PopulationSizeParameterName, "The size of the population of solutions.", new IntValue(100)));
+      Parameters.Add(new ValueParameter<DoubleValue>(CrossoverProbabilityParameterName, "The value for crossover rate", new DoubleValue(0.88)));
+      Parameters.Add(new ValueParameter<DoubleValue>(ScalingFactorParameterName, "The value for scaling factor", new DoubleValue(0.47)));
+      Parameters.Add(new ValueParameter<DoubleValue>(ValueToReachParameterName, "Value to reach (VTR) parameter", new DoubleValue(0.00000001)));
+    }
+
+    protected override void Run(CancellationToken cancellationToken) {
+
+      // Set up the results display
+      Results.Add(new Result("Iterations", new IntValue(0)));
+      Results.Add(new Result("Evaluations", new IntValue(0)));
+      Results.Add(new Result("Best Solution", new RealVector()));
+      Results.Add(new Result("Best Quality", new DoubleValue(double.NaN)));
+      Results.Add(new Result("VTR", new DoubleValue(double.NaN)));
+      var table = new DataTable("Qualities");
+      table.Rows.Add(new DataRow("Best Quality"));
+      Results.Add(new Result("Qualities", table));
+
+
+      //problem variables
+      var dim = Problem.ProblemSize.Value;
+      var lb = Problem.Bounds[0, 0];
+      var ub = Problem.Bounds[0, 1];
+      var range = ub - lb;
+      this.evals = 0;
+
+      double[,] populationOld = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value];
+      double[,] mutationPopulation = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value];
+      double[,] trialPopulation = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value];
+      double[] bestPopulation = new double[Problem.ProblemSize.Value];
+      double[] bestPopulationIteration = new double[Problem.ProblemSize.Value];
+
+      //create initial population 
+      //population is a matrix of size PopulationSize*ProblemSize
+      for(int i = 0; i < PopulationSizeParameter.Value.Value; i++) {
+        for(int j = 0; j < Problem.ProblemSize.Value; j++) {
+          populationOld[i, j] = _random.NextDouble() * range + lb;
+        }
+      }
+
+      //evaluate the best member after the intialiazation
+      //the idea is to select first member and after that to check the others members from the population
+
+      int best_index = 0;
+      double[] populationRow = new double[Problem.ProblemSize.Value];
+      double[] qualityPopulation = new double[PopulationSizeParameter.Value.Value];
+      bestPopulation = getMatrixRow(populationOld, best_index);
+      RealVector bestPopulationVector = new RealVector(bestPopulation);
+      double bestPopulationValue = Obj(bestPopulationVector);
+      qualityPopulation[best_index] = bestPopulationValue;
+      RealVector selectionVector;
+      RealVector trialVector;
+      double qtrial;
+
+
+      for(var i = 1; i < PopulationSizeParameter.Value.Value; i++) {
+        populationRow = getMatrixRow(populationOld, i);
+        trialVector = new RealVector(populationRow);
+
+        qtrial = Obj(trialVector);
+        qualityPopulation[i] = qtrial;
+
+        if(qtrial > bestPopulationValue) {
+          bestPopulationVector = new RealVector(populationRow);
+          bestPopulationValue = qtrial;
+          best_index = i;
+        }
+      }
+
+      int iterations = 1;
+
+      // Loop until iteration limit reached or canceled.
+      // todo replace with a function
+      // && bestPopulationValue > Problem.BestKnownQuality.Value + ValueToReachParameter.Value.Value
+      while(ResultsEvaluations < MaximumEvaluations
+          && !cancellationToken.IsCancellationRequested
+          && (bestPopulationValue - Problem.BestKnownQuality.Value) > ValueToReachParameter.Value.Value) {
+        //mutation DE/rand/1/bin; classic DE
+        for(int i = 0; i < PopulationSizeParameter.Value.Value; i++) {
+          int r0, r1, r2;
+
+          //assure the selected vectors r0, r1 and r2 are different
+          do {
+            r0 = _random.Next(0, PopulationSizeParameter.Value.Value);
+          } while(r0 == i);
+          do {
+            r1 = _random.Next(0, PopulationSizeParameter.Value.Value);
+          } while(r1 == i || r1 == r0);
+          do {
+            r2 = _random.Next(0, PopulationSizeParameter.Value.Value);
+          } while(r2 == i || r2 == r0 || r2 == r1);
+
+          for(int j = 0; j < getMatrixRow(mutationPopulation, i).Length; j++) {
+            mutationPopulation[i, j] = populationOld[r0, j] +
+                ScalingFactorParameter.Value.Value * (populationOld[r1, j] - populationOld[r2, j]);
+            //check the problem upper and lower bounds
+            if(mutationPopulation[i, j] > ub) mutationPopulation[i, j] = ub;
+            if(mutationPopulation[i, j] < lb) mutationPopulation[i, j] = lb;
+          }
+        }
+
+        //uniform crossover
+        for(int i = 0; i < PopulationSizeParameter.Value.Value; i++) {
+          double rnbr = _random.Next(0, Problem.ProblemSize.Value);
+          for(int j = 0; j < getMatrixRow(mutationPopulation, i).Length; j++) {
+            if(_random.NextDouble() <= CrossoverProbabilityParameter.Value.Value || j == rnbr) {
+              trialPopulation[i, j] = mutationPopulation[i, j];
+            } else {
+              trialPopulation[i, j] = populationOld[i, j];
+            }
+          }
+        }
+
+        //One-to-One Survivor Selection
+        for(int i = 0; i < PopulationSizeParameter.Value.Value; i++) {
+          selectionVector = new RealVector(getMatrixRow(populationOld, i));
+          trialVector = new RealVector(getMatrixRow(trialPopulation, i));
+
+          var selectionEval = qualityPopulation[i];
+          var trialEval = Obj(trialVector);
+
+          if(trialEval < selectionEval) {
+            for(int j = 0; j < getMatrixRow(populationOld, i).Length; j++) {
+              populationOld[i, j] = trialPopulation[i, j];
+            }
+            qualityPopulation[i] = trialEval;
+          }
+        }
+
+        //update the best candidate
+        for(int i = 0; i < PopulationSizeParameter.Value.Value; i++) {
+          selectionVector = new RealVector(getMatrixRow(populationOld, i));
+          var quality = qualityPopulation[i];
+          if(quality < bestPopulationValue) {
+            bestPopulationVector = (RealVector)selectionVector.Clone();
+            bestPopulationValue = quality;
+          }
+        }
+
+        iterations = iterations + 1;
+
+        //update the results
+        ResultsEvaluations = evals;
+        ResultsIterations = iterations;
+        ResultsBestSolution = bestPopulationVector;
+        ResultsBestQuality = bestPopulationValue;
+
+        //update the results in view
+        if(iterations % 10 == 0) ResultsQualitiesBest.Values.Add(bestPopulationValue);
+        if(bestPopulationValue < Problem.BestKnownQuality.Value + ValueToReachParameter.Value.Value) {
+          VTRBestQuality = bestPopulationValue;
+        }
+      }
+    }
+
+    public override bool SupportsPause { get { return false; } } // XXX is pause actually supported?
+
+    //evaluate the vector
+    public double Obj(RealVector x) {
+      evals = evals + 1;
+      if(Problem.Maximization.Value)
+        return -Problem.Evaluator.Evaluate(x);
+
+      return Problem.Evaluator.Evaluate(x);
+    }
+
+    // Get ith row from the matrix
+    public double[] getMatrixRow(double[,] Mat, int i) {
+      double[] tmp = new double[Mat.GetUpperBound(1) + 1];
+
+      for(int j = 0; j <= Mat.GetUpperBound(1); j++) {
+        tmp[j] = Mat[i, j];
+      }
+
+      return tmp;
+    }
+  }
+}
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution.csproj
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution.csproj	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution.csproj	(revision 16391)
@@ -0,0 +1,138 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{A0D49B7F-6E04-4D86-945B-F0CE1618A907}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Algorithms.DifferentialEvolution</RootNamespace>
+    <AssemblyName>HeuristicLab.Algorithms.DifferentialEvolution</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\stable\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>TheKey.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Clients.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Clients.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.MultiObjectiveTestFunctions-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.MultiObjectiveTestFunctions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.TestFunctions-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.TestFunctions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Selection-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Selection-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DifferentialEvolution.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="TheKey.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\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>
+  -->
+</Project>
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution.csproj.user
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution.csproj.user	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution.csproj.user	(revision 16391)
@@ -0,0 +1,11 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+    <StartAction>Program</StartAction>
+    <StartProgram>C:\Users\Privat\Documents\HeuristicLab\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
+    <StartAction>Program</StartAction>
+    <StartProgram>C:\Users\igorc\Documents\HeuristicLab\stable\bin\HeuristicLab 3.3.exe</StartProgram>
+  </PropertyGroup>
+</Project>
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/Plugin.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/Plugin.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/Plugin.cs	(revision 16391)
@@ -0,0 +1,9 @@
+﻿
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.DifferentialEvolution {
+  [Plugin("HeuristicLab.Algorithms.DifferentialEvolution", "Provides an implementation of DE algorithm", "3.3.9.0")]
+  [PluginFile("HeuristicLab.Algorithms.DifferentialEvolution.dll", PluginFileType.Assembly)]
+  public class Plugin : PluginBase {
+  }
+}
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/Properties/AssemblyInfo.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/Properties/AssemblyInfo.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.DifferentialEvolution/Properties/AssemblyInfo.cs	(revision 16391)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+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.DifferentialEvolution")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HEAL")]
+[assembly: AssemblyProduct("HeuristicLab.Algorithms.DifferentialEvolution")]
+[assembly: AssemblyCopyright("Copyright ©  2015")]
+[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("a0d49b7f-6e04-4d86-945b-f0ce1618a907")]
+
+// 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 Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.9.0")]
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/GDE3.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/GDE3.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/GDE3.cs	(revision 16391)
@@ -0,0 +1,683 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * Implementation based on the GDE3 implementation in jMetal Framework https://github.com/jMetal/jMetal
+ *
+ * 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 System.Collections.Generic;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Problems.MultiObjectiveTestFunctions;
+using HeuristicLab.Random;
+using System.Threading;
+using HeuristicLab.Algorithms.GDE3;
+
+namespace HeuristicLab.Algoritms.GDE3 {
+
+  [Item("Generalized Differential Evolution (GDE3)", "A generalized differential evolution algorithm.")]
+  [StorableClass]
+  [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 400)]
+  public class GDE3 : BasicAlgorithm {
+    public override Type ProblemType {
+      get { return typeof(MultiObjectiveBasicProblem<RealVectorEncoding>); }
+    }
+    public new MultiObjectiveTestFunctionProblem Problem {
+      get { return (MultiObjectiveTestFunctionProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+
+    public ILookupParameter<DoubleMatrix> BestKnownFrontParameter {
+      get {
+        return (ILookupParameter<DoubleMatrix>)Parameters["BestKnownFront"];
+      }
+    }
+
+    private readonly IRandom _random = new MersenneTwister();
+    private int evals;
+    private double IGDSumm;
+
+    #region ParameterNames
+    private const string MaximumGenerationsParameterName = "Maximum Generations";
+    private const string MaximumEvaluationsParameterName = "Maximum Evaluations";
+    private const string CrossoverProbabilityParameterName = "CrossoverProbability";
+    private const string PopulationSizeParameterName = "PopulationSize";
+    private const string ScalingFactorParameterName = "ScalingFactor";
+
+    #endregion
+
+    #region ParameterProperties
+    public IFixedValueParameter<IntValue> MaximumGenerationsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumGenerationsParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> MaximumEvaluationsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumEvaluationsParameterName]; }
+    }
+    private ValueParameter<IntValue> PopulationSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters[PopulationSizeParameterName]; }
+    }
+    public ValueParameter<DoubleValue> CrossoverProbabilityParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[CrossoverProbabilityParameterName]; }
+    }
+    public ValueParameter<DoubleValue> ScalingFactorParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[ScalingFactorParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public int MaximumGenerations {
+      get { return MaximumGenerationsParameter.Value.Value; }
+      set { MaximumGenerationsParameter.Value.Value = value; }
+    }
+
+    public int MaximumEvaluations {
+      get { return MaximumEvaluationsParameter.Value.Value; }
+      set { MaximumEvaluationsParameter.Value.Value = value; }
+    }
+
+    public Double CrossoverProbability {
+      get { return CrossoverProbabilityParameter.Value.Value; }
+      set { CrossoverProbabilityParameter.Value.Value = value; }
+    }
+    public Double ScalingFactor {
+      get { return ScalingFactorParameter.Value.Value; }
+      set { ScalingFactorParameter.Value.Value = value; }
+    }
+    public IntValue PopulationSize {
+      get { return PopulationSizeParameter.Value; }
+      set { PopulationSizeParameter.Value = value; }
+    }
+    #endregion
+
+    #region ResultsProperties
+    private double ResultsBestQuality {
+      get { return ((DoubleValue)Results["Best Quality"].Value).Value; }
+      set { ((DoubleValue)Results["Best Quality"].Value).Value = value; }
+    }
+
+    private double ResultsIGDMean {
+      get { return ((DoubleValue)Results["IGDMeanValue"].Value).Value; }
+      set { ((DoubleValue)Results["IGDMeanValue"].Value).Value = value; }
+    }
+
+    private double ResultsIGDBest {
+      get { return ((DoubleValue)Results["IGDBestValue"].Value).Value; }
+      set { ((DoubleValue)Results["IGDBestValue"].Value).Value = value; }
+    }
+
+    private double ResultsIGDWorst {
+      get { return ((DoubleValue)Results["IGDWorstValue"].Value).Value; }
+      set { ((DoubleValue)Results["IGDWorstValue"].Value).Value = value; }
+    }
+
+    private double ResultsInvertedGenerationalDistance {
+      get { return ((DoubleValue)Results["InvertedGenerationalDistance"].Value).Value; }
+      set { ((DoubleValue)Results["InvertedGenerationalDistance"].Value).Value = value; }
+    }
+
+    private double ResultsHypervolume {
+      get { return ((DoubleValue)Results["HyperVolumeValue"].Value).Value; }
+      set { ((DoubleValue)Results["HyperVolumeValue"].Value).Value = value; }
+    }
+
+    private DoubleMatrix ResultsBestFront {
+      get { return (DoubleMatrix)Results["Best Front"].Value; }
+      set { Results["Best Front"].Value = value; }
+    }
+
+    private int ResultsEvaluations {
+      get { return ((IntValue)Results["Evaluations"].Value).Value; }
+      set { ((IntValue)Results["Evaluations"].Value).Value = value; }
+    }
+    private int ResultsGenerations {
+      get { return ((IntValue)Results["Generations"].Value).Value; }
+      set { ((IntValue)Results["Generations"].Value).Value = value; }
+    }
+    private double ResultsGenerationalDistance {
+      get { return ((DoubleValue)Results["GenerationalDistance"].Value).Value; }
+      set { ((DoubleValue)Results["GenerationalDistance"].Value).Value = value; }
+    }
+
+    private double ResultsSpacing {
+      get { return ((DoubleValue)Results["Spacing"].Value).Value; }
+      set { ((DoubleValue)Results["Spacing"].Value).Value = value; }
+    }
+
+    private double ResultsCrowding {
+      get { return ((DoubleValue)Results["Crowding"].Value).Value; }
+      set { ((DoubleValue)Results["Crowding"].Value).Value = value; }
+    }
+
+    #endregion
+
+    [StorableConstructor]
+    protected GDE3(bool deserializing) : base(deserializing) { }
+
+    protected GDE3(GDE3 original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GDE3(this, cloner);
+    }
+
+    public GDE3() {
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumGenerationsParameterName, "", new IntValue(1000)));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumEvaluationsParameterName, "", new IntValue(Int32.MaxValue)));
+      Parameters.Add(new ValueParameter<IntValue>(PopulationSizeParameterName, "The size of the population of solutions.", new IntValue(100)));
+      Parameters.Add(new ValueParameter<DoubleValue>(CrossoverProbabilityParameterName, "The value for crossover rate", new DoubleValue(0.5)));
+      Parameters.Add(new ValueParameter<DoubleValue>(ScalingFactorParameterName, "The value for scaling factor", new DoubleValue(0.5)));
+      Parameters.Add(new LookupParameter<DoubleMatrix>("BestKnownFront", "The currently best known Pareto front"));
+    }
+
+    protected override void Run(CancellationToken cancellationToken) {
+      // Set up the results display
+      Results.Add(new Result("Generations", new IntValue(0)));
+      Results.Add(new Result("Evaluations", new IntValue(0)));
+      Results.Add(new Result("Best Front", new DoubleMatrix()));
+      Results.Add(new Result("Crowding", new DoubleValue(0)));
+      Results.Add(new Result("InvertedGenerationalDistance", new DoubleValue(0)));
+      Results.Add(new Result("GenerationalDistance", new DoubleValue(0)));
+      Results.Add(new Result("HyperVolumeValue", new DoubleValue(0)));
+      Results.Add(new Result("IGDMeanValue", new DoubleValue(0)));
+      Results.Add(new Result("IGDBestValue", new DoubleValue(Int32.MaxValue)));
+      Results.Add(new Result("IGDWorstValue", new DoubleValue(0)));
+
+      Results.Add(new Result("Spacing", new DoubleValue(0)));
+      Results.Add(new Result("Scatterplot", typeof(IMOFrontModel)));
+      var table = new DataTable("Qualities");
+      table.Rows.Add(new DataRow("Best Quality"));
+      Results.Add(new Result("Qualities", table));
+
+      //setup the variables
+      List<SolutionSet> population;
+      List<SolutionSet> offspringPopulation;
+      SolutionSet[] parent;
+      double IGDSumm = 0;
+
+      //initialize population
+      population = new List<SolutionSet>(PopulationSizeParameter.Value.Value);
+
+      for(int i = 0; i < PopulationSizeParameter.Value.Value; ++i) {
+        var m = createIndividual();
+        m.Quality = Problem.Evaluate(m.Population, _random);
+        //the test function is constrained
+        if(m.Quality.Length > Problem.Objectives) {
+          m.OverallConstrainViolation = m.Quality[Problem.Objectives];
+        } else {
+          m.OverallConstrainViolation = 0;
+        }
+        population.Add(m);
+      }
+
+      this.initProgress();
+      int generations = 1;
+
+      while(ResultsEvaluations < MaximumEvaluationsParameter.Value.Value
+         && !cancellationToken.IsCancellationRequested) {
+        var populationSize = PopulationSizeParameter.Value.Value;
+
+        // Create the offSpring solutionSet
+        offspringPopulation = new List<SolutionSet>(PopulationSizeParameter.Value.Value * 2);
+
+        for(int i = 0; i < populationSize; i++) {
+          // Obtain parents. Two parameters are required: the population and the 
+          //                 index of the current individual
+          parent = selection(population, i);
+
+          SolutionSet child;
+          // Crossover. The parameters are the current individual and the index of the array of parents 
+          child = reproduction(population[i], parent);
+
+          child.Quality = Problem.Evaluate(child.Population, _random);
+
+          this.updateProgres();
+
+          //the test function is constrained
+          if(child.Quality.Length > Problem.Objectives) {
+            child.OverallConstrainViolation = child.Quality[Problem.Objectives];
+          } else {
+            child.OverallConstrainViolation = 0;
+          }
+
+          // Dominance test
+          int result;
+          result = compareDomination(population[i], child);
+
+          if(result == -1) { // Solution i dominates child
+            offspringPopulation.Add(population[i]);
+          } else if(result == 1) { // child dominates
+            offspringPopulation.Add(child);
+          } else { // the two solutions are non-dominated
+            offspringPopulation.Add(child);
+            offspringPopulation.Add(population[i]);
+          }
+        }
+
+        // Ranking the offspring population
+        List<SolutionSet>[] ranking = computeRanking(offspringPopulation);
+        population = crowdingDistanceSelection(ranking);
+        generations++;
+        ResultsGenerations = generations;
+        displayResults(population);
+      }
+    }
+
+    public override bool SupportsPause { get { return false; } } // XXX does it actually support pause?
+
+    private void displayResults(List<SolutionSet> population) {
+      List<SolutionSet>[] rankingFinal = computeRanking(population);
+
+      int objectives = Problem.Objectives;
+      var optimalfront = Problem.TestFunction.OptimalParetoFront(objectives);
+
+      double[][] opf = new double[0][];
+      if(optimalfront != null) {
+        opf = optimalfront.Select(s => s.ToArray()).ToArray();
+      }
+
+      //compute the final qualities and population
+      double[][] qualitiesFinal = new double[rankingFinal[0].Count][];
+      double[][] populationFinal = new double[rankingFinal[0].Count][];
+
+      for(int i = 0; i < rankingFinal[0].Count; ++i) {
+        qualitiesFinal[i] = new double[Problem.Objectives];
+        populationFinal[i] = new double[Problem.Objectives];
+        for(int j = 0; j < Problem.Objectives; ++j) {
+          populationFinal[i][j] = rankingFinal[0][i].Population[j];
+          qualitiesFinal[i][j] = rankingFinal[0][i].Quality[j];
+        }
+      }
+      IEnumerable<double[]> en = qualitiesFinal;
+      IEnumerable<double[]> frontVectors = NonDominatedSelect.selectNonDominatedVectors(qualitiesFinal, Problem.TestFunction.Maximization(objectives), true);
+      //update the results
+
+      ResultsEvaluations = this.evals;
+      ResultsBestFront = new DoubleMatrix(MultiObjectiveTestFunctionProblem.To2D(qualitiesFinal));
+      ResultsCrowding = Crowding.Calculate(qualitiesFinal, Problem.TestFunction.Bounds(objectives));
+      GenerationalDistanceCalculator distance = new GenerationalDistanceCalculator();
+      ResultsInvertedGenerationalDistance = distance.CalculateGenerationalDistance(qualitiesFinal, opf, Problem.Objectives);
+      ResultsHypervolume = Hypervolume.Calculate(frontVectors, Problem.TestFunction.ReferencePoint(objectives), Problem.TestFunction.Maximization(objectives));
+      ResultsGenerationalDistance = GenerationalDistance.Calculate(qualitiesFinal, optimalfront, 1);
+      Results["Scatterplot"].Value = new MOSolution(qualitiesFinal, populationFinal, opf, objectives);
+      ResultsSpacing = Spacing.Calculate(qualitiesFinal);
+
+      if(ResultsIGDBest > ResultsInvertedGenerationalDistance) {
+        ResultsIGDBest = ResultsInvertedGenerationalDistance;
+      }
+      if(ResultsIGDWorst < ResultsInvertedGenerationalDistance) {
+        ResultsIGDWorst = ResultsInvertedGenerationalDistance;
+      }
+      this.IGDSumm += ResultsInvertedGenerationalDistance;
+      ResultsIGDMean = this.IGDSumm / ResultsGenerations;
+    }
+
+    private int getWorstIndex(List<SolutionSet> SolutionsList) {
+      int result = 0;
+
+      if((SolutionsList == null) || SolutionsList.Count == 0) {
+        result = 0;
+      } else {
+        SolutionSet worstKnown = SolutionsList[0],
+                    candidateSolution;
+        int flag;
+        for(int i = 1; i < SolutionsList.Count; i++) {
+          candidateSolution = SolutionsList[i];
+          flag = compareDomination(worstKnown, candidateSolution);
+          if(flag == -1) {
+            result = i;
+            worstKnown = candidateSolution;
+          }
+        }
+      }
+      return result;
+    }
+
+    private SolutionSet createIndividual() {
+      var dim = Problem.ProblemSize;
+      var lb = Problem.Bounds[0, 0];
+      var ub = Problem.Bounds[0, 1];
+      var range = ub - lb;
+      var v = new double[Problem.ProblemSize];
+      SolutionSet solutionObject = new SolutionSet(PopulationSizeParameter.Value.Value);
+
+      for(int i = 0; i < Problem.ProblemSize; ++i) {
+        v[i] = _random.NextDouble() * range + lb;
+
+      }
+      solutionObject.createSolution(v);
+      return solutionObject;
+    }
+
+    private SolutionSet createEmptyIndividual() {
+      SolutionSet solutionObject = new SolutionSet(PopulationSizeParameter.Value.Value);
+      var n = new RealVector(Problem.ProblemSize);
+      solutionObject.Population = n;
+      return solutionObject;
+    }
+
+    private void initProgress() {
+      this.evals = PopulationSizeParameter.Value.Value;
+    }
+
+    private void updateProgres() {
+      this.evals++;
+    }
+
+    private SolutionSet[] selection(List<SolutionSet> population, int i) {
+      SolutionSet[] parents = new SolutionSet[3];
+      int r0, r1, r2;
+      //assure the selected vectors r0, r1 and r2 are different
+      do {
+        r0 = _random.Next(0, PopulationSizeParameter.Value.Value);
+      } while(r0 == i);
+      do {
+        r1 = _random.Next(0, PopulationSizeParameter.Value.Value);
+      } while(r1 == i || r1 == r0);
+      do {
+        r2 = _random.Next(0, PopulationSizeParameter.Value.Value);
+      } while(r2 == i || r2 == r0 || r2 == r1);
+
+      parents[0] = population[r0];
+      parents[1] = population[r1];
+      parents[2] = population[r2];
+
+      return parents;
+    }
+
+    private SolutionSet reproduction(SolutionSet parent, SolutionSet[] parentsSolutions) {
+      var individual = createEmptyIndividual();
+      double rnbr = _random.Next(0, Problem.ProblemSize);
+      for(int m = 0; m < Problem.ProblemSize; m++) {
+        if(_random.NextDouble() < CrossoverProbabilityParameter.Value.Value || m == rnbr) {
+          double value;
+          value = parentsSolutions[2].Population[m] +
+              ScalingFactorParameter.Value.Value * (parentsSolutions[0].Population[m] - parentsSolutions[1].Population[m]);
+          //check the problem upper and lower bounds
+          if(value > Problem.Bounds[0, 1]) value = Problem.Bounds[0, 1];
+          if(value < Problem.Bounds[0, 0]) value = Problem.Bounds[0, 0];
+          individual.Population[m] = value;
+        } else {
+          double value;
+          value = parent.Population[m];
+          individual.Population[m] = value;
+        }
+      }
+      return individual;
+    }
+
+    private List<SolutionSet> crowdingDistanceSelection(List<SolutionSet>[] ranking) {
+      List<SolutionSet> population = new List<SolutionSet>();
+      int rankingIndex = 0;
+      while(populationIsNotFull(population)) {
+        if(subFrontFillsIntoThePopulation(ranking, rankingIndex, population)) {
+          addRankedSolutionToPopulation(ranking, rankingIndex, population);
+          rankingIndex++;
+        } else {
+          crowdingDistanceAssignment(ranking[rankingIndex]);
+          addLastRankedSolutionToPopulation(ranking, rankingIndex, population);
+        }
+      }
+      return population;
+    }
+
+    private void addLastRankedSolutionToPopulation(List<SolutionSet>[] ranking, int rankingIndex, List<SolutionSet> population) {
+      List<SolutionSet> currentRankedFront = ranking[rankingIndex];
+      //descending sort and add the front with highest crowding distance to the population
+      currentRankedFront.Sort((x, y) => -x.CrowdingDistance.CompareTo(y.CrowdingDistance));
+      int i = 0;
+      while(population.Count < PopulationSizeParameter.Value.Value) {
+        population.Add(currentRankedFront[i]);
+        i++;
+      }
+    }
+
+    private void crowdingDistanceAssignment(List<SolutionSet> rankingSubfront) {
+      int size = rankingSubfront.Count;
+
+      if(size == 0)
+        return;
+
+      if(size == 1) {
+        rankingSubfront[0].CrowdingDistance = double.PositiveInfinity;
+        return;
+      }
+
+      if(size == 2) {
+        rankingSubfront[0].CrowdingDistance = double.PositiveInfinity;
+        rankingSubfront[1].CrowdingDistance = double.PositiveInfinity;
+        return;
+      }
+
+      //Use a new SolutionSet to evite alter original solutionSet
+      List<SolutionSet> front = new List<SolutionSet>(size);
+      for(int i = 0; i < size; i++) {
+        front.Add(rankingSubfront[i]);
+      }
+
+      for(int i = 0; i < size; i++)
+        front[i].CrowdingDistance = 0.0;
+
+      double objetiveMaxn;
+      double objetiveMinn;
+      double distance;
+
+      for(int i = 0; i < Problem.Objectives; i++) {
+        // Sort the front population by the objective i          
+        front.Sort((x, y) => x.Quality[i].CompareTo(y.Quality[i]));
+        objetiveMinn = front[0].Quality[i];
+        objetiveMaxn = front[front.Count - 1].Quality[i];
+
+        //Set crowding distance for the current front           
+        front[0].CrowdingDistance = double.PositiveInfinity;
+        front[size - 1].CrowdingDistance = double.PositiveInfinity;
+
+        for(int j = 1; j < size - 1; j++) {
+          distance = front[j + 1].Quality[i] - front[j - 1].Quality[i];
+          distance = distance / (objetiveMaxn - objetiveMinn);
+          distance += front[j].CrowdingDistance;
+          front[j].CrowdingDistance = distance;
+        }
+      }
+    }
+
+    private void addRankedSolutionToPopulation(List<SolutionSet>[] ranking, int rankingIndex, List<SolutionSet> population) {
+      foreach(SolutionSet solution in ranking[rankingIndex]) {
+        population.Add(solution);
+      }
+    }
+
+    private bool subFrontFillsIntoThePopulation(List<SolutionSet>[] ranking, int rankingIndex, List<SolutionSet> population) {
+      return ranking[rankingIndex].Count < (PopulationSizeParameter.Value.Value - population.Count);
+    }
+
+    private bool populationIsNotFull(List<SolutionSet> population) {
+      return population.Count < PopulationSizeParameter.Value.Value;
+    }
+
+    private List<SolutionSet>[] computeRanking(List<SolutionSet> tmpList) {
+      // dominateMe[i] contains the number of solutions dominating i        
+      int[] dominateMe = new int[tmpList.Count];
+
+      // iDominate[k] contains the list of solutions dominated by k
+      List<int>[] iDominate = new List<int>[tmpList.Count];
+
+      // front[i] contains the list of individuals belonging to the front i
+      List<int>[] front = new List<int>[tmpList.Count + 1];
+
+      // flagDominate is an auxiliar encodings.variable
+      int flagDominate;
+
+      // Initialize the fronts 
+      for(int i = 0; i < front.Length; i++) {
+        front[i] = new List<int>();
+      }
+
+      //-> Fast non dominated sorting algorithm
+      // Contribution of Guillaume Jacquenot
+      for(int p = 0; p < tmpList.Count; p++) {
+        // Initialize the list of individuals that i dominate and the number
+        // of individuals that dominate me
+        iDominate[p] = new List<int>();
+        dominateMe[p] = 0;
+      }
+      for(int p = 0; p < (tmpList.Count - 1); p++) {
+        // For all q individuals , calculate if p dominates q or vice versa
+        for(int q = p + 1; q < tmpList.Count; q++) {
+          flagDominate = compareConstraintsViolation(tmpList[p], tmpList[q]);
+          if(flagDominate == 0) {
+            flagDominate = compareDomination(tmpList[p], tmpList[q]);
+          }
+          if(flagDominate == -1) {
+            iDominate[p].Add(q);
+            dominateMe[q]++;
+          } else if(flagDominate == 1) {
+            iDominate[q].Add(p);
+            dominateMe[p]++;
+          }
+        }
+        // If nobody dominates p, p belongs to the first front
+      }
+      for(int i = 0; i < tmpList.Count; i++) {
+        if(dominateMe[i] == 0) {
+          front[0].Add(i);
+          tmpList[i].Rank = 0;
+        }
+      }
+
+      //Obtain the rest of fronts
+      int k = 0;
+
+      while(front[k].Count != 0) {
+        k++;
+        foreach(var it1 in front[k - 1]) {
+          foreach(var it2 in iDominate[it1]) {
+            int index = it2;
+            dominateMe[index]--;
+            if(dominateMe[index] == 0) {
+              front[k].Add(index);
+              tmpList[index].Rank = k;
+            }
+          }
+        }
+      }
+      //<-
+
+      var rankedSubpopulation = new List<SolutionSet>[k];
+      //0,1,2,....,i-1 are front, then i fronts
+      for(int j = 0; j < k; j++) {
+        rankedSubpopulation[j] = new List<SolutionSet>(front[j].Count);
+        foreach(var it1 in front[j]) {
+          rankedSubpopulation[j].Add(tmpList[it1]);
+        }
+      }
+      return rankedSubpopulation;
+    }
+
+    private int compareDomination(SolutionSet solution1, SolutionSet solution2) {
+      int dominate1; // dominate1 indicates if some objective of solution1 
+                     // dominates the same objective in solution2. dominate2
+      int dominate2; // is the complementary of dominate1.
+
+      dominate1 = 0;
+      dominate2 = 0;
+
+      int flag; //stores the result of the comparison
+
+      // Test to determine whether at least a solution violates some constraint
+      if(needToCompareViolations(solution1, solution2)) {
+        return compareConstraintsViolation(solution1, solution2);
+      }
+
+      // Equal number of violated constraints. Applying a dominance Test then
+      double value1, value2;
+      for(int i = 0; i < Problem.Objectives; i++) {
+        value1 = solution1.Quality[i];
+        value2 = solution2.Quality[i];
+        if(value1 < value2) {
+          flag = -1;
+        } else if(value2 < value1) {
+          flag = 1;
+        } else {
+          flag = 0;
+        }
+
+        if(flag == -1) {
+          dominate1 = 1;
+        }
+
+        if(flag == 1) {
+          dominate2 = 1;
+        }
+      }
+
+      if(dominate1 == dominate2) {
+        return 0; //No one dominate the other
+      }
+      if(dominate1 == 1) {
+        return -1; // solution1 dominate
+      }
+      return 1;    // solution2 dominate   
+    }
+
+    private bool needToCompareViolations(SolutionSet solution1, SolutionSet solution2) {
+      bool needToCompare;
+      needToCompare = (solution1.OverallConstrainViolation < 0) || (solution2.OverallConstrainViolation < 0);
+
+      return needToCompare;
+    }
+
+    private int compareConstraintsViolation(SolutionSet solution1, SolutionSet solution2) {
+      int result;
+      double overall1, overall2;
+      overall1 = solution1.OverallConstrainViolation;
+      overall2 = solution2.OverallConstrainViolation;
+
+      if((overall1 < 0) && (overall2 < 0)) {
+        if(overall1 > overall2) {
+          result = -1;
+        } else if(overall2 > overall1) {
+          result = 1;
+        } else {
+          result = 0;
+        }
+      } else if((overall1 == 0) && (overall2 < 0)) {
+        result = -1;
+      } else if((overall1 < 0) && (overall2 == 0)) {
+        result = 1;
+      } else {
+        result = 0;
+      }
+      return result;
+    }
+  }
+}
+
+
+
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/HeuristicLab.Algorithms.GDE3.csproj
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/HeuristicLab.Algorithms.GDE3.csproj	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/HeuristicLab.Algorithms.GDE3.csproj	(revision 16391)
@@ -0,0 +1,131 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{C2DE3C93-3E1B-4996-B301-C3C344AB0598}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Algorithms.GDE3</RootNamespace>
+    <AssemblyName>HeuristicLab.Algorithms.GDE3</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE;DEBUG; </DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>0</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE; </DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>0</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>TheKey.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Clients.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Clients.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3">
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Selection-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Selection-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="GDE3.cs" />
+    <Compile Include="GenerationalDistanceCalculator.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SolutionSet.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="TheKey.snk" />
+  </ItemGroup>
+  <ItemGroup>
+    <WCFMetadata Include="Service References\" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\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>
+  -->
+</Project>
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/Plugin.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/Plugin.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/Plugin.cs	(revision 16391)
@@ -0,0 +1,15 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.GDE3
+{
+    [Plugin("HeuristicLab.Algorithms.GDE3", "Provides an implementation of GDE algorithm", "3.3.9.0")]
+    [PluginFile("HeuristicLab.Algorithms.GDE3.dll", PluginFileType.Assembly)]
+    public class Plugin : PluginBase
+    {
+    }
+}
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/Properties/AssemblyInfo.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/Properties/AssemblyInfo.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/Properties/AssemblyInfo.cs	(revision 16391)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+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.GDE3")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab.Algorithms.GDE3")]
+[assembly: AssemblyCopyright("Copyright ©  2016")]
+[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("c2de3c93-3e1b-4996-b301-c3c344ab0598")]
+
+// 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 Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.9.0")]
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/SolutionSet.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/SolutionSet.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.GDE3/SolutionSet.cs	(revision 16391)
@@ -0,0 +1,59 @@
+﻿using System;
+using System.Linq;
+using System.Collections.Generic;
+using HeuristicLab.Encodings.RealVectorEncoding;
+
+namespace HeuristicLab.Algoritms.GDE3
+{
+    public class SolutionSet
+    {
+        private RealVector population;
+        private double[] quality;
+        private double crowdingDistance;
+        private double rank;
+        private double overallConstrainViolation;
+        public int populationSize;
+
+        //constructor set size equal with population size
+        public SolutionSet(int populationSize)
+        {
+            this.populationSize = populationSize;
+        }
+
+        public double CrowdingDistance
+        {
+            get { return crowdingDistance; }
+            set { crowdingDistance = value; }
+        }
+
+        public double Rank
+        {
+            get { return rank; }
+            set { rank = value; }
+        }
+
+        public RealVector Population
+        {
+            get { return population; }
+            set { population = value; }
+        }
+
+        public double[] Quality
+        {
+            get { return quality; }
+            set { quality = value; }
+        }
+
+        public double OverallConstrainViolation
+        {
+            get { return overallConstrainViolation; }
+            set { overallConstrainViolation = value; }
+        }
+
+        public SolutionSet createSolution(double[] v)
+        {
+            this.population = new RealVector(v);
+            return this;
+        }
+    }
+}
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/HeuristicLab.Algorithms.Shade.csproj
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/HeuristicLab.Algorithms.Shade.csproj	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/HeuristicLab.Algorithms.Shade.csproj	(revision 16391)
@@ -0,0 +1,115 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{181677F9-9AAD-4C45-8424-E5C5651BF644}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Algorithms.Shade</RootNamespace>
+    <AssemblyName>HeuristicLab.Algorithms.Shade</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>TheKey.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Clients.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Clients.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Parameters-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.TestFunctions-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.TestFunctions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Selection-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Selection-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Shade.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="TheKey.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\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>
+  -->
+</Project>
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/Plugin.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/Plugin.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/Plugin.cs	(revision 16391)
@@ -0,0 +1,8 @@
+﻿using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Algorithms.Shade {
+  [Plugin("HeuristicLab.Algorithms.Shade", "Provides an implementation of SHADE algorithm", "3.3.9.0")]
+  [PluginFile("HeuristicLab.Algorithms.Shade.dll", PluginFileType.Assembly)]
+  public class Plugin : PluginBase {
+  }
+}
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/Properties/AssemblyInfo.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/Properties/AssemblyInfo.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/Properties/AssemblyInfo.cs	(revision 16391)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+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.Schade")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab.Algorithms.Schade")]
+[assembly: AssemblyCopyright("Copyright ©  2016")]
+[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("181677f9-9aad-4c45-8424-e5c5651bf644")]
+
+// 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 Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/Shade.cs
===================================================================
--- branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/Shade.cs	(revision 16391)
+++ branches/2646_DifferentialEvolution/HeuristicLab.Algorithms.Shade/Shade.cs	(revision 16391)
@@ -0,0 +1,610 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * The implementation is inspired by the implementation in JAVA of SHADE algorithm https://sites.google.com/site/tanaberyoji/software/SHADE1.0.1_CEC2013.zip?attredirects=0&d=1
+ *
+ * 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.TestFunctions;
+using HeuristicLab.Random;
+using System;
+using System.Collections.Generic;
+using System.Threading;
+
+namespace HeuristicLab.Algorithms.Shade {
+
+  [Item("Success-History Based Parameter Adaptation for DE (SHADE)", "A self-adaptive version of differential evolution")]
+  [StorableClass]
+  [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 400)]
+  public class Shade : BasicAlgorithm {
+    public Func<IEnumerable<double>, double> Evaluation;
+
+    public override Type ProblemType {
+      get { return typeof(SingleObjectiveTestFunctionProblem); }
+    }
+    public new SingleObjectiveTestFunctionProblem Problem {
+      get { return (SingleObjectiveTestFunctionProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+
+    private readonly IRandom _random = new MersenneTwister();
+    private int evals;
+    private int pop_size;
+    private double arc_rate;
+    private int arc_size;
+    private double p_best_rate;
+    private int memory_size;
+
+    private double[][] pop;
+    private double[] fitness;
+    private double[][] children;
+    private double[] children_fitness;
+
+    private double[] bsf_solution;
+    private double bsf_fitness = 1e+30;
+    private double[,] archive;
+    private int num_arc_inds = 0;
+
+    #region ParameterNames
+    private const string MaximumEvaluationsParameterName = "Maximum Evaluations";
+    private const string SeedParameterName = "Seed";
+    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    private const string CrossoverProbabilityParameterName = "CrossoverProbability";
+    private const string PopulationSizeParameterName = "PopulationSize";
+    private const string ScalingFactorParameterName = "ScalingFactor";
+    private const string ValueToReachParameterName = "ValueToReach";
+    private const string ArchiveRateParameterName = "ArchiveRate";
+    private const string MemorySizeParameterName = "MemorySize";
+    private const string BestRateParameterName = "BestRate";
+    #endregion
+
+    #region ParameterProperties
+    public IFixedValueParameter<IntValue> MaximumEvaluationsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumEvaluationsParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> SeedParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[SeedParameterName]; }
+    }
+    public FixedValueParameter<BoolValue> SetSeedRandomlyParameter {
+      get { return (FixedValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; }
+    }
+    private ValueParameter<IntValue> PopulationSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters[PopulationSizeParameterName]; }
+    }
+    public ValueParameter<DoubleValue> CrossoverProbabilityParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[CrossoverProbabilityParameterName]; }
+    }
+    public ValueParameter<DoubleValue> ScalingFactorParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[ScalingFactorParameterName]; }
+    }
+    public ValueParameter<DoubleValue> ValueToReachParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[ValueToReachParameterName]; }
+    }
+    public ValueParameter<DoubleValue> ArchiveRateParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[ArchiveRateParameterName]; }
+    }
+    public ValueParameter<IntValue> MemorySizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters[MemorySizeParameterName]; }
+    }
+    public ValueParameter<DoubleValue> BestRateParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters[BestRateParameterName]; }
+    }
+    #endregion
+
+    #region Properties
+    public int MaximumEvaluations {
+      get { return MaximumEvaluationsParameter.Value.Value; }
+      set { MaximumEvaluationsParameter.Value.Value = value; }
+    }
+
+    public Double CrossoverProbability {
+      get { return CrossoverProbabilityParameter.Value.Value; }
+      set { CrossoverProbabilityParameter.Value.Value = value; }
+    }
+    public Double ScalingFactor {
+      get { return ScalingFactorParameter.Value.Value; }
+      set { ScalingFactorParameter.Value.Value = value; }
+    }
+    public int Seed {
+      get { return SeedParameter.Value.Value; }
+      set { SeedParameter.Value.Value = value; }
+    }
+    public bool SetSeedRandomly {
+      get { return SetSeedRandomlyParameter.Value.Value; }
+      set { SetSeedRandomlyParameter.Value.Value = value; }
+    }
+    public IntValue PopulationSize {
+      get { return PopulationSizeParameter.Value; }
+      set { PopulationSizeParameter.Value = value; }
+    }
+    public Double ValueToReach {
+      get { return ValueToReachParameter.Value.Value; }
+      set { ValueToReachParameter.Value.Value = value; }
+    }
+    public Double ArchiveRate {
+      get { return ArchiveRateParameter.Value.Value; }
+      set { ArchiveRateParameter.Value.Value = value; }
+    }
+    public IntValue MemorySize {
+      get { return MemorySizeParameter.Value; }
+      set { MemorySizeParameter.Value = value; }
+    }
+    public Double BestRate {
+      get { return BestRateParameter.Value.Value; }
+      set { BestRateParameter.Value.Value = value; }
+    }
+    #endregion
+
+    #region ResultsProperties
+    private double ResultsBestQuality {
+      get { return ((DoubleValue)Results["Best Quality"].Value).Value; }
+      set { ((DoubleValue)Results["Best Quality"].Value).Value = value; }
+    }
+
+    private double VTRBestQuality {
+      get { return ((DoubleValue)Results["VTR"].Value).Value; }
+      set { ((DoubleValue)Results["VTR"].Value).Value = value; }
+    }
+
+    private RealVector ResultsBestSolution {
+      get { return (RealVector)Results["Best Solution"].Value; }
+      set { Results["Best Solution"].Value = value; }
+    }
+
+    private int ResultsEvaluations {
+      get { return ((IntValue)Results["Evaluations"].Value).Value; }
+      set { ((IntValue)Results["Evaluations"].Value).Value = value; }
+    }
+    private int ResultsIterations {
+      get { return ((IntValue)Results["Iterations"].Value).Value; }
+      set { ((IntValue)Results["Iterations"].Value).Value = value; }
+    }
+
+    private DataTable ResultsQualities {
+      get { return ((DataTable)Results["Qualities"].Value); }
+    }
+    private DataRow ResultsQualitiesBest {
+      get { return ResultsQualities.Rows["Best Quality"]; }
+    }
+
+    #endregion
+
+    [StorableConstructor]
+    protected Shade(bool deserializing) : base(deserializing) { }
+
+    protected Shade(Shade original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new Shade(this, cloner);
+    }
+
+    public Shade() {
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumEvaluationsParameterName, "", new IntValue(Int32.MaxValue)));
+      Parameters.Add(new ValueParameter<IntValue>(PopulationSizeParameterName, "The size of the population of solutions.", new IntValue(75)));
+      Parameters.Add(new ValueParameter<DoubleValue>(ValueToReachParameterName, "Value to reach (VTR) parameter", new DoubleValue(0.00000001)));
+      Parameters.Add(new ValueParameter<DoubleValue>(ArchiveRateParameterName, "Archive rate parameter", new DoubleValue(2.0)));
+      Parameters.Add(new ValueParameter<IntValue>(MemorySizeParameterName, "Memory size parameter", new IntValue(0)));
+      Parameters.Add(new ValueParameter<DoubleValue>(BestRateParameterName, "Best rate parameter", new DoubleValue(0.1)));
+    }
+
+    protected override void Run(CancellationToken cancellationToken) {
+
+      // Set up the results display
+      Results.Add(new Result("Iterations", new IntValue(0)));
+      Results.Add(new Result("Evaluations", new IntValue(0)));
+      Results.Add(new Result("Best Solution", new RealVector()));
+      Results.Add(new Result("Best Quality", new DoubleValue(double.NaN)));
+      Results.Add(new Result("VTR", new DoubleValue(double.NaN)));
+      var table = new DataTable("Qualities");
+      table.Rows.Add(new DataRow("Best Quality"));
+      Results.Add(new Result("Qualities", table));
+
+
+      this.evals = 0;
+      int archive_size = (int)Math.Round(ArchiveRateParameter.Value.Value * PopulationSize.Value);
+      int problem_size = Problem.ProblemSize.Value;
+
+      int pop_size = PopulationSizeParameter.Value.Value;
+      this.arc_rate = ArchiveRateParameter.Value.Value;
+      this.arc_size = (int)Math.Round(this.arc_rate * pop_size);
+      this.p_best_rate = BestRateParameter.Value.Value;
+      this.memory_size = MemorySizeParameter.Value.Value;
+
+      this.pop = new double[pop_size][];
+      this.fitness = new double[pop_size];
+      this.children = new double[pop_size][];
+      this.children_fitness = new double[pop_size];
+
+      this.bsf_solution = new double[problem_size];
+      this.bsf_fitness = 1e+30;
+      this.archive = new double[arc_size, Problem.ProblemSize.Value];
+      this.num_arc_inds = 0;
+
+      double[,] populationOld = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value];
+      double[,] mutationPopulation = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value];
+      double[,] trialPopulation = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value];
+      double[] bestPopulation = new double[Problem.ProblemSize.Value];
+      double[] bestPopulationIteration = new double[Problem.ProblemSize.Value];
+      double[,] archive = new double[archive_size, Problem.ProblemSize.Value];
+
+
+      // //for external archive
+      int rand_arc_ind;
+
+      int num_success_params;
+
+      double[] success_sf = new double[PopulationSizeParameter.Value.Value];
+      double[] success_cr = new double[PopulationSizeParameter.Value.Value];
+      double[] dif_fitness = new double[PopulationSizeParameter.Value.Value];
+      double[] fitness = new double[PopulationSizeParameter.Value.Value];
+
+      // the contents of M_f and M_cr are all initialiezed 0.5
+      double[] memory_sf = new double[MemorySizeParameter.Value.Value];
+      double[] memory_cr = new double[MemorySizeParameter.Value.Value];
+
+      for(int i = 0; i < MemorySizeParameter.Value.Value; i++) {
+        memory_sf[i] = 0.5;
+        memory_cr[i] = 0.5;
+      }
+
+      //memory index counter
+      int memory_pos = 0;
+      double temp_sum_sf1, temp_sum_sf2, temp_sum_cr1, temp_sum_cr2, temp_sum, temp_weight;
+
+      //for new parameters sampling
+      double mu_sf, mu_cr;
+      int rand_mem_index;
+
+      double[] pop_sf = new double[PopulationSizeParameter.Value.Value];
+      double[] pop_cr = new double[PopulationSizeParameter.Value.Value];
+
+      //for current-to-pbest/1
+      int p_best_ind;
+      double m = PopulationSizeParameter.Value.Value * BestRateParameter.Value.Value;
+      int p_num = (int)Math.Round(m);
+      int[] sorted_array = new int[PopulationSizeParameter.Value.Value];
+      double[] sorted_fitness = new double[PopulationSizeParameter.Value.Value];
+
+      //initialize the population
+      populationOld = makeNewIndividuals();
+
+      //evaluate the best member after the intialiazation
+      //the idea is to select first member and after that to check the others members from the population
+
+      int best_index = 0;
+      double[] populationRow = new double[Problem.ProblemSize.Value];
+      bestPopulation = getMatrixRow(populationOld, best_index);
+      RealVector bestPopulationVector = new RealVector(bestPopulation);
+      double bestPopulationValue = Obj(bestPopulationVector);
+      fitness[best_index] = bestPopulationValue;
+      RealVector selectionVector;
+      RealVector trialVector;
+      double qtrial;
+
+
+      for(var i = 0; i < PopulationSizeParameter.Value.Value; i++) {
+        populationRow = getMatrixRow(populationOld, i);
+        trialVector = new RealVector(populationRow);
+
+        qtrial = Obj(trialVector);
+        fitness[i] = qtrial;
+
+        if(qtrial > bestPopulationValue) {
+          bestPopulationVector = new RealVector(populationRow);
+          bestPopulationValue = qtrial;
+          best_index = i;
+        }
+      }
+
+      int iterations = 1;
+
+      // Loop until iteration limit reached or canceled.
+      // todo replace with a function
+      // && bestPopulationValue > Problem.BestKnownQuality.Value + ValueToReachParameter.Value.Value
+      while(ResultsEvaluations < MaximumEvaluations
+          && !cancellationToken.IsCancellationRequested &&
+          bestPopulationValue > Problem.BestKnownQuality.Value + ValueToReachParameter.Value.Value) {
+        for(int i = 0; i < PopulationSizeParameter.Value.Value; i++) sorted_array[i] = i;
+        for(int i = 0; i < PopulationSizeParameter.Value.Value; i++) sorted_fitness[i] = fitness[i];
+
+        Quicksort(sorted_fitness, 0, PopulationSizeParameter.Value.Value - 1, sorted_array);
+
+        for(int target = 0; target < PopulationSizeParameter.Value.Value; target++) {
+          rand_mem_index = (int)(_random.NextDouble() * MemorySizeParameter.Value.Value);
+          mu_sf = memory_sf[rand_mem_index];
+          mu_cr = memory_cr[rand_mem_index];
+
+          //generate CR_i and repair its value
+          if(mu_cr == -1) {
+            pop_cr[target] = 0;
+          } else {
+            pop_cr[target] = gauss(mu_cr, 0.1);
+            if(pop_cr[target] > 1) pop_cr[target] = 1;
+            else if(pop_cr[target] < 0) pop_cr[target] = 0;
+          }
+
+          //generate F_i and repair its value
+          do {
+            pop_sf[target] = cauchy_g(mu_sf, 0.1);
+          } while(pop_sf[target] <= 0);
+
+          if(pop_sf[target] > 1) pop_sf[target] = 1;
+
+          //p-best individual is randomly selected from the top pop_size *  p_i members
+          p_best_ind = sorted_array[(int)(_random.NextDouble() * p_num)];
+
+          trialPopulation = operateCurrentToPBest1BinWithArchive(populationOld, trialPopulation, target, p_best_ind, pop_sf[target], pop_cr[target]);
+        }
+
+        for(int i = 0; i < pop_size; i++) {
+          trialVector = new RealVector(getMatrixRow(trialPopulation, i));
+          children_fitness[i] = Obj(trialVector);
+        }
+
+        //update bfs solution 
+        for(var i = 0; i < PopulationSizeParameter.Value.Value; i++) {
+          populationRow = getMatrixRow(populationOld, i);
+          qtrial = fitness[i];
+
+          if(qtrial > bestPopulationValue) {
+            bestPopulationVector = new RealVector(populationRow);
+            bestPopulationValue = qtrial;
+            best_index = i;
+          }
+        }
+
+        num_success_params = 0;
+
+        //generation alternation
+        for(int i = 0; i < pop_size; i++) {
+          if(children_fitness[i] == fitness[i]) {
+            fitness[i] = children_fitness[i];
+            for(int j = 0; j < problem_size; j++) populationOld[i, j] = trialPopulation[i, j];
+          } else if(children_fitness[i] < fitness[i]) {
+            //parent vectors x_i which were worse than the trial vectors u_i are preserved
+            if(arc_size > 1) {
+              if(num_arc_inds < arc_size) {
+                for(int j = 0; j < problem_size; j++) this.archive[num_arc_inds, j] = populationOld[i, j];
+                num_arc_inds++;
+
+              }
+              //Whenever the size of the archive exceeds, randomly selected elements are deleted to make space for the newly inserted elements
+              else {
+                rand_arc_ind = (int)(_random.NextDouble() * arc_size);
+                for(int j = 0; j < problem_size; j++) this.archive[rand_arc_ind, j] = populationOld[i, j];
+              }
+            }
+
+            dif_fitness[num_success_params] = Math.Abs(fitness[i] - children_fitness[i]);
+
+            fitness[i] = children_fitness[i];
+            for(int j = 0; j < problem_size; j++) populationOld[i, j] = trialPopulation[i, j];
+
+            //successful parameters are preserved in S_F and S_CR
+            success_sf[num_success_params] = pop_sf[i];
+            success_cr[num_success_params] = pop_cr[i];
+            num_success_params++;
+          }
+        }
+
+        if(num_success_params > 0) {
+          temp_sum_sf1 = 0;
+          temp_sum_sf2 = 0;
+          temp_sum_cr1 = 0;
+          temp_sum_cr2 = 0;
+          temp_sum = 0;
+          temp_weight = 0;
+
+          for(int i = 0; i < num_success_params; i++) temp_sum += dif_fitness[i];
+
+          //weighted lehmer mean
+          for(int i = 0; i < num_success_params; i++) {
+            temp_weight = dif_fitness[i] / temp_sum;
+
+            temp_sum_sf1 += temp_weight * success_sf[i] * success_sf[i];
+            temp_sum_sf2 += temp_weight * success_sf[i];
+
+            temp_sum_cr1 += temp_weight * success_cr[i] * success_cr[i];
+            temp_sum_cr2 += temp_weight * success_cr[i];
+          }
+
+          memory_sf[memory_pos] = temp_sum_sf1 / temp_sum_sf2;
+
+          if(temp_sum_cr2 == 0 || memory_cr[memory_pos] == -1) {
+            memory_cr[memory_pos] = -1;
+          } else {
+            memory_cr[memory_pos] = temp_sum_cr1 / temp_sum_cr2;
+          }
+
+          //increment the counter
+          memory_pos++;
+          if(memory_pos >= memory_size) memory_pos = 0;
+        }
+
+        //update the best candidate
+        for(int i = 0; i < PopulationSizeParameter.Value.Value; i++) {
+          selectionVector = new RealVector(getMatrixRow(populationOld, i));
+          var quality = fitness[i];
+          if(quality < bestPopulationValue) {
+            bestPopulationVector = (RealVector)selectionVector.Clone();
+            bestPopulationValue = quality;
+          }
+        }
+
+        iterations = iterations + 1;
+
+        //update the results
+        ResultsEvaluations = evals;
+        ResultsIterations = iterations;
+        ResultsBestSolution = bestPopulationVector;
+        ResultsBestQuality = bestPopulationValue;
+
+        //update the results in view
+        if(iterations % 10 == 0) ResultsQualitiesBest.Values.Add(bestPopulationValue);
+        if(bestPopulationValue < Problem.BestKnownQuality.Value + ValueToReachParameter.Value.Value) {
+          VTRBestQuality = bestPopulationValue;
+        }
+      }
+    }
+
+    public override bool SupportsPause { get { return false; } } // TODO (can we pause?)
+
+    //evaluate the vector
+    public double Obj(RealVector x) {
+      evals = evals + 1;
+      if(Problem.Maximization.Value)
+        return -Problem.Evaluator.Evaluate(x);
+
+      return Problem.Evaluator.Evaluate(x);
+    }
+
+    // Get ith row from the matrix
+    public double[] getMatrixRow(double[,] Mat, int i) {
+      double[] tmp = new double[Mat.GetUpperBound(1) + 1];
+
+      for(int j = 0; j <= Mat.GetUpperBound(1); j++) {
+        tmp[j] = Mat[i, j];
+      }
+
+      return tmp;
+    }
+
+    /*
+        Return random value from Cauchy distribution with mean "mu" and variance "gamma"
+        http://www.sat.t.u-tokyo.ac.jp/~omi/random_variables_generation.html#Cauchy
+    */
+    private double cauchy_g(double mu, double gamma) {
+      return mu + gamma * Math.Tan(Math.PI * (_random.NextDouble() - 0.5));
+    }
+
+    /*
+         Return random value from normal distribution with mean "mu" and variance "gamma"
+         http://www.sat.t.u-tokyo.ac.jp/~omi/random_variables_generation.html#Gauss
+    */
+    private double gauss(double mu, double sigma) {
+      return mu + sigma * Math.Sqrt(-2.0 * Math.Log(_random.NextDouble())) * Math.Sin(2.0 * Math.PI * _random.NextDouble());
+    }
+
+    private double[,] makeNewIndividuals() {
+      //problem variables
+      var dim = Problem.ProblemSize.Value;
+      var lb = Problem.Bounds[0, 0];
+      var ub = Problem.Bounds[0, 1];
+      var range = ub - lb;
+      double[,] population = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value];
+
+      //create initial population
+      //population is a matrix of size PopulationSize*ProblemSize
+      for(int i = 0; i < PopulationSizeParameter.Value.Value; i++) {
+        for(int j = 0; j < Problem.ProblemSize.Value; j++) {
+          population[i, j] = _random.NextDouble() * range + lb;
+        }
+      }
+      return population;
+    }
+
+    private static void Quicksort(double[] elements, int left, int right, int[] index) {
+      int i = left, j = right;
+      double pivot = elements[(left + right) / 2];
+      double tmp_var = 0;
+      int tmp_index = 0;
+
+      while(i <= j) {
+        while(elements[i].CompareTo(pivot) < 0) {
+          i++;
+        }
+
+        while(elements[j].CompareTo(pivot) > 0) {
+          j--;
+        }
+
+        if(i <= j) {
+          // Swap
+          tmp_var = elements[i];
+          elements[i] = elements[j];
+          elements[j] = tmp_var;
+
+          tmp_index = index[i];
+          index[i] = index[j];
+          index[j] = tmp_index;
+
+          i++;
+          j--;
+        }
+      }
+
+      // Recursive calls
+      if(left < j) {
+        Quicksort(elements, left, j, index);
+      }
+
+      if(i < right) {
+        Quicksort(elements, i, right, index);
+      }
+    }
+
+    // current to best selection scheme with archive
+    // analyze how the archive is implemented
+    private double[,] operateCurrentToPBest1BinWithArchive(double[,] pop, double[,] children, int target, int p_best_individual, double scaling_factor, double cross_rate) {
+      int r1, r2;
+      int num_arc_inds = 0;
+      var lb = Problem.Bounds[0, 0];
+      var ub = Problem.Bounds[0, 1];
+
+      do {
+        r1 = (int)(_random.NextDouble() * PopulationSizeParameter.Value.Value);
+      } while(r1 == target);
+      do {
+        r2 = (int)(_random.NextDouble() * (PopulationSizeParameter.Value.Value + num_arc_inds));
+      } while((r2 == target) || (r2 == r1));
+
+      int random_variable = (int)(_random.NextDouble() * Problem.ProblemSize.Value);
+
+      if(r2 >= PopulationSizeParameter.Value.Value) {
+        r2 -= PopulationSizeParameter.Value.Value;
+        for(int i = 0; i < Problem.ProblemSize.Value; i++) {
+          if((_random.NextDouble() < cross_rate) || (i == random_variable)) children[target, i] = pop[target, i] + scaling_factor * (pop[p_best_individual, i] - pop[target, i]) + scaling_factor * (pop[r1, i] - archive[r2, i]);
+          else children[target, i] = pop[target, i];
+        }
+      } else {
+        for(int i = 0; i < Problem.ProblemSize.Value; i++) {
+          if((_random.NextDouble() < cross_rate) || (i == random_variable)) children[target, i] = pop[target, i] + scaling_factor * (pop[p_best_individual, i] - pop[target, i]) + scaling_factor * (pop[r1, i] - pop[r2, i]);
+          else children[target, i] = pop[target, i];
+        }
+      }
+
+      for(int i = 0; i < Problem.ProblemSize.Value; i++) {
+        if(children[target, i] < lb) children[target, i] = (lb + pop[target, i]) / 2.0;
+        else if(children[target, i] > ub) children[target, i] = (ub + pop[target, i]) / 2.0;
+      }
+
+      return children;
+    }
+  }
+}
