SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
GumbelGen.java
1/*
2 * Class: GumbelGen
3 * Description: generator of random variates from the Gumbel distribution
4 * Environment: Java
5 * Software: SSJ
6 * Copyright (C) 2001 Pierre L'Ecuyer and Universite de Montreal
7 * Organization: DIRO, Universite de Montreal
8 * @author
9 * @since
10 *
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 */
25package umontreal.ssj.randvar;
26
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
29
45public class GumbelGen extends RandomVariateGen {
46 private double delta;
47 private double beta;
48
55 this(s, 1.0, 0.0);
56 }
57
63 public GumbelGen(RandomStream s, double beta, double delta) {
64 super(s, new GumbelDist(beta, delta));
65 setParams(beta, delta);
66 }
67
72 super(s, dist);
73 if (dist != null)
74 setParams(dist.getBeta(), dist.getDelta());
75 }
76
82 public static double nextDouble(RandomStream s, double beta, double delta) {
83 return GumbelDist.inverseF(beta, delta, s.nextDouble());
84 }
85
89 public double getBeta() {
90 return beta;
91 }
92
96 public double getDelta() {
97 return delta;
98 }
99
103 protected void setParams(double beta, double delta) {
104 if (beta == 0.0)
105 throw new IllegalArgumentException("beta = 0");
106 this.delta = delta;
107 this.beta = beta;
108 }
109}
Extends the class ContinuousDistribution for the Gumbel distribution tjoh95b  (page 2),...
double inverseF(double u)
Returns the inverse distribution function .
GumbelGen(RandomStream s)
Creates a Gumbel random number generator with and.
static double nextDouble(RandomStream s, double beta, double delta)
Generates a new variate from the Gumbel distribution with parameters.
void setParams(double beta, double delta)
Sets the parameters and of this object.
GumbelGen(RandomStream s, double beta, double delta)
Creates a Gumbel random number generator with parameters.
GumbelGen(RandomStream s, GumbelDist dist)
Creates a new generator for the Gumbel distribution dist and stream s.
double getBeta()
Returns the parameter .
double getDelta()
Returns the parameter .
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...
double nextDouble()
Returns a (pseudo)random number from the uniform distribution over the interval , using this stream,...