Index: branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs
===================================================================
--- branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs	(revision 17661)
+++ branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs	(revision 17662)
@@ -43,4 +43,6 @@
         }
 
+        public int NumberOfObjectives => Problem.Maximization.Length;
+
         #endregion ProblemProperties
 
@@ -236,15 +238,15 @@
         }
 
-        private void InitReferencePoints()
-        {
-            // Generate reference points and add them to results
-            ReferencePoints = ReferencePoint.GenerateReferencePoints(random, Problem.Maximization.Length);
-            ResultsGeneratedReferencePoints = Utility.ConvertToDoubleMatrix(ReferencePoints);
-        }
-
         private void InitResults()
         {
             Results.Add(new Result(GeneratedReferencePointsResultName, "The initially generated reference points", new DoubleMatrix()));
             Results.Add(new Result(CurrentFrontResultName, "The Pareto Front", new DoubleMatrix()));
+        }
+
+        private void InitReferencePoints()
+        {
+            // Generate reference points and add them to results
+            ReferencePoints = ReferencePoint.GenerateReferencePoints(random, NumberOfObjectives);
+            ResultsGeneratedReferencePoints = Utility.ConvertToDoubleMatrix(ReferencePoints);
         }
 
@@ -343,6 +345,6 @@
         {
             // Find the ideal point
-            double[] idealPoint = new double[Problem.Encoding.Length];
-            for (int j = 0; j < Problem.Encoding.Length; j++)
+            double[] idealPoint = new double[NumberOfObjectives];
+            for (int j = 0; j < NumberOfObjectives; j++)
             {
                 // Compute ideal point
@@ -355,10 +357,10 @@
 
             // Find the extreme points
-            Solution[] extremePoints = new Solution[Problem.Encoding.Length];
-            for (int j = 0; j < Problem.Encoding.Length; j++)
+            Solution[] extremePoints = new Solution[NumberOfObjectives];
+            for (int j = 0; j < NumberOfObjectives; j++)
             {
                 // Compute extreme points
-                double[] weights = new double[Problem.Encoding.Length];
-                for (int i = 0; i < Problem.Encoding.Length; i++) weights[i] = EPSILON;
+                double[] weights = new double[NumberOfObjectives];
+                for (int i = 0; i < NumberOfObjectives; i++) weights[i] = EPSILON;
                 weights[j] = 1;
                 double func(Solution s) => ASF(s.Fitness, weights);
@@ -379,5 +381,5 @@
                 foreach (var solution in Fronts[f])
                 {
-                    for (int i = 0; i < Problem.Encoding.Length; i++)
+                    for (int i = 0; i < NumberOfObjectives; i++)
                     {
                         if (Math.Abs(intercepts[i] - idealPoint[i]) > EPSILON)
@@ -498,5 +500,5 @@
         {
             List<int> dimensions = new List<int>();
-            for (int i = 0; i < Problem.Encoding.Length; i++) dimensions.Add(i);
+            for (int i = 0; i < NumberOfObjectives; i++) dimensions.Add(i);
             double f(int dim) => x[dim] / weight[dim];
             return Utility.Max(f, dimensions);
@@ -521,5 +523,5 @@
             if (duplicate)
             { // cannot construct the unique hyperplane (this is a casual method to deal with the condition)
-                for (int f = 0; f < Problem.Encoding.Length; f++)
+                for (int f = 0; f < NumberOfObjectives; f++)
                 {
                     // extreme_points[f] stands for the individual with the largest value of
@@ -532,5 +534,5 @@
                 // Find the equation of the hyperplane
                 List<double> b = new List<double>(); //(pop[0].objs().size(), 1.0);
-                for (int i = 0; i < Problem.Encoding.Length; i++)
+                for (int i = 0; i < NumberOfObjectives; i++)
                 {
                     b.Add(1.0);
@@ -541,5 +543,5 @@
                 {
                     List<double> aux = new List<double>();
-                    for (int i = 0; i < Problem.Encoding.Length; i++)
+                    for (int i = 0; i < NumberOfObjectives; i++)
                         aux.Add(s.Fitness[i]);
                     a.Add(aux);
@@ -548,5 +550,5 @@
 
                 // Find intercepts
-                for (int f = 0; f < Problem.Encoding.Length; f++)
+                for (int f = 0; f < NumberOfObjectives; f++)
                 {
                     intercepts.Add(1.0 / x[f]);
