public class RandomVariable
extends java.lang.Object
Constructor and Description |
---|
RandomVariable(Distribution d)
Special constructor: create a new random variable with a specified
probability distribution and the name X
|
RandomVariable(Distribution d,
java.lang.String n)
General constructor: create a new random variable with a specified
probability distribution and name
|
Modifier and Type | Method and Description |
---|---|
Distribution |
getDistribution()
Get the probability distribution
|
IntervalData |
getIntervalData()
Get the data distribution
|
java.lang.String |
getName()
Get the name of the random variable
|
double |
getValue()
Get the current value of the random variable
|
void |
reset()
Reset the data distribution
|
void |
sample()
Simulate a value of the probability distribution and assign the value to
the data distribution
|
void |
setDistribution(Distribution d)
Assign the probability distribution and create a corresponding data
distribution
|
void |
setName(java.lang.String n)
Assign a name to the random variable
|
void |
setValue(double x)
Assign a value to the random variable
|
double |
simulate()
Simulate a value of the probability distribution, assign the value to the
data distribution and return the value
|
public RandomVariable(Distribution d, java.lang.String n)
public RandomVariable(Distribution d)
public void setDistribution(Distribution d)
public Distribution getDistribution()
public IntervalData getIntervalData()
public void setValue(double x)
public double getValue()
public void sample()
public double simulate()
public void reset()
public java.lang.String getName()
public void setName(java.lang.String n)