Changeset 10141 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/PermutationConvexHullModifier.cs
- Timestamp:
- 11/20/13 10:44:12 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/PermutationConvexHullModifier.cs
r10139 r10141 61 61 nrOfPointsTable.Rows.Add(dtNrPointsRow); 62 62 63 List<double[]> curHull = null;64 63 var sols = solutionCache.GetSolutionsFromGeneration(i); 65 int dim = sols.First().Length; 64 int dim; 65 double[][] dm; 66 double[][] popPoints; 66 67 while (sols.Count != 0) { 67 d ouble[][] dm = CalculateDistanceMatrixFromPermutations(sols);68 dm = CalculateDistanceMatrixFromPermutations(sols); 68 69 70 dim = sols.First().Length; 69 71 if (dim > dm.Length) 70 72 dim = dm.Length - 1; 71 73 72 double[][]popPoints = DistanceMatrixToPoints.MetricMDS(dm, dim);74 popPoints = DistanceMatrixToPoints.MetricMDS(dm, dim); 73 75 74 76 var convexHull = LPHull.Calculate(popPoints); … … 77 79 dtNrPointsRow.Values.Add(convexHull.Count); 78 80 79 if (curHull == null) {80 curHull = convexHull;81 } else {82 var newPHull = curHull.Union(convexHull).ToArray();83 curHull = LPHull.Calculate(newPHull);84 }85 86 81 sols = solutionCache.GetSolutionsFromGeneration(++i); 87 82 } 88 overallVolumn.Value = ConvexHullMeasures.CalculateVolume(curHull);89 83 90 run.Results.Add("Overall volumn: ", overallVolumn); 84 //calculate convex hull for all individuals 85 /* dm = CalculateDistanceMatrixFromPermutations(solutionCache.Keys().ToList()); 86 dim = solutionCache.Keys().First().Length; 87 if (dim > dm.Length) 88 dim = dm.Length - 1; 89 popPoints = DistanceMatrixToPoints.MetricMDS(dm, dim); 90 91 List<double[]> allPoints = LPHull.Calculate(popPoints); 92 overallVolumn.Value = ConvexHullMeasures.CalculateVolume(allPoints);*/ 93 94 //run.Results.Add("Overall volumn: ", overallVolumn); 91 95 run.Results.Add("Convex hull volumn", volDataTable); 92 96 run.Results.Add("Convex nr. of points", nrOfPointsTable);
Note: See TracChangeset
for help on using the changeset viewer.