hydroScalingAPI.util.probability
Class GeometricDistribution

java.lang.Object
  extended by hydroScalingAPI.util.probability.GeometricDistribution
All Implemented Interfaces:
DiscreteDistribution

public class GeometricDistribution
extends java.lang.Object
implements DiscreteDistribution

An implementation of DiscreteDistribution using a geometric distribution P(i)=p*(1-p)^i

Author:
Ricardo Mantilla

Constructor Summary
GeometricDistribution(double theBase, int theMinVal)
          Creates a new instance of GeometricDistribution
 
Method Summary
static void main(java.lang.String[] args)
          Tests for the class
 int sample()
          Returns a random value that follows a geometric distribution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometricDistribution

public GeometricDistribution(double theBase,
                             int theMinVal)
Creates a new instance of GeometricDistribution

Parameters:
theBase - The probability of success
theMinVal - The lower limit of the random variable
Method Detail

sample

public int sample()
Returns a random value that follows a geometric distribution

Specified by:
sample in interface DiscreteDistribution
Returns:
A random value

main

public static void main(java.lang.String[] args)
Tests for the class

Parameters:
args - the command line arguments


CUENCAS was initially developed by Ricardo Mantilla at the University of Colorado under the supervision of Dr. Vijay K. Gupta. We wish to recognize the support from the National Science Fundation.