Index: /branches/ichiriac/HeuristicLab.Algorithms.GDE3/GDE3.cs
===================================================================
--- /branches/ichiriac/HeuristicLab.Algorithms.GDE3/GDE3.cs	(revision 14086)
+++ /branches/ichiriac/HeuristicLab.Algorithms.GDE3/GDE3.cs	(revision 14087)
@@ -5,4 +5,5 @@
  * 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
@@ -71,4 +72,5 @@
         #region ParameterNames
         private const string MaximumGenerationsParameterName = "Maximum Generations";
+        private const string MaximumEvaluationsParameterName = "Maximum Evaluations";
         private const string CrossoverProbabilityParameterName = "CrossoverProbability";
         private const string PopulationSizeParameterName = "PopulationSize";
@@ -82,4 +84,8 @@
             get { return (IFixedValueParameter<IntValue>)Parameters[MaximumGenerationsParameterName]; }
         }
+        public IFixedValueParameter<IntValue> MaximumEvaluationsParameter
+        {
+            get { return (IFixedValueParameter<IntValue>)Parameters[MaximumEvaluationsParameterName]; }
+        }
         private ValueParameter<IntValue> PopulationSizeParameter
         {
@@ -97,5 +103,5 @@
 
         #region Properties
-        public int MaximumEvaluations
+        public int MaximumGenerations
         {
             get { return MaximumGenerationsParameter.Value.Value; }
@@ -103,4 +109,10 @@
         }
 
+        public int MaximumEvaluations
+        {
+            get { return MaximumEvaluationsParameter.Value.Value; }
+            set { MaximumEvaluationsParameter.Value.Value = value; }
+        }
+
         public Double CrossoverProbability
         {
@@ -209,4 +221,5 @@
         {
             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)));
@@ -261,5 +274,5 @@
             int generations = 1;
 
-            while (ResultsGenerations < MaximumGenerationsParameter.Value.Value
+            while (ResultsEvaluations < MaximumEvaluationsParameter.Value.Value
                && !cancellationToken.IsCancellationRequested)
             {
@@ -353,5 +366,6 @@
             ResultsBestFront = new DoubleMatrix(MultiObjectiveTestFunctionProblem.To2D(qualitiesFinal));
             ResultsCrowding = Crowding.Calculate(qualitiesFinal, Problem.TestFunction.Bounds(objectives));
-            ResultsInvertedGenerationalDistance = InvertedGenerationalDistance.Calculate(en, optimalfront, 1);
+            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);
@@ -397,5 +411,5 @@
         }
 
-        protected SolutionSet createIndividual()
+        private SolutionSet createIndividual()
         {
             var dim = Problem.ProblemSize;
@@ -423,15 +437,15 @@
         }
 
-        protected void initProgress()
+        private void initProgress()
         {
             this.evals = PopulationSizeParameter.Value.Value;
         }
 
-        protected void updateProgres()
+        private void updateProgres()
         {
             this.evals++;
         }
 
-        protected SolutionSet[] selection(List<SolutionSet> population, int i)
+        private SolutionSet[] selection(List<SolutionSet> population, int i)
         {
             SolutionSet[] parents = new SolutionSet[3];
@@ -458,5 +472,5 @@
         }
 
-        protected SolutionSet reproduction(SolutionSet parent, SolutionSet[] parentsSolutions)
+        private SolutionSet reproduction(SolutionSet parent, SolutionSet[] parentsSolutions)
         {
             var individual = createEmptyIndividual();
@@ -516,5 +530,5 @@
         }
 
-        public void crowdingDistanceAssignment(List<SolutionSet> rankingSubfront)
+        private void crowdingDistanceAssignment(List<SolutionSet> rankingSubfront)
         {
             int size = rankingSubfront.Count;
