Package org.nlpub.watset.eval
Class Measurer<V,E>
- java.lang.Object
-
- org.nlpub.watset.eval.Measurer<V,E>
-
- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph
public class Measurer<V,E> extends Object
A clustering algorithm performance measurement class.Given a clustering algorithm provider and a graph, it measures the running time of the clustering algorithm on every input graph.
Before recording the measurements, it warms up by running exactly the same operation to leverage the influence of JIT and other VM optimizations.
- See Also:
ClusteringAlgorithm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMeasurer.Measurement<V>A performance measurement result.
-
Field Summary
Fields Modifier and Type Field Description static intREPETITIONSThe default number of repetitions.static intWARMUPThe default number of warmup runs kept off-record beforeREPETITIONS.
-
Constructor Summary
Constructors Constructor Description Measurer(ClusteringAlgorithmBuilder<V,E,?> provider, org.jgrapht.Graph<V,E> graph)Create an instance ofMeasurer.Measurer(ClusteringAlgorithmBuilder<V,E,?> provider, org.jgrapht.Graph<V,E> graph, int repetitions, int warmup)Create an instance ofMeasurer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Integer>getClusters()Return the list of the measured number of clusters.List<Long>getDurations()Return the list of the measured graph clustering durations in milliseconds.org.jgrapht.Graph<V,E>getGraph()Return the input graph.voidrun()Perform the measurement.
-
-
-
Field Detail
-
REPETITIONS
public static final int REPETITIONS
The default number of repetitions.- See Also:
- Constant Field Values
-
WARMUP
public static final int WARMUP
The default number of warmup runs kept off-record beforeREPETITIONS.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Measurer
public Measurer(ClusteringAlgorithmBuilder<V,E,?> provider, org.jgrapht.Graph<V,E> graph, int repetitions, int warmup)
Create an instance ofMeasurer.- Parameters:
provider- the clustering algorithm providergraph- the graphrepetitions- the number of repetitionswarmup- the number of off-record repetitions
-
Measurer
public Measurer(ClusteringAlgorithmBuilder<V,E,?> provider, org.jgrapht.Graph<V,E> graph)
Create an instance ofMeasurer.- Parameters:
provider- the clustering algorithm providergraph- the graph
-
-
Method Detail
-
getDurations
public List<Long> getDurations()
Return the list of the measured graph clustering durations in milliseconds.- Returns:
- the list of durations
-
getClusters
public List<Integer> getClusters()
Return the list of the measured number of clusters.- Returns:
- the list of cluster sizes
-
run
public void run()
Perform the measurement. First,warmupiterations are performed off-record. Then, the actualrepetitionsare performed to measure the performance of the clustering algorithm.
-
-