|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--Utility.RandomNumber
|
+--Utility.Triangular
Triangular is used to generate random variables from
the triangular distribution.
This is a continuous distribution.
Tests Performed
1000 samples were generated and the means and variances
were examined. Subjectively, they seemed correct.
A goodness of fit test was performed with 100 samples
and 10 intervals. It succeeded about 19/20 times.
| Constructor Summary | |
Triangular(double left,
double center,
double right)
Triangular constructor. |
|
| Method Summary | |
double |
sampleDouble()
Generate a random double from the triangular distribution. |
int |
sampleInt()
The sampleInt function should not be called for this continuous distribution. |
| Methods inherited from class Utility.RandomNumber |
goodnessOfFitTest, goodnessOfFitTest, randomMixer, resetRandomMixer, sample01 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Triangular(double left,
double center,
double right)
left - The leftmost endpointcenter - The center point of the triangle (x-axis pos
not height.right - The rightmost endpoint| Method Detail |
public double sampleDouble()
sampleDouble in class RandomNumberTriangular(double, double, double)public int sampleInt()
sampleInt in class RandomNumber
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||