return report;
}
@Override
public void loop(GraphView window, Interval interval) {
Graph graph = null;
if (isDirected) {
graph = graphModel.getDirectedGraph(window);
} else {
graph = graphModel.getUndirectedGraph(window);
}
graph.readLock();
clusteringCoefficientStat = new ClusteringCoefficient();
clusteringCoefficientStat.setDirected(isDirected);
clusteringCoefficientStat.triangles(graph);
//Columns
if (!averageOnly) {
double[] coefficients = clusteringCoefficientStat.getCoefficientReuslts();
int i = 0;
for (Node n : graph.getNodes()) {
double coef = coefficients[i++];
n.setAttribute(dynamicCoefficientColumn, coef, interval.getLow());
n.setAttribute(dynamicCoefficientColumn, coef, interval.getHigh());
if (cancel) {
break;
}
}
}
graph.readUnlockAll();
//Average
double avg = clusteringCoefficientStat.getAverageClusteringCoefficient();
graph.setAttribute(DYNAMIC_AVG_CLUSTERING_COEFFICIENT, avg, interval.getLow());
graph.setAttribute(DYNAMIC_AVG_CLUSTERING_COEFFICIENT, avg, interval.getHigh());
averages.put(interval.getLow(), avg);
averages.put(interval.getHigh(), avg);
}