Gephi Toolkit Javadoc

org.gephi.statistics.plugin
Class DegreeDistribution

java.lang.Object
  extended by org.gephi.statistics.plugin.DegreeDistribution
All Implemented Interfaces:
Statistics, LongTask

public class DegreeDistribution
extends java.lang.Object
implements Statistics, LongTask

This class measures how closely the degree distribution of a network follows a power-law scale. An alpha value between 2 and 3 implies a power law.

Author:
pjmcswees

Constructor Summary
DegreeDistribution()
           
 
Method Summary
 boolean cancel()
          Cancel the task.
 void execute(Graph graph, AttributeModel attributeModel)
           
 void execute(GraphModel graphModel, AttributeModel attributeModel)
          Calculates the degree distribution for this network.
 double getCombinedPowerLaw()
           
 double getInPowerLaw()
           
 double getOutPowerLaw()
           
 java.lang.String getReport()
          Returns an HTML string that displays the statistics result.
 boolean isDirected()
           
 void leastSquares(double[] dist, double[] res)
          Fits the logarithm distribution/degree to a straight line of the form: a + b *x which is then interrpreted as a*x^y in the non-logarithmic scale
 void setDirected(boolean pDirected)
           
 void setProgressTicket(ProgressTicket pProgressTicket)
          Set the progress ticket for the long task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DegreeDistribution

public DegreeDistribution()
Method Detail

setDirected

public void setDirected(boolean pDirected)
Parameters:
pDirected - Indicates the metric's interpretation of this network.

isDirected

public boolean isDirected()

getCombinedPowerLaw

public double getCombinedPowerLaw()
Returns:
The combined in/out-degree power law value for this network.

getInPowerLaw

public double getInPowerLaw()
Returns:
The combined in/out-degree power law value for this network.

getOutPowerLaw

public double getOutPowerLaw()
Returns:
The combined in/out-degree power law value for this network.

execute

public void execute(GraphModel graphModel,
                    AttributeModel attributeModel)
Calculates the degree distribution for this network. Either a combined degree distribution or separate in-degree distribution and out-degree distribution is calculated based on the mDirected variable.

Specified by:
execute in interface Statistics
Parameters:
graphModel -
attributeModel - The elements attributes, and where to write table results

execute

public void execute(Graph graph,
                    AttributeModel attributeModel)

leastSquares

public void leastSquares(double[] dist,
                         double[] res)
Fits the logarithm distribution/degree to a straight line of the form: a + b *x which is then interrpreted as a*x^y in the non-logarithmic scale

Parameters:
dist - The distribution of node degrees to fit to a logarithmized straight line

getReport

public java.lang.String getReport()
Description copied from interface: Statistics
Returns an HTML string that displays the statistics result. Can contains complex HTML snippets and images.

Specified by:
getReport in interface Statistics
Returns:
A String report based on the interpretation of the network.

cancel

public boolean cancel()
Description copied from interface: LongTask
Cancel the task. Returns true if the task has been sucessfully cancelled, false otherwise.

Specified by:
cancel in interface LongTask
Returns:
Indicates that the metric canceled flag was set.

setProgressTicket

public void setProgressTicket(ProgressTicket pProgressTicket)
Description copied from interface: LongTask
Set the progress ticket for the long task. Can't be null.

Specified by:
setProgressTicket in interface LongTask
Parameters:
progressTicket - Sets the progress meter for the metric.

Gephi Toolkit Javadoc