peersim.vector
Class UniformDistribution

java.lang.Object
  extended by peersim.vector.VectControl
      extended by peersim.vector.UniformDistribution
All Implemented Interfaces:
Control, NodeInitializer

public class UniformDistribution
extends VectControl
implements NodeInitializer

Initializes the values drawing uniform random samples from the range ["min", "max"[.

See Also:
VectControl, peersim.vector

Parameter Summary
max
          The upper bound of the uniform random variable, exclusive.
min
          The lower bound of the uniform random variable, inclusive.
 
Parameters inherited from class peersim.vector.VectControl
protocol, setter, getter
 
Field Summary
 
Fields inherited from class peersim.vector.VectControl
getter, setter
 
Constructor Summary
UniformDistribution(java.lang.String prefix)
          Standard constructor that reads the configuration parameters.
 
Method Summary
 boolean execute()
          Initializes the values drawing uniform random samples from the range ["min", "max"[.
 void initialize(Node n)
          Initializes the value drawing a uniform random sample from the range ["min", "max"[.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Parameter Detail

max

The upper bound of the uniform random variable, exclusive.


min

The lower bound of the uniform random variable, inclusive. Defaults to -"max".

Constructor Detail

UniformDistribution

public UniformDistribution(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 the values drawing uniform random samples from the range ["min", "max"[.

Specified by:
execute in interface Control
Returns:
always false

initialize

public void initialize(Node n)
Initializes the value drawing a uniform random sample from the range ["min", "max"[.

Specified by:
initialize in interface NodeInitializer
Parameters:
n - the node to initialize