drasys.or.prob
Class Distribution

java.lang.Object
  |
  +--drasys.or.prob.Distribution
Direct Known Subclasses:
ContinuousDistribution, DiscreteDistribution

public abstract class Distribution
extends java.lang.Object
implements DistributionI, java.io.Serializable

An abstract class shared by all distributions.

See Also:
BinomialDistribution, PoissonDistribution, EmpiricalDistribution, DiscreteUniformDistribution, UniformDistribution, NormalDistribution, ExponentialDistribution, GammaDistribution, Serialized Form

Constructor Summary
Distribution()
          The default random number generator is 'BaysDurhamShuffle'.
Distribution(long seed)
          The random number generator is 'BaysDurhamShuffle' which is initialized to seed.
 
Method Summary
 MatrixI getRandomMatrix(int sizeOfRows, int sizeOfColumns)
          Returns a matrix of random numbers from the distribution.
 RandomI getRandomNumberGenerator()
          Gets the random number generator.
 VectorI getRandomVector(int size)
          Returns a vector of random numbers from the distribution.
 MatrixI setElements(MatrixI matrix)
          Set the elements in a matrix to random values from the distribution.
 VectorI setElements(VectorI vector)
          Set the elements in a vector to random values from the distribution.
 void setRandomNumberGenerator(RandomI random)
          Sets the random number generator.
 void setSeed(long seed)
          Sets the seed for the random number generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Distribution

public Distribution()
The default random number generator is 'BaysDurhamShuffle'.

Distribution

public Distribution(long seed)
The random number generator is 'BaysDurhamShuffle' which is initialized to seed.
Method Detail

setSeed

public void setSeed(long seed)
Sets the seed for the random number generator.
Specified by:
setSeed in interface DistributionI

setRandomNumberGenerator

public void setRandomNumberGenerator(RandomI random)
Sets the random number generator.
Specified by:
setRandomNumberGenerator in interface DistributionI

getRandomNumberGenerator

public RandomI getRandomNumberGenerator()
Gets the random number generator.
Specified by:
getRandomNumberGenerator in interface DistributionI

getRandomVector

public VectorI getRandomVector(int size)
Returns a vector of random numbers from the distribution. The returned vector is a DenseVector.
Specified by:
getRandomVector in interface DistributionI

getRandomMatrix

public MatrixI getRandomMatrix(int sizeOfRows,
                               int sizeOfColumns)
Returns a matrix of random numbers from the distribution. The returned matrix is a DenseMatrix.
Specified by:
getRandomMatrix in interface DistributionI

setElements

public VectorI setElements(VectorI vector)
Set the elements in a vector to random values from the distribution. Only the non-null elements in the vector are set.
Specified by:
setElements in interface DistributionI
Returns:
the argument 'vector'

setElements

public MatrixI setElements(MatrixI matrix)
Set the elements in a matrix to random values from the distribution. Only the non-null elements in the matrix are set.
Specified by:
setElements in interface DistributionI
Returns:
the argument 'matrix'


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com