Skip to content

Commit 31580ee

Browse files
author
Bruce
committed
update documentation and some comment
1 parent 3efdb6a commit 31580ee

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

docs/manual.adoc

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,26 @@ NormalStream returns a normal distribution of random numbers, with mean mean and
489489
----
490490
public class NormalStream extends RandomStream
491491
{
492-
public NormalStream (double mean, double sd);
493-
public NormalStream (double mean, double sd, int StreamSelect);
494-
public NormalStream (double mean, double sd, int StreamSelect, long MGSeed, long LCGSeed);
492+
public NormalStream (double mean, double sd);
493+
public NormalStream (double mean, double sd, int StreamSelect);
494+
public NormalStream (double mean, double sd, int StreamSelect, long MGSeed, long LCGSeed);
495+
496+
public double getNumber () throws IOException, ArithmeticException;
497+
};
498+
----
499+
500+
StreamSelect indicates the offset in the random number sequence to begin sampling, and MGSeed and LCGSeed can be used to modify the seed values used by the RandomStream class.
501+
502+
=== TriangularStream
503+
504+
TriangularStream returns a triangular distribution of random numbers, with lower limit a, upper limit b and mode c, where a < b and a ≤ c ≤ b.
505+
506+
----
507+
public class TriangularStream extends RandomStream
508+
{
509+
public NormalStream (double a, double b, double c);
510+
public NormalStream (double a, double b, double c, int StreamSelect);
511+
public NormalStream (double a, double b, double c, int StreamSelect, long MGSeed, long LCGSeed);
495512
496513
public double getNumber () throws IOException, ArithmeticException;
497514
};

src/main/java/org/javasim/streams/TriangularStream.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
import java.io.IOException;
2424

2525
/**
26-
* Returns a number drawn from a uniform distribution with the given lower and upper bounds.
26+
* Returns a number drawn from a triangular distribution with lower limit a, upper limit b and mode c, where a < b and a ≤ c ≤ b.
2727
*/
2828

2929
public class TriangularStream extends RandomStream {
3030
/**
31-
* Create stream with low bound 'l' and high bound 'h' and 'm' value.
31+
* Create stream with low bound 'l'(a) and high bound 'h'(b) and 'm'(c) value.
3232
*/
3333

3434
public TriangularStream(double a, double b, double c) {
@@ -40,7 +40,7 @@ public TriangularStream(double a, double b, double c) {
4040
}
4141

4242
/**
43-
* Create stream with low bound 'l' and high bound 'h' and 'm' value. Skip the first 'StreamSelect' values before returning numbers from the stream.
43+
* Create stream with low bound 'l'(a) and high bound 'h'(b) and 'm'(c) value. Skip the first 'StreamSelect' values before returning numbers from the stream.
4444
*/
4545

4646
public TriangularStream(double a, double b, double c, int StreamSelect) {
@@ -55,8 +55,8 @@ public TriangularStream(double a, double b, double c, int StreamSelect) {
5555
}
5656

5757
/**
58-
* Create stream with low bound 'l' and high bound 'h' and 'm' value. Skip the first 'StreamSelect' values before returning numbers from the stream. Pass the seeds 'MGSeed' and 'LCGSeed' to the base
59-
* class.
58+
* Create stream with low bound 'l'(a) and high bound 'h'(b) and 'm'(c) value. Skip the first 'StreamSelect' values before returning numbers from the stream. Pass the seeds 'MGSeed' and 'LCGSeed' to
59+
* the base class.
6060
*/
6161

6262
public TriangularStream(double a, double b, double c, int StreamSelect, long MGSeed, long LCGSeed) {

0 commit comments

Comments
 (0)