|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uah.math.distributions.Distribution edu.uah.math.distributions.FiniteDistribution edu.uah.math.distributions.DieDistribution
public class DieDistribution
This class models the distribution for a standard 6-sided die.
Field Summary | |
---|---|
static int |
FAIR
|
static int |
FLAT16
|
static int |
FLAT25
|
static int |
FLAT34
|
static int |
LEFT
|
static int |
RIGHT
|
Fields inherited from class edu.uah.math.distributions.Distribution |
---|
CONTINUOUS, DISCRETE, MIXED |
Constructor Summary | |
---|---|
DieDistribution()
This default constructor creates a new fair die distribution. |
|
DieDistribution(double[] p)
This general constructor creates a new die distribution with specified probabilities. |
|
DieDistribution(int n)
This special constructor creates a new die distribution of a special type (1-6 flat, 2-5 flat, 3-4 flat, skewed left, skewed right, or fair). |
Method Summary | |
---|---|
void |
setParameters(double a,
double b,
double w,
double[] p)
This method ensures that the finite distribution parameters are not changed to inappropriate values. |
void |
setProbabilities(double[] p)
This method sets the probabilities. |
void |
setProbabilities(int n)
This method specifies the probabilities for the special types (fair, 1-6 flat, 2-5 flat, 3-4 flat, skewed left, or skewed right). |
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of the parameters. |
Methods inherited from class edu.uah.math.distributions.FiniteDistribution |
---|
getDensity, getLowerValue, getProbabilities, getProbabilities, getSize, getUpperValue, getWidth, setLowerValue, setParameters, setProbabilities, setUpperValue, setWidth |
Methods inherited from class edu.uah.math.distributions.Distribution |
---|
getCDF, getDomain, getFailureRate, getMaxDensity, getMean, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, getVariance, setDomain, setDomain, simulate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int FAIR
public static final int FLAT16
public static final int FLAT25
public static final int FLAT34
public static final int LEFT
public static final int RIGHT
Constructor Detail |
---|
public DieDistribution(double[] p)
p
- the array of probabilitiespublic DieDistribution(int n)
n
- the type of distributionpublic DieDistribution()
Method Detail |
---|
public void setProbabilities(int n)
n
- the type of distributionpublic void setProbabilities(double[] p)
setProbabilities
in class FiniteDistribution
p
- the array of probabilitiespublic void setParameters(double a, double b, double w, double[] p)
setParameters
in class FiniteDistribution
a
- the lower value of the domainb
- the upper value of the domainw
- the step size of the domainp
- the array of probabilitiespublic java.lang.String toString()
toString
in class FiniteDistribution
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |