SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
FatigueLifeGen.java
1/*
2 * Class: FatigueLifeGen
3 * Description: random variate generators for the fatigue life 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
47public class FatigueLifeGen extends RandomVariateGen {
48 protected double mu;
49 protected double beta;
50 protected double gamma;
51
58 public FatigueLifeGen(RandomStream s, double mu, double beta, double gamma) {
59 super(s, new FatigueLifeDist(mu, beta, gamma));
60 setParams(mu, beta, gamma);
61 }
62
67 super(s, dist);
68 if (dist != null)
69 setParams(dist.getMu(), dist.getBeta(), dist.getGamma());
70 }
71
77 public static double nextDouble(RandomStream s, double mu, double beta, double gamma) {
78 return FatigueLifeDist.inverseF(mu, beta, gamma, s.nextDouble());
79 }
80
84 public double getBeta() {
85 return beta;
86 }
87
91 public double getGamma() {
92 return gamma;
93 }
94
98 public double getMu() {
99 return mu;
100 }
101
105 protected void setParams(double mu, double beta, double gamma) {
106 if (beta <= 0.0)
107 throw new IllegalArgumentException("beta <= 0");
108 if (gamma <= 0.0)
109 throw new IllegalArgumentException("gamma <= 0");
110
111 this.mu = mu;
112 this.beta = beta;
113 this.gamma = gamma;
114 }
115}
Extends the class ContinuousDistribution for the fatigue life distribution tbir69a  with location par...
double inverseF(double u)
Returns the inverse distribution function .
FatigueLifeGen(RandomStream s, FatigueLifeDist dist)
Creates a new generator for the distribution dist, using stream s.
void setParams(double mu, double beta, double gamma)
Sets the parameters , and of this object.
double getGamma()
Returns the parameter of this object.
double getMu()
Returns the parameter of this object.
static double nextDouble(RandomStream s, double mu, double beta, double gamma)
Generates a variate from the fatigue life distribution with location parameter , scale parameter and...
FatigueLifeGen(RandomStream s, double mu, double beta, double gamma)
Creates a fatigue life random variate generator with parameters.
double getBeta()
Returns the parameter of this object.
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,...