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

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

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

Computes the average node degree of a topology as a GraphMetric. This class uses the number of outgoing edges of a node as its nodal degree. It also returns the node degree as a NODE metric.

Additionally, it provides the node degree distribution, although that functionality is not accessible through the GraphMetric interface.

Author:
Juan Segovia S.

Constructor Summary
OutNodeDegree()
          Default constructor.
OutNodeDegree(SimGraph<V,E> g, Environ env)
          Creates a new instance and calls setup to complete the initialization.
 
Method Summary
 java.util.Map<java.lang.Integer,java.lang.Integer> degreeDistrib()
          Returns the (outgoing) nodal degree distribution.
 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 average (out) node degree.
 double getGraphMetricStdev()
          Returns the standard deviation of the average (out) node degree.
 java.lang.String getLabel()
          Returns the string "Avg. (out) node degree".
 java.util.Map<V,java.lang.Double> getNodeMetric()
          Returns the (out) node degrees.
 boolean isApplicableTo(MetricTarget m)
          Returns true if m is MetricTarget.GRAPH or NODE.
 
Methods inherited from class bcds.phison.gm.GraphMetricBase
dump, getEdgeMetric, getEnviron, getEnvParams, getGraph, getName, run, setup
 
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, run, setup
 
Methods inherited from interface bcds.phison.WithEnvParams
getEnviron, getEnvParams, getName
 

Constructor Detail

OutNodeDegree

public OutNodeDegree()
Default constructor.


OutNodeDegree

public OutNodeDegree(SimGraph<V,E> g,
                     Environ env)
Creates a new instance and calls setup to complete the initialization.

Method Detail

isApplicableTo

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

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

getGraphMetric

public double getGraphMetric()
Returns the average (out) node degree.

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

getGraphMetricStdev

public double getGraphMetricStdev()
Returns the standard deviation of the average (out) node degree.

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

getNodeMetric

public java.util.Map<V,java.lang.Double> getNodeMetric()
Returns the (out) node degrees. The map is sorted by the nodes' natural ordering.

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

getLabel

public java.lang.String getLabel()
Returns the string "Avg. (out) node degree".

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>

degreeDistrib

public java.util.Map<java.lang.Integer,java.lang.Integer> degreeDistrib()
Returns the (outgoing) nodal degree distribution. For each node degree that exists in the graph, the map gives their number (non-existing degrees do not appear in the map). The map is sorted by node degree, in ascending order.