Changeset 10283 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers
- Timestamp:
- 01/05/14 14:23:45 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/RealVectorConvexHullModifier.cs
r10279 r10283 41 41 private const string CentroidMotionName = "Centroid Motion"; 42 42 private const string BestSolutionName = "Best Solution"; 43 private const string IncrementalHullVolumeRatioName = "Incremental Hull Volume Ratio"; 43 44 44 45 public IValueParameter<DoubleArray> BestSolutionParameter { … … 65 66 List<double[]> centroidList = new List<double[]>(); 66 67 var bestSolution = run.Results["Best Solution"] as SingleObjectiveTestFunctionSolution; 67 //var bestKnownSolution = ConvertRealVectorToVertexArray(bestSolution.BestKnownRealVector);68 68 var bestKnownSolution = BestSolutionParameter.Value; 69 69 … … 72 72 DataTable centroidDistancesTable = new DataTable(CentroidMovementDistancesName); 73 73 DataTable centroidMotionTable = new DataTable(CentroidMotionName); 74 DataTable incrementalHullVolumeRatioTable = new DataTable(IncrementalHullVolumeRatioName); 74 75 DoubleValue overallVolume = new DoubleValue(); 75 76 DoubleValue overallVolumeRatio = new DoubleValue(); … … 80 81 DataRow dtCentroidMotion = new DataRow("Motion"); 81 82 DataRow dtCentroidDistanceFromOptimum = new DataRow("Distance from optimum"); 83 DataRow dtIncrementalHullVolume = new DataRow("Incremental Hull Volume"); 84 DataRow dtIncrementalHullVolumeRatio = new DataRow("Incremental Hull Volume Ratio"); 82 85 centroidMotionTable.Rows.Add(dtCentroidMotion); 83 86 centroidDistancesTable.Rows.Add(dtCentroidDistances); 84 87 centroidDistancesTable.Rows.Add(dtCentroidDistanceFromOptimum); 85 88 volDataTable.Rows.Add(dtVolumeRow); 89 volDataTable.Rows.Add(dtIncrementalHullVolume); 86 90 nrOfPointsTable.Rows.Add(dtNrPointsRow); 91 incrementalHullVolumeRatioTable.Rows.Add(dtIncrementalHullVolumeRatio); 92 93 var boundsMatrix = run.Parameters["Bounds"] as DoubleMatrix; 94 var bounds = new double[] { boundsMatrix[0, 0], boundsMatrix[0, 1] }; 95 double hyperCubeVolume = ConvexHullMeasures.CalculateHypercubeVolume(bounds, BestSolutionParameter.Value.Length); 87 96 88 97 List<double[]> completeHull = null; … … 108 117 } 109 118 119 if (completeHull != null && completeHull.Any() && completeHull.First().Length < completeHull.Count) { 120 double completeHullVolume = ConvexHullMeasures.CalculateVolume(completeHull); 121 double ratio = completeHullVolume / hyperCubeVolume; 122 dtIncrementalHullVolume.Values.Add(completeHullVolume); 123 dtIncrementalHullVolumeRatio.Values.Add(ratio); 124 } 125 110 126 sols = solutionCache.GetSolutionsFromGeneration(++i); 111 127 } … … 113 129 if (completeHull != null && completeHull.Any() && completeHull.First().Length < completeHull.Count) { 114 130 overallVolume.Value = ConvexHullMeasures.CalculateVolume(completeHull); 115 var boundsMatrix = run.Parameters["Bounds"] as DoubleMatrix; 116 var bounds = new double[] { boundsMatrix[0, 0], boundsMatrix[0, 1] }; 117 double hyperHullVolume = ConvexHullMeasures.CalculateHypercubeVolume(bounds, BestSolutionParameter.Value.Length); 118 overallVolumeRatio.Value = overallVolume.Value / hyperHullVolume; 131 overallVolumeRatio.Value = overallVolume.Value / hyperCubeVolume; 119 132 } else { 120 133 overallVolume.Value = double.NaN; … … 133 146 run.Results[CentroidMovementDistancesName] = centroidDistancesTable; 134 147 run.Results[CentroidMotionName] = centroidMotionTable; 148 run.Results[IncrementalHullVolumeRatioName] = incrementalHullVolumeRatioTable; 135 149 } 136 150 }
Note: See TracChangeset
for help on using the changeset viewer.