public class RightWedgeVariate extends RandomVariateBase
The shape of the wedge is determined by 3 parameters. The first is the left side. The second is the right side. The third determines the relative heights of the two sides.
Modifier and Type | Field and Description |
---|---|
private double |
left |
private double |
range |
private double |
right |
private double |
smallHeight |
private double |
test |
rng
Constructor and Description |
---|
RightWedgeVariate()
Creates a new instance of RightWedgeVariate; the parameters must be set
prior to use.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeTest()
Precomputes the test and range values.
|
double |
generate()
Generate a random variate having this class's distribution.
|
double |
getLeft() |
java.lang.Object[] |
getParameters()
Returns the array of parameters as an Object[].
|
double |
getRight() |
double |
getSmallHeight() |
void |
setLeft(double left) |
void |
setParameters(java.lang.Object... params)
Sets the left, right, and height parameters.
|
void |
setRight(double right) |
void |
setSmallHeight(double smallHeight) |
java.lang.String |
toString() |
getRandomNumber, setRandomNumber
private double left
private double right
private double smallHeight
private double test
private double range
public RightWedgeVariate()
public double generate()
RandomVariate
public java.lang.Object[] getParameters()
RandomVariate
public void setParameters(java.lang.Object... params)
params
- A 3 element array containing the left, right, and relative
height as Numbers.java.lang.IllegalArgumentException
- If the array does not contain exactly 3
elements, any of the elements are not Numbers, the left is not smaller
than the right, or the product of the height and the difference between
right and left is greater than one.public void setLeft(double left)
left
- the value of the left side. Does no error checking.public double getLeft()
public void setRight(double right)
right
- the value of the right side. Does no error checking.public double getRight()
public void setSmallHeight(double smallHeight)
smallHeight
- the value of the height. Does no error checking.public double getSmallHeight()
protected void computeTest()
public java.lang.String toString()
toString
in class java.lang.Object