peersim.vector
Class InitVectFromFile

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

public class InitVectFromFile
extends VectControl

Initializes a protocol vector from data read from a file. The file format is as follows: lines starting with # or lines that contain only whitespace are ignored. From the rest of the lines the first field separated by whitespace is read. Only the first field is read from each line, the rest of the line is ignored. The file can contain more values than necessary but enough values must be present.

See Also:
VectControl, peersim.vector

Parameter Summary
file
          The filename to load links from.
 
Parameters inherited from class peersim.vector.VectControl
protocol, setter, getter
 
Field Summary
 
Fields inherited from class peersim.vector.VectControl
getter, setter
 
Constructor Summary
InitVectFromFile(java.lang.String prefix)
          Standard constructor that reads the configuration parameters.
 
Method Summary
 boolean execute()
          Initializes values from a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Parameter Detail

file

The filename to load links from.

Constructor Detail

InitVectFromFile

public InitVectFromFile(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()
Initializes values from a file. The file format is as follows: lines starting with # or lines that contain only whitespace are ignored. From the rest of the lines the first field separated by whitespace is read. Only the first field is read from each line, the rest of the line is ignored. The file can contain more values than necessary but enough values must be present.

Returns:
always false
Throws:
java.lang.RuntimeException - if the file cannot be read or contains too few values