SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
LognormalSpecialGen.java
1/*
2 * Class: LognormalSpecialGen
3 * Description: random variates from the lognormal 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
37public class LognormalSpecialGen extends RandomVariateGen {
38
39 NormalGen myGen;
40
46 // Necessary to compile, but we do not want to use stream and dist
47 super(g.stream, null);
48 stream = null;
49 myGen = g;
50 }
51
52 public double nextDouble() {
53 return Math.exp(myGen.nextDouble());
54 }
55}
double nextDouble()
Generates a random number from the continuous distribution contained in this object.
LognormalSpecialGen(NormalGen g)
Create a lognormal random variate generator using the normal generator g and with the same parameters...
This class implements methods for generating random variates from the normal distribution .