peersim.reports
Class BallExpansion

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

public class BallExpansion
extends GraphObserver

Control to observe the ball expansion, that is, the number of nodes that are accessible from a given node in at most 1, 2, etc steps.


Parameter Summary
maxd
          This parameter defines the maximal distance we care about.
n
          The number of nodes to print info about.
stats
          If defined, statistics are printed instead over the minimal path lengths.
 
Parameters inherited from class peersim.reports.GraphObserver
undir
 
Field Summary
 
Fields inherited from class peersim.reports.GraphObserver
g, ga, name, pid, undir
 
Constructor Summary
BallExpansion(java.lang.String name)
          Standard constructor that reads the configuration parameters.
 
Method Summary
 boolean execute()
          Prints information about ball expansion.
 
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

maxd

This parameter defines the maximal distance we care about. In other words, two nodes are further away, they will not be taken into account when calculating statistics.

Defaults to the network size (which means all distances are taken into account). Note that this default is normally way too much; many low diameter graphs have only short distances between the nodes. Setting a short (but sufficient) distance saves memory. Also note that the initial network size is used if no value is given which might not be what you want if e.g. the network is growing.


n

The number of nodes to print info about. Defaults to 1000. If larger than the current network size, then the current network size is used.


stats

If defined, statistics are printed instead over the minimal path lengths. Not defined by default.

Constructor Detail

BallExpansion

public BallExpansion(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()
Prints information about ball expansion. It uses "n" nodes to collect statistics. If parameter "stats" is defined then the output is produced by IncrementalStats.toString(), over the values of minimal distances from the given number of nodes to all other nodes in the network. If at least one node is unreachable from any selected starting node, then the path length is taken as infinity and statistics are calculated accordingly. In that case, IncrementalStats.getMaxCount() returns the number of nodes of "infinite distance", that is, the number of unreachable nodes. Otherwise one line is printed for all nodes we observe, containing the number of nodes at distance 1, 2, etc, separated by spaces. In this output format, unreachable nodes are simply ignored, but of course the sum of the numbers in one line can be used to detect partitioning if necessary. Finally, note that the "n" nodes are not guaranteed to be the same nodes over consecutive calls to this method.

Returns:
always false