Pandora
Class Metrics
- public class Metrics
This class contains the implementation of all the metrics of Pandora Analyzer. To plot the metrics and represent them as a graph, we use the package JFreeChart that can be downloaded from www.jfree.org. The API of jFreeChart can be found at http://www.jfree.org/jfreechart/api/javadoc/index.html.
- Version:
- 0.1
- Author:
- Foudalis Ilias
Metrics
public Metrics(Pandora.AnalysisFrame parent,
java.util.Vector nodes,
java.util.Vector edges)
- Class Constructor.
- Parameters:
parent
- AnalysisFrame : The parent of the class is AnalysisFrame.
nodes
- Vector Holds the vertices of the graph. The vertices are of type GraphNode.
edges
- Vector Holds the graph edges. The edges are of type GraphEdge.
buildTables
private void buildTables()
- Method used to construct the ccdf, degree frequency and neighbor tables of the graph. Called from the class constructor.
log10
public double log10(double d)
- Returns the base 10 logarithm of a double number d.
- Parameters:
d
- double : The number of which we want to compute the base 10 logarithm.
- Returns:
- double
getCorrelation
public double getCorrelation(double[] data1,
double[] data2,
int start,
int end)
- Computes the correlation between 2 double arrays. The 2 arrays must be of the same size.
- Parameters:
data1
- double[] : The first array.
data2
- double[] : The second array.
start
- int : The position in the array of the variable that we will start computing the correlation.
end
- int : The position in the array that we will end computing the correlation.
- Returns:
- double : Correlation value.
BFSTraversal
public int[] BFSTraversal(int start)
- Starting from node "int start" in the graph does a Breadth First Traversal.
- Parameters:
start
- int : The node from which the traversal will start.
- Returns:
- int[] : Array that holds the nodes with the order visited by Breadth First Search.
freqDegree
public void freqDegree()
- Computes power law maximum degree, max node degree and ratio and power law coefficient (γ).
jointDegree
public void jointDegree()
- Computes the assortativity coefficient, normalized average and max neighbor degree, and average neighbor degree.
ccdfDegree
public void ccdfDegree()
- Computes ccdf v.s degree metric.
degreeRank
public void degreeRank()
- Computes the rank v.s degree metric.
eccentricity
public void eccentricity()
- Computes minimum, maximum and average eccentricity, characteristic path length, center size ratio, minimum degree in center, maximum and minimum degree in periphery.
betweenness
public void betweenness()
- Computes the average and max, node and edge betweenness metric.
sepctrum
public void sepctrum()
- Computes largest eigenvalue.
clustering
public void clustering()
- Computes K PK and mean local clustering.
createChart
private org.jfree.chart.JFreeChart createChart(org.jfree.data.xy.XYDataset xydataset,
java.lang.String title,
java.lang.String x,
java.lang.String y)
- Used to create a line chart.
- Parameters:
xydataset
- XYDataset : The dataset of x and y values of he chart.
title
- String : The name of the chart.
x
- String : The name of x axis.
y
- String : The name of y axis.
- Returns:
- JFreeChart