Package peersim.vector

Classes that make it possible to modify and analyze numeric vectors defined by the vector of protocol instances in the network.

See:
          Description

Interface Summary
SingleValue The implementor class has a single parameter.
 

Class Summary
Getter Vectors can be written through this class.
InitVectFromFile Initializes a protocol vector from data read from a file.
LinearDistribution Initializes a protocol vector with values in the range ["min", "max"] (inclusive both ends), linearly increasing.
Normalizer Normalizes the values of a protocol vector.
PeakDistribution Initializes the values so that "peaks" nodes have value "value"/"peaks", the rest "background" (zero by default).
Setter Vectors can be written through this class.
SingleValueComparator This comparator class compares two node objects based on the value maintained by one of its protocols.
SingleValueHolder The task of this protocol is to store a single double value and make it available through the SingleValue interface.
SingleValueObserver Print statistics over a vector.
TestVectors Do testing the vector package.
UniformDistribution Initializes the values drawing uniform random samples from the range ["min", "max"[.
ValueDumper Dump the content of a vector in a file.
VectAngle Observes the cosine angle between two vectors.
VectControl Serves as an abstract superclass for Controls that deal with vectors.
VectCopy Sets values in a protocol vector by copying the values of another protocol vector.
VectorComparator This class provides a generic implementation of the java.lang.Comparator interface specialized for Node objects.
VectorObserver This class computes and reports statistics information about a vector.
 

Package peersim.vector Description

Classes that make it possible to modify and analyze numeric vectors defined by the vector of protocol instances in the network.

The idea is the following: all the protocol instances contained by nodes in the network define a protocol vector. This package handles protocol vectors as a whole: for example, by observing one of its fields and reporting aggregation statistics over them (like average, variance, etc.).

Originally, this package was designed to interact with protocols implementing the SingleValue interface, containing a getter and a setter method for interacting with a double value. The current implementation is backward-compatible with this design, meaning that it works with SingleValue as default, but it has also been extended in order to initialize and observe generic fields and generic primitive types. In this general case, the getter and setter methods that read and write this field have to be explicitly given in the configuration.

Getter methods must have a signature as follows:

Setter methods are characterized as follows:

Although there are other numberic types such as byte and short, they are not supported. They can be represented as an int in a protocol.