peersim.reports
Class GraphPrinter

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

public class GraphPrinter
extends GraphObserver

Prints the whole graph in a given format.


Parameter Summary
outf
          This is the prefix of the filename where the graph is saved.
format
          The name for the format of the output.
 
Parameters inherited from class peersim.reports.GraphObserver
undir
 
Field Summary
 
Fields inherited from class peersim.reports.GraphObserver
g, ga, name, pid, undir
 
Constructor Summary
GraphPrinter(java.lang.String name)
          Standard constructor that reads the configuration parameters.
 
Method Summary
 boolean execute()
          Saves the graph according to the specifications in the configuration.
 
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

outf

This is the prefix of the filename where the graph is saved. The extension is ".graph" and after the prefix the basename contains a numeric index that is incremented at each saving point. If not given, the graph is dumped on the standard output.


format

The name for the format of the output. Defaults to "neighborlist", which is a plain dump of neighbors. The class WireFromFile can read this format. Other supported formats are "chaco" to be used with Yehuda Koren's Embedder, "netmeter" to be used with Sergi Valverde's netmeter and also with pajek, "edgelist" that dumps one (directed) node pair in each line for each edge, "gml" that is a generic format of many graph tools, and "dot" that can be used with the graphviz package.

See Also:
GraphIO.writeEdgeList(peersim.graph.Graph, java.io.PrintStream), GraphIO.writeChaco(peersim.graph.Graph, java.io.PrintStream), GraphIO.writeNeighborList(peersim.graph.Graph, java.io.PrintStream), GraphIO.writeNetmeter(peersim.graph.Graph, java.io.PrintStream)
Constructor Detail

GraphPrinter

public GraphPrinter(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()
Saves the graph according to the specifications in the configuration.

Returns:
always false