peersim.reports
Class GraphStats

java.lang.Object
  extended by peersim.reports.GraphObserver
      extended by peersim.reports.GraphStats
All Implemented Interfaces:
Control

public class GraphStats
extends GraphObserver

Prints reports on the graph like average clustering and average path length, based on random sampling of the nodes. In fact its functionality is a subset of the union of Clustering and BallExpansion, and therefore is redundant, but it is there for historical reasons.

See Also:
BallExpansion, Clustering

Parameter Summary
nl
          The number of nodes to use for sampling average path length.
nc
          The number of nodes to use to sample average clustering.
 
Parameters inherited from class peersim.reports.GraphObserver
undir
 
Field Summary
 
Fields inherited from class peersim.reports.GraphObserver
g, ga, name, pid, undir
 
Constructor Summary
GraphStats(java.lang.String name)
          Standard constructor that reads the configuration parameters.
 
Method Summary
 boolean execute()
          Returns statistics over minimal path length and clustering.
 
Methods inherited from class peersim.reports.GraphObserver
updateGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Parameter Detail

nl

The number of nodes to use for sampling average path length. Statistics are printed over a set of node pairs. To create the set of pairs, we select the given number of different nodes first, and then pair all these nodes with every other node in the network. If zero is given, then no statistics will be printed about path length. If a negative value is given then the value is the full size of the graph. Defaults to zero.


nc

The number of nodes to use to sample average clustering. If zero is given, then no statistics will be printed about clustering. If a negative value is given then the value is the full size of the graph. Defaults to zero.

Constructor Detail

GraphStats

public GraphStats(java.lang.String name)
Standard constructor that reads the configuration parameters. Invoked by the simulation engine.

Parameters:
name - the configuration prefix for this class
Method Detail

execute

public boolean execute()
Returns statistics over minimal path length and clustering. The output is the average over the set of clustering coefficients of randomly selected nodes, and the set of distances from randomly selected nodes to all the other nodes. The output is always concatenated in one line, containing zero, one or two numbers (averages) as defined by the config parameters. Note that the path length between a pair of nodes can be infinite, in which case the statistics will reflect this (the average will be infinite, etc). See also the configuration parameters.

Returns:
always false
See Also:
BallExpansion, Clustering