public class OscillatingExponential_64Variate extends java.lang.Object implements RandomVariate
Uses simkit.util.Math64.log() function for replicability on 64-bit platforms.
Modifier and Type | Field and Description |
---|---|
private double |
amplitude
The amplitude of the sinusoid.
|
private double |
frequency
The frequency in cycles per unit of SimTime.
|
private double |
mean
The mean of the sinusoid.
|
private double |
phase
The phase shift in cycles.
|
private RandomNumber |
rng
The supporting RandomNumber.
|
private static double |
TWO_PI |
Constructor and Description |
---|
OscillatingExponential_64Variate()
Creates new OscillatingExponentialVariate, parameters must be set prior
to use.
|
Modifier and Type | Method and Description |
---|---|
double |
generate()
Generate a random variate having this class's distribution.
|
double |
getAmplitude() |
double |
getFrequency() |
double |
getMean() |
java.lang.Object[] |
getParameters()
Returns a 4 element array containing the mean, amplitude, frequency, and
phase as Doubles.
|
double |
getPhase() |
RandomNumber |
getRandomNumber()
Returns the instance of the underlying RandomNumber.
|
void |
setAmplitude(double amplitude) |
void |
setFrequency(double frequency) |
void |
setMean(double mean) |
void |
setParameters(java.lang.Object... params)
Sets the mean, amplitude, frequency, and phase.
|
void |
setPhase(double phase) |
void |
setRandomNumber(RandomNumber rng)
Sets the supporting RandomNumber object
|
java.lang.String |
toString()
Returns an String containing the name of this variate with the mean,
amplitude, frequency, and phase.
|
private static final double TWO_PI
private RandomNumber rng
private double mean
private double amplitude
private double frequency
private double phase
public OscillatingExponential_64Variate()
public RandomNumber getRandomNumber()
getRandomNumber
in interface RandomVariate
public void setRandomNumber(RandomNumber rng)
setRandomNumber
in interface RandomVariate
rng
- The RandomNumber instance supporting the generating algorithmpublic java.lang.Object[] getParameters()
getParameters
in interface RandomVariate
public void setParameters(java.lang.Object... params)
setParameters
in interface RandomVariate
params
- A 4 element array containing the mean, amplitude,
frequency, and phase shift as Numbers.java.lang.IllegalArgumentException
- If the array does not contain exactly 4
elements, or if any of the elements is not a Number.public double generate()
generate
in interface RandomVariate
public void setMean(double mean)
mean
- The mean of the sinusoid.public double getMean()
public void setAmplitude(double amplitude)
amplitude
- The amplitude of the sinusoid.public double getAmplitude()
public void setFrequency(double frequency)
frequency
- The frequency in cycles per unit of SimTime.public double getFrequency()
public void setPhase(double phase)
phase
- The phase shift in cycles.public double getPhase()
public java.lang.String toString()
toString
in class java.lang.Object