|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.cas.utilities.ProbDist
public abstract class ProbDist
Each class which extends ProbDist represents a probability distribution. The ProbDist abstract class provides methods for calculating the probability of elements and sets of elements according to the probability distribution represented by the class which extends ProbDist. ProbDist also provides a method for finding an element at random from the probability distribution that the class which extends ProbDist represents
Field Summary | |
---|---|
static int |
CONSTANT
|
static int |
EXP
|
protected int |
max
|
protected int |
min
|
static int |
ONE
|
static int |
POISSON
|
protected java.util.Vector |
probs
|
static int |
ZERO
|
Constructor Summary | |
---|---|
ProbDist()
|
Method Summary | |
---|---|
int |
getMax()
Returns the greatest number in this probability distribution which has a calculated probability |
static ProbDist |
getProbDist(int type,
double[] parameters)
A static factory method used to generate a probability distribution from an integer flag indicating a type (as above) and some parameters. |
int |
next(java.util.Random r)
Returns a number at random from this probability distribution |
double |
probFor(int n)
Calculates the probability of n in this probability distribution |
double |
probMoreThan(int n)
Calculates the probability for all numbers strictly greater than n in this probability distribution |
double |
probUpTo(int n)
Calculates the sum of the probabilities for 0 to n inclusive in this probability distribution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ZERO
public static final int ONE
public static final int CONSTANT
public static final int EXP
public static final int POISSON
protected java.util.Vector probs
protected int min
protected int max
Constructor Detail |
---|
public ProbDist()
Method Detail |
---|
public double probFor(int n)
n
- the int which represents the number for which the probability is to
be calculated
public double probUpTo(int n)
n
- the int which represents the last number in the set of numbers whose
probabilities are to be summed
public double probMoreThan(int n)
n
- the int which represents the greatest integer not in the set of
integers whos probabilities are to be summed
public int next(java.util.Random r)
r
- a Random object used to find the number to return
public int getMax()
public static ProbDist getProbDist(int type, double[] parameters)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |