Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/PermutationConvexHullModifier.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/PermutationConvexHullModifier.cs	(revision 10132)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/PermutationConvexHullModifier.cs	(revision 10133)
@@ -20,13 +20,11 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using HeuristicLab.Analysis.SolutionCaching.PermutationEncoding;
-using HeuristicLab.Analysis.SolutionCaching.RealVectorEncoding;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
 using HeuristicLab.Optimization;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
@@ -54,24 +52,19 @@
         if (solutionCache == null) continue;
 
-        DataTable dt = new DataTable("Convex Hull Volume over Generations");
+        DataTable volDataTable = new DataTable("Convex hull volume over generations");
+        DataTable nrOfPointsTable = new DataTable("Nr. of points of convex hull");
+        DoubleValue overallVolumn = new DoubleValue();
+
         DataRow dtVolumeRow = new DataRow("Volume");
-        DataRow dtNrPointsRow = new DataRow("Nr. of Points");
-        dt.Rows.Add(dtVolumeRow);
-        dt.Rows.Add(dtNrPointsRow);
+        DataRow dtNrPointsRow = new DataRow("Nr. of points");
+        volDataTable.Rows.Add(dtVolumeRow);
+        nrOfPointsTable.Rows.Add(dtNrPointsRow);
 
+        List<double[]> curHull = null;
         var sols = solutionCache.GetSolutionsFromGeneration(i);
         int dim = sols.First().Length;
         while (sols.Count != 0) {
-          double[][] dm = new double[sols.Count][];
-          for (int j = 0; j < sols.Count; j++) {
-            dm[j] = new double[sols.Count];
-          }
-
-          for (int j = 0; j < sols.Count; j++) {
-            for (int k = 0; k < sols.Count; k++) {
-              dm[j][k] = TSPSimilarityCalculator.CalculateSimilarity(sols[j], sols[k]);
-            }
-          }
-          double[][] popPoints = DistanceMatrixToPoints.ConvertDistanceMatrixToPoints(DistanceMatrixToPoints.MetricMDS(dm, dim, true));
+          double[][] dm = CalculateDistanceMatrixFromPermutations(sols);
+          double[][] popPoints = DistanceMatrixToPoints.MetricMDS(dm, dim);
 
           var convexHull = LPHull.Calculate(popPoints);
@@ -80,8 +73,38 @@
           dtNrPointsRow.Values.Add(convexHull.Count);
 
+          if (curHull == null) {
+            curHull = convexHull;
+          } else {
+            var newPHull = curHull.Union(convexHull).ToArray();
+            curHull = LPHull.Calculate(newPHull);
+          }
+
           sols = solutionCache.GetSolutionsFromGeneration(++i);
         }
+        overallVolumn.Value = ConvexHullMeasures.CalculateVolume(curHull);
 
-        run.Results.Add("Convex Hull Measures", dt);
+        run.Results.Add("Overall volumn: ", overallVolumn);
+        run.Results.Add("Convex hull volumn", volDataTable);
+        run.Results.Add("Convex nr. of points", nrOfPointsTable);
+      }
+    }
+
+    private double[][] CalculateDistanceMatrixFromPermutations(List<Permutation> points) {
+      double[][] tmpDm = new double[points.Count][];
+      AllocArray(tmpDm, points.Count);
+
+      for (int i = 0; i < points.Count; i++) {
+        for (int j = 0; j < points.Count; j++) {
+          double diversity = TSPSimilarityCalculator.CalculateSimilarity(points[i], points[j]);
+          tmpDm[i][j] = diversity;
+        }
+      }
+
+      return DistanceMatrixToPoints.TransformToDistances(tmpDm);
+    }
+
+    private void AllocArray(double[][] arr, int size) {
+      for (int i = 0; i < arr.Length; i++) {
+        arr[i] = new double[size];
       }
     }
Index: /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/RealVectorConvexHullModifier.cs
===================================================================
--- /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/RealVectorConvexHullModifier.cs	(revision 10132)
+++ /branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/RealVectorConvexHullModifier.cs	(revision 10133)
@@ -20,8 +20,6 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using HeuristicLab.Analysis.SolutionCaching.RealVectorEncoding;
 using HeuristicLab.Common;
@@ -53,5 +51,4 @@
         if (solutionCache == null) continue;
 
-        var sols = solutionCache.GetSolutionsFromGeneration(i);
         DataTable volDataTable = new DataTable("Convex hull volume over generations");
         DataTable nrOfPointsTable = new DataTable("Nr. of points of convex hull");
@@ -64,5 +61,5 @@
 
         List<double[]> curHull = null;
-
+        var sols = solutionCache.GetSolutionsFromGeneration(i);
         while (sols.Count != 0) {
           var input = sols.Select(x => ConvertRealVectorToVertexArray(x)).ToArray();
