SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
HypoExponentialGen.java
1/*
2 * Class: HypoExponentialGen
3 * Description: random variate generators for the hypoexponential 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 Richard Simard
9 * @since January 2011
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
40public class HypoExponentialGen extends RandomVariateGen {
41
48 public HypoExponentialGen(RandomStream stream, double[] lambda) {
49 super(stream, new HypoExponentialDist(lambda));
50 }
51
57 super(stream, dist);
58// if (dist != null)
59// setParams (dist.getLambda());
60 }
61
69 public static double nextDouble(RandomStream stream, double[] lambda) {
70 return HypoExponentialDist.inverseF(lambda, stream.nextDouble());
71 }
72
76 public double[] getLambda() {
77 return ((HypoExponentialDist) dist).getLambda();
78 }
79
85 public void setLambda(double[] lambda) {
86 ((HypoExponentialDist) dist).setLambda(lambda);
87 }
88
89}
This class implements the hypoexponential distribution, also called the generalized Erlang distributi...
double inverseF(double u)
Returns the inverse distribution function .
double[] getLambda()
Returns the associated with this object.
HypoExponentialGen(RandomStream stream, HypoExponentialDist dist)
Creates a new generator for the hypoexponential distribution dist with stream stream.
void setLambda(double[] lambda)
Sets the rates lam[ ],.
static double nextDouble(RandomStream stream, double[] lambda)
Uses inversion to generate a new hypoexponential variate with rates.
HypoExponentialGen(RandomStream stream, double[] lambda)
Creates a hypoexponential random variate generator with rates.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...