Changeset 10287 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers
- Timestamp:
- 01/06/14 14:40:45 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionModifiers/RealVectorConvexHullModifier.cs
r10283 r10287 32 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 33 33 using HeuristicLab.Problems.TestFunctions; 34 using Mehroz; 34 35 35 36 namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers { … … 93 94 var boundsMatrix = run.Parameters["Bounds"] as DoubleMatrix; 94 95 var bounds = new double[] { boundsMatrix[0, 0], boundsMatrix[0, 1] }; 95 double hyperCubeVolume = ConvexHullMeasures.CalculateHypercubeVolume(bounds, BestSolutionParameter.Value.Length); 96 Fraction hyperCubeVolumeBig = ConvexHullMeasures.CalculateHypercubeVolumeBig(bounds, BestSolutionParameter.Value.Length); 97 double hyperCubeVolume = double.NaN; 98 99 if (hyperCubeVolumeBig < 10000000) { 100 hyperCubeVolume = ConvexHullMeasures.CalculateHypercubeVolume(bounds, BestSolutionParameter.Value.Length); 101 } 96 102 97 103 List<double[]> completeHull = null; … … 118 124 119 125 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); 126 if (double.IsNaN(hyperCubeVolume)) { 127 Fraction completeHullVolume = ConvexHullMeasures.CalculateVolumeBig(completeHull); 128 Fraction ratio = completeHullVolume / hyperCubeVolumeBig; 129 dtIncrementalHullVolume.Values.Add(completeHullVolume.ToDouble()); 130 dtIncrementalHullVolumeRatio.Values.Add(ratio.ToDouble()); 131 } else { 132 double completeHullVolume = ConvexHullMeasures.CalculateVolume(completeHull); 133 double ratio = completeHullVolume / hyperCubeVolume; 134 dtIncrementalHullVolume.Values.Add(completeHullVolume); 135 dtIncrementalHullVolumeRatio.Values.Add(ratio); 136 } 124 137 } 125 138 … … 128 141 129 142 if (completeHull != null && completeHull.Any() && completeHull.First().Length < completeHull.Count) { 130 overallVolume.Value = ConvexHullMeasures.CalculateVolume(completeHull); 131 overallVolumeRatio.Value = overallVolume.Value / hyperCubeVolume; 143 if (!double.IsNaN(hyperCubeVolume)) { 144 overallVolume.Value = ConvexHullMeasures.CalculateVolume(completeHull); 145 overallVolumeRatio.Value = overallVolume.Value / hyperCubeVolume; 146 } else { 147 Fraction v = ConvexHullMeasures.CalculateVolumeBig(completeHull); 148 overallVolume.Value = v.ToDouble(); 149 overallVolumeRatio.Value = (double)(v / hyperCubeVolumeBig); 150 } 132 151 } else { 133 152 overallVolume.Value = double.NaN;
Note: See TracChangeset
for help on using the changeset viewer.