Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mrd.random
Class Bernoulli  view Bernoulli download Bernoulli.java

java.lang.Object
  extended byAbstractContinousDistribution
      extended byorg.mrd.random.Bernoulli

public class Bernoulli
extends AbstractContinousDistribution

Constructs a Bernoulli Trial with the given successProbability, using a cern.jet.random.engine.MersenneTwister seeded with the given seed.

Version:
0.1

Field Summary
protected  double successProbability
           
 
Constructor Summary
Bernoulli(double p, int seed)
          Constructs a Bernoulli Trial with the given successProbability, using a cern.jet.random.engine.MersenneTwister seeded with the given seed.
 
Method Summary
 double getSuccessProbability()
           
 boolean nextBoolean()
          Returns a uniformly distributed random boolean.
 double nextDouble()
           
 int nextInt()
           
 void setSuccessProbability(double successProbability)
          Returns a Bernoulli with the propability of success equal to successProbability.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

successProbability

protected double successProbability
Constructor Detail

Bernoulli

public Bernoulli(double p,
                 int seed)
Constructs a Bernoulli Trial with the given successProbability, using a cern.jet.random.engine.MersenneTwister seeded with the given seed.

Method Detail

nextInt

public int nextInt()

nextBoolean

public boolean nextBoolean()
Returns a uniformly distributed random boolean.


nextDouble

public double nextDouble()

setSuccessProbability

public void setSuccessProbability(double successProbability)
                           throws java.lang.IndexOutOfBoundsException
Returns a Bernoulli with the propability of success equal to successProbability.


getSuccessProbability

public double getSuccessProbability()