bcds.phison.gm
Class Assortativity<V,E>

java.lang.Object
  extended by bcds.phison.gm.GraphMetricBase<V,E>
      extended by bcds.phison.gm.Assortativity<V,E>
All Implemented Interfaces:
GraphMetric<V,E>, WithEnvParams

public class Assortativity<V,E>
extends GraphMetricBase<V,E>
implements GraphMetric<V,E>

Computes the assortativity coefficient of a graph, based on the Pearson correlation coefficient.


Constructor Summary
Assortativity()
          Default constructor.
Assortativity(SimGraph<V,E> g, Environ env)
          Creates a new instance.
 
Method Summary
 java.lang.String getDescription()
          Returns a string describing the metric, for example, article where it has been published, URL where to find reference implementation, etc.
 double getGraphMetric()
          Returns the graph's assortativity coefficient.
 java.lang.String getLabel()
          Returns "Assortativity".
 boolean isApplicableTo(MetricTarget m)
          Returns true if m is MetricTarget.GRAPH.
 void run()
          Default implementation.
 void setup(SimGraph<V,E> g, Environ env)
          Saves the parameters for future use.
 
Methods inherited from class bcds.phison.gm.GraphMetricBase
dump, getEdgeMetric, getEnviron, getEnvParams, getGraph, getGraphMetricStdev, getName, getNodeMetric
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bcds.phison.gm.GraphMetric
dump, getEdgeMetric, getGraphMetricStdev, getNodeMetric
 
Methods inherited from interface bcds.phison.WithEnvParams
getEnviron, getEnvParams, getName
 

Constructor Detail

Assortativity

public Assortativity()
Default constructor. To complete the initialization, setup(SimGraph, Environ) must be called.


Assortativity

public Assortativity(SimGraph<V,E> g,
                     Environ env)
Creates a new instance. Calls setup(bcds.phison.SimGraph, bcds.tools.Environ) to complete the inialization.

Method Detail

setup

public void setup(SimGraph<V,E> g,
                  Environ env)
Description copied from class: GraphMetricBase
Saves the parameters for future use. The parameter g must not be null. If env is null, a new empty environment is created. Default values are incorporated by calling getEnvParams and the types of already-present values are adapted, if possible.

Specified by:
setup in interface GraphMetric<V,E>
Overrides:
setup in class GraphMetricBase<V,E>

isApplicableTo

public boolean isApplicableTo(MetricTarget m)
Returns true if m is MetricTarget.GRAPH.

Specified by:
isApplicableTo in interface GraphMetric<V,E>
Overrides:
isApplicableTo in class GraphMetricBase<V,E>

getGraphMetric

public double getGraphMetric()
Returns the graph's assortativity coefficient.

Specified by:
getGraphMetric in interface GraphMetric<V,E>
Overrides:
getGraphMetric in class GraphMetricBase<V,E>

run

public void run()
Description copied from class: GraphMetricBase
Default implementation. Does nothing.

Specified by:
run in interface GraphMetric<V,E>
Overrides:
run in class GraphMetricBase<V,E>

getLabel

public java.lang.String getLabel()
Returns "Assortativity".

Specified by:
getLabel in interface GraphMetric<V,E>

getDescription

public java.lang.String getDescription()
Description copied from interface: GraphMetric
Returns a string describing the metric, for example, article where it has been published, URL where to find reference implementation, etc.

Specified by:
getDescription in interface GraphMetric<V,E>