コード例 #1
0
ファイル: BernoulliGen.java プロジェクト: umontreal-simul/ssj
 /**
  * Generates a new integer from the *Bernoulli* distribution with parameter @f$p = @f$ `p`,
  * using the given stream `s`.
  */
 public static int nextInt(RandomStream s, double p) {
   return BernoulliDist.inverseF(p, s.nextDouble());
 }
コード例 #2
0
ファイル: BernoulliGen.java プロジェクト: umontreal-simul/ssj
 /**
  * Creates a random variate generator for the *Bernoulli* distribution `dist` and the random
  * stream `s`.
  */
 public BernoulliGen(RandomStream s, BernoulliDist dist) {
   super(s, dist);
   if (dist != null) setParams(dist.getP());
 }