adams.data.random
Class Exponential

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.data.random.AbstractRandomNumberGenerator<T>
              extended by adams.data.random.AbstractSeededRandomNumberGenerator<Double>
                  extended by adams.data.random.Exponential
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, Randomizable, ShallowCopySupporter<AbstractRandomNumberGenerator>, SizeOfHandler, Serializable

public class Exponential
extends AbstractSeededRandomNumberGenerator<Double>

Generates random numbers from an Exponential random variable (Mean = 1/lambda, variance = 1/lambda^2).

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to
    the console (0 = off).
    default: 0
    minimum: 0
 
-seed <long> (property: seed)
    The seed value for the random number generator.
    default: 1
 
-lambda <double> (property: lambda)
    The lambda parameter for the exponential random variable.
    default: 1.0
 

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Random.exponential(double), Serialized Form

Field Summary
protected  double m_Lambda
          the lambda parameter.
protected  Random m_Random
          the random number generator to use.
 
Fields inherited from class adams.data.random.AbstractSeededRandomNumberGenerator
m_Seed
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
Exponential()
           
 
Method Summary
protected  void check()
          Performs optional checks.
 void defineOptions()
          Adds options to the internal list of options.
protected  Double doNext()
          Returns the next random number.
 double getLambda()
          Returns the first parameter for the beta random variable.
 String globalInfo()
          Returns a string describing the object.
 String lambdaTipText()
          Returns the tip text for this property.
 void reset()
          Resets the generator.
 void setLambda(double value)
          Sets the first parameter for the beta random variable.
 
Methods inherited from class adams.data.random.AbstractSeededRandomNumberGenerator
getSeed, seedTipText, setSeed
 
Methods inherited from class adams.data.random.AbstractRandomNumberGenerator
forCommandLine, forName, getGenerators, next, shallowCopy, shallowCopy
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Lambda

protected double m_Lambda
the lambda parameter.


m_Random

protected Random m_Random
the random number generator to use.

Constructor Detail

Exponential

public Exponential()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractOptionHandler
Returns:
a description suitable for displaying in the gui

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractSeededRandomNumberGenerator<Double>

reset

public void reset()
Resets the generator.

Overrides:
reset in class AbstractRandomNumberGenerator<Double>

setLambda

public void setLambda(double value)
Sets the first parameter for the beta random variable.

Parameters:
value - the first parameter

getLambda

public double getLambda()
Returns the first parameter for the beta random variable.

Returns:
the first parameter

lambdaTipText

public String lambdaTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

check

protected void check()
Performs optional checks.

Initializes the random number generator.

Overrides:
check in class AbstractRandomNumberGenerator<Double>

doNext

protected Double doNext()
Returns the next random number. Does the actual computation.

Specified by:
doNext in class AbstractRandomNumberGenerator<Double>
Returns:
the next number


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.