peersim.vector
Class ValueDumper

java.lang.Object
  extended by peersim.vector.VectControl
      extended by peersim.vector.ValueDumper
All Implemented Interfaces:
Control

public class ValueDumper
extends VectControl

Dump the content of a vector in a file. Each line represent a single node. Values are dumped to a file whose name is obtained from a configurable prefix (set by "outf"), a number that is increased before each dump by one, and the extension ".vec".

This observer class can observe any protocol field containing a primitive value, provided that the field is associated with a getter method that reads it.

See Also:
VectControl, peersim.vector

Parameter Summary
outf
          This is the base name of the file where the values are saved.
 
Parameters inherited from class peersim.vector.VectControl
protocol, setter, getter
 
Field Summary
 
Fields inherited from class peersim.vector.VectControl
getter, setter
 
Constructor Summary
ValueDumper(java.lang.String prefix)
          Standard constructor that reads the configuration parameters.
 
Method Summary
 boolean execute()
          Dump the content of a vector in a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Parameter Detail

outf

This is the base name of the file where the values are saved. The full name will be baseName+cycleid+".vec".

Constructor Detail

ValueDumper

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

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

execute

public boolean execute()
Dump the content of a vector in a file. Each line represent a single node. Values are dumped to a file whose name is obtained from a configurable prefix (set by "outf"), a number that is increased before each dump by one, and the extension ".vec".

Returns:
always false
Throws:
java.lang.RuntimeException - if there is an I/O problem