peersim.vector
Class Normalizer

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

public class Normalizer
extends VectControl

Normalizes the values of a protocol vector. The normalization is based on the L1 norm, that is, the sum of the absolute values of the vector elements. Parameter "l1" defines the L1 norm that the vector will have after normalization.

See Also:
VectControl, peersim.vector

Parameter Summary
l1
          The L1 norm (sum of absolute values) to normalize to.
 
Parameters inherited from class peersim.vector.VectControl
protocol, setter, getter
 
Field Summary
 
Fields inherited from class peersim.vector.VectControl
getter, setter
 
Constructor Summary
Normalizer(java.lang.String prefix)
          Standard constructor that reads the configuration parameters.
 
Method Summary
 boolean execute()
          Makes the sum of the absolute values (L1 norm) equal to the value given in the configuration parameter "l1".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Parameter Detail

l1

The L1 norm (sum of absolute values) to normalize to. After the operation the L1 norm will be the value given here. Defaults to 1.

Constructor Detail

Normalizer

public Normalizer(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()
Makes the sum of the absolute values (L1 norm) equal to the value given in the configuration parameter "l1". If the value is negative, the L1 norm will be the absolute value and the vector elements change sign.

Returns:
always false