/** * Returns a deep copy of the receiver; the copy will produce identical * sequences. After this call has returned, the copy and the receiver have * equal but separate state. * * @return a copy of the receiver. */ public Object clone() { BreitWignerMeanSquare copy = (BreitWignerMeanSquare) super.clone(); if (this.uniform != null) copy.uniform = new DoubleUniform(copy.randomGenerator); return copy; }
/** * Constructs an Exponential Power distribution. Example: tau=1.0. * * @throws IllegalArgumentException * if <tt>tau < 1.0</tt>. */ public ExponentialPower(double tau, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setState(tau); }
/** * Constructs a poisson distribution. Example: mean=1.0. */ public Poisson(double mean, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setMean(mean); }
/** * Constructs a BreitWigner distribution. * * @param cut * </tt>cut==Double.NEGATIVE_INFINITY</tt> indicates "don't cut". */ public BreitWigner(double mean, double gamma, double cut, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setState(mean, gamma, cut); }
/** * Constructs a poisson distribution. Example: mean=1.0. */ public PoissonSlow(double mean, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setMean(mean); }
/** * Constructs a Beta distribution. */ public Beta(double alpha, double beta, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setState(alpha, beta); }
/** * Constructs a Gamma distribution. Example: alpha=1.0, lambda=1.0. * * @throws IllegalArgumentException * if <tt>alpha <= 0.0 || lambda <= 0.0</tt>. */ public Gamma(double alpha, double lambda, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setState(alpha, lambda); }
/** * Constructs a uniform distribution with the given minimum and maximum. */ public DoubleUniform(double min, double max, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setState(min, max); }
/** * Returns a random number from the distribution. */ public double nextDouble() { return nextDouble(this.freedom); }
/** * Equivalent to <tt>nextDouble()</tt>. This has the effect that * distributions can now be used as function objects, returning a random * number upon function evaluation. */ public double apply(double dummy) { return nextDouble(); }
/** * Returns a random number from the distribution. * * @throws IllegalArgumentException * if <tt>tau < 1.0</tt>. */ public static double staticNextDouble(double tau) { synchronized (shared) { return shared.nextDouble(tau); } }
/** * Returns a random number from the distribution with the given lambda. */ public static double staticNextDouble(double lambda) { synchronized (shared) { return shared.nextDouble(lambda); } }
/** * Returns a random number from the distribution. */ public double nextDouble() { return nextDouble(this.mean, this.standardDeviation); }
/** * Returns a random number from the distribution. * * @throws IllegalArgumentException * if <tt>k <= 0.0</tt>. */ public static double staticNextDouble(double freedom) { synchronized (shared) { return shared.nextDouble(freedom); } }
/** * Returns a uniformly distributed random number in the open interval * <tt>(0,1)</tt> (excluding <tt>0</tt> and <tt>1</tt>). */ public static double staticNextDouble() { synchronized (shared) { return shared.nextDouble(); } }
/** * Returns a uniformly distributed random number in the open interval * <tt>(from,to)</tt> (excluding <tt>from</tt> and <tt>to</tt>). Pre * conditions: <tt>from <= to</tt>. */ public float nextFloatFromTo(float from, float to) { return (float) nextDoubleFromTo(from, to); }
/** * Returns a random number from the distribution; returns * <tt>(double) nextInt()</tt>. */ public double nextDouble() { return nextInt(); }
/** * Returns a random number from the distribution. */ public double nextDouble() { return nextDouble(this.freedom); }
/** * Returns a deep copy of the receiver; the copy will produce identical * sequences. After this call has returned, the copy and the receiver have * equal but separate state. * * @return a copy of the receiver. */ public Object clone() { BreitWignerMeanSquare copy = (BreitWignerMeanSquare) super.clone(); if (this.uniform != null) copy.uniform = new DoubleUniform(copy.randomGenerator); return copy; }