public class CommonUtilities extends Object
Constructor and Description |
---|
CommonUtilities() |
Modifier and Type | Method and Description |
---|---|
static List<MeasurementGroupsCluster> |
clusterTimerValuesFromHistogram(SortedMap<Long,Integer> allMeasurementsHistogram,
int clusterFormationThresholdDistance)
TODO move back to AbstractTimerMeter and rename to show this method's specific nature
Sketch of work for threshold==2 ("entry" := one element of
allMeasurementsHistogram ):
if a cluster with 3 elements (i.e. |
static long |
computeAccuracyFromClusters(List<MeasurementGroupsCluster> clusters,
boolean verbose)
TODO document me please
TODO replace through greatest-common-divisor scheme (or add it testwise...)
|
static StatisticalDescription |
computeCharacteristics_detailed(long[] measurements,
boolean logValues) |
static SortedMap<Long,Integer> |
computeHistogram(long[] measurements)
TODO test me!
Computes a simple sorted histogram from
measurements |
static void |
rearrangeMeasurementsByValue(SortedMap<Integer,SortedMap<Long,Integer>> source,
SortedMap<Long,SortedMap<Integer,Integer>> destination) |
public static void rearrangeMeasurementsByValue(SortedMap<Integer,SortedMap<Long,Integer>> source, SortedMap<Long,SortedMap<Integer,Integer>> destination)
source
- destination
- public static List<MeasurementGroupsCluster> clusterTimerValuesFromHistogram(SortedMap<Long,Integer> allMeasurementsHistogram, int clusterFormationThresholdDistance)
allMeasurementsHistogram
):
if a cluster with 3 elements (i.e. x, x+1, x+2) appears:
re-visit existing clusters and break them into one-entry-per-cluster
(or, simpler: discard existing clusters and re-traverse
allMeasurementsHistogram
with a threshold of <1).
The return of this method should be postprocessed by another method
that computes the accuracy as greatest common divisor of cluster
distances. However, this is tricky, as some two-classes clusters may
not have any values from one class, e.g. [(100,101), (200,201), (300), (400,401)],
or some classes may have been skipped altogether...
Just work with "+-1" cluster distances (this does not work with "2" or
other small accuracies)? Or should we "fill" non-existing classes?
In fact, we cannot guarantee that all classes are present...
For future work: can we make any statements about the "Nachkommastelle"
from the frequencies of the classes?allMeasurementsHistogram
- clusterFormationThresholdDistance
- the maximum distance (incl.)
from the leftmost [smalles] element of the current cluster
so that the considered allMeasurementsHistogram
entry
can still be added to the current cluster.public static long computeAccuracyFromClusters(List<MeasurementGroupsCluster> clusters, boolean verbose)
clusters
- public static StatisticalDescription computeCharacteristics_detailed(long[] measurements, boolean logValues)
measurements
- logValues
-